/* ============================================================
   Vault Hub — Design System
   Brand: confident blue primary (matches product branding),
   green reserved for success/health states, neutral ink for a
   premium, trustworthy feel.
   ============================================================ */
/* ============================================================
   Vault Hub: Design System (Material Design 3)
   Colours are the product's own: blue primary, indigo secondary,
   green for success and health, amber and red for warnings.
   Four colour modes, all built from the same tokens:
     Light    (default)         : <html data-theme="light">
     Dark                       : <html data-theme="dark">
     Colorful (tinted, vibrant) : <html data-theme="colorful">
     System   follows the device and resolves to light or dark.
   assets/theme.js sets data-theme before the first paint.
   ============================================================ */
:root {
  /* colour roles */
  --brand: #1A73E8;               /* primary */
  --brand-hover: #1557B0;
  --link: #1557B0;                /* blue for text and links: reads on every surface */
  --on-brand: #FFFFFF;
  --brand-soft: #D8E6FD;          /* primary container */
  --on-brand-soft: #0B2E66;
  --secondary: #34519E;
  --secondary-soft: #DFE5F6;      /* secondary container */
  --on-secondary-soft: #14234F;
  --tertiary: #1B5E46;
  --tertiary-soft: #D3EBDD;

  --ink: #171B1E;                 /* on-surface */
  --muted: #5B6570;               /* on-surface-variant */
  --bg: #F4F5F4;                  /* surface */
  --surface: #FFFFFF;             /* surface container lowest (cards, fields) */
  --surface-alt: #EFF2F0;         /* surface container */
  --surface-high: #E7EBE9;        /* surface container high */
  --surface-pop: #FFFFFF;         /* menus and dialogs */
  --border: #E2E5E3;              /* outline variant */
  --border-strong: #C9D0CC;
  --outline: #78837D;             /* outline (fields, outlined buttons) */

  --danger: #B3261E;
  --danger-soft: #F9DEDC;
  --warn: #7A4F00;
  --warn-soft: #FCEBC8;
  --success: #1B5E46;
  --success-soft: #D6EBDF;

  --inverse-surface: #2D3135;     /* snackbars and tooltips */
  --inverse-ink: #F1F3F2;
  --state-hover: rgba(26,115,232,.08);
  --state-press: rgba(26,115,232,.12);
  --scrim: rgba(9,13,11,.40);

  /* shape */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 28px;
  --radius-full: 999px;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(23,27,30,.16), 0 1px 3px 1px rgba(23,27,30,.07);
  --shadow-md: 0 1px 2px rgba(23,27,30,.16), 0 2px 6px 2px rgba(23,27,30,.09);
  --shadow-lg: 0 4px 8px 3px rgba(23,27,30,.11), 0 1px 3px rgba(23,27,30,.18);

  --brand-gradient: linear-gradient(135deg, #1A73E8 0%, #1A73E8 100%);
  --secondary-gradient: linear-gradient(135deg, #34519E 0%, #34519E 100%);
  --transition: 150ms cubic-bezier(.2,0,0,1);

  /* app bar, footer and sign-in panel */
  --header-bg: var(--bg);
  --header-ink: var(--ink);
  --header-muted: var(--muted);
  --header-hover: var(--state-hover);
  --header-active-bg: var(--secondary-soft);
  --header-active-ink: var(--on-secondary-soft);
  --header-btn-bg: var(--surface-alt);
  --header-btn-hover: var(--surface-high);
  --header-border: var(--border);
  --footer-bg: #12201A;
  --auth-panel: linear-gradient(160deg, #0B1F3A 0%, #123A6B 100%);
  --page-glow: radial-gradient(900px 420px at 90% -10%, rgba(26,115,232,.10), transparent 60%), radial-gradient(700px 380px at -5% 105%, rgba(52,81,158,.08), transparent 60%);

  /* charts */
  --chart-1: #1A73E8; --chart-1-soft: rgba(26,115,232,.32);
  --chart-2: #2E7D5B; --chart-2-soft: rgba(46,125,91,.32);
  --chart-3: #C9852B; --chart-4: #8E4EC6; --chart-5: #2B8FA8; --chart-6: #34519E;

  --field-height: 44px;
  --container: 1440px;
  --font-ui: 'Roboto', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ===== Dark: the product's dark palette, with Material tonal surfaces ===== */
:root[data-theme="dark"] {
  --brand: #6AA6F7;
  --brand-hover: #8DBBFA;
  --link: #6AA6F7;
  --on-brand: #06214F;
  --brand-soft: rgba(106,166,247,0.20);
  --on-brand-soft: #D6E4FF;
  --secondary: #8FA9F0;
  --secondary-soft: rgba(143,169,240,0.20);
  --on-secondary-soft: #DCE4FF;
  --tertiary: #5CC59B;
  --tertiary-soft: rgba(92,197,155,0.18);

  --ink: #ECF1EE;
  --muted: #A3B0AA;
  --bg: #0E1512;
  --surface: #151F1B;
  --surface-alt: #1D2A25;
  --surface-high: #26352F;
  --surface-pop: #212F29;
  --border: #2C3B34;
  --border-strong: #3D4F46;
  --outline: #7F8F87;

  --danger: #F2867B;
  --danger-soft: rgba(242,134,123,0.16);
  --warn: #E9C46A;
  --warn-soft: rgba(233,196,106,0.16);
  --success: #5CC59B;
  --success-soft: rgba(92,197,155,0.18);

  --inverse-surface: #E3E9E6;
  --inverse-ink: #1B2420;
  --state-hover: rgba(106,166,247,.10);
  --state-press: rgba(106,166,247,.16);
  --scrim: rgba(0,0,0,.60);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.40), 0 1px 3px 1px rgba(0,0,0,.22);
  --shadow-md: 0 1px 2px rgba(0,0,0,.40), 0 2px 6px 2px rgba(0,0,0,.28);
  --shadow-lg: 0 4px 8px 3px rgba(0,0,0,.34), 0 1px 3px rgba(0,0,0,.50);

  --brand-gradient: linear-gradient(135deg, #6AA6F7 0%, #6AA6F7 100%);
  --secondary-gradient: linear-gradient(135deg, #8FA9F0 0%, #8FA9F0 100%);

  --header-bg: #121C18;
  --header-border: #22312A;
  --header-btn-bg: #1D2A25;
  --header-btn-hover: #26352F;
  --footer-bg: #0A100E;
  --page-glow: radial-gradient(900px 420px at 90% -10%, rgba(106,166,247,.08), transparent 60%);

  --chart-1: #6AA6F7; --chart-1-soft: rgba(106,166,247,.34);
  --chart-2: #5CC59B; --chart-2-soft: rgba(92,197,155,.34);
  --chart-3: #E3A957; --chart-4: #B98AE3; --chart-5: #5BC0D8; --chart-6: #8FA9F0;
}

/* ===== Colorful: a bright, tinted light mode. Same blue, indigo, green, amber and violet, used more boldly ===== */
:root[data-theme="colorful"] {
  --brand: #1A6FE0;
  --brand-hover: #1257B5;
  --link: #1257B5;
  --brand-soft: #CFE0FC;
  --on-brand-soft: #0A2B63;
  --secondary: #3A4FA8;
  --secondary-soft: #D9DFF7;
  --on-secondary-soft: #14224F;
  --tertiary: #17714F;
  --tertiary-soft: #CBEBDA;

  --ink: #13202F;
  --muted: #4B5B70;
  --bg: #E7EEFC;
  --surface: #FFFFFF;
  --surface-alt: #EDF2FD;
  --surface-high: #DCE6FA;
  --surface-pop: #FFFFFF;
  --border: #CFDBF3;
  --border-strong: #AFC2E8;
  --outline: #6E83AD;

  --warn: #7A4F00;
  --warn-soft: #FFE6B0;
  --success-soft: #C7EBD7;
  --danger-soft: #FADAD7;

  --inverse-surface: #1F2F63;
  --inverse-ink: #EEF2FF;
  --state-hover: rgba(26,111,224,.09);
  --state-press: rgba(26,111,224,.14);
  --scrim: rgba(14,24,60,.45);

  --shadow-sm: 0 1px 2px rgba(31,47,99,.14), 0 1px 3px 1px rgba(31,47,99,.08);
  --shadow-md: 0 1px 2px rgba(31,47,99,.16), 0 3px 8px 2px rgba(31,47,99,.12);
  --shadow-lg: 0 6px 12px 4px rgba(31,47,99,.14), 0 1px 3px rgba(31,47,99,.20);

  --brand-gradient: linear-gradient(135deg, #1A6FE0 0%, #3A66D6 100%);
  --secondary-gradient: linear-gradient(135deg, #3A4FA8 0%, #5A47B8 100%);

  --header-bg: linear-gradient(95deg, #1557B0 0%, #2F4CA8 55%, #54389F 100%);
  --header-ink: #FFFFFF;
  --header-muted: rgba(255,255,255,.86);
  --header-hover: rgba(255,255,255,.14);
  --header-active-bg: rgba(255,255,255,.17);
  --header-active-ink: #FFFFFF;
  --header-btn-bg: rgba(255,255,255,.16);
  --header-btn-hover: rgba(255,255,255,.28);
  --header-border: transparent;
  --footer-bg: #1B2A5E;
  --auth-panel: linear-gradient(160deg, #1557B0 0%, #3A4FA8 55%, #6B3FA0 100%);
  --page-glow: radial-gradient(800px 380px at 92% -8%, rgba(91,63,166,.16), transparent 60%), radial-gradient(700px 380px at -5% 105%, rgba(26,111,224,.16), transparent 60%);

  --chart-1: #1A6FE0; --chart-1-soft: rgba(26,111,224,.34);
  --chart-2: #8E4EC6; --chart-2-soft: rgba(142,78,198,.34);
  --chart-3: #E08A12; --chart-4: #17714F; --chart-5: #1796B5; --chart-6: #3A4FA8;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--bg);
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="colorful"] { color-scheme: light; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .2s ease, color .2s ease;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0; }

/* ===== Subtle entrance animation for freshly-rendered panels ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== "Live" pulse dot — use next to Connected/Healthy status text ===== */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); margin-right: 6px; position: relative; top: -1px;
  box-shadow: 0 0 0 0 rgba(27,94,70,.5);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(27,94,70,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(27,94,70,0); }
  100% { box-shadow: 0 0 0 0 rgba(27,94,70,0); }
}

/* ===== Layout shell ===== */
.site-main { flex: 1; width: 100%; }
.container { max-width: var(--container); margin: 0 auto; padding: 28px 28px 48px; }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  color: var(--header-ink);
  border-bottom: 1px solid var(--header-border);
  transition: box-shadow var(--transition);
}
:root[data-theme="colorful"] .site-header { box-shadow: var(--shadow-md); }
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand-mark { display: flex; align-items: center; gap: 10px; color: var(--header-ink); }
.brand-mark:hover { text-decoration: none; }
.brand-mark .logo-badge {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-mark .logo-badge img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-mark .brand-name { font-weight: 500; font-size: 20px; letter-spacing: 0; white-space: nowrap; }
.brand-mark { flex-shrink: 0; }
.brand-mark .brand-tagline { font-size: 11px; color: var(--header-muted); font-weight: 500; }

.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; padding-left: 16px; }
.nav-more { position: relative; flex-shrink: 0; }
.nav-more > button {
  display: flex; align-items: center; gap: 7px;
  padding: 0 12px; height: 40px; border-radius: var(--radius-full); border: none; background: none;
  color: var(--header-muted); font-size: 14px; font-weight: 500; letter-spacing: .1px; font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-more > button:hover { background: var(--header-hover); color: var(--header-ink); }
.nav-more > button.active { background: var(--header-active-bg); color: var(--header-active-ink); font-weight: 500; }
.nav-more-dropdown {
  display: none; position: absolute; left: 0; top: calc(100% + 6px);
  background: var(--surface-pop); border: 1px solid var(--border); border-radius: 12px; color: var(--ink);
  box-shadow: var(--shadow-md); min-width: 210px; padding: 8px; z-index: 60;
}
.nav-more-dropdown.open { display: block; animation: menuIn .14s ease; }
.nav-more-dropdown a {
  display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 42px;
  border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; text-decoration: none;
}
.nav-more-dropdown a:hover { background: var(--state-hover); }
.nav-more-dropdown a.active { background: var(--brand-soft); color: var(--on-brand-soft); font-weight: 500; }
.nav-more-dropdown a svg, .nav-sub-btn svg, .nav-sub-panel a svg, .account-dropdown a svg { color: var(--muted); }
.nav-more-dropdown a.active svg, .nav-sub-btn.active svg, .nav-sub-panel a.active svg { color: currentColor; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.nav-more-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.main-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 40px; border-radius: var(--radius-full);
  color: var(--header-muted); font-size: 14px; font-weight: 500; letter-spacing: .1px;
  text-decoration: none; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover { background: var(--header-hover); color: var(--header-ink); }
.main-nav a.active { background: var(--header-active-bg); color: var(--header-active-ink); font-weight: 500; }
.main-nav a svg { flex-shrink: 0; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--header-btn-bg); color: var(--header-ink); cursor: pointer; font-family: inherit;
  transition: background var(--transition);
}
.theme-toggle-btn:hover { background: var(--header-btn-hover); }
.theme-toggle-btn:focus-visible, .notif-bell > button:focus-visible, .account-menu > button:focus-visible, .lang-menu > button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ===== Colour-mode picker (Light, Dark, Colorful, System) ===== */
.theme-menu { position: relative; }
.theme-menu .tm-ic { display: none; align-items: center; justify-content: center; }
:root[data-theme-pref="light"] .tm-ic-light, :root[data-theme-pref="dark"] .tm-ic-dark,
:root[data-theme-pref="colorful"] .tm-ic-colorful, :root[data-theme-pref="system"] .tm-ic-system { display: inline-flex; }
:root:not([data-theme-pref]) .tm-ic-light { display: inline-flex; }
.theme-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 206px; padding: 8px; z-index: 70;
  background: var(--surface-pop); color: var(--ink); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
}
.theme-menu.open .theme-dropdown { display: block; animation: menuIn .14s ease; }
.theme-dropdown .dd-label { padding: 6px 12px 6px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .4px; text-transform: uppercase; }
.theme-dropdown button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--ink); font: 500 14px var(--font-ui); text-align: left; cursor: pointer;
}
.theme-dropdown button:hover, .theme-dropdown button:focus-visible { background: var(--state-hover); outline: none; }
.theme-dropdown button svg { color: var(--muted); flex: none; }
.theme-dropdown button > span:first-of-type { flex: 1; }
.theme-dropdown .tm-check { visibility: hidden; color: var(--brand); display: inline-flex; }
.theme-dropdown button.active { background: var(--brand-soft); color: var(--on-brand-soft); }
.theme-dropdown button.active svg { color: currentColor; }
.theme-dropdown button.active .tm-check { visibility: visible; }

/* ===== Toast notifications (lightweight, auto-dismiss) ===== */
#toast-stack { position: fixed; top: 78px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--inverse-surface); color: var(--inverse-ink); padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px;
  animation: toastIn .2s ease; max-width: 340px;
}
.toast.toast-success { background: var(--success); color: #fff; }
:root[data-theme="dark"] .toast.toast-success, :root[data-theme="dark"] .toast.toast-danger, :root[data-theme="dark"] .toast.toast-warn { color: #0E1512; }
.toast.toast-warn { background: var(--warn); color: #fff; }
.toast.toast-danger { background: var(--danger); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Inline loading indicator (wave bars — button-click loading, style #4) ===== */
.spinner { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 14px; vertical-align: middle; }
.spinner span {
  width: 3px; background: var(--on-brand); border-radius: 2px;
  animation: barwave 1s ease-in-out infinite;
}
.btn-outline .spinner span, .btn-danger .spinner span { background: var(--ink); }
.spinner span:nth-child(1) { animation-delay: 0s; }
.spinner span:nth-child(2) { animation-delay: .1s; }
.spinner span:nth-child(3) { animation-delay: .2s; }
.spinner span:nth-child(4) { animation-delay: .3s; }
@keyframes barwave { 0%, 100% { height: 4px; } 50% { height: 13px; } }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ===== Full-page loading overlay (dual-tone ring — style #6) — shows on every navigation/submit ===== */
#page-loader-overlay {
  position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(1.5px);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
#page-loader-overlay.visible { opacity: 1; pointer-events: all; }
.page-loader-ring {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid transparent; border-top-color: var(--brand); border-bottom-color: var(--success); background: var(--surface); box-shadow: var(--shadow-md);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Notification bell ===== */
.notif-bell { position: relative; }
.notif-bell > button {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--header-btn-bg); color: var(--header-ink); cursor: pointer; position: relative;
  transition: background var(--transition);
}
.notif-bell > button:hover { background: var(--header-btn-hover); }
.notif-badge {
  position: absolute; top: 1px; right: 0; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 500; min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; box-shadow: 0 0 0 2px var(--header-bg, var(--bg));
}
.notif-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface-pop); color: var(--ink); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); width: 320px; max-height: 360px; overflow-y: auto; padding: 8px; z-index: 60;
}
.notif-dropdown.open { display: block; animation: menuIn .14s ease; }
.notif-dropdown .notif-item { display: block; padding: 11px 12px; border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; }
.notif-dropdown .notif-item:hover { background: var(--state-hover); text-decoration: none; }
.notif-dropdown .notif-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.account-menu, .lang-menu { position: relative; }
.account-menu > button, .lang-menu > button {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--header-ink); font-weight: 500; letter-spacing: .1px;
  height: 40px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--header-btn-bg);
  border: none; cursor: pointer; font-family: inherit; transition: background var(--transition);
}
.lang-menu > button { padding-left: 12px; }
.account-menu > button:hover, .lang-menu > button:hover { background: var(--header-btn-hover); }
.account-menu .avatar-dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--on-brand-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.account-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface-pop); color: var(--ink); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); min-width: 200px; padding: 8px; z-index: 60;
}
.account-dropdown.open { display: block; animation: menuIn .14s ease; }
.account-dropdown .dd-label { padding: 6px 12px 6px; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.account-dropdown a {
  display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 42px;
  border-radius: var(--radius-sm); color: var(--ink); font-size: 14px;
}
.account-dropdown a:hover { background: var(--state-hover); text-decoration: none; }
.account-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

.nav-toggle { display: none; }
.nav-toggle-label {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; color: var(--header-ink);
}
.nav-toggle-label:hover { background: var(--header-hover); }

/* ===== Footer ===== */
.site-footer { background: var(--footer-bg); color: #C7D5CC; margin-top: 40px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 40px 24px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 32px; }
.footer-col h4 { font-size: 13px; color: #fff; font-weight: 600; margin-bottom: 14px; letter-spacing: .02em; text-transform: uppercase; }
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.footer-brand .logo-badge { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.footer-brand .logo-badge img { width: 100%; height: 100%; object-fit: contain; }
.footer-brand .brand-name { color: #fff; font-weight: 700; font-size: 16px; }
.footer-desc { font-size: 13.5px; color: #A7B8AE; line-height: 1.6; max-width: 320px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-links a { color: #C7D5CC; font-size: 13.5px; }
.footer-links a:hover { color: #fff; }
.footer-contact { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.footer-contact .row { display: flex; align-items: flex-start; gap: 9px; color: #C7D5CC; }
.footer-contact .row svg { flex-shrink: 0; margin-top: 2px; color: #7FAE93; }
.footer-contact .placeholder { color: #7C8C82; font-style: italic; }

/* একই কনট্যাক্ট-রো লেআউট, কিন্তু সাদা প্যানেল ব্যাকগ্রাউন্ডের জন্য (Help পেজে ব্যবহৃত) */
.contact-list { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.contact-list .row { display: flex; align-items: flex-start; gap: 9px; color: var(--ink); }
.contact-list .row svg { flex-shrink: 0; margin-top: 2px; color: var(--link); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 32px; padding-top: 18px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: #8FA096;
}
.footer-legal { display: flex; gap: 16px; }
.footer-legal a { color: #8FA096; font-size: 12.5px; }
.footer-legal a:hover { color: #fff; }

/* ===== Page header ===== */
.page-head { margin-bottom: 24px; display: flex; align-items: center; gap: 16px; }
.page-head-icon {
  width: 48px; height: 48px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--on-brand-soft);
}
.page-head h1 { font-size: 24px; font-weight: 500; letter-spacing: 0; }
.page-head .subtitle { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ===== Panels / Cards ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 24px;
  margin-bottom: 20px;
  animation: fadeInUp .3s ease;
}
:root[data-theme="colorful"] .panel { box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 16px; font-weight: 500; letter-spacing: .1px; display: flex; align-items: center; gap: 10px; }
.panel > h2:not(:last-child) { margin-bottom: 12px; }
.panel h2 > svg:first-child {
  box-sizing: content-box; padding: 6px; border-radius: 10px; flex: none;
  color: var(--on-brand-soft); background: var(--brand-soft);
}
.panel .panel-desc { font-size: 13.5px; color: var(--muted); margin: 8px 0 16px; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.filter-bar .field { margin-bottom: 0; }
.filter-bar .field select, .filter-bar .field input { max-width: 260px; }

/* ===== Empty / status states ===== */
.empty-state { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-state svg { box-sizing: content-box; padding: 14px; border-radius: 50%; background: var(--surface-alt); color: var(--muted); margin-bottom: 12px; }
.empty-state strong { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 4px; }

/* ===== Tables ===== */
.table-wrap { overflow: visible; }  /* no scroll bars inside a page: tables fit the width and wrap */
.no-scroll { overflow: visible; max-width: 100%; }
.no-scroll svg { max-width: 100%; height: auto; }
@media (max-width: 640px) { .table-wrap { overflow-x: auto; } }  /* only on phones, for tables that cannot become cards */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-weight: 500; font-size: 12.5px; letter-spacing: .3px; color: var(--muted);
  padding: 12px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.table td { padding: 12px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; overflow-wrap: anywhere; }
.table td .btn { margin: 2px 2px 2px 0; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--state-hover); }
.table tbody tr.row-approved { background: var(--success-soft); }
.table tbody tr.row-approved:hover { background: var(--success-soft); filter: brightness(0.97); }
.table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.table thead th, .table tr:first-child th { position: sticky; top: 0; background: var(--surface-alt); z-index: 1; }
.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* ===== Responsive table → stacked cards on small screens (data-label driven) ===== */
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 12px; padding: 4px 0; background: var(--surface);
  }
  .table-stack td {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--border-strong-alpha, var(--border));
    text-align: right; white-space: normal;
  }
  .table-stack td:last-child { border-bottom: none; }
  .table-stack td::before {
    content: attr(data-label); font-size: 12px; font-weight: 600;
    color: var(--muted); text-align: left; margin-right: auto;
  }
  .table-stack td:empty::before { content: none; }
}

/* ===== Stat cards ===== */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: none; padding: 18px 20px; min-width: 150px; flex: 1;
  display: flex; align-items: center; gap: 16px;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
/* icon containers are tonal: a soft colour behind a deeper icon */
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--brand-soft); color: var(--on-brand-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-card .stat-icon.stat-icon-info { background: var(--secondary-soft); color: var(--on-secondary-soft); }
.stat-card .stat-icon.stat-icon-warn { background: var(--warn-soft); color: var(--warn); }
.stat-card .stat-icon.stat-icon-danger { background: var(--danger-soft); color: var(--danger); }
.stat-card .stat-icon.stat-icon-purple { background: #E9DDF8; color: #4B2A7A; }
:root[data-theme="dark"] .stat-card .stat-icon.stat-icon-purple { background: rgba(185,138,227,.20); color: #D8BDF3; }
/* Colorful mode: bold coloured icon tiles and softly tinted cards */
:root[data-theme="colorful"] .stat-card { box-shadow: var(--shadow-sm); border-color: transparent; }
:root[data-theme="colorful"] .stat-card .stat-icon { background: var(--brand-gradient); color: #fff; }
:root[data-theme="colorful"] .stat-card .stat-icon.stat-icon-info { background: var(--secondary-gradient); color: #fff; }
:root[data-theme="colorful"] .stat-card .stat-icon.stat-icon-warn { background: linear-gradient(135deg, #C47A00, #E39B1E); color: #fff; }
:root[data-theme="colorful"] .stat-card .stat-icon.stat-icon-danger { background: linear-gradient(135deg, #B3261E, #D64A40); color: #fff; }
:root[data-theme="colorful"] .stat-card .stat-icon.stat-icon-purple { background: linear-gradient(135deg, #6B3FA0, #8E4EC6); color: #fff; }
:root[data-theme="colorful"] .stat-card:has(.stat-icon-info) { background: #E7EAFA; }
:root[data-theme="colorful"] .stat-card:has(.stat-icon-warn) { background: #FFF1D2; }
:root[data-theme="colorful"] .stat-card:has(.stat-icon-danger) { background: #FDE5E2; }
:root[data-theme="colorful"] .stat-card:has(.stat-icon-purple) { background: #F0E6FA; }
:root[data-theme="colorful"] .stat-card:not(:has(.stat-icon-info, .stat-icon-warn, .stat-icon-danger, .stat-icon-purple)) { background: #E2EDFE; }
.stat-card .stat-value { font-size: 24px; font-weight: 500; letter-spacing: 0; line-height: 1.2; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ===== Badges / pills ===== */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; letter-spacing: .2px; white-space: nowrap; }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-muted { background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-info { background: var(--secondary-soft); color: var(--on-secondary-soft); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
#global-search-results a:hover { background: var(--surface-alt); }

/* ===== Alerts ===== */
.banner {
  padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid transparent; border-left-width: 4px;
}
.banner svg { flex-shrink: 0; }
.banner .banner-action { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.banner-warn { background: var(--warn-soft); color: var(--warn); border-left-color: var(--warn); }
.banner-success { background: var(--success-soft); color: var(--success); border-left-color: var(--success); }
.banner-danger { background: var(--danger-soft); color: var(--danger); border-left-color: var(--danger); }
.banner-info { background: var(--secondary-soft); color: var(--on-secondary-soft); border-left-color: var(--secondary); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 24px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 500; letter-spacing: .1px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; font-family: inherit; line-height: 1.3;
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn:hover { text-decoration: none; }
/* filled: primary */
.btn-primary { background: var(--brand-gradient); color: var(--on-brand); box-shadow: none; }
.btn-primary:hover { background: var(--brand-hover); box-shadow: var(--shadow-sm); }
:root[data-theme="colorful"] .btn-primary { box-shadow: 0 2px 6px rgba(26,111,224,.30); }
/* outlined */
.btn-outline { background: transparent; border-color: var(--outline); color: var(--link); }
.btn-outline:hover { background: var(--state-hover); }
.btn-outline:active { background: var(--state-press); }
/* outlined, destructive */
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
/* tonal: secondary container */
.btn-tonal { background: var(--secondary-soft); color: var(--on-secondary-soft); }
.btn-tonal:hover { box-shadow: var(--shadow-sm); filter: brightness(.97); }
.btn-sm { height: 32px; padding: 0 16px; font-size: 13px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; }
.btn-sm.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ===== Forms ===== */
/* Bare controls (not inside .field) get the same outlined Material look. :where() keeps this at zero weight so any class can still override it. */
:where(select, textarea, input[type="text"], input[type="number"], input[type="search"], input[type="password"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], input[type="datetime-local"], input[type="month"], input[type="time"]) {
  font-family: inherit; font-size: 14px; color: var(--ink); background-color: var(--surface);
  border: 1px solid var(--outline); border-radius: var(--radius-sm); min-height: 40px; padding: 0 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
:where(textarea) { padding: 10px 12px; min-height: 0; }
:where(select, textarea, input[type="text"], input[type="number"], input[type="search"], input[type="password"], input[type="email"], input[type="tel"], input[type="url"], input[type="date"], input[type="datetime-local"], input[type="month"], input[type="time"]):focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--brand); }
::placeholder { color: var(--muted); opacity: .8; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; letter-spacing: .2px; color: var(--ink); margin-bottom: 6px; min-height: 34px; }
.field .hint { font-weight: 400; color: var(--muted); }
.field .req { color: var(--danger); margin-left: 2px; }
.field input, .field select {
  width: 100%; max-width: 420px; height: var(--field-height); padding: 0 12px;
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; background: var(--surface); color: var(--ink);
  box-shadow: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:hover:not(:focus), .field select:hover:not(:focus) { border-color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 200px; }
.input-sm { width: 80px !important; padding: 6px 8px !important; }
.search-box { width: 260px; max-width: 100%; height: var(--field-height); padding: 0 16px 0 40px; border: 1px solid var(--outline); border-radius: var(--radius-full); font-size: 14px; font-family: inherit; background: var(--surface); color: var(--ink); }
.search-box:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.search-wrap { position: relative; max-width: 260px; }
.search-wrap input.search-box { padding-left: 40px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* ===== Grouped input (input + unit/suffix + button as one visual control) ===== */
.input-group {
  display: inline-flex; align-items: stretch; height: var(--field-height);
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.input-group input, .input-group select {
  border: none; border-radius: 0; max-width: none; height: 100%;
  box-shadow: none; padding: 0 10px;
}
.input-group input:focus, .input-group select:focus { box-shadow: none; outline: none; }
.input-group .unit {
  display: flex; align-items: center; padding: 0 10px;
  background: var(--surface-alt); color: var(--muted); font-size: 12.5px;
  border-left: 1px solid var(--border); white-space: nowrap;
}
.input-group .btn {
  border-radius: 0; border: none; border-left: 1px solid var(--border-strong); height: 100%;
}

/* ===== Toggle switch (Material switch) ===== */
input.toggle {
  appearance: none; -webkit-appearance: none;
  width: 48px; height: 28px; background: var(--surface-high); border: 2px solid var(--outline); border-radius: 999px; position: relative;
  cursor: pointer; outline: none; transition: background var(--transition), border-color var(--transition); vertical-align: middle; margin: 0; flex-shrink: 0;
}
input.toggle::before {
  content: ""; position: absolute; top: 50%; left: 4px; width: 14px; height: 14px; margin-top: -7px;
  background: var(--outline); border-radius: 50%; transition: transform var(--transition), width var(--transition), height var(--transition), margin var(--transition), background var(--transition);
}
input.toggle:checked { background: var(--brand); border-color: var(--brand); }
input.toggle:checked::before { width: 20px; height: 20px; margin-top: -10px; transform: translateX(19px); background: var(--on-brand); }
input.toggle:hover::before { box-shadow: 0 0 0 8px var(--state-hover); }
input.toggle:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft), 0 0 0 5px var(--brand); }

/* ===== Tooltip ===== */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%);
  background: var(--inverse-surface); color: var(--inverse-ink); font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: var(--radius-xs);
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 80;
}
[data-tooltip]:hover::after { opacity: 1; }
[data-tooltip].tip-left::after { left: auto; right: 0; transform: none; }
[data-tooltip].tip-right::after { left: 0; transform: none; }
/* হেডারের এলিমেন্টগুলো ভিউপোর্টের একদম উপরে থাকায় সেখানে টুলটিপ উপরে দেখালে কেটে যায় — তাই নিচে দেখানো হবে */
.site-header [data-tooltip]::after { bottom: auto; top: 125%; }
/* টেবিলের ভেতরের টুলটিপও একই কারণে (overflow-x: auto থাকলে overflow-y ক্লিপ হয়ে যায়) নিচে দেখানো হবে */
.table-wrap [data-tooltip]::after { bottom: auto; top: 125%; }
/* last column sits at the screen edge: open the tip toward the left so it is never cut off or widens the page */
.table td:last-child [data-tooltip]::after { left: auto; right: 0; transform: none; }
html, body { overflow-x: clip; }  /* a hidden tip can never create a sideways scroll bar */

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: var(--scrim);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-overlay.open { display: flex; animation: overlayFade .15s ease; }
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--surface-pop); color: var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 28px;
  animation: modal-pop .15s ease;
}
@keyframes modal-pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { font-size: 20px; font-weight: 500; letter-spacing: 0; }
.modal-head h2 { display: flex; align-items: center; gap: 12px; }
.modal-head h2 > svg:first-child { box-sizing: content-box; padding: 7px; border-radius: 12px; flex: none; color: var(--on-brand-soft); background: var(--brand-soft); }
.modal-close {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--state-hover); color: var(--ink); }

/* ===== OTP boxes ===== */
.otp-boxes { display: flex; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.otp-box {
  width: 44px; height: 52px; text-align: center;
  font-size: 22px; font-family: var(--font-mono); font-weight: 600;
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.otp-box:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* ===== Icon micro-animations ===== */
.stat-card .stat-icon { transition: transform .25s cubic-bezier(.2,0,0,1); }
.stat-card:hover .stat-icon { transform: scale(1.06); }
.main-nav a svg { transition: transform .2s ease; }
.main-nav a:hover svg { transform: scale(1.08); }
.btn svg { transition: transform .15s ease; }
.btn:hover svg { transform: scale(1.1); }
.theme-toggle-btn svg, .notif-bell svg, .lang-menu svg { transition: transform .3s ease; }
.theme-toggle-btn:hover svg { transform: rotate(18deg); }
.notif-bell button:hover svg { transform: rotate(-10deg); }
.logo-badge svg, .logo-badge img { transition: transform .3s ease; }
.brand-mark:hover .logo-badge svg, .brand-mark:hover .logo-badge img { transform: scale(1.15); }

/* ===== Animated gradient background for the login/auth pages ===== */
body.login-page { background: var(--page-glow), var(--bg); background-attachment: fixed; }
.login-card { animation: fadeInUp .35s ease; }

/* ===== Login page ===== */
body.login-page { justify-content: center; align-items: center; flex-direction: row; min-height: 100vh; }
.login-card {
  width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 36px;
}
.login-card .logo-badge { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-card .logo-badge img { width: 100%; height: 100%; object-fit: contain; }
.login-card .brand { font-size: 22px; font-weight: 500; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }

/* ===== Two-panel login layout (login.php only) ===== */
.auth-shell {
  display: flex; width: 100%; max-width: 1040px; min-height: 620px;
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: fadeInUp .35s ease;
}
.auth-brand-panel {
  flex: 1.05; background: var(--auth-panel);
  color: #fff; padding: 40px 38px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-brand-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand-top .logo-badge { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-brand-top .logo-badge img { width: 100%; height: 100%; object-fit: contain; }
.auth-brand-name { font-size: 26px; font-weight: 500; letter-spacing: 0; }
.auth-brand-name span { color: #4FC3F7; }
.auth-brand-tagline { font-size: 11px; letter-spacing: .12em; color: #9FC3DE; margin-top: 2px; }
.auth-brand-mid { position: relative; z-index: 1; margin: 30px 0; }
.auth-brand-mid h2 { font-size: 22px; font-weight: 500; margin-bottom: 10px; line-height: 1.35; }
.auth-brand-mid p { font-size: 14px; color: #C7DCEC; line-height: 1.6; max-width: 380px; }
.auth-feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; position: relative; z-index: 1; }
.auth-feature {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 14px 8px;
}
.auth-feature svg { color: #6FD3FF; }
.auth-feature span { font-size: 11.5px; color: #DCEBF5; line-height: 1.35; }
.auth-brand-footer { text-align: center; font-size: 13px; color: #6FD3FF; letter-spacing: .04em; margin-top: 26px; position: relative; z-index: 1; }

.auth-form-panel { flex: 1; padding: 30px 44px 36px; display: flex; flex-direction: column; }
.auth-form-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-form-top a { font-size: 13.5px; font-weight: 500; color: var(--link); display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--radius-full); }
.auth-form-top a:hover { background: var(--state-hover); text-decoration: none; }
.auth-form-top .theme-toggle-btn { background: var(--surface-alt); color: var(--ink); }
.auth-form-top .theme-toggle-btn:hover { background: var(--surface-high); }
.auth-form-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 380px; margin: 0 auto; width: 100%; }
.auth-form-inner h1 { font-size: 30px; font-weight: 500; margin-bottom: 6px; }
.auth-form-inner h1 span { color: var(--link); }
.auth-form-sub { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.auth-form-features { display: flex; justify-content: space-around; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.auth-form-features div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-form-features svg { color: var(--link); }
.auth-form-features span { font-size: 11px; color: var(--muted); text-align: center; }
.auth-illustration { margin: 4px 0 22px; position: relative; z-index: 1; display: flex; justify-content: center; }
.auth-glow-icon {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, rgba(111,211,255,.25) 0%, rgba(111,211,255,0) 70%);
  display: flex; align-items: center; justify-content: center; color: #6FD3FF;
}
.auth-illustration { flex-direction: column; gap: 12px; }
.auth-cloud-row {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px; padding: 14px 18px;
}
.auth-cloud-row img { height: 26px; width: auto; }
.auth-cloud-caption { font-size: 11px; color: #9FC3DE; text-align: center; }
.auth-flow-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.auth-flow-icon { filter: drop-shadow(0 0 10px rgba(111,211,255,.4)); flex-shrink: 0; }
.auth-flow-server { height: 74px; width: auto; }
.auth-flow-laptop { height: 58px; width: auto; }
.auth-beam {
  display: block; width: 34px; height: 3px; border-radius: 3px; flex-shrink: 0;
  background: linear-gradient(90deg, rgba(111,211,255,0), rgba(111,211,255,.95), rgba(111,211,255,0));
  background-size: 200% 100%; animation: beamMove 1.6s linear infinite;
}
.auth-beam-green {
  background: linear-gradient(90deg, rgba(79,227,160,0), rgba(79,227,160,.95), rgba(79,227,160,0));
  background-size: 200% 100%; animation: beamMove 1.6s linear infinite;
}
@keyframes beamMove { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.input-group .input-leading-icon { display: flex; align-items: center; padding: 0 0 0 14px; color: var(--muted); }
.input-group input { padding-left: 8px !important; }

@media (max-width: 860px) {
  .auth-brand-panel { display: none; }
  .auth-shell { max-width: 420px; }
  .auth-form-panel { padding: 26px 24px; }
}

/* ===== OTP entry boxes ===== */
.otp-box-row { display: flex; gap: 6px; justify-content: center; }
.otp-box {
  width: 36px; height: 46px; text-align: center;
  font-family: var(--font-mono); font-size: 19px; font-weight: 600;
  border: 1px solid var(--outline); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  text-transform: uppercase;
}
.otp-box:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand);
}
@media (max-width: 420px) {
  .otp-box { width: 32px; height: 42px; font-size: 17px; }
  .otp-box-row { gap: 5px; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
/* Tablets and small laptops: the links fold into the menu button before they can collide with the buttons on the right */
@media (max-width: 1240px) {
  .main-nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface-pop); color: var(--ink); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; padding: 8px; gap: 2px;
    box-shadow: var(--shadow-md);
  }
  .main-nav a { padding: 0 16px; color: var(--ink); }
  .main-nav a:hover { background: var(--state-hover); color: var(--ink); }
  .main-nav a.active { background: var(--brand-soft); color: var(--on-brand-soft); }
  .nav-more > button { color: var(--ink); }
  .nav-more > button:hover { background: var(--state-hover); color: var(--ink); }
  .nav-more > button.active { background: var(--brand-soft); color: var(--on-brand-soft); }
  .nav-toggle:checked ~ .header-inner .main-nav { display: flex; }
  .nav-toggle-label { display: flex; }
  .account-menu .name-text { display: none; }
}
@media (max-width: 720px) {
  .two-col-grid { grid-template-columns: 1fr !important; }
  .container { padding: 18px 16px 36px; }
  .header-inner { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .stat-card { min-width: 100%; }
  .login-card { width: 100%; max-width: 380px; }
}
/* Laptops: slightly tighter links, and a long account name is cut short instead of pushing the links around */
@media (max-width: 1400px) {
  .account-menu .name-text { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.role-user .main-nav .nav-more > button svg:first-child { display: none; }
.role-user .main-nav .nav-more-dropdown a { padding: 0 12px; color: var(--ink); }
.role-user .main-nav .nav-more-dropdown a svg { display: inline-block; }
.role-user .main-nav .nav-more > button { padding: 0 8px; }
/* the customer menu has the most links, so it shows text only; with the icons it ran under the wallet chip even on wide screens */
.role-user .main-nav a { padding: 0 8px; }
.role-user .main-nav a svg { display: none; }
.role-user .account-menu .name-text { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1240px) {
  .role-user .main-nav a svg { display: inline-block; }
}
/* The customer menu has 8 links plus the wallet chip: below this width they would run under the chip, so they fold into the menu button earlier than the admin menu does */
@media (max-width: 1500px) {
  .role-user .main-nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface-pop); color: var(--ink); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; padding: 8px; gap: 2px;
    box-shadow: var(--shadow-md);
  }
  .role-user .main-nav a { padding: 0 16px; color: var(--ink); }
  .role-user .main-nav a:hover { background: var(--state-hover); color: var(--ink); }
  .role-user .main-nav a.active { background: var(--brand-soft); color: var(--on-brand-soft); }
  .role-user .main-nav a svg, .role-user .main-nav .nav-more > button svg:first-child { display: inline-block; }
  .nav-toggle:checked ~ .header-inner .main-nav { display: flex; }
  .nav-toggle-label { display: flex; }
  .account-menu .name-text { display: none; }
}
@media (max-width: 420px) {
  .login-card { padding: 26px 22px; }
  .panel { padding: 18px 16px; }
  .field input, .field select { max-width: 100%; }
  .search-box, .search-wrap { max-width: 100%; width: 100%; }
}

/* ===== Mobile: turn wide tables into stacked cards instead of horizontal scroll ===== */
@media (max-width: 640px) {
  .table.cards-on-mobile thead { display: none; }
  .table.cards-on-mobile, .table.cards-on-mobile tbody, .table.cards-on-mobile tr, .table.cards-on-mobile td {
    display: block; width: 100%;
  }
  .table.cards-on-mobile tr {
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; padding: 10px 4px;
  }
  .table.cards-on-mobile td {
    border: none; padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right;
  }
  .table.cards-on-mobile td[data-label]:not([data-label=""])::before {
    content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left;
  }
}

/* ===== হেডারে সবসময় দেখানো ওয়ালেট ব্যালেন্স চিপ (ইউজারদের জন্য) ===== */
.wallet-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; background: var(--brand-soft); color: var(--on-brand-soft);
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.wallet-chip:hover { background: var(--brand); color: var(--on-brand); text-decoration: none; }

.field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--outline); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; resize: vertical;
}
.field textarea:hover:not(:focus) { border-color: var(--ink); }
.field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* ===== আইনি পেজ (Terms / Privacy / Refund) ===== */
.legal-doc { max-width: 820px; margin: 0 auto; }
.legal-doc h1 { font-size: 24px; margin: 0 0 6px; }
.legal-doc h2 { font-size: 16px; margin: 24px 0 6px; padding: 0; border: 0; }
.legal-doc p, .legal-doc li { font-size: 14px; line-height: 1.75; color: var(--ink); }
.legal-doc p { margin: 0 0 10px; }
.legal-doc ul { padding-left: 20px; margin: 6px 0 12px; }
.legal-doc li { margin-bottom: 5px; }

/* ===== Wallet top-up: payment card with the UPI QR ===== */
.pay-card { text-align: center; margin-bottom: 16px; padding: 18px 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt); }
.qr-frame { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 4px 18px rgba(0, 0, 0, .08); line-height: 0; font: inherit; }
button.qr-frame { appearance: none; -webkit-appearance: none; cursor: zoom-in; }
button.qr-frame:hover { box-shadow: 0 6px 22px rgba(0, 0, 0, .14); }
button.qr-frame:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.qr-img { display: block; width: min(240px, 62vw); height: auto; background: #fff; }
.qr-frame-lg .qr-img { width: min(340px, 78vw); }
.pay-caption { margin-top: 12px; font-size: 13.5px; font-weight: 600; }
.pay-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.pay-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.pay-upi { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.pay-payee { margin-top: 12px; font-size: 13.5px; }
.pay-payee span { color: var(--muted); margin-right: 4px; }

/* ===== Admin: Telegram messages and confirmation prompts ===== */
.msg-event { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; background: var(--surface); }
.msg-event-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.msg-event .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.msg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.msg-chip { font: 12px var(--font-mono, monospace); padding: 4px 10px; border: 1px solid var(--outline); border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--ink); cursor: pointer; }
.msg-chip:hover { background: var(--state-hover); border-color: var(--link); color: var(--link); }
.msg-preview { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); padding: 10px 12px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.confirm-row { padding: 12px 0; border-top: 1px solid var(--border); }
.confirm-row:first-of-type { border-top: 0; }
.confirm-row .hint { font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; }
.confirm-row { min-width: 0; }
.confirm-row label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; margin-bottom: 2px; }
.confirm-row textarea {
  display: block; width: 100%; box-sizing: border-box; min-height: 72px; padding: 10px 12px; margin: 2px 0 0;
  border: 1px solid var(--outline); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.55; resize: vertical; overflow: hidden;
}
.confirm-row textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.confirm-row textarea[readonly] { background: var(--surface-alt); color: var(--muted); cursor: not-allowed; }
.confirm-tools { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.confirm-tools .hint { margin: 0; }
.confirm-tools .btn { margin-left: auto; }
.panel .panel-note { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 600px) { .confirm-tools .btn { margin-left: 0; } }

/* ===== Settings: one tab per group of settings ===== */
.settings-root:not(.settings-ready) .settings-tabs { display: none; }
.settings-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0 0 18px; padding: 0 2px; scrollbar-width: thin; }
.settings-tab { display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; height: 48px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: 500 14px var(--font-ui, inherit); letter-spacing: .1px; cursor: pointer; white-space: nowrap; margin-bottom: -1px; border-radius: 12px 12px 0 0; transition: background var(--transition), color var(--transition); }
.settings-tab svg { flex: none; }
.settings-tab:hover { color: var(--ink); background: var(--state-hover); }
.settings-tab.active { color: var(--link); border-bottom-color: var(--link); }
.settings-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.settings-pane[hidden] { display: none; }
.settings-save { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 24px; }
.settings-save .hint { font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .settings-tab { padding: 10px 12px; font-size: 13px; } }

/* ===== Plans page: grouped by duration ===== */

/* very small phones: the header must fit, otherwise the menu button is pushed off the screen */
@media (max-width: 480px) {
  .header-inner { gap: 6px; padding: 0 10px; }
  .brand-mark .brand-text { display: none; }
  .header-actions { gap: 4px; }
  .lang-menu .name-text { display: none; }
  .account-menu .name-text, .account-menu .chevron-icon { display: none; }
  .account-menu > button > svg:last-child { display: none; }
  .theme-toggle-btn, .notif-bell > button, .nav-toggle-label { width: 36px; height: 36px; }
  .lang-menu > button, .account-menu > button { height: 36px; }
  .lang-menu > button { padding: 0 10px; }
  .account-menu > button { padding: 0 4px; }
  .wallet-chip { height: 36px; padding: 0 10px; font-size: 13px; }
  .wallet-chip svg { display: none; }
}

/* ===== Admin > Plans: compact list + tabbed edit window ===== */
.plans-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plans-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.plans-list-panel { padding: 0; overflow: hidden; }
.plans-list-panel .table-wrap { margin: 0; }
.plans-table th, .plans-table td { vertical-align: top; }
.plans-table .plan-desc { color: var(--muted); font-size: 12.5px; margin-top: 3px; max-width: 360px; line-height: 1.45; }
.plans-table .plan-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.plans-table .plan-actions { white-space: nowrap; text-align: right; }
.plans-table .plan-actions .btn { margin-left: 4px; }
.plans-table tr.plan-row-hidden td { opacity: .6; }
.plans-table tr.plan-row-hidden td.plan-actions { opacity: 1; }
.plan-modal { max-width: 820px; padding: 24px 26px 0; }
.plan-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 18px; overflow-x: auto; }
.plan-tab { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; height: 48px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; margin-bottom: -1px; border-radius: 12px 12px 0 0; }
.plan-tab:hover { color: var(--ink); background: var(--state-hover); }
.plan-tab.active { color: var(--link); border-bottom-color: var(--link); }
.plan-pane { display: none; }
.plan-pane.active { display: block; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.plan-grid .field { min-width: 0; }
.plan-grid .field label { min-height: 0; }
.plan-grid .field input, .plan-grid .field select { max-width: 100%; }
.plan-span2 { grid-column: 1 / -1; }
.plan-checks { display: flex; gap: 8px 24px; flex-wrap: wrap; margin: 2px 0 12px; }
.plan-checks label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.plan-checks input[type=checkbox] { width: auto; height: auto; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.plan-chips .pill { cursor: pointer; border: 0; }
.plan-bonus { border: 1px solid var(--border); background: var(--surface-alt); border-radius: 12px; padding: 14px 16px 12px; margin-top: 6px; }
.plan-bonus-head { margin-bottom: 10px; }
.plan-bonus .field input { max-width: 200px; }
.plan-modal .field textarea { max-width: 100%; }
.modal-foot { position: sticky; bottom: 0; display: flex; gap: 8px; flex-wrap: wrap; margin: 18px -26px 0; padding: 14px 26px; background: var(--surface); border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan-modal { padding: 18px 16px 0; }
  .modal-foot { margin: 14px -16px 0; padding: 12px 16px; }
  .plans-table .plan-actions { text-align: left; }
}

/* "More" menu: pages and sub-menus, A to Z. A sub-menu opens beside its row on wide screens (hover or click) and inside the menu on phones. */
.nav-more-dropdown { min-width: 240px; width: auto; padding: 6px; }
.nav-sub { position: relative; }
.nav-sub-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; background: none; text-align: left;
  border-radius: var(--radius-sm); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.nav-sub-btn > span:first-of-type { flex: 1; }
.nav-sub-btn:hover, .nav-sub.open > .nav-sub-btn { background: var(--state-hover); }
.nav-sub-btn.active { background: var(--brand-soft); color: var(--on-brand-soft); font-weight: 500; }
.nav-sub-chev { display: inline-flex; transform: rotate(-90deg); color: var(--muted); }
.nav-sub-panel {
  display: none; position: absolute; left: calc(100% - 2px); top: -9px; min-width: 230px; padding: 8px;
  background: var(--surface-pop); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 61;
}
.nav-sub.flip .nav-sub-panel { left: auto; right: calc(100% - 2px); }
.nav-sub.open > .nav-sub-panel { display: block; }
.nav-sub-panel a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; text-decoration: none; white-space: nowrap; }
.nav-sub-panel a:hover { background: var(--state-hover); }
.nav-sub-panel a.active { background: var(--brand-soft); color: var(--on-brand-soft); font-weight: 500; }
@media (hover: hover) and (min-width: 1241px) {
  .nav-sub:hover > .nav-sub-panel { display: block; }
  .nav-sub:hover > .nav-sub-btn { background: var(--state-hover); }
  .nav-more-dropdown:hover .nav-sub.open:not(:hover) > .nav-sub-panel { display: none; }
}
@media (max-width: 1240px) {
  .nav-more { width: 100%; }
  .nav-more > button { width: 100%; padding: 11px 14px; }
  .nav-more-dropdown { position: static; width: auto; box-shadow: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; padding: 6px 0 0; }
  .nav-sub-chev { transform: none; }
  .nav-sub.open .nav-sub-chev { transform: rotate(180deg); }
  .nav-sub-panel { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--border); border-radius: 0; margin: 2px 0 6px 18px; padding: 2px 0 2px 4px; min-width: 0; }
}
.plan-pane .hint, .plan-form .hint { display: block; font-size: 12.5px; line-height: 1.5; color: var(--muted); margin-top: 6px; }

.plan-picker { margin: 8px 0; }
.plan-chip-filter { width: 100%; max-width: 100%; margin-bottom: 6px; }
.plan-pick-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.plan-pick-head label { margin: 0; font-weight: 600; }
.plan-pick-head select { height: 36px; padding: 0 10px; border: 1px solid var(--outline); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.plan-picker .plan-chips { max-height: 150px; overflow-y: auto; padding: 8px; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); align-content: flex-start; }
.plan-chips .pill.chip-added, .plan-chips .pill.chip-added:disabled { background: var(--success-soft); color: var(--success); box-shadow: inset 0 0 0 1px var(--success); cursor: not-allowed; opacity: 1; }
.plan-chips .pill.chip-added::before { content: "\2713\00a0"; }
.plan-chips-note { margin-top: 4px; }

/* Users list: two-line cells keep the table inside the screen so the action buttons are always visible */
.users-table td { vertical-align: middle; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-stack small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.cell-id { color: var(--muted); font-size: 12px; font-family: var(--mono, ui-monospace, monospace); margin-left: 4px; }
.pill-ellipsis { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.row-actions form { display: inline-flex; margin: 0; }
.col-actions { white-space: nowrap; width: 1%; }
@media (max-width: 640px) {
  .table.cards-on-mobile td.col-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .table.cards-on-mobile .row-actions { flex-wrap: wrap; }
  .table.cards-on-mobile td .cell-stack { align-items: flex-end; text-align: right; }
  .table.cards-on-mobile .pill-ellipsis { max-width: 60vw; }
}

.row-actions.wrap { flex-wrap: wrap; }
.jobs-table .col-actions { width: auto; white-space: normal; max-width: 360px; }
@media (min-width: 1101px) {
  .users-table .col-actions { position: sticky; right: 0; background: var(--surface); box-shadow: -10px 0 10px -10px rgba(15, 23, 42, .18); }
}
/* Header rows written without a <thead> must also disappear when a table turns into cards on phones */
@media (max-width: 640px) {
  .table.cards-on-mobile th { display: none; }
  .table.cards-on-mobile tr:has(> th) { display: none; }
}
.users-table td:nth-child(2) { min-width: 120px; }
.users-table td:nth-child(3) { min-width: 150px; }
.cell-stack small { overflow-wrap: break-word; word-break: normal; }
.users-table .pill-ellipsis { max-width: 150px; }
.users-table th, .users-table td { padding-left: 9px; padding-right: 9px; }
.users-table .row-actions { gap: 4px; }

.app-version { margin-left: 8px; padding-left: 10px; border-left: 1px solid currentColor; opacity: .7; white-space: nowrap; }

/* ===== Accessibility: keyboard focus ring, and no motion for people who ask for less ===== */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.site-header a:focus-visible, .site-header button:focus-visible { outline-color: var(--header-ink); }
.nav-more-dropdown a:focus-visible, .account-dropdown a:focus-visible, .notif-dropdown a:focus-visible, .nav-sub-panel a:focus-visible { outline-color: var(--brand); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* users-table: too many columns for a tablet, so it becomes stacked cards below 1100px (phones use the generic rule above) */
@media (min-width: 641px) and (max-width: 1100px) {
  .table.users-table thead, .table.users-table th, .table.users-table tr:has(> th) { display: none; }
  .table.users-table, .table.users-table tbody, .table.users-table tr, .table.users-table td { display: block; width: 100%; }
  .table.users-table tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; padding: 10px 4px; }
  .table.users-table td { border: none; padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .table.users-table td[data-label]:not([data-label=""])::before { content: attr(data-label); font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; }
  .table.users-table td.col-actions, .table.users-table td.plan-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; text-align: left; }
  .table.users-table .row-actions { flex-wrap: wrap; }
  .table.users-table td .cell-stack { align-items: flex-end; text-align: right; }
}

/* plans-table: too many columns for a tablet, so it becomes stacked cards below 860px (phones use the generic rule above) */
@media (min-width: 641px) and (max-width: 860px) {
  .table.plans-table thead, .table.plans-table th, .table.plans-table tr:has(> th) { display: none; }
  .table.plans-table, .table.plans-table tbody, .table.plans-table tr, .table.plans-table td { display: block; width: 100%; }
  .table.plans-table tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; padding: 10px 4px; }
  .table.plans-table td { border: none; padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .table.plans-table td[data-label]:not([data-label=""])::before { content: attr(data-label); font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; }
  .table.plans-table td.col-actions, .table.plans-table td.plan-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; text-align: left; }
  .table.plans-table .row-actions { flex-wrap: wrap; }
  .table.plans-table td .cell-stack { align-items: flex-end; text-align: right; }
}

/* Table names shown to users (admin-plans.php) */
.label-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.label-tools input[type="search"] { max-width: 320px; }
.label-table td input[type="text"] { width: 100%; max-width: 360px; }
.label-table tr.label-new td { background: var(--surface-alt); }
.label-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }

/* Charts: Style G thin columns and Style F line (see backup-lib.php) */
.chart-key { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.vh-col rect[fill]:not([fill="transparent"]) { transition: opacity .15s; }
.vh-col:hover rect[fill]:not([fill="transparent"]) { opacity: .78; }
svg text { font-family: inherit; }
.chart-narrow { display: none; }
.chart-wide svg { max-width: 920px; }
@media (max-width: 560px) { .chart-wide { display: none; } .chart-narrow { display: block; } }

/* Help page (help.php): Material Design 3 hub layout */
.help-hero { background: var(--brand-soft); color: var(--on-brand-soft); border-radius: 28px; padding: 34px 36px; display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.help-hero h1 { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -.2px; }
.help-hero p { margin: 6px 0 0; opacity: .85; font-size: 15px; }
.help-search { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 999px; padding: 0 20px; height: 56px; flex: 1; min-width: 280px; max-width: 520px; box-shadow: var(--shadow-md, 0 1px 3px rgba(0,0,0,.15)); color: var(--muted); }
.help-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; color: var(--ink); font-size: 15px; height: 100%; padding: 0 !important; }
.help-search:focus-within { box-shadow: 0 0 0 2px var(--brand); }
.help-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.help-cat { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: background .15s, border-color .15s; }
.help-cat:hover { background: var(--state-hover); }
.help-cat.on { border-color: var(--brand); background: var(--brand-soft); }
.help-cat b { font-size: 16px; font-weight: 500; }
.help-cat span:not(.help-ic) { font-size: 13px; color: var(--muted); }
.help-cat em { font-style: normal; font-size: 12px; color: var(--link); margin-top: 8px; }
.help-ic { width: 48px; height: 48px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-bottom: 14px; }
.help-ic.t1 { background: var(--brand-soft); color: var(--on-brand-soft); }
.help-ic.t2 { background: var(--secondary-soft); color: var(--on-secondary-soft); }
.help-ic.t3 { background: var(--tertiary-soft); color: var(--ink); }
.help-ic.t4 { background: var(--success-soft); color: var(--success); }
.help-cols { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.help-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 22px 24px; }
.help-card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 500; }
.help-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.help-chip { font: inherit; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--outline); font-size: 13px; color: var(--ink); background: transparent; cursor: pointer; }
.help-chip:hover { background: var(--state-hover); }
.help-chip.on { background: var(--brand-soft); border-color: transparent; color: var(--on-brand-soft); }
.help-q { border-top: 1px solid var(--border); }
.help-q:first-of-type { border-top: 0; }
.help-q[hidden] { display: none; }
.help-q summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 4px; font-weight: 500; font-size: 15px; }
.help-q summary::-webkit-details-marker { display: none; }
.help-q summary .q { flex: 1; }
.help-q summary .ch { transition: transform .2s; color: var(--muted); display: inline-flex; }
.help-q[open] summary .ch { transform: rotate(180deg); }
.help-q .a { padding: 0 4px 18px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.help-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 28px 12px; color: var(--muted); }
.help-empty[hidden] { display: none; }
.help-empty strong { color: var(--ink); font-weight: 500; }
.help-ct { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; color: var(--ink); text-decoration: none; }
a.help-ct:hover { background: var(--state-hover); }
.help-ct .help-ic { width: 42px; height: 42px; border-radius: 14px; margin: 0; }
.help-ct b { display: block; font-weight: 500; font-size: 14.5px; }
.help-ct small { display: block; color: var(--muted); font-size: 12.5px; word-break: break-word; }
.help-ct small a { color: var(--link); text-decoration: none; }
.help-ct small a:hover { text-decoration: underline; }
.help-hours { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-alt); border-radius: 16px; padding: 14px 16px; margin-top: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.help-hours svg { flex: none; margin-top: 2px; }
@media (max-width: 980px) { .help-cats { grid-template-columns: 1fr 1fr; } .help-cols { grid-template-columns: 1fr; } .help-search { min-width: 0; width: 100%; max-width: none; } .help-hero { padding: 26px 22px; } }
@media (max-width: 480px) { .help-cats { grid-template-columns: 1fr; } .help-hero h1 { font-size: 24px; } }

/* Plans page: pill tabs and tonal plan cards (plans.php) */
.pl-seg { display: flex; justify-content: center; margin: 6px 0 10px; }
.pl-segbar { display: inline-flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; border: 1px solid var(--outline); border-radius: 999px; }
.pl-segbar button { font: inherit; background: transparent; border: 0; border-right: 1px solid var(--outline); padding: 0 24px; height: 44px; font-size: 14px; color: var(--ink); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; white-space: nowrap; }
.pl-segbar button:last-child { border-right: 0; }
.pl-segbar button:hover { background: var(--state-hover); }
.pl-segbar button svg { display: none; }
.pl-segbar button.on { background: var(--brand-soft); color: var(--on-brand-soft); font-weight: 500; }
.pl-segbar button.on svg { display: inline-block; }
.pl-segbar button:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.pl-n { font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-high); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.pl-segbar button.on .pl-n { background: var(--surface); }
.pl-panel[hidden] { display: none; }
.pl-head { text-align: center; margin: 18px 0 22px; }
.pl-head h2 { margin: 0; font-size: 26px; font-weight: 500; }
.pl-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 380px)); gap: 20px; justify-content: center; }
.pl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 26px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.pl-card.mine { border: 2px solid var(--brand); padding: 25px; }
.pl-card.hidden-plan { opacity: .65; }
.pl-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; min-height: 30px; }
.pl-chip { display: inline-flex; gap: 6px; align-items: center; height: 28px; padding: 0 12px; border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12.5px; border: 1px solid var(--border); }
.pl-chip.ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.pl-chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pl-name { margin: -26px -26px 20px; padding: 24px 26px; background: var(--brand-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pl-card.mine .pl-name { margin: -25px -25px 20px; padding: 23px 25px; }
.pl-card h3 { margin: 0; font-size: 20px; font-weight: 500; }
.pl-desc { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; line-height: 1.5; }
.pl-price { margin: 2px 0 16px; padding: 14px 0; border-top: 1px dashed var(--border-strong); border-bottom: 1px dashed var(--border-strong); }
.pl-price b { font-size: 34px; font-weight: 600; }
.pl-price b.free { color: var(--link); }
.pl-price b.ask { font-size: 20px; }
.pl-price small { color: var(--muted); margin-left: 8px; font-size: 13px; }
.pl-feat { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; flex: 1; }
.pl-feat li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.pl-feat li svg { color: var(--success); flex: none; margin-top: 1px; }
.pl-cta form { margin: 0; }
.pl-btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--brand); color: var(--on-brand); font-weight: 500; font-size: 14px; width: 100%; cursor: pointer; text-decoration: none; }
.pl-btn:hover { background: var(--brand-hover); }
.pl-state { display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; text-align: center; }
.pl-state.ok { background: var(--success-soft); color: var(--success); }
.pl-state.wait { background: var(--warn-soft); color: var(--warn); }
.pl-state.muted { background: var(--surface-high); color: var(--muted); }
@media (max-width: 560px) { .pl-grid { grid-template-columns: 1fr; } .pl-segbar button { padding: 0 16px; } .pl-head h2 { font-size: 22px; } .pl-card { padding: 22px; } .pl-card.mine { padding: 21px; } .pl-name { margin: -22px -22px 18px; padding: 20px 22px; } .pl-card.mine .pl-name { margin: -21px -21px 18px; padding: 19px 21px; } }

/* Backup time and times per day, and the admin's Time required tick */
.sched { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sched-time { width: 132px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.sched-note { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.checkline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }

/* Administrator: bulk Days to Keep and time */
.bulk-pick { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; max-height: 320px; overflow: auto; }
.bulk-tables { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 6px 0 0 24px; }
.bulk-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.bulk-controls input[type=number] { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
/* Administrator dashboard: user health */
.health-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.health-chip { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.health-chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); }
.health-score { font-weight: 600; font-variant-numeric: tabular-nums; }
.health-reasons { color: var(--muted); font-size: 12.5px; }
.plan-sched .table th, .plan-sched .table td { padding: 8px 10px; }
.plan-sched input[type=number], .plan-sched input[type=time] { max-width: 140px; }
.sched-add { margin: 6px 0 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sched-times:empty { display: none; }
.retry-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 150px; margin: 0; }
.retry-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.retry-btn { white-space: nowrap; }
.retry-note { font-size: 12px; color: var(--muted); line-height: 1.35; max-width: 220px; }
.retry-wait { display: inline-block; }
.retry-wait .retry-btn[disabled] { opacity: .75; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-high); color: var(--ink); }
.retry-actions .btn { white-space: nowrap; }
.retry-fix { color: var(--muted); border-color: var(--border); }

/* Notices (admin-notices.php and the customer dashboard) */
.notice-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.notice-head h2 { margin: 0; }
.notice-item { align-items: flex-start; }
.notice-item svg { margin-top: 2px; }

/* Security page */
.sec-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.sec-zero { color: var(--muted); font-weight: 400; }
.sec-barcol { width: 40%; }
.sec-bar { display: block; height: 8px; border-radius: 4px; background: var(--surface-high); overflow: hidden; }
.sec-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.sec-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.sec-chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; text-decoration: none; }
.sec-chip:hover { background: var(--surface-high); color: var(--ink); }
.sec-chip.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* Plan card: Days to Keep and backup time (one small card per table, times as chips) */
.pl-sched-body { display: block; flex: 1; min-width: 0; }
.pl-sched-item { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 8px; background: var(--surface); }
.pl-sched-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.pl-sched-top b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pl-sched-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-sched-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-high); color: var(--ink); border-radius: 999px; padding: 3px 9px; font-size: 12px; }
.pl-sched-chip svg { color: var(--muted); flex: none; margin: 0; }

/* Reports */
.field-row .report-actions, .report-actions { flex: 1 1 100%; min-width: 0; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
.report-range { margin: 0 0 12px; }
.report-two { align-items: stretch; }
@media print {
    .site-header, .site-footer, .report-filter, .nav-toggle, .modal-overlay { display: none !important; }
    body { background: #fff; }
    .panel, .stat-card { break-inside: avoid; box-shadow: none; }
}


/* ===== Release notes pop-up (What's new) ===== */
.rn-open { margin-left: 10px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; opacity: .85; }
.rn-open:hover { opacity: 1; background: rgba(255,255,255,.08); }
.rn-box { max-width: 680px; }
.rn-hero { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; color: var(--on-brand-soft); background: linear-gradient(135deg, var(--brand-soft), var(--tertiary-soft)); }
.rn-hero-ver { font-size: 18px; font-weight: 700; }
.rn-hero-text { font-size: 13px; opacity: .9; }
.rn-body { display: flex; flex-direction: column; gap: 10px; }
.rn-release { border: 1px solid var(--border); border-left: 4px solid var(--chart-1); border-radius: var(--radius); background: var(--surface); }
.rn-accent-1 { border-left-color: var(--chart-1); } .rn-accent-1 .rn-ver { border-color: var(--chart-1); }
.rn-accent-2 { border-left-color: var(--chart-2); } .rn-accent-2 .rn-ver { border-color: var(--chart-2); }
.rn-accent-3 { border-left-color: var(--chart-3); } .rn-accent-3 .rn-ver { border-color: var(--chart-3); }
.rn-accent-4 { border-left-color: var(--chart-4); } .rn-accent-4 .rn-ver { border-color: var(--chart-4); }
.rn-accent-5 { border-left-color: var(--chart-5); } .rn-accent-5 .rn-ver { border-color: var(--chart-5); }
.rn-accent-6 { border-left-color: var(--chart-6); } .rn-accent-6 .rn-ver { border-color: var(--chart-6); }
.rn-latest { background: var(--surface-alt); box-shadow: var(--shadow-sm); }
.rn-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; cursor: pointer; list-style: none; }
.rn-sum::-webkit-details-marker { display: none; }
.rn-sum::after { content: "+"; margin-left: auto; font-weight: 700; color: var(--muted); }
.rn-release[open] > .rn-sum::after { content: "-"; }
.rn-ver { font-weight: 700; font-size: 14px; padding: 2px 10px; border-radius: 999px; color: var(--ink); background: var(--surface-high); border: 1px solid var(--chart-1); }
.rn-title { font-weight: 500; color: var(--ink); flex: 1 1 160px; }
.rn-count { font-size: 12px; color: var(--muted); }
.rn-list { list-style: none; margin: 0; padding: 0 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.rn-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.rn-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rn-none { margin: 0; padding: 0 14px 14px; font-size: 13px; color: var(--muted); }
.rn-badge { flex: none; display: inline-block; min-width: 74px; text-align: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.rn-badge-new { background: var(--success-soft); color: var(--success); }
.rn-badge-improved { background: var(--brand-soft); color: var(--on-brand-soft); }
.rn-badge-fixed { background: var(--warn-soft); color: var(--warn); }
.rn-badge-security { background: var(--danger-soft); color: var(--danger); }
.rn-badge-latest { min-width: 0; background: var(--brand); color: var(--on-brand); }
.rn-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 640px) { .rn-box { padding: 20px; } .rn-badge { min-width: 64px; } }
@media print { .rn-open, #release-notes-modal { display: none !important; } }

/* ===== Footer: contact cards over a dark bar ===== */
.site-footer.ft-d { background: transparent; border-radius: 0; margin-top: 40px; }
.ft-cards { max-width: var(--container); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; position: relative; z-index: 2; margin-bottom: -28px; }
.ft-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; color: var(--ink); box-shadow: var(--shadow-md); min-width: 0; }
.ft-card-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; flex: none; }
.ft-card-body { display: flex; flex-direction: column; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.ft-card-body small { color: var(--muted); font-size: 11.5px; }
.ft-card-body a { color: var(--ink); }
.ft-card-body a:hover { color: var(--link); text-decoration: underline; }
.ft-bar { background: var(--footer-bg); color: #C7D5CC; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.ft-bar.has-cards { padding-top: 28px; }
.ft-bar .footer-inner { padding: 28px 24px 22px; }
.ft-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.ft-top .footer-brand { margin-bottom: 0; }
.ft-nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.ft-nav a { color: #C7D5CC; font-size: 13.5px; }
.ft-nav a:hover { color: #fff; }
.ft-bar .footer-bottom { margin-top: 18px; }
@media (max-width: 720px) {
  .ft-cards { grid-template-columns: 1fr; padding: 0 16px; }
  .ft-top { flex-direction: column; align-items: flex-start; }
}

/* ===== Hero card (Account and Dashboard) ===== */
.hero-card { background: linear-gradient(120deg, var(--brand), var(--brand-hover)); color: var(--on-brand); border-radius: var(--radius-lg); padding: 22px 26px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.hero-av { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--on-brand-soft); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex: none; }
.hero-text { min-width: 0; flex: 1 1 260px; }
.hero-text h3 { margin: 0 0 3px; font-size: 21px; color: var(--on-brand); }
.hero-text small { display: block; color: var(--on-brand); font-size: 13px; overflow-wrap: anywhere; }
.hero-text .hero-note { margin-top: 3px; font-size: 12px; }
.hero-chips { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-chip { background: var(--brand-soft); color: var(--on-brand-soft); border-radius: 12px; padding: 8px 14px; min-width: 110px; }
.hero-chip small { display: block; font-size: 11.5px; color: var(--on-brand-soft); }
.hero-chip b { display: block; font-size: 16px; color: var(--on-brand-soft); }
.hero-chip b a { color: var(--on-brand-soft); text-decoration: underline; }
/* Account cards */
.acc-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.acc-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.acc-3 > .panel, .acc-2 > .panel { margin: 0; }
.acc-card .acc-big { font-size: 28px; font-weight: 700; color: var(--link); margin: 4px 0 12px; }
.acc-card .acc-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.acc-bar { height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; margin: 6px 0 10px; }
.acc-bar i { display: block; height: 100%; background: var(--success); border-radius: 6px; }
/* Dashboard */
.dash-row { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(220px, 1fr); gap: 16px; margin-bottom: 22px; }
.quick-actions { display: grid; gap: 10px; margin-top: 8px; }
.quick-actions .btn { justify-content: center; }
.dash-tables-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.dash-tables-head h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.dash-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-bottom: 20px; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.table-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink); }
.table-card-top strong { flex: 1 1 100%; overflow-wrap: anywhere; }
.table-card-top .table-card-check { margin-left: 0; }
.table-card-meta { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.table-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 860px) {
  .dash-row { grid-template-columns: 1fr; }
  .hero-chips { margin-left: 0; width: 100%; }
  .hero-chip { flex: 1 1 130px; }
}

/* ===== Admin dashboard (bento) ===== */
.bn-quick { display: flex; flex-wrap: wrap; gap: 10px; }
.bn-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.bn-tile { border-radius: var(--radius-lg); padding: 16px 18px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 4px; color: var(--ink); min-width: 0; text-decoration: none; }
.bn-tile small { color: var(--muted); font-size: 12.5px; }
.bn-tile b { font-size: 26px; line-height: 1.15; }
.bn-tile b em { font-style: normal; font-size: 13px; font-weight: 600; margin-left: 4px; }
.bn-tile .bn-spark { margin-top: auto; color: var(--success); }
.bn-tile.bn-ok { background: var(--success-soft); }
.bn-tile.bn-warn { background: var(--warn-soft); }
.bn-tile.bn-bad { background: var(--danger-soft); }
.bn-tile.bn-ok small, .bn-tile.bn-warn small, .bn-tile.bn-bad small { color: var(--ink); }
.bn-w2 { grid-column: span 2; }
.bn-w4 { grid-column: span 4; }
.bn-w3 { grid-column: span 3; }
.bn-h2 { grid-row: span 2; }
.bn-grid { display: grid; gap: 16px; margin-bottom: 18px; }
.bn-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bn-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bn-g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.bn-grid > .panel, .bn-grid > .bn-tile { margin: 0; }
.bn-act { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--surface-alt); text-decoration: none; color: var(--ink); margin-bottom: 8px; font-size: 13.5px; }
.bn-act:last-child { margin-bottom: 0; }
.bn-act .bn-go { margin-left: auto; color: var(--muted); font-size: 12px; }
.bn-act.is-danger .pill { background: var(--danger-soft); color: var(--danger); }
.bn-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--ink); }
.bn-row:last-of-type { border-bottom: 0; }
.bn-row span:first-child { min-width: 0; overflow-wrap: anywhere; }
.bn-row span:last-child { color: var(--muted); text-align: right; flex: none; }
.bn-meter { margin: 9px 0; }
.bn-meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink); }
.bn-meter-bar { height: 9px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 4px; }
.bn-meter-bar i { display: block; height: 100%; border-radius: 6px; background: var(--chart-1); }
.bn-note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.bn-big { font-size: 26px; font-weight: 700; color: var(--ink); }
.bn-empty { text-align: center; padding: 18px 0; color: var(--muted); font-size: 13px; }
.bn-empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.bn-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 110px; }
.bn-week div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: 11.5px; color: var(--muted); }
.bn-week i { display: block; width: 100%; border-radius: 4px; background: var(--success); min-height: 3px; }
.bn-week i.is-low { background: var(--warn); }
.bn-week i.is-none { background: var(--border); }
@media (max-width: 960px) {
    .bn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bn-w2, .bn-w3, .bn-w4 { grid-column: span 2; }
    .bn-h2 { grid-row: auto; }
    .bn-g3, .bn-g2, .bn-g21 { grid-template-columns: minmax(0, 1fr); }
}

/* ===== User dashboard: table rows with a small graph, and the activity list ===== */
.dx-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 16px; align-items: start; margin-bottom: 20px; }
.dx-rows { display: flex; flex-direction: column; gap: 10px; }
.dx-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(120px, 1fr) auto; gap: 8px 16px; align-items: center; color: var(--ink); }
.dx-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.dx-name strong { overflow-wrap: anywhere; }
.dx-meta { color: var(--muted); font-size: 12.5px; display: block; overflow-wrap: anywhere; }
.dx-graph { min-width: 0; }
.dx-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; align-items: end; height: 26px; }
.dx-bars i { display: block; border-radius: 2px; height: 100%; background: var(--border); }
.dx-bars i.is-ok { background: var(--success); }
.dx-bars i.is-failed { background: var(--danger); }
.dx-bars i.is-none { height: 25%; }
.dx-graph small { color: var(--muted); font-size: 12px; display: block; margin-top: 4px; }
.dx-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dx-feed { list-style: none; margin: 0; padding: 0; }
.dx-feed li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--ink); font-size: 13.5px; }
.dx-feed li:last-child { border-bottom: 0; }
.dx-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--success-soft); color: var(--success); }
.dx-dot.is-failed { background: var(--danger-soft); color: var(--danger); }
.dx-dot.is-verify { background: var(--brand-soft); color: var(--on-brand-soft); }
.dx-feed small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 960px) {
    .dx-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .dx-row { grid-template-columns: minmax(0, 1fr); }
    .dx-actions { justify-content: flex-start; }
}

/* ===== Message channels (Telegram, Email, WhatsApp) ===== */
.chan-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.chan-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 500; cursor: pointer; min-height: 0; }
.chan-chip input { width: auto; margin: 0; accent-color: var(--brand); }
.chan-chip.is-on { background: var(--brand-soft); color: var(--on-brand-soft); border-color: transparent; }
.chan-all { padding: 3px 10px; }

/* Channels tab: one sub-tab per channel */
.settings-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.settings-subtab { display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; height: 38px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface, transparent); color: var(--muted); font: 500 13.5px var(--font-ui, inherit); cursor: pointer; transition: background var(--transition), color var(--transition); }
.settings-subtab:hover { color: var(--ink); background: var(--state-hover); }
.settings-subtab.active { color: var(--link); border-color: var(--link); background: var(--state-hover); }
.settings-subtab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.settings-subpane[hidden] { display: none; }

/* My Account: Authenticator app, notifications, location */
.qr-box { background: #fff; padding: 10px; border-radius: 12px; width: 220px; max-width: 100%; margin: 6px 0 10px; border: 1px solid var(--border); }
.qr-box svg { display: block; width: 100%; height: auto; }
.setup-key { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--state-hover); font: 500 14px var(--font-mono, monospace); letter-spacing: .5px; word-break: break-all; }
.recovery-codes { margin: 8px 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--state-hover); font: 500 15px var(--font-mono, monospace); letter-spacing: 1px; columns: 2; }
.device-list { list-style: none; margin: 0 0 10px; padding: 0; }
.device-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.inline-form .field { max-width: 280px; margin-bottom: 8px; }
.perm-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface, transparent); }
.perm-prompt > div { flex: 1 1 260px; }
.perm-prompt strong { display: block; margin-bottom: 2px; }
.perm-prompt[hidden] { display: none; }

/* Sign-ups: the list inside the bulk confirmation pop-up */
.su-list { max-height: 260px; overflow: auto; font-size: 13.5px; margin: 10px 0 14px; }

/* Sign in security card */
.sec-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.sec-row + .sec-row { margin-top: 10px; }
.sec-ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: 0 0 36px; background: var(--surface-alt); }
.sec-body { flex: 1; min-width: 0; }
.sec-bar { height: 10px; background: var(--surface-alt); border-radius: 99px; overflow: hidden; margin: 8px 0 12px; }
.sec-bar span { display: block; height: 100%; background: var(--brand); }

/* Support tickets */
.tk-thread { display: flex; flex-direction: column; margin: 8px 0 14px; }
.tk-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; margin: 6px 0; word-wrap: break-word; }
.tk-msg small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.tk-me { align-self: flex-end; background: var(--surface-alt); border-bottom-right-radius: 4px; }
.tk-them { align-self: flex-start; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.tk-wait td { background: var(--surface-alt); }
.note-box { background: var(--surface-alt); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin: 0 0 10px; }

/* Shown on a case until the first answer arrives */
.tk-auto { margin: 0 0 14px; line-height: 1.6; }

/* Cases: help desk layout with a progress bar */
.case-crumbs { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.case-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.case-steps { display: flex; list-style: none; margin: 0; padding: 0; }
.case-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; font-size: 12px; color: var(--muted); text-align: center; }
.case-steps li i { width: 18px; height: 18px; border-radius: 50%; background: var(--border-strong); display: block; margin-bottom: 4px; position: relative; z-index: 1; box-sizing: border-box; }
.case-steps li:not(:last-child)::after { content: ""; position: absolute; top: 8px; left: 50%; width: 100%; height: 2px; background: var(--border-strong); }
.case-steps li.done { color: var(--ink); }
.case-steps li.done i { background: var(--brand); }
.case-steps li.done:not(:last-child)::after { background: var(--brand); }
.case-steps li.now { color: var(--ink); font-weight: 600; }
.case-steps li.now i { background: var(--surface); border: 4px solid var(--brand); }
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.case-blk { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 10px; overflow-wrap: anywhere; }
.case-blk.staff { border-left-color: var(--success); }
.case-who { margin-bottom: 2px; }
.case-reply { margin-top: 14px; }
.case-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.case-side h3 { margin: 0 0 8px; font-size: 14px; }
.case-side dl { margin: 0; }
.case-side dt { color: var(--muted); font-size: 12px; margin-top: 10px; }
.case-side dd { margin: 0; font-size: 13.5px; }
.case-counts { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
@media (max-width: 900px) { .case-grid { grid-template-columns: 1fr; } }
.panel > .case-side { margin: 12px 0; }
.case-listhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.case-listhead h2 { margin: 0; }
#new-case-modal .field select, #new-case-modal .field input { max-width: none; width: 100%; }
.req { color: var(--danger); font-weight: 700; }
.case-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.case-tile { position: relative; display: block; cursor: pointer; margin: 0; }
.case-tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.case-tile-body { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.case-tile-body b { font-size: 13px; font-weight: 600; }
.case-tile-body small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.case-tile-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--on-brand-soft); margin-bottom: 4px; }
.case-tile:hover .case-tile-body { background: var(--state-hover); }
.case-tile input:checked + .case-tile-body { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.case-tile input:focus-visible + .case-tile-body { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 560px) { .case-tiles { grid-template-columns: 1fr 1fr; } }
