/* ═══════════════════════════════════════════════════════════════════════
   TriAankh License Manager — "Indigo Perimeter" theme
   The same design language as the TriAankh platform (26.36.0): white
   surfaces on a light blue-grey page, blue for action, indigo for trust
   and selection, near-night ink for text, red only for failure.

   Presentation only. Loaded LAST on every page (after each page's own
   <style> block); no markup, script or behaviour depends on it.
   ═══════════════════════════════════════════════════════════════════════ */

:root, :root:not([data-theme="light"]) {
  color-scheme: light !important;

  /* Indigo Perimeter palette */
  --tf-blue: #2563EB;
  --tf-brand: #2F4FE0;
  --tf-brand-hover: #2640C7;
  --tf-indigo: #4338CA;
  --tf-ink: #0B1033;
  --tf-brand-soft: #EEF2FF;
  --tf-brand-line: #C7D2FE;
  --tf-grad: linear-gradient(135deg, #2563EB 0%, #4338CA 100%);
  --tf-ring: 0 0 0 3px rgba(47, 79, 224, .14);

  /* style.css tokens */
  --bg: #F4F6FB !important;
  --bg-surface: #FFFFFF !important;
  --bg-card: #FFFFFF !important;
  --bg-hover: #F5F7FF !important;
  --border: #E0E6F0 !important;
  --border-light: #EDF0F6 !important;
  --indigo: #4338CA !important;
  --indigo-dark: #312E81 !important;
  --indigo-light: #6366F1 !important;
  --blue: #2563EB !important;
  --blue-light: #60A5FA !important;
  --accent: #2F4FE0 !important;
  --accent-dim: #2640C7 !important;
  --red: #D92D20 !important;
  --green: #079455 !important;
  --yellow: #DC6803 !important;
  --text: #111834 !important;
  --text-muted: #5B6582 !important;
  --text-dim: #8891AB !important;
  --glow: 0 0 0 3px rgba(47, 79, 224, .14) !important;
  --shadow-sm: 0 1px 2px rgba(16, 24, 64, .04), 0 1px 3px rgba(16, 24, 64, .03) !important;
  --shadow: 0 4px 12px rgba(16, 24, 64, .06), 0 1px 3px rgba(16, 24, 64, .04) !important;
  --shadow-lg: 0 20px 48px -12px rgba(31, 41, 110, .22), 0 2px 8px rgba(16, 24, 64, .05) !important;
  --sidebar-w: 216px !important;
  --topbar-h: 52px !important;
  --radius: 10px !important;

  /* dashboard.html / login.html / setup.html tokens */
  --bg-panel: #FFFFFF !important;
  --bg-side: #FFFFFF !important;
  --bg-side-2: #F7F9FC !important;
  --indigo-l: #6366F1 !important;
  --indigo-d: #312E81 !important;
  --blue-l: #60A5FA !important;
  --sea: #0EA5E9 !important;
  --sea-l: #38BDF8 !important;
  --sea-light: #93C5FD !important;
  --amber: #DC6803 !important;
  --text-2: #4B5572 !important;
  --text-3: #8891AB !important;
  --text-light: #8891AB !important;
  --input-bg: #FFFFFF !important;
  --input-focus: #2F4FE0 !important;
  --shadow-md: 0 4px 12px rgba(16, 24, 64, .06), 0 16px 36px rgba(16, 24, 64, .05) !important;
}

html body { background: #F4F6FB; color: #111834; }
html body ::selection { background: #DDE4FF; color: #0B1033; }
html body :focus-visible { outline: 2px solid #4F6BF0; outline-offset: 2px; }
html body input[type="checkbox"], html body input[type="radio"] { accent-color: #2F4FE0; }
html body * { scrollbar-width: thin; scrollbar-color: #C9D1E3 transparent; }

/* ── Top bar (both shells) ─────────────────────────────────────────────── */
html body .lm-topbar,
html body .topbar {
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #E6EAF2;
  box-shadow: 0 1px 0 rgba(16, 24, 64, .02);
  backdrop-filter: saturate(1.4) blur(8px);
}
html body .lm-logo-area,
html body .topbar-logo {
  border-right: 1px solid #EDF0F6;
  position: relative;
}
html body .lm-logo-area::after,
html body .topbar-logo::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, rgba(37,99,235,.55), rgba(67,56,202,.3) 50%, transparent);
}
html body .lm-logo-mark,
html body .logo-mark {
  background: var(--tf-grad);
  box-shadow: 0 6px 14px -6px rgba(47, 79, 224, .6), inset 0 1px 0 rgba(255,255,255,.2);
  border-radius: 9px;
}
html body .lm-logo-text strong,
html body .logo-text strong { color: #0B1033; font-weight: 700; }
html body .lm-logo-text small,
html body .logo-text small { color: #6E7896; letter-spacing: .08em; }
html body .lm-topbar-center::after { background: linear-gradient(90deg, #E6EAF2, transparent); }

html body .lm-user-badge,
html body .user-badge {
  background: #F5F7FB; border: 1px solid #E3E8F1; color: #111834;
}
html body .user-name { color: #111834; }
html body .lm-user-badge .role,
html body .user-role { background: #EEF2FF; color: #3730A3; border: 1px solid #DDE4FF; }
html body .user-avatar { background: var(--tf-grad); }
html body .btn-logout {
  background: #FFFFFF; color: #26304D; border: 1px solid #D6DDEA;
  box-shadow: 0 1px 1px rgba(16, 24, 64, .03);
}
html body .btn-logout:hover { background: #F6F8FF; color: #2F4FE0; border-color: #8EA0F5; }

/* ── Sidebar (both shells) ─────────────────────────────────────────────── */
html body .lm-sidebar,
html body .sidebar {
  background: #FFFFFF;
  border-right: 1px solid #E4E9F2;
  padding: 10px 10px;
}
html body .lm-sidebar::before { display: none; }
html body .lm-nav-section,
html body .nav-section {
  color: #98A1BA; font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  padding: 12px 10px 4px; margin-top: 2px;
}
html body .lm-nav a,
html body .sidebar a {
  color: #475069; font-size: 13px; font-weight: 600;
  padding: 7px 10px; margin: 1px 0; border-radius: 8px;
  background: transparent;
}
html body .lm-nav a svg,
html body .sidebar a svg { color: #7C86A2; stroke: currentColor; opacity: 1; }
html body .lm-nav a:hover,
html body .sidebar a:hover { background: #F4F6FC; color: #111834; text-decoration: none; }
html body .lm-nav a:hover svg,
html body .sidebar a:hover svg { color: #2F4FE0; }
html body .lm-nav a.active,
html body .sidebar a.active {
  background: linear-gradient(90deg, #EAEFFF 0%, #F3F5FF 100%);
  color: #2B36B8; font-weight: 700;
  box-shadow: inset 3px 0 0 #3B4FE0;
}
html body .lm-nav a.active::before { display: none; }
html body .lm-nav a.active svg,
html body .sidebar a.active svg { color: #3B4FE0; stroke: #3B4FE0; }

/* ── Content area ──────────────────────────────────────────────────────── */
html body .lm-main,
html body .main { padding: 20px 24px 32px; background: #F4F6FB; }
html body .lm-page-header,
html body .page-header { margin-bottom: 16px; }
html body .lm-page-header h1,
html body .page-header h1 { font-size: 20px; font-weight: 750; letter-spacing: -.025em; color: #0B1033; }
html body .lm-page-header p,
html body .page-header p { color: #5B6582; font-size: 13px; }
html body .section-label,
html body .lm-section-title { color: #6E7896; letter-spacing: .1em; font-size: 10.5px; }

/* Cards */
html body .lm-card,
html body .card,
html body .stat-card,
html body .lm-stat,
html body .stat-pill {
  background: #FFFFFF;
  border: 1px solid #E3E8F1;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 64, .04), 0 2px 6px rgba(16, 24, 64, .03);
}
html body .lm-card { margin-bottom: 14px; }
html body .lm-card-header,
html body .card-header { padding: 11px 16px; border-bottom: 1px solid #EDF0F6; font-weight: 700; color: #0B1033; }
html body .card-title { color: #0B1033; font-weight: 700; }
html body .lm-card-body { padding: 16px; }

/* Stat tiles */
html body .lm-stat-grid,
html body .stat-grid { gap: 10px; margin-bottom: 16px; }
html body .lm-stat { padding: 14px 16px; }
html body .lm-stat::after { height: 2px; background: var(--tf-grad); }
html body .stat-card { padding: 13px 15px; gap: 8px; position: relative; overflow: hidden; }
html body .stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--tf-grad); opacity: .85;
}
html body .stat-card:hover { box-shadow: 0 8px 22px -10px rgba(31, 41, 110, .25); }
html body .lm-stat-label,
html body .stat-label { color: #6E7896; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
html body .lm-stat-value,
html body .stat-val { color: #0B1033; font-size: 24px; font-weight: 750; letter-spacing: -.03em; }
html body .lm-stat-value.blue { color: #2F4FE0; }
html body .stat-sub { color: #8891AB; }
html body .stat-icon.indigo, html body .stat-pill-icon.indigo { background: #EEF2FF; color: #3B4FE0; }
html body .stat-icon.blue { background: #EFF6FF; color: #2563EB; }
html body .stat-icon.sea, html body .stat-pill-icon.sea { background: #F0F9FF; color: #0284C7; }
html body .stat-icon.purple { background: #F2F0FF; color: #5B4BDB; }

/* Tables */
html body table.lm-table,
html body .table-wrap table { font-size: 13px; }
html body table.lm-table th,
html body .card th {
  background: #F7F9FC; color: #5E6887; font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  border-bottom: 1px solid #E3E8F1; padding: 9px 16px;
}
html body table.lm-table td,
html body .card td { padding: 10px 16px; border-bottom: 1px solid #EEF1F6; color: #28314D; }
html body table.lm-table tbody tr:hover,
html body .card tbody tr:hover { background: #F7F9FF; }

/* Buttons */
html body .btn { border-radius: 8px; font-weight: 600; padding: 7px 14px; font-size: 13px; }
html body .btn:hover { transform: none; }
html body .btn-primary,
html body button.btn-primary {
  background: var(--tf-grad); color: #FFFFFF; border: 1px solid #2F45D6;
  box-shadow: 0 1px 2px rgba(16, 24, 64, .12), 0 4px 12px -6px rgba(47, 79, 224, .6), inset 0 1px 0 rgba(255,255,255,.14);
}
html body .btn-primary:hover,
html body button.btn-primary:hover { background: var(--tf-grad); filter: brightness(1.07) saturate(1.05); box-shadow: 0 1px 2px rgba(16, 24, 64, .12), 0 6px 16px -6px rgba(47, 79, 224, .7); }
html body .btn-secondary,
html body .btn-refresh { background: #FFFFFF; color: #26304D; border: 1px solid #D6DDEA; box-shadow: 0 1px 1px rgba(16,24,64,.03); }
html body .btn-secondary:hover,
html body .btn-refresh:hover { background: #F6F8FF; color: #2F4FE0; border-color: #8EA0F5; }
html body .btn-danger { background: #FFFFFF; color: #B42318; border-color: #FDA29B; }
html body .btn-danger:hover { background: #FEF3F2; }
html body .btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
html body .lm-field { gap: 5px; margin-bottom: 12px; }
html body .lm-field label { color: #3C4663; font-size: 12.5px; font-weight: 600; }
html body .lm-form-row { gap: 12px; margin-bottom: 12px; }
html body .lm-input, html body .lm-select, html body .lm-textarea,
html body .lm-filter-bar input, html body .lm-filter-bar select {
  background: #FFFFFF; border: 1px solid #D6DDEA; border-radius: 8px; color: #111834;
  padding: 7px 11px; font-size: 13px; box-shadow: none;
}
html body .lm-input::placeholder, html body .lm-filter-bar input::placeholder { color: #9AA3BB; }
html body .lm-input:focus, html body .lm-select:focus, html body .lm-textarea:focus,
html body .lm-filter-bar input:focus, html body .lm-filter-bar select:focus { border-color: #6D83F2; box-shadow: var(--tf-ring); }
html body .lm-filter-bar { gap: 8px; margin-bottom: 14px; }
html body .lm-toggle input:checked + .lm-toggle-slider { background: var(--tf-grad); }

/* Tabs (installation detail) */
html body .lm-tabs { border-bottom-color: #E3E8F1; margin-bottom: 16px; }
html body .lm-tab { padding: 8px 14px; font-weight: 600; color: #5B6582; font-size: 13px; }
html body .lm-tab:hover { color: #111834; }
html body .lm-tab.active { color: #2B36B8; border-bottom-color: #3B4FE0; }

/* Modal and drawer */
html body .lm-modal,
html body .modal { border-radius: 14px; border: 1px solid #E1E6F0; box-shadow: var(--shadow-lg); }
html body .lm-modal { padding: 24px; }
html body .lm-modal::before,
html body .modal::before { background: var(--tf-grad); height: 3px; }
html body .lm-modal h2 { color: #0B1033; }
html body .lm-modal-overlay,
html body .lm-drawer-overlay,
html body .modal-backdrop { background: rgba(11, 16, 51, .42); }
html body .lm-drawer-header {
  background:
    radial-gradient(ellipse 60% 140% at 100% 0%, rgba(99, 102, 241, .5), transparent 60%),
    linear-gradient(120deg, #0B1033 0%, #1E1B4B 60%, #272B86 100%);
  padding: 16px 20px;
}
html body .lm-drawer-body { padding: 20px; }

/* Badges and small bits */
html body .badge { font-size: 11px; padding: 2px 9px; }
html body .badge-pending { background: #EEF2FF; color: #3730A3; border-color: #C7D2FE; }
html body .lm-cyber-tag { background: #EEF2FF; color: #3730A3; border-color: #DDE4FF; }
html body .lim-section-title { color: #3B4FE0; }
html body .cap-bar { background: #EEF2FF; }
html body .cap-ok { background: var(--tf-grad); }
html body .lm-spinner { border-top-color: #2F4FE0; }
html body .lm-flash.info { background: #EEF2FF; color: #2B36B8; border-color: #C7D2FE; }
html body .lm-empty { padding: 36px 20px; color: #6E7896; }
html body .role-sales { background: #EEF2FF; color: #3730A3; border-color: #C7D2FE; }
html body .ms-mark { background: var(--tf-grad); }
html body .ms-card::before { background: var(--tf-grad); }
html body .ms-secret { color: #2B36B8; }

/* ═══ Sign-in and first-run setup ════════════════════════════════════════
   Deep indigo brand panel + clean white form panel, as in TriAankh. */
html body .lm-side {
  background:
    radial-gradient(ellipse 70% 60% at 0% 0%, rgba(59, 130, 246, .35), transparent 60%),
    radial-gradient(ellipse 60% 60% at 100% 100%, rgba(99, 102, 241, .38), transparent 62%),
    linear-gradient(160deg, #0B1033 0%, #1E1B4B 55%, #262A7A 100%);
  padding: 44px 52px;
}
html body .lm-side::before {
  background-image: radial-gradient(rgba(165, 180, 252, .22) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.15));
          mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.15));
}
html body .lm-side::after { display: none; }
html body .lm-side-mark {
  background: linear-gradient(135deg, #3B82F6, #4F46E5);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .8);
}
html body .lm-side-brand-text small { color: rgba(224, 231, 255, .7); letter-spacing: .12em; }
html body .lm-side-headline { font-size: 32px; letter-spacing: -.02em; }
html body .lm-side-headline span { background: linear-gradient(90deg, #93C5FD, #A5B4FC 60%, #C4B5FD); -webkit-background-clip: text; background-clip: text; }
html body .lm-side-sub { color: rgba(224, 231, 255, .76); }
html body .lm-side-stat { background: rgba(129, 140, 248, .10); border: 1px solid rgba(165, 180, 252, .22); }
html body .lm-side-stat-text { color: rgba(224, 231, 255, .85); }
html body .dot-indigo { background: #A5B4FC; box-shadow: 0 0 8px #A5B4FC; }
html body .dot-sea { background: #7DD3FC; box-shadow: 0 0 8px #7DD3FC; }
html body .dot-blue { background: #93C5FD; box-shadow: 0 0 8px #93C5FD; }
html body .lm-side-footer { color: rgba(224, 231, 255, .5); }

html body .lm-form-panel { background: #FFFFFF; box-shadow: none; border-left: 1px solid #E6EAF2; padding: 40px 44px; }
html body .lm-form-title { font-size: 24px; font-weight: 750; letter-spacing: -.02em; color: #0B1033; }
html body .lm-form-sub { color: #5B6582; margin-bottom: 22px; }
html body .lm-form-panel .lm-input {
  height: 42px; border-radius: 10px; border: 1px solid #D6DDEA; background: #FFFFFF; font-size: 14px;
}
html body .lm-form-panel .lm-input:focus { border-color: #6D83F2; box-shadow: var(--tf-ring); }
html body .lm-form-panel .btn-primary { height: 44px; border-radius: 10px; font-size: 14.5px; font-weight: 700; }
html body .btn-ms { border: 1px solid #D6DDEA; border-radius: 10px; color: #26304D; background: #FFFFFF; }
html body .btn-ms:hover { background: #F6F8FF; border-color: #8EA0F5; }
html body .security-badge { color: #6E7896; }
html body .security-badge svg { color: #3B4FE0; }

/* Inputs with a leading icon (sign-in / setup) keep room for the icon */
html body .lm-input-wrap .lm-input { padding-left: 38px; }
html body .lm-input-icon { color: #8891AB; }

/* SSO & Password Policy page components */
html body .sp-card { background: #FFFFFF; border: 1px solid #E3E8F1; border-radius: 12px; padding: 18px; box-shadow: 0 1px 2px rgba(16,24,64,.04), 0 2px 6px rgba(16,24,64,.03); }
html body .sp-layout { gap: 14px; }
html body .sp-card-title { color: #0B1033; font-weight: 700; }
html body .sp-card-sub { margin-bottom: 14px; }
html body .sp-field { margin-bottom: 12px; }
html body .sp-label { color: #5E6887; font-weight: 700; font-size: 10.5px; letter-spacing: .07em; }
html body .sp-input { background: #FFFFFF; border: 1px solid #D6DDEA; border-radius: 8px; padding: 7px 10px; }
html body .sp-input:focus { border-color: #6D83F2; box-shadow: var(--tf-ring); }
html body .sp-btn { border-radius: 8px; font-weight: 600; }
html body .sp-btn-primary { background: var(--tf-grad); color: #FFFFFF; border: 1px solid #2F45D6; box-shadow: 0 1px 2px rgba(16,24,64,.12), 0 4px 12px -6px rgba(47,79,224,.6); }
html body .sp-btn-primary:hover { filter: brightness(1.07); background: var(--tf-grad); }
html body .sp-btn-secondary { background: #FFFFFF; color: #26304D; border: 1px solid #D6DDEA; }
html body .sp-btn-secondary:hover { background: #F6F8FF; color: #2F4FE0; border-color: #8EA0F5; }
html body .toggle input:checked + .slider { background: var(--tf-grad); }

/* Admin-user and license dialogs */
html body .modal-header { border-bottom: 1px solid #EDF0F6; }
html body .modal-title { color: #0B1033; font-weight: 700; }
html body .modal-sub { color: #5B6582; }
html body .modal-actions { border-top: 1px solid #EDF0F6; }
html body .lic-type-card { border-radius: 10px; border-color: #E0E6F0; }
html body .lic-type-card:hover { border-color: #8EA0F5; }
html body .lic-type-card.selected, html body .lic-type-card.active { border-color: #3B4FE0; background: #F5F7FF; box-shadow: var(--tf-ring); }
html body .totp-code-input:focus { border-color: #6D83F2; box-shadow: var(--tf-ring); }
