/* Traccar-RS dashboard. Layout and look follow a clean "admin template" style:
   white cards on a soft lavender background, violet primary, pastel icon tiles. */
:root {
  --bg: #f5f5f9;
  --card: #ffffff;
  --text: #566a7f;
  --heading: #566a7f;
  --muted: #a1acb8;
  --border: #e4e6e8;
  --primary: #696cff;
  --primary-soft: #e7e7ff;
  --primary-dark: #5f61e6;
  --success: #71dd37;
  --success-soft: #e8fadf;
  --success-text: #4ba521;
  --info: #03c3ec;
  --info-soft: #d7f5fc;
  --danger: #ff3e1d;
  --danger-soft: #ffe0db;
  --warning: #ffab00;
  --warning-soft: #fff2d6;
  --warning-text: #c98700;
  --shadow: 0 2px 6px 0 rgba(67, 89, 113, 0.12);
  --radius: 8px;
  --sidebar: 260px;
  --sidebar-collapsed: 78px;
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; color: var(--heading); font-weight: 500; line-height: 1.25; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

/* ---------- login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.login-card .brand { justify-content: center; margin-bottom: 20px; }
.login-card h2 { font-size: 1.25rem; margin-bottom: 4px; }
.login-card p { margin: 0 0 20px; color: var(--muted); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100%; transition: grid-template-columns 0.2s ease; }
.shell.collapsed { grid-template-columns: var(--sidebar-collapsed) 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--card); box-shadow: 0 0 0 1px rgba(67, 89, 113, 0.04), 2px 0 6px rgba(67, 89, 113, 0.05); z-index: 30; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 22px; height: 78px; color: #283144; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand svg { flex: none; }
.brand small { display: block; font-size: 0.68rem; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: -3px; }
.collapse-btn { position: absolute; top: 28px; right: -14px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 6px rgba(105, 108, 255, 0.5); }
.collapse-btn svg { transition: transform 0.2s; }
.shell.collapsed .collapse-btn svg { transform: rotate(180deg); }
.nav { list-style: none; margin: 4px 0 0; padding: 0 16px; display: grid; gap: 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 6px; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: #f4f5fb; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav a.active::after { content: ""; position: absolute; right: -16px; top: 0; bottom: 0; width: 4px; background: var(--primary); border-radius: 4px 0 0 4px; }
.nav .chev { margin-left: auto; opacity: 0.6; }
.shell.collapsed .brand-text, .shell.collapsed .nav .label, .shell.collapsed .nav .chev { display: none; }
.shell.collapsed .nav a { justify-content: center; padding: 10px; }
.sidebar-foot { margin-top: auto; padding: 16px 22px; color: var(--muted); font-size: 0.8rem; }
.shell.collapsed .sidebar-foot { display: none; }

.main { min-width: 0; padding: 0 24px 24px; }
.topbar { position: sticky; top: 0; z-index: 20; margin: 0 -24px 24px; padding: 0 24px; background: linear-gradient(var(--bg) 70%, transparent); }
.topbar-inner { height: 60px; background: var(--card); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; padding: 0 22px; }
.menu-btn { display: none; border: 0; background: transparent; cursor: pointer; color: var(--text); }
.search { position: relative; flex: 1; max-width: 520px; }
.search svg { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input[type="text"] { width: 100%; border: 0; box-shadow: none; outline: 0; padding: 8px 8px 8px 34px; background: transparent; font-size: 0.95rem; }
.search input::placeholder { color: var(--muted); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(67, 89, 113, 0.2); padding: 6px; max-height: 340px; overflow: auto; }
.search-results a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--primary-soft); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; position: relative; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 600; border: 0; cursor: pointer; }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: var(--muted); }
.avatar .dot.on { background: var(--success); }
.menu { position: absolute; right: 0; top: 48px; min-width: 220px; background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(67, 89, 113, 0.2); padding: 8px; z-index: 40; }
.menu button, .menu .menu-info { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; text-align: left; cursor: pointer; }
.menu button:hover { background: var(--primary-soft); }
.menu .menu-info { cursor: default; color: var(--muted); font-size: 0.82rem; }

/* ---------- cards & grid ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { font-size: 1.125rem; }
.card-sub { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-12 { grid-column: span 12; }
.stack { display: grid; gap: 24px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.welcome { display: flex; justify-content: space-between; align-items: center; overflow: hidden; padding: 24px; min-height: 164px; }
.welcome h3 { color: var(--primary); font-size: 1.2rem; margin-bottom: 10px; }
.welcome p { margin: 0 0 18px; max-width: 520px; }
.welcome .art { flex: none; width: 230px; margin-right: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 18px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-weight: 500; font-size: 0.9rem; text-decoration: none; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.outline { background: transparent; color: var(--primary); border-color: var(--primary); padding: 5px 12px; font-size: 0.8rem; }
.btn.outline:hover { background: var(--primary-soft); }
.btn.ghost { background: #f1f2f6; color: var(--text); }
.btn.ghost:hover { background: #e7e9f0; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: 0.8rem; }
.btn.icon { padding: 6px; border-radius: 6px; }

.stat { padding: 20px 22px 22px; }
.tile { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; }
.tile.primary { background: var(--primary-soft); color: var(--primary); }
.tile.success { background: var(--success-soft); color: var(--success); }
.tile.info { background: var(--info-soft); color: var(--info); }
.tile.danger { background: var(--danger-soft); color: var(--danger); }
.tile.warning { background: var(--warning-soft); color: var(--warning); }
.stat .label { margin-top: 18px; display: block; }
.stat .value { font-size: 1.55rem; font-weight: 500; color: var(--heading); margin: 2px 0 6px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 500; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.kebab { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; position: relative; }
.kebab:hover { color: var(--text); background: #f1f2f6; }

.chart-card { display: grid; grid-template-columns: 1fr 320px; padding: 0; overflow: hidden; }
.chart-main { padding: 24px; min-width: 0; }
.chart-side { border-left: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 18px; text-align: center; }
.select { border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 0.82rem; cursor: pointer; }
.mini-stats { width: 100%; display: flex; justify-content: space-between; gap: 12px; text-align: left; }
.mini { display: flex; align-items: center; gap: 10px; }
.mini .tile { width: 36px; height: 36px; }
.mini small { color: var(--muted); display: block; font-size: 0.8rem; }
.mini b { color: var(--heading); font-weight: 500; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: #283144; color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 0.78rem; white-space: nowrap; transform: translate(-50%, -120%); }
.chart-wrap { position: relative; margin-top: 12px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge.warning { background: var(--warning-soft); color: var(--warning-text); }
.badge.success { background: var(--success-soft); color: var(--success-text); }
.badge.danger { background: var(--danger-soft); color: #c4301a; }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.gray { background: #eceef1; color: var(--text); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; background: #eceef1; }
.pill.jt808 { background: var(--primary-soft); color: var(--primary); }
.pill.gt06 { background: var(--info-soft); color: #0486a0; }
.pill.gt02 { background: var(--warning-soft); color: var(--warning-text); }

.bigline { font-size: 1.6rem; font-weight: 500; color: var(--heading); margin: 10px 0; }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #eceef1; margin: 12px 0; }
.legend { display: grid; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend b { margin-left: auto; color: var(--heading); font-weight: 500; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 6px; cursor: pointer; color: var(--text); }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 4px rgba(105, 108, 255, 0.4); }
.list { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { color: var(--heading); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row small { color: var(--muted); display: block; font-size: 0.78rem; }
.row .end { text-align: right; white-space: nowrap; color: var(--heading); font-weight: 500; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.notice { background: var(--warning-soft); color: #8a5d00; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px; }
.notice.error { background: var(--danger-soft); color: #a3260f; }

.map { width: 100%; border-radius: var(--radius); background: #e9edf1; z-index: 1; }
.map.tall { height: calc(100vh - 170px); min-height: 420px; }
.map.mid { height: 380px; }
.mk { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--muted); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.mk.online { background: var(--success); }
.mk.alarm { background: var(--danger); }
.mk i { position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #fff; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); transform-origin: 50% 50%; }
.mk.still i { display: none; }
.mk.still::after { content: ""; position: absolute; inset: 7px; background: #fff; border-radius: 50%; }
.map-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.side-list { max-height: calc(100vh - 170px); overflow: auto; padding: 14px; }
.side-list input { width: 100%; margin-bottom: 12px; }
.side-item { padding: 10px; border-radius: 6px; cursor: pointer; }
.side-item:hover, .side-item.sel { background: var(--primary-soft); }

/* ---------- forms & tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.toolbar .grow { flex: 1; }
input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], input[type="date"], select.field, textarea {
  border: 1px solid #d9dee3; border-radius: 6px; padding: 8px 12px; background: #fff; min-width: 0; outline: 0; }
input:focus, select.field:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.15); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--heading); font-weight: 500; }
.form .hint { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex !important; align-items: center; gap: 10px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafd; }
td.actions { white-space: nowrap; text-align: right; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--heading); word-break: break-word; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.4rem; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cols-21 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }

.modal-back { position: fixed; inset: 0; background: rgba(40, 49, 68, 0.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { width: 100%; max-width: 480px; background: var(--card); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); padding: 24px; max-height: 92vh; overflow: auto; }
.modal h3 { margin-bottom: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toasts { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 10px; z-index: 200; }
.toast { background: #283144; color: #fff; padding: 12px 16px; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); max-width: 360px; }
.toast.error { background: #c4301a; }
.toast.ok { background: #3a8a1a; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- addresses ---------- */
.addr { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; line-height: 1.35; white-space: normal;
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.addr.failed { font-style: italic; }
.leaflet-popup-content .addr { max-width: 240px; }

/* ---------- alarm settings (on/off switches) ---------- */
.toggles { margin-top: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid #f0f1f3; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .t-title { color: var(--heading); font-weight: 500; }
.toggle-row small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.toggle-row small .badge { margin-left: 4px; font-size: 0.62rem; padding: 1px 6px; }
.switch { position: relative; display: inline-block; flex: none; width: 46px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: not-allowed; }
.switch .slider { position: absolute; inset: 0; border-radius: 26px; background: #d9dee3; transition: background 0.2s; }
.switch .slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.3); }
.switch input:disabled + .slider { opacity: 0.5; }
.switch.busy .slider { opacity: 0.6; animation: switch-pulse 0.9s ease-in-out infinite alternate; }
@keyframes switch-pulse { from { opacity: 0.45; } to { opacity: 0.85; } }
.cfg-more { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.cfg-more + .cfg-more { margin-top: 0; }
.cfg-more summary { cursor: pointer; color: var(--heading); font-weight: 500; padding: 4px 0 8px; }
.cfg-more .form { padding-bottom: 6px; }
.cfg-more .btn { justify-self: start; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .cfg-grid { grid-template-columns: 1fr; } }

@media (max-width: 1180px) {
  .span-8, .span-4 { grid-column: span 12; }
  .chart-card { grid-template-columns: 1fr; }
  .chart-side { border-left: 0; border-top: 1px solid var(--border); }
  .cols-2, .cols-21, .map-layout { grid-template-columns: 1fr; }
  .side-list { max-height: 280px; }
  .map.tall { height: 60vh; }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar); transform: translateX(-100%); transition: transform 0.2s; }
  .shell.open .sidebar { transform: none; }
  .shell.collapsed .brand-text, .shell.collapsed .nav .label { display: initial; }
  .collapse-btn { display: none; }
  .menu-btn { display: block; }
  .welcome .art { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .main { padding: 0 14px 20px; }
  .topbar { margin: 0 -14px 18px; padding: 0 14px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }

/* History & trips: report cards, playback bar, stop markers, clickable rows */
.stats-grid.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .stats-grid.r4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .stats-grid.r4 { grid-template-columns: 1fr; } }
.playback { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.playback input[type="range"] { flex: 1; min-width: 160px; accent-color: var(--primary); }
.pb-info { flex-basis: 100%; font-size: 0.85rem; color: var(--heading); min-height: 1.3em; }
.mk.pb { background: var(--primary); }
.stop-mk { width: 22px; height: 22px; border-radius: 6px; background: #ff9f43; color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
tr.click { cursor: pointer; }
tr.sel td { background: var(--primary-soft); }
tr.day-row td { background: #f5f5f9; font-size: 0.82rem; color: var(--heading); padding-top: 8px; padding-bottom: 8px; }

/* Geofences */
.map-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 500; background: rgba(35, 52, 70, 0.88); color: #fff; padding: 7px 14px; border-radius: 6px; font-size: 0.85rem; max-width: calc(100% - 24px); text-align: center; pointer-events: none; }
.map.drawing, .map.drawing .leaflet-interactive { cursor: crosshair !important; }
#gform label.check { font-weight: 400; }
/* Checkboxes and radios keep their natural size inside side panels. */
.side-list input[type="checkbox"], .side-list input[type="radio"] { width: auto; margin: 0; flex: none; }
.side-list .form input { margin-bottom: 0; }
.side-list #gdq { margin-bottom: 8px; }
.dev-checks { display: grid; gap: 2px; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.dev-check { padding: 6px 0; align-items: flex-start !important; cursor: pointer; }
.dev-check input { margin-top: 3px !important; }
@media (max-width: 1180px) { .side-list:has(#gform) { max-height: none; } }

/* Notification center (bell in the top bar) */
.notif-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.notif-btn:hover, .notif-btn.open { background: var(--primary-soft); color: var(--primary); }
.notif-badge { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 600; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--card); box-sizing: border-box; }
.notif-panel { position: absolute; right: 0; top: 48px; width: 380px; max-width: calc(100vw - 32px); max-height: min(540px, calc(100vh - 80px)); display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(67, 89, 113, 0.2); z-index: 40; overflow: hidden; }
.notif-panel.hidden { display: none; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--heading); }
.notif-head .badge { margin-left: auto; }
.notif-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.notif-item { display: flex; gap: 12px; padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--bg); text-decoration: none; }
.notif-item.unread { background: #fff6f4; }
.notif-item.unread:hover { background: var(--danger-soft); }
.notif-item.unread .notif-text b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--danger); vertical-align: middle; }
.notif-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; }
.notif-text { display: flex; flex-direction: column; min-width: 0; }
.notif-text b { color: var(--heading); font-weight: 500; }
.notif-text span { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-text small { color: var(--muted); font-size: 0.75rem; }
.notif-text .notif-count { display: inline; font-size: 0.78rem; color: var(--danger); font-weight: 600; }
.notif-foot { padding: 10px 16px; font-size: 0.8rem; color: var(--muted); text-align: center; border-top: 1px solid var(--border); }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .notif-panel { position: fixed; top: 66px; left: 16px; right: 16px; width: auto; max-width: none; }
  .live-pill { display: none; }
}

/* Ownership & subscriptions */
.locked-row td { opacity: 0.7; }
.lock-card { max-width: 560px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 28px; }
.lock-card h3 { margin-top: 8px; }
.lock-card p { margin: 4px 0; color: var(--text); }
.lock-icon { width: 56px; height: 56px; border-radius: 50%; }
.code-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg); }
.code-box .code { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.15em; color: var(--heading); margin: 2px 0; }
