/*
 * Be Your Eye admin — styled after the Velzon admin template:
 * indigo vertical sidebar, white 70px topbar, soft-tinted stat widgets,
 * page-title bar with breadcrumb. No build step; plain CSS.
 */
:root {
  --primary: #405189;
  --primary-rgb: 64, 81, 137;
  --link: #405189;
  --secondary: #3577f1;
  --success: #0ab39c;
  --info: #299cdb;
  --warning: #f7b84b;
  --danger: #f06548;
  --dark: #212529;

  --body-bg: #f3f3f9;
  --body-color: #212529;
  --muted: #878a99;
  --heading: #495057;
  --card-bg: #ffffff;
  --border: #e9ebec;
  --light: #f3f6f9;
  --input-bg: #ffffff;
  --input-border: #ced4da;
  --topbar-bg: #ffffff;
  --sidebar-bg: #405189;
  --sidebar-text: rgba(255, 255, 255, .55);
  --sidebar-active: #ffffff;
  --sidebar-title: rgba(255, 255, 255, .4);
  --shadow: 0 1px 2px rgba(56, 65, 74, .15);
  --shadow-lg: 0 5px 10px rgba(30, 32, 37, .12);

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sidebar-w: 250px;
  --sidebar-sm: 70px;
  --topbar-h: 70px;
  --radius: .25rem;
  --radius-lg: .5rem;
}

:root[data-theme="dark"] {
  --link: #7d93d8;
  --body-bg: #1a1d21;
  --body-color: #ced4da;
  --muted: #878a99;
  --heading: #ced4da;
  --card-bg: #212529;
  --border: #32383e;
  --light: #2a2f34;
  --input-bg: #262a2f;
  --input-border: #2a2f34;
  --topbar-bg: #212529;
  --sidebar-bg: #212529;
  --sidebar-text: #7c7f90;
  --sidebar-active: #ffffff;
  --sidebar-title: #5f6270;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 5px 10px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--body-bg);
  color: var(--body-color);
  font: 400 .8125rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; color: var(--heading); font-weight: 600; line-height: 1.2; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: .8rem; letter-spacing: .01em; }
.text-muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.fw-medium { font-weight: 500; }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ================= layout ================= */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1002;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid transparent;
  display: flex; flex-direction: column;
  transition: width .2s ease, transform .25s ease;
}
:root[data-theme="dark"] .sidebar { border-right-color: var(--border); }
.sidebar .brand {
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 0 22px;
  color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden;
}
.brand svg { width: 34px; height: 20px; flex: 0 0 auto; }
.brand b { font-size: 1.05rem; font-weight: 600; letter-spacing: .2px; }
.sidebar .menu { flex: 1; overflow-y: auto; padding: 0 0 24px; }
.menu-title {
  padding: 12px 22px 6px; font-size: .6875rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--sidebar-title); white-space: nowrap;
}
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px; color: var(--sidebar-text);
  font-size: .9375rem; font-weight: 400; white-space: nowrap; text-decoration: none;
  transition: color .15s;
}
.menu a i { font-size: 1.15rem; line-height: 1; width: 20px; text-align: center; flex: 0 0 auto; }
.menu a:hover { color: var(--sidebar-active); }
.menu a.active { color: var(--sidebar-active); font-weight: 500; }
.menu .badge { margin-left: auto; }

.topbar {
  position: fixed; top: 0; right: 0; left: var(--sidebar-w); z-index: 1001;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  box-shadow: 0 1px 2px rgba(56, 65, 74, .15);
  display: flex; align-items: center; gap: 8px;
  padding: 0 max(18px, env(safe-area-inset-right, 0px)) 0 18px;
  transition: left .2s ease;
}
.icon-btn {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 1.35rem; cursor: pointer; position: relative;
  text-decoration: none;
}
.icon-btn:hover { background: var(--light); color: var(--body-color); text-decoration: none; }
.icon-btn .dot {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: .625rem; font-weight: 600;
  display: grid; place-items: center; line-height: 1;
}
.topbar .search { position: relative; flex: 0 1 320px; margin-left: 4px; }
.topbar .search input {
  width: 100%; height: 38px; border: 0; border-radius: var(--radius);
  background: var(--light); color: var(--body-color); padding: 0 12px 0 36px; font: inherit;
}
.topbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1rem; }
.topbar .spacer { flex: 1; }

/* dropdowns built on <details> */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 1005;
  min-width: 220px; background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 8px 0;
}
.dropdown-menu .dropdown-header { padding: 8px 16px; font-size: .75rem; color: var(--muted); }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 16px; color: var(--body-color); font: inherit; text-align: left;
  border: 0; background: none; cursor: pointer; text-decoration: none;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--light); text-decoration: none; }
.dropdown-menu i { color: var(--muted); font-size: 1rem; }
.notif-item { align-items: flex-start !important; }
.notif-item small { display: block; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 4px; height: var(--topbar-h); }
:root:not([data-theme="dark"]) .user-chip { background: #f3f3f9; }
.user-chip .who b { display: block; font-weight: 500; color: var(--heading); }
.user-chip .who small { color: var(--muted); font-size: .75rem; }

.main {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 24px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left .2s ease;
}
.container { width: 100%; padding: 0 12px; display: grid; gap: 24px; align-content: start; flex: 1; }
.footer {
  margin-top: 24px; padding: 20px 12px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* collapsed (icon-only) sidebar on desktop */
@media (min-width: 992px) {
  :root[data-sidebar="sm"] .sidebar { width: var(--sidebar-sm); }
  :root[data-sidebar="sm"] .topbar { left: var(--sidebar-sm); }
  :root[data-sidebar="sm"] .main { margin-left: var(--sidebar-sm); }
  :root[data-sidebar="sm"] .brand b,
  :root[data-sidebar="sm"] .menu-title,
  :root[data-sidebar="sm"] .menu a span,
  :root[data-sidebar="sm"] .menu .badge { display: none; }
  :root[data-sidebar="sm"] .menu a { justify-content: center; padding: 12px 0; }
  :root[data-sidebar="sm"] .sidebar .brand { padding: 0; justify-content: center; }
}

/* off-canvas sidebar on tablet and phone */
.backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  :root[data-sidebar-open] .sidebar { transform: none; }
  :root[data-sidebar-open] .backdrop {
    display: block; position: fixed; inset: 0; z-index: 1001; background: rgba(33, 37, 41, .45);
  }
  .topbar { left: 0; }
  .main { margin-left: 0; }
}
@media (max-width: 767.98px) {
  .topbar .search { display: none; }
  .user-chip .who { display: none; }
  .user-chip { background: transparent !important; }
}

/* ================= page title ================= */
.page-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  margin: -24px -24px 0; padding: 10px 24px;
  background: var(--card-bg); box-shadow: var(--shadow);
  border-bottom: 1px solid transparent;
}
.page-title h4 { font-size: .9375rem; text-transform: uppercase; font-weight: 600; letter-spacing: .02em; }
.breadcrumb { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .8125rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--body-color); }
.breadcrumb .sep { opacity: .6; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar h5 { font-size: 1rem; }
.toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ================= grid ================= */
.row { display: grid; gap: 24px; }
.row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-8-4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row-9-3 { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 1599.98px) { .row-9-3 { grid-template-columns: minmax(0, 1fr); } .row-9-3 > .row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .row-9-3 > .row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1399.98px) { .row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1199.98px) {
  .row-8-4 { grid-template-columns: minmax(0, 1fr); }
  .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); }
  .row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .container { gap: 16px; }
  .row { gap: 16px; }
}
@media (max-width: 359.98px) { .row-4 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575.98px) {
  .widget { padding: 14px; gap: 10px 8px; }
  .widget .avatar { width: 38px; height: 38px; font-size: 1.15rem; }
  .widget .value { font-size: 1.15rem; }
  .widget .label { font-size: .6875rem; white-space: normal; overflow: visible; }
}

/* ================= cards ================= */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 16px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 500; }
.card-body { padding: 16px; display: grid; gap: 14px; }
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border); }

/* stat widget */
.widget { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 12px; transition: transform .2s ease, box-shadow .2s ease; }
.widget:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.widget .label { font-size: .75rem; font-weight: 500; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget .value { grid-column: 1; font-size: 1.375rem; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.widget .value.sm { font-size: 1.05rem; }
.widget .more { grid-column: 1; font-size: .8125rem; text-decoration: underline; }
.widget .avatar { grid-column: 2; grid-row: 2 / span 2; align-self: end; }
.widget .change { font-size: .8125rem; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .widget, .widget:hover { transform: none; transition: none; } }

.avatar { width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center; font-size: 1.5rem; flex: 0 0 auto; }
.soft-primary { background: rgba(64, 81, 137, .1); color: var(--primary); }
.soft-success { background: rgba(10, 179, 156, .1); color: var(--success); }
.soft-info { background: rgba(41, 156, 219, .1); color: var(--info); }
.soft-warning { background: rgba(247, 184, 75, .12); color: #d99a2b; }
.soft-danger { background: rgba(240, 101, 72, .1); color: var(--danger); }
.soft-secondary { background: rgba(53, 119, 241, .1); color: var(--secondary); }
:root[data-theme="dark"] .soft-primary { color: #7d93d8; background: rgba(125, 147, 216, .14); }

/* person avatar */
.pic { width: 32px; height: 32px; border-radius: 50%; background: rgba(var(--primary-rgb), .12); color: var(--primary); display: inline-grid; place-items: center; font-weight: 600; font-size: .75rem; overflow: hidden; flex: 0 0 auto; }
:root[data-theme="dark"] .pic { color: #9fb1e8; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic.lg { width: 64px; height: 64px; font-size: 1.25rem; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .name { font-weight: 500; color: var(--heading); }
.who small { display: block; color: var(--muted); font-size: .75rem; }

/* ================= badges & buttons ================= */
.badge { display: inline-block; padding: .3em .6em; border-radius: var(--radius); font-size: .7rem; font-weight: 600; line-height: 1; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.badge.success { background: rgba(10, 179, 156, .12); color: var(--success); }
.badge.warning { background: rgba(247, 184, 75, .15); color: #d99a2b; }
.badge.danger { background: rgba(240, 101, 72, .12); color: var(--danger); }
.badge.info { background: rgba(41, 156, 219, .12); color: var(--info); }
.badge.primary { background: rgba(64, 81, 137, .12); color: var(--primary); }
.badge.light { background: var(--light); color: var(--muted); }
.badge.solid-danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .badge.primary { color: #9fb1e8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: .5rem .9rem; border-radius: var(--radius); border: 1px solid transparent;
  font: 400 .8125rem/1.5 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn i { font-size: 1rem; line-height: 1; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #364574; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #099885; color: #fff; }
.btn-light { background: var(--light); color: var(--body-color); border-color: var(--light); }
.btn-light:hover { background: #e2e5ed; }
:root[data-theme="dark"] .btn-light:hover { background: #333a41; }
.btn-soft-danger { background: rgba(240, 101, 72, .1); color: var(--danger); }
.btn-soft-danger:hover { background: var(--danger); color: #fff; }
.btn-soft-success { background: rgba(10, 179, 156, .1); color: var(--success); }
.btn-soft-success:hover { background: var(--success); color: #fff; }
.btn-soft-primary { background: rgba(64, 81, 137, .1); color: var(--primary); }
.btn-soft-primary:hover { background: var(--primary); color: #fff; }
:root[data-theme="dark"] .btn-soft-primary { color: #9fb1e8; }
.btn-sm { padding: .25rem .55rem; font-size: .75rem; }
.btn-block { width: 100%; }
form.inline { display: inline; }
.btn-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
/* In table action cells, show icon-only buttons on mid-size screens so the column never runs off the card. */
@media (min-width: 1200px) and (max-width: 1499.98px) {
  .table td.actions .btn .lbl { display: none; }
  .table td.actions .btn { padding: .3rem .45rem; }
  .table td.actions .btn-row { flex-wrap: nowrap; }
}

/* ================= forms ================= */
.form-label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--heading); }
.form-control, .form-select {
  display: block; width: 100%; padding: .5rem .9rem;
  font: 400 .8125rem/1.5 var(--font); color: var(--body-color);
  background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--radius);
}
.form-control:focus, .form-select:focus { outline: 0; border-color: #a0a8c4; box-shadow: 0 0 0 .15rem rgba(var(--primary-rgb), .18); }
textarea.form-control { resize: vertical; }
.form-text { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.invalid { font-size: .75rem; color: var(--danger); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 767.98px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 8px; color: var(--body-color); }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .form-control { padding-left: 34px; }

.filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; gap: 12px; align-items: center; }
.filters.two { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 767.98px) {
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters > :first-child { grid-column: 1 / -1; }
  .filters.two > :first-child { grid-column: auto; }
  .filters .btn { width: 100%; grid-column: 1 / -1; }
  .filters.two .btn { grid-column: auto; width: auto; }
}

/* collapsible "generate" panel */
details.collapse > summary { list-style: none; cursor: pointer; }
details.collapse > summary::-webkit-details-marker { display: none; }

/* ================= alerts ================= */
.alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid transparent; display: flex; gap: 8px; align-items: flex-start; }
.alert i { font-size: 1.1rem; line-height: 1.2; }
.alert-success { background: rgba(10, 179, 156, .1); color: #078573; border-color: rgba(10, 179, 156, .25); }
.alert-danger { background: rgba(240, 101, 72, .1); color: #c44b32; border-color: rgba(240, 101, 72, .25); }
:root[data-theme="dark"] .alert-success { color: #3fd7c2; }
:root[data-theme="dark"] .alert-danger { color: #f78f79; }

/* ================= tables ================= */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem .9rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table thead th { background: var(--light); color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--light) 60%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.wrap { white-space: normal; min-width: 180px; }
.table td.actions { text-align: right; }
.table tr.child td:first-child { padding-left: 42px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty i { display: block; font-size: 2.2rem; color: var(--border); margin-bottom: 6px; }

/*
 * Below 1200px each row becomes a small card (two per line on tablets, one on
 * phones). Every <td> carries data-label, shown on the left; the first cell is
 * the card title.
 */
@media (max-width: 1199.98px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table.stack tbody tr:hover { background: none; }
  .table.stack td {
    border: 0; padding: 4px 0; white-space: normal;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right;
  }
  .table.stack td::before { content: attr(data-label); color: var(--muted); font: 400 .75rem/1.5 var(--font); letter-spacing: 0; text-align: left; flex: 0 0 auto; }
  .table.stack td:first-child { padding-bottom: 8px; text-align: left; }
  .table.stack td:first-child::before { display: none; }
  .table.stack td.actions { justify-content: flex-start; padding-top: 10px; }
  .table.stack td.actions::before { display: none; }
  .table.stack td.actions .btn-row { justify-content: flex-start; }
  .table.stack tr.child td:first-child { padding-left: 18px; }
  .table.stack td.wrap { min-width: 0; }
  .table.stack .empty-row td { justify-content: center; }
  .table.stack td audio { max-width: 60%; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .table.stack tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table.stack tbody tr:nth-child(odd) { border-right: 1px solid var(--border); }
  .table.stack .empty-row { grid-column: 1 / -1; border-right: 0 !important; }
}
@media (max-width: 767.98px) {
  .table.stack tbody tr:last-child { border-bottom: 0; }
}

/* nav tabs */
.nav-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto; }
.nav-tabs a { padding: 14px 12px; color: var(--muted) !important; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.nav-tabs a.active { color: var(--link) !important; border-color: var(--link); }

/* lists */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { font-weight: 500; color: var(--heading); }
.list-item small { display: block; color: var(--muted); }
@media (max-width: 479.98px) { .list-item.wrap-sm { flex-wrap: wrap; } .list-item.wrap-sm .btn-row { width: 100%; justify-content: flex-start; padding-left: 44px; } }

dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; color: var(--heading); overflow-wrap: anywhere; }

/* QR */
.qr { background: #fff; border-radius: var(--radius-lg); padding: 12px; justify-self: center; border: 1px solid var(--border); }
.qr svg { display: block; width: 200px; height: 200px; max-width: 100%; }

/* activations chart */
.chart { position: relative; height: 230px; padding: 8px 4px 0 34px; }
.chart .grid-lines { position: absolute; inset: 8px 4px 26px 34px; display: flex; flex-direction: column; justify-content: space-between; }
.chart .grid-lines span { border-top: 1px dashed var(--border); position: relative; }
.chart .grid-lines span::before { content: attr(data-v); position: absolute; left: -34px; top: -8px; width: 28px; text-align: right; font-size: .6875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart .bars { position: relative; height: calc(100% - 18px); display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 8px; align-items: end; }
.chart .bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.chart .bar i { display: block; width: 70%; max-width: 26px; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
:root[data-theme="dark"] .chart .bar i { background: #6f8ae0; }
.chart .bar.today i { background: var(--success); }
.chart .labels { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 8px; font-size: .6875rem; color: var(--muted); text-align: center; padding-top: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .chart .bars, .chart .labels { gap: 3px; } .chart .labels span:nth-child(even) { visibility: hidden; } }

.sos-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: 0 0 auto; box-shadow: 0 0 0 4px rgba(240, 101, 72, .18); }
audio { height: 32px; max-width: 220px; }

/* pagination */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 50%; display: grid; place-items: center; color: var(--body-color); text-decoration: none; }
.pagination a:hover { background: var(--light); }
.pagination .active { background: var(--primary); color: #fff; }
.pagination .disabled { opacity: .45; }

/* profile header */
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.profile-head h5 { font-size: 1.1rem; }

/* ================= auth page ================= */
.auth-page { min-height: 100vh; position: relative; display: flex; flex-direction: column; align-items: center; padding: 64px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.auth-bg {
  position: absolute; inset: 0 0 auto; height: 380px; overflow: hidden;
  background: linear-gradient(to right, #364574, #405189);
}
.auth-bg::before, .auth-bg::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .05); }
.auth-bg::before { width: 420px; height: 420px; top: -180px; left: -120px; }
.auth-bg::after { width: 300px; height: 300px; bottom: -120px; right: 8%; }
.auth-bg .wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 70px; color: var(--body-bg); }
.auth-brand { position: relative; color: #fff; text-align: center; display: grid; gap: 10px; justify-items: center; margin-bottom: 28px; }
.auth-brand svg { width: 64px; height: 38px; }
.auth-brand b { font-size: 1.5rem; font-weight: 600; }
.auth-brand p { color: rgba(255, 255, 255, .6); }
.auth-card { position: relative; width: min(440px, 100%); background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 32px 28px; display: grid; gap: 16px; }
.auth-card h5 { color: var(--primary); font-size: 1.1rem; text-align: center; }
:root[data-theme="dark"] .auth-card h5 { color: #9fb1e8; }
.auth-card .sub { text-align: center; color: var(--muted); margin-top: -10px; }
.auth-foot { position: relative; margin-top: auto; padding-top: 28px; color: var(--muted); }

/* ================= public SOS page ================= */
.sos-page { max-width: 460px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; text-align: center; color: #fff; }
.sos-page h1 { color: #fff; font-size: 1.6rem; }
.sos-page .btn { background: #fff; color: #b3172b; font-size: .95rem; padding: 12px; }
.sos-page .panel { background: rgba(255, 255, 255, .1); border-radius: var(--radius-lg); padding: 16px; display: grid; gap: 10px; }
.sos-page audio { width: 100%; max-width: none; height: 40px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .menu a, .form-control { transition: background-color .15s, border-color .15s, color .15s; }
}
