/* NUQTA Admin — design tokens and components.
   One restrained system shared by the NUQTA home and every product
   workspace. Light by default, dark via the OS preference. */

:root {
  color-scheme: light;
  --navy: #0d213f;
  --navy-raised: #17365f;
  --navy-text: #d8e2f0;
  --navy-muted: #9cafc8;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;
  --surface-hover: #f5f8fc;
  --surface-sunken: #e8ecf2;
  --border: #dce3ec;
  --border-strong: #c8d2df;
  --text: #132238;
  --text-secondary: #415168;
  --muted: #637188;
  --accent: #1f56c9;
  --accent-hover: #1a49ad;
  --accent-soft: #e9f0fc;
  --accent-text: #1a49ad;
  --success: #13703f;
  --success-soft: #e6f4ec;
  --warning: #8a5300;
  --warning-soft: #fbf1df;
  --danger: #b42b22;
  --danger-soft: #fbeae9;
  --info: #1f56c9;
  --info-soft: #e9f0fc;
  --icare: #0f766e;
  --icare-soft: #e2f3f1;
  --invoice: #c64b28;
  --invoice-soft: #fff0ea;
  --primary: #0b1e3b;
  --primary-hover: #183662;
  --primary-text: #ffffff;
  --scrim: rgba(8, 18, 36, 0.45);
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06);
  --shadow: 0 1px 3px rgba(15, 27, 45, 0.06), 0 4px 12px rgba(15, 27, 45, 0.05);
  --shadow-lg: 0 16px 40px rgba(15, 27, 45, 0.18);
  --focus-ring: 0 0 0 3px rgba(31, 86, 201, 0.25);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 248px;
  --topbar-height: 56px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Outfit", var(--font);
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas,
    "Liberation Mono", monospace;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html[lang="ar"] {
  --font: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "Noto Sans Arabic", var(--font);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4,
.wordmark,
.page-title,
.section-title,
.card-title,
.stat-value {
  font-family: var(--font-display);
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-text);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.mono,
.code-cell {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease,
    color 120ms ease, box-shadow 120ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-secondary,
.secondary-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-danger,
.danger-button {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled),
.danger-button:hover:not(:disabled) {
  background: var(--danger);
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 7px;
}

.btn:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn svg,
.secondary-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-weight: 500;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

/* ---------- Form controls ---------- */

label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  outline: none;
}

input:disabled,
select:disabled {
  background: var(--surface-alt);
  color: var(--muted);
  cursor: not-allowed;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
}

.field-help {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.field-error {
  display: block;
  min-height: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
}

.field-error:empty {
  display: none;
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

/* ---------- Status text, alerts, toasts ---------- */

.status {
  color: var(--muted);
  font-size: 13px;
}

.status:empty {
  display: none;
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--danger);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 13px;
}

.alert svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.alert strong {
  color: var(--text);
  font-weight: 600;
}

.alert.warning {
  border-color: transparent;
  background: var(--warning-soft);
  color: var(--warning);
}

.alert.danger {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.alert.info {
  border-color: transparent;
  background: var(--info-soft);
  color: var(--info);
}

.alert.warning strong,
.alert.danger strong,
.alert.info strong {
  color: inherit;
}

.toast-region {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
  pointer-events: none;
}

.toast-region[popover]:not(:popover-open) {
  display: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 13px;
  pointer-events: auto;
  animation: toastIn 180ms ease both;
}

.toast svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.toast.success svg {
  color: var(--success);
}

.toast.error svg {
  color: var(--danger);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.badge.plain::before {
  display: none;
}

.badge.success,
.badge.yes {
  border-color: transparent;
  background: var(--success-soft);
  color: var(--success);
}

.badge.warning {
  border-color: transparent;
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger,
.badge.no {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info {
  border-color: transparent;
  background: var(--info-soft);
  color: var(--info);
}

.badge.icare {
  border-color: transparent;
  background: var(--icare-soft);
  color: var(--icare);
}

.badge.invoice {
  border-color: transparent;
  background: var(--invoice-soft);
  color: var(--invoice);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Auth screens ---------- */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--navy);
}

.auth-stack {
  display: grid;
  gap: 28px;
  width: min(400px, 100%);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.auth-brand h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-brand p {
  color: var(--muted);
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card h1,
.auth-card h2 {
  font-size: 18px;
  font-weight: 600;
}

.auth-card p {
  color: var(--muted);
}

.auth-card .btn {
  width: 100%;
  min-height: 40px;
}

.auth-footnote {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

/* ---------- Brand ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
}

.wordmark-lg {
  font-size: 24px;
}

.wordmark-lg .wordmark-dot {
  width: 16px;
  height: 16px;
}

.product-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.product-mark.icare {
  background: var(--icare);
}

.product-mark.invoice {
  overflow: hidden;
  border: 0;
  background-color: transparent;
  background-image: url("../assets/invoice-ai-logo.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 118%;
  color: transparent;
  box-shadow: none;
}

.product-mark.lg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
}

/* ---------- App shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 20px 14px;
}

.sidebar-brand .context {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.nav {
  display: grid;
  gap: 2px;
  padding: 4px 12px 16px;
}

.nav-label {
  margin: 18px 8px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.nav-item:hover {
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
}

.nav-item[aria-current="page"],
.nav-item.is-active {
  background: var(--surface-alt);
  color: var(--text);
}

.nav-item[aria-current="page"] svg,
.nav-item.is-active svg {
  color: var(--text);
}

.nav-item .chevron {
  margin-left: auto;
  width: 14px;
  height: 14px;
  transition: transform 150ms ease;
}

.nav-product.is-open .chevron {
  transform: rotate(90deg);
}

.nav-sub {
  display: none;
  gap: 1px;
  margin: 2px 0 6px 19px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.nav-product.is-open .nav-sub {
  display: grid;
}

.nav-sub .nav-item {
  min-height: 30px;
  font-size: 13px;
}

.nav-sub .nav-item[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.account-text {
  display: grid;
  min-width: 0;
}

.account-text strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-text span {
  color: var(--muted);
  font-size: 12px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar .menu-button {
  display: none;
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--border-strong);
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--text);
  text-decoration: none;
}

.breadcrumbs [aria-current="page"] {
  max-width: 320px;
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-spacer {
  flex: 1;
}

.language-toggle {
  min-width: 72px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.language-toggle:hover {
  border-color: var(--navy);
  background: var(--surface-alt);
  color: var(--navy);
}

html[dir="rtl"] .chevron {
  transform: scaleX(-1);
}

html[dir="rtl"] .nav-product.is-open .chevron {
  transform: scaleX(-1) rotate(90deg);
}

html[dir="rtl"] .nav-sub {
  margin-right: 19px;
  margin-left: 0;
  padding-right: 12px;
  padding-left: 0;
  border-right: 1px solid var(--border);
  border-left: 0;
}

html[dir="rtl"] .sidebar .nav-sub {
  border-right-color: rgba(255, 255, 255, 0.12);
}

html[dir="rtl"] .sidebar .nav-sub .nav-item[aria-current="page"] {
  border-radius: 7px 0 0 7px;
  box-shadow: inset -2px 0 0 #ffffff;
}

.scrim {
  display: none;
}

#main:focus {
  outline: none;
}

.view {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 32px 72px;
  animation: viewIn 200ms ease both;
}

.view-narrow {
  max-width: 920px;
}

/* ---------- Page header ---------- */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-heading {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow.icare {
  color: var(--icare);
}

.eyebrow.invoice {
  color: var(--invoice);
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.page-title:focus {
  outline: none;
}

.page-subtitle {
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
}

.page-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.back-link svg {
  width: 14px;
  height: 14px;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.section {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}

.section:first-child {
  margin-top: 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Cards ---------- */

.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.card-header.bordered {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.card-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.card-body {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

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

.grid-main-side {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  align-items: start;
  gap: 16px;
}

.stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* ---------- Stats ---------- */

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

.stat-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-label svg {
  width: 14px;
  height: 14px;
}

.stat-value {
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat-value.small {
  font-size: 18px;
  line-height: 1.35;
}

.stat-value .of {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.stat-meta {
  color: var(--muted);
  font-size: 13px;
}

.stat-meta.warning {
  color: var(--warning);
}

.stat-meta.danger {
  color: var(--danger);
}

.stat-meta.success {
  color: var(--success);
}

.stat.is-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.stat.is-link:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* ---------- Home ---------- */

.home-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 32px;
}

.home-hero h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.home-hero p {
  max-width: 640px;
  color: var(--muted);
  font-size: 16px;
}

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

.product-card {
  position: relative;
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--product-color, var(--accent));
}

.product-card.icare {
  --product-color: var(--icare);
}

.product-card.invoice {
  --product-color: var(--invoice);
}

.product-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.product-identity h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product-identity p {
  color: var(--muted);
  font-size: 13px;
}

.product-identity.invoice {
  display: grid;
  gap: 2px;
}

.invoice-wordmark {
  display: block;
  width: 158px;
  height: 42px;
  background: transparent url("../assets/invoice-ai-wordmark.png") center / 158px auto no-repeat;
}

.product-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}

.product-metrics > div {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
}

.product-metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.product-metrics dd {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.product-metrics dd .of {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.product-metrics dd.pending {
  color: var(--muted);
  font-weight: 500;
}

.product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.product-card-footer .muted {
  font-size: 12px;
}

/* ---------- Lists ---------- */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
}

.list-item:first-child {
  border-top: 0;
}

a.list-item,
.list-item a.list-link {
  color: inherit;
}

a.list-item:hover {
  background: var(--surface-hover);
  text-decoration: none;
}

.list-item-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--muted);
}

.list-item-icon svg {
  width: 15px;
  height: 15px;
}

.list-item-icon.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.list-item-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.list-item-icon.success {
  background: var(--success-soft);
  color: var(--success);
}

.list-item-body {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.list-item-title {
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-meta {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.list-item-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.list-item-end svg {
  width: 16px;
  height: 16px;
}

.kv {
  display: grid;
  gap: 0;
  margin: 0;
}

.kv > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.4fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.kv > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.kv dt {
  color: var(--muted);
  font-size: 13px;
}

.kv dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.meter-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meter-row {
  display: grid;
  gap: 6px;
}

.meter-row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.meter-row-header span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-row-header strong {
  flex: 0 0 auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.meter-track {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--meter-color, var(--accent));
  transition: width 260ms ease;
}

.meter-row small {
  color: var(--muted);
  font-size: 12px;
}

.split-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.split-bar span {
  display: block;
  height: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ---------- Toolbar, filters, segmented ---------- */

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-field {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input {
  min-height: 34px;
  padding-left: 34px;
}

.filter-select {
  width: auto;
  min-width: 140px;
  min-height: 34px;
  padding: 4px 30px 4px 10px;
  font-size: 13px;
}

.toolbar-end {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-alt);
}

.segmented button {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.segmented .count {
  margin-left: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Tables ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.data-table th:first-child {
  padding-left: 20px;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  vertical-align: middle;
}

.data-table td:first-child {
  padding-left: 20px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 20px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background-color 100ms ease;
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.data-table tr.is-clickable {
  cursor: pointer;
}

.data-table .align-end {
  text-align: right;
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cell-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cell-stack > .badge {
  justify-self: start;
}

.cell-primary {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

a.cell-primary:hover {
  color: var(--accent-text);
}

.cell-secondary {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.cell-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-actions .btn,
.cell-actions .secondary-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.row-empty td {
  padding: 0 !important;
}

.row-empty:hover {
  background: transparent !important;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.table-footer:empty {
  display: none;
}

/* ---------- Empty, error and loading states ---------- */

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 44px 24px;
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--muted);
}

.empty-state .empty-icon svg {
  width: 18px;
  height: 18px;
}

.empty-state.error .empty-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state.success .empty-icon {
  background: var(--success-soft);
  color: var(--success);
}

.empty-state h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.empty-state p {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state .btn,
.empty-state .secondary-button {
  margin-top: 8px;
}

.empty-state.compact {
  padding: 24px 16px;
}

.skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-alt) 0%,
    var(--surface-sunken) 50%, var(--surface-alt) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.skeleton.value {
  width: 56px;
  height: 24px;
}

.skeleton.line {
  width: 70%;
}

.skeleton.short {
  width: 40%;
}

/* ---------- Detail pages ---------- */

.issue-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.issue-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

.issue-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.issue-list svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: 0 0 auto;
  color: var(--warning);
}

.issue-list li.ok svg {
  color: var(--success);
}

.form-card {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.form-card > .card-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-section {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 22px 24px;
  border: 0;
  border-top: 1px solid var(--border);
}

.form-card > .form-section:first-of-type,
.form-card > .card-header + .form-section {
  border-top: 0;
}

.form-section legend {
  float: left;
  width: 100%;
  padding: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.form-section legend + * {
  clear: both;
}

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

.full-span {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.form-card > .form-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.conditional-fields {
  display: grid;
  gap: 16px;
}

.system-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.system-values > div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.system-values dt {
  color: var(--muted);
  font-size: 12px;
}

.system-values dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.readiness-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.credential-summary,
.credential-form,
.sequence-form {
  display: grid;
  gap: 16px;
}

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

.sequence-form {
  max-width: 460px;
}

.credential-values {
  display: grid;
  gap: 0;
  margin: 0;
}

.credential-values > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) 1fr;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.credential-values > div:first-child {
  border-top: 0;
}

.credential-values dt {
  color: var(--muted);
  font-size: 13px;
}

.credential-values dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.activation-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.icare-pairing {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.icare-pairing-code {
  color: var(--text);
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.icare-pairing-qr {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: #fff;
}

.wa-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ---------- Drawer (native dialog) ---------- */

dialog.drawer {
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

dialog.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: drawerIn 200ms ease both;
}

dialog.drawer::backdrop {
  background: var(--scrim);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.drawer-body {
  display: grid;
  align-content: start;
  gap: 22px;
  flex: 1;
  padding: 20px 22px 28px;
  overflow-y: auto;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.drawer-section.danger-zone {
  padding: 14px;
  border: 1px solid var(--danger-soft);
  border-radius: var(--radius);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .view {
    padding: 28px 28px 64px;
  }

  .topbar {
    padding: 0 28px;
  }

  .grid-main-side {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  }
}

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-main-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(288px, 86vw);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 200ms ease;
    visibility: hidden;
  }

  html[dir="rtl"] .sidebar {
    inset: 0 0 0 auto;
    transform: translateX(100%);
  }

  .shell.nav-open .sidebar {
    transform: none;
    visibility: visible;
  }

  .shell.nav-open .scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    background: var(--scrim);
  }

  .topbar .menu-button {
    display: inline-grid;
  }

  .topbar {
    padding: 0 20px 0 12px;
  }

  .view {
    padding: 24px 20px 56px;
  }

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

@media (max-width: 720px) {
  .page-header,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .page-title {
    font-size: 24px;
  }

  .home-hero h1 {
    font-size: 26px;
  }

  .form-section-grid,
  .credential-form,
  .system-values {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-field {
    max-width: none;
  }

  .toolbar-end {
    width: 100%;
    margin-left: 0;
  }

  .data-table.stackable thead {
    display: none;
  }

  .data-table.stackable,
  .data-table.stackable tbody,
  .data-table.stackable tr,
  .data-table.stackable td {
    display: block;
    width: 100%;
  }

  .data-table.stackable tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  .data-table.stackable td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 !important;
    border: 0;
    text-align: right;
  }

  .data-table.stackable td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    text-align: left;
  }

  .data-table.stackable td.cell-lead {
    display: block;
    text-align: left;
  }

  .data-table.stackable td.cell-lead::before,
  .data-table.stackable td.cell-actions::before {
    display: none;
  }

  .data-table.stackable td.cell-actions {
    justify-content: flex-start;
    padding-top: 8px !important;
  }

  html[dir="rtl"] .data-table.stackable td {
    text-align: left;
  }

  html[dir="rtl"] .data-table.stackable td::before,
  html[dir="rtl"] .data-table.stackable td.cell-lead {
    text-align: right;
  }
}

@media (max-width: 520px) {
  .stat-grid,
  .stat-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .kv > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ---------- Motion ---------- */

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes drawerIn {
  from {
    transform: translateX(24px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes toastIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- Static theme: navy chrome ---------- */

.product-card::before {
  display: none;
}

.auth-brand .wordmark {
  color: #ffffff;
}

.auth-brand .wordmark-dot {
  background: #ffffff;
}

.auth-brand p,
.auth-footnote {
  color: var(--navy-muted);
}

.sidebar {
  border-right-color: var(--navy);
  background: var(--navy);
  color: var(--navy-text);
}

.sidebar .wordmark {
  color: #ffffff;
}

.sidebar .wordmark-dot {
  background: #ffffff;
}

.sidebar-brand .context,
.sidebar .nav-label,
.sidebar .account-text span {
  color: var(--navy-muted);
}

.sidebar .nav-item {
  color: var(--navy-text);
}

.sidebar .nav-item svg {
  color: var(--navy-muted);
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar .nav-item[aria-current="page"],
.sidebar .nav-item.is-active {
  background: var(--navy-raised);
  color: #ffffff;
}

.sidebar .nav-item[aria-current="page"] svg,
.sidebar .nav-item.is-active svg {
  color: #ffffff;
}

.sidebar .nav-sub {
  border-left-color: rgba(255, 255, 255, 0.12);
}

.sidebar .nav-sub .nav-item[aria-current="page"] {
  background: transparent;
  box-shadow: inset 2px 0 0 #ffffff;
  border-radius: 0 7px 7px 0;
}

.sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.sidebar .account-text strong {
  color: #ffffff;
}

.sidebar .avatar {
  background: var(--navy-raised);
  color: #ffffff;
}

.sidebar .btn-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #ffffff;
  box-shadow: none;
}

.sidebar .btn-secondary:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar :focus-visible {
  outline-color: #ffffff;
}

/* ---------- NUQTA Team (panel staff) ---------- */
.hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.staff-actions select {
  min-width: 120px;
}

@media (max-width: 720px) {
  .staff-actions {
    justify-content: flex-start;
  }
}

#addStaffForm .form-section-grid {
  align-items: start;
}

.icare-setup-steps { display:flex; flex-wrap:wrap; gap:12px; list-style:none; padding:0; margin:0 0 24px; }
.icare-setup-steps li { flex:1 1 160px; padding:12px 16px; border:1px solid var(--border); border-radius:12px; }
#icareWhatsappQrDownload { align-self:center; }
#icareDetailConfig details form { margin-top:16px; }
