.hsq-app {
  min-height: 720px;
  border: 1px solid var(--hsq-border);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(1200px 460px at -10% -20%, rgba(13, 148, 136, 0.16), transparent 65%),
    radial-gradient(900px 420px at 120% 0%, rgba(34, 197, 94, 0.09), transparent 62%),
    linear-gradient(180deg, var(--hsq-bg-0) 0%, var(--hsq-bg-1) 100%);
  box-shadow: var(--hsq-shadow);
}

.hsq-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 720px;
}

.hsq-sidebar {
  background: linear-gradient(195deg, #0f172a 0%, #1f2937 70%, #0f172a 100%);
  color: #e5e7eb;
  padding: 26px 20px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.hsq-sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px 280px at 22% -20%, rgba(16, 185, 129, 0.28), transparent 60%),
    radial-gradient(560px 280px at 102% 20%, rgba(56, 189, 248, 0.14), transparent 58%);
  pointer-events: none;
}

.hsq-sidebar-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.hsq-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 18px;
}

.hsq-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2dd4bf, #0d9488);
  display: grid;
  place-items: center;
  color: #042f2e;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.hsq-brand-name {
  font-family: 'Sora', 'Segoe UI', Tahoma, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hsq-brand-sub {
  font-size: 12px;
  color: rgba(229, 231, 235, 0.68);
}

.hsq-nav {
  display: grid;
  gap: 6px;
}

.hsq-nav-btn {
  border: 0;
  background: transparent;
  color: rgba(229, 231, 235, 0.75);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 160ms ease;
}

.hsq-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.hsq-nav-btn.is-active {
  color: #08161c;
  background: linear-gradient(145deg, #99f6e4, #2dd4bf);
  box-shadow: 0 12px 24px rgba(45, 212, 191, 0.28);
}

.hsq-nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  opacity: 0.95;
}

.hsq-nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hsq-sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(229, 231, 235, 0.7);
}

.hsq-main {
  padding: 28px;
  overflow-x: auto;
}

.hsq-page {
  display: grid;
  gap: 20px;
  animation: hsq-fade-up 240ms ease;
}

.hsq-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hsq-heading {
  margin: 0;
  font-size: clamp(24px, 2.1vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hsq-subheading {
  margin-top: 6px;
  margin-bottom: 0;
  color: var(--hsq-muted);
  font-size: 14px;
}

.hsq-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.hsq-card {
  border: 1px solid var(--hsq-border);
  border-radius: var(--hsq-radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--hsq-shadow-soft);
}

.hsq-card-pad {
  padding: 18px;
}

.hsq-kpi {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.hsq-kpi-label {
  color: var(--hsq-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hsq-kpi-value {
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hsq-kpi-value.is-success {
  color: var(--hsq-success);
}

.hsq-kpi-value.is-primary {
  color: var(--hsq-primary-600);
}

.hsq-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 16px;
}

.hsq-grid-2.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hsq-table-wrap {
  overflow: auto;
}

.hsq-table {
  width: 100%;
  border-collapse: collapse;
}

.hsq-table th,
.hsq-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e7edf5;
  text-align: left;
  font-size: 14px;
}

.hsq-table th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hsq-muted);
  background: #f8fafc;
}

.hsq-table tbody tr {
  transition: background-color 130ms ease;
}

.hsq-table tbody tr:hover {
  background: #f6f9ff;
}

.hsq-table a {
  color: var(--hsq-primary-600);
  text-decoration: none;
  font-weight: 700;
}

.hsq-table a:hover {
  text-decoration: underline;
}

.hsq-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  line-height: 1;
}

.hsq-status.status-draft {
  background: #f1f5f9;
  color: #334155;
}

.hsq-status.status-pending {
  background: #fff7ed;
  color: #b45309;
  border-color: #facc15;
}

.hsq-status.status-sent {
  background: #ecfeff;
  color: #0f766e;
  border-color: #5eead4;
}

.hsq-status.status-accepted {
  background: #ecfdf3;
  color: #15803d;
  border-color: #86efac;
}

.hsq-status.status-rejected {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.hsq-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.hsq-input,
.hsq-select,
.hsq-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ced9e8;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.hsq-input:focus,
.hsq-select:focus,
.hsq-textarea:focus {
  border-color: var(--hsq-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
  outline: none;
}

.hsq-textarea {
  min-height: 90px;
  resize: vertical;
}

.hsq-field {
  display: grid;
  gap: 6px;
}

.hsq-label {
  font-size: 12px;
  color: var(--hsq-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hsq-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hsq-form-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.hsq-form-section {
  display: grid;
  gap: 14px;
}

.hsq-item-list {
  display: grid;
  gap: 12px;
}

.hsq-item {
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.hsq-item-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.hsq-subitems {
  display: grid;
  gap: 8px;
  padding-left: 6px;
}

.hsq-subitem-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.hsq-summary {
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #ffffff;
  padding: 16px;
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
}

.hsq-summary-bottom {
  position: static;
  top: auto;
}

.hsq-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--hsq-muted);
  font-size: 14px;
}

.hsq-summary-row strong,
.hsq-total-value {
  color: var(--hsq-text);
}

.hsq-total-box {
  border-top: 1px dashed #c8d4e5;
  margin-top: 8px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.hsq-total-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hsq-btn {
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  line-height: 1;
  transition: transform 130ms ease, box-shadow 130ms ease, background-color 130ms ease, border-color 130ms ease;
}

.hsq-btn:hover {
  transform: translateY(-1px);
}

.hsq-btn:active {
  transform: translateY(0);
}

.hsq-btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #ecfeff;
  box-shadow: 0 10px 22px rgba(20, 184, 166, 0.26);
}

.hsq-btn-primary:hover {
  box-shadow: 0 14px 26px rgba(20, 184, 166, 0.34);
}

.hsq-btn-ghost {
  background: #f8fafc;
  border-color: #d8e1ec;
  color: #0f172a;
}

.hsq-btn-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.hsq-btn-small {
  padding: 8px 10px;
  font-size: 12px;
}

.hsq-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--hsq-primary-soft);
  color: #0f766e;
  font-weight: 700;
  font-size: 12px;
}

.hsq-bar-chart {
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 10px;
}

.hsq-bar-col {
  flex: 1;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.hsq-bar {
  width: 100%;
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
  border-radius: 9px 9px 3px 3px;
  min-height: 4px;
}

.hsq-service-meter {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.hsq-service-meter > span {
  height: 100%;
  display: block;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.hsq-alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 600;
}

.hsq-alert.is-info {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #115e59;
}

.hsq-alert.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.hsq-alert.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.hsq-empty {
  text-align: center;
  color: var(--hsq-muted);
  border: 1px dashed #c8d4e5;
  border-radius: 14px;
  background: #f8fafc;
  padding: 26px;
}

.hsq-inline-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #dbe5f2;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}

.hsq-switch {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.hsq-switch::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  background: #fff;
  transition: transform 140ms ease;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.3);
}

.hsq-switch:checked {
  background: #14b8a6;
}

.hsq-switch:checked::after {
  transform: translateX(20px);
}

.hsq-mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  color: #e5e7eb;
  padding: 12px 14px;
}

.hsq-menu-toggle {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hsq-hidden {
  display: none !important;
}

.hsq-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.hsq-fade-stagger > * {
  animation: hsq-fade-up 260ms ease both;
}

.hsq-fade-stagger > *:nth-child(2) { animation-delay: 35ms; }
.hsq-fade-stagger > *:nth-child(3) { animation-delay: 70ms; }
.hsq-fade-stagger > *:nth-child(4) { animation-delay: 105ms; }
.hsq-fade-stagger > *:nth-child(5) { animation-delay: 140ms; }

@keyframes hsq-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .hsq-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hsq-grid-2 {
    grid-template-columns: 1fr;
  }

  .hsq-form-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .hsq-app {
    border-radius: 18px;
  }

  .hsq-mobile-topbar {
    display: flex;
  }

  .hsq-shell {
    grid-template-columns: 1fr;
  }

  .hsq-sidebar {
    position: fixed;
    left: 12px;
    top: 62px;
    bottom: 12px;
    width: 290px;
    border-radius: 16px;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.32);
    transform: translateX(-118%);
    transition: transform 180ms ease;
    z-index: 1000;
  }

  .hsq-sidebar.is-open {
    transform: translateX(0);
  }

  .hsq-main {
    padding: 18px;
  }

  .hsq-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hsq-item-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hsq-main {
    padding: 14px;
  }

  .hsq-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hsq-kpi-grid {
    grid-template-columns: 1fr;
  }

  .hsq-form-grid {
    grid-template-columns: 1fr;
  }

  .hsq-toolbar {
    width: 100%;
  }

  .hsq-toolbar > * {
    width: 100%;
  }
}
