/* rent-service · Web Admin Prototype · shared.css
   Dark theme by default. Desktop-first (1280–1920). */

/* ===== Tokens ===== */
:root {
  --bg: #0F172A;            /* slate-900 */
  --surface: #1E293B;       /* slate-800 */
  --surface-2: #263449;     /* slate-750 approx */
  --surface-3: #334155;     /* slate-700 */
  --border: #334155;        /* slate-700 */
  --border-2: #475569;      /* slate-600 */
  --text: #F8FAFC;          /* slate-50 */
  --text-muted: #CBD5E1;    /* slate-300 */
  --text-dim: #94A3B8;      /* slate-400 */

  --brand: #2563EB;         /* blue-600 */
  --brand-hover: #1D4ED8;   /* blue-700 */
  --brand-soft: rgba(37, 99, 235, .18);
  --amber: #F59E0B;
  --amber-soft: rgba(245, 158, 11, .16);
  --jade: #30A46C;          /* return */
  --jade-soft: rgba(48, 164, 108, .16);
  --green: #10B981;
  --green-soft: rgba(16, 185, 129, .16);
  --red: #EF4444;
  --red-soft: rgba(239, 68, 68, .16);
  /* --freeze удалено: метафора залога — return jade (↻), не snowflake */

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --shadow: 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5);

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --sidebar-w: 240px;
  --topbar-h: 60px;

  --dur-fast: 120ms;
  --dur: 200ms;
  --ease: cubic-bezier(.2,.8,.2,1);
}

/* ===== Reset / base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 1; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 20px;
  vertical-align: middle;
}

/* ===== App shell ===== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.content {
  padding: 24px 32px;
  flex: 1;
  min-width: 0;
}
.content.no-pad { padding: 0; }

/* ===== Sidebar ===== */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #7C3AED);
  display: grid; place-items: center;
  color: white; font-weight: 800;
  font-size: 14px;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}
.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  padding: 14px 10px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-soft);
  color: #93C5FD;
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -10px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.nav-item .material-symbols-rounded { font-size: 20px; }
.nav-item .shortcut {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.counter-badge {
  margin-left: auto;
  background: var(--amber);
  color: #111;
  font-weight: 700;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.counter-badge.critical { background: var(--red); color: white; }

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #60A5FA, #A78BFA);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 13px;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta .name { font-size: 13px; font-weight: 500; }
.user-meta .role { font-size: 11px; color: var(--text-dim); }

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-h);
  background: rgba(15, 23, 42, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.breadcrumbs { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.breadcrumbs .sep { color: var(--text-dim); }
.breadcrumbs .current { color: var(--text); font-weight: 500; }
.topbar-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
  transition: border-color var(--dur-fast);
}
.topbar-search:hover { border-color: var(--border-2); }
.topbar-search .material-symbols-rounded { font-size: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--text-muted);
  position: relative;
  transition: background var(--dur-fast);
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--dur-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-lg { padding: 12px 18px; font-size: 14px; }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* ===== KPI cards ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color var(--dur-fast);
  cursor: pointer;
}
.kpi-card:hover { border-color: var(--border-2); }
.kpi-card .kpi-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.kpi-card .kpi-value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-top: 8px;
  display: flex; align-items: baseline; gap: 8px;
}
.kpi-card .kpi-unit { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.kpi-card .kpi-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.kpi-card .kpi-trend.up { color: var(--green); background: var(--green-soft); }
.kpi-card .kpi-trend.down { color: var(--red); background: var(--red-soft); }
.kpi-card .kpi-trend.flat { color: var(--text-muted); background: var(--surface-2); }

/* ===== Live feed ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.panel-header h2 { font-size: 15px; }
.panel-body { padding: 8px 0; }
.panel-body.pad { padding: 16px 18px; }

.live-feed { max-height: 380px; overflow-y: auto; }
.feed-event {
  display: flex;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  animation: feedIn var(--dur) var(--ease);
}
.feed-event:last-child { border-bottom: 0; }
.feed-event .feed-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  min-width: 52px;
  padding-top: 2px;
}
.feed-event .feed-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--surface-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.feed-event.ok .feed-icon { color: var(--green); background: var(--green-soft); }
.feed-event.warn .feed-icon { color: var(--amber); background: var(--amber-soft); }
.feed-event.err .feed-icon { color: var(--red); background: var(--red-soft); }
.feed-event.info .feed-icon { color: #60A5FA; background: var(--brand-soft); }
.feed-event .feed-text { flex: 1; color: var(--text-muted); }
.feed-event .feed-text b { color: var(--text); font-weight: 500; }

@keyframes feedIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Data table ===== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  position: sticky; top: 0;
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.data-table thead th.sortable:hover { color: var(--text); }
.data-table thead th .sort-arrow { opacity: .5; margin-left: 4px; font-size: 14px; }
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr { transition: background var(--dur-fast); cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr.selected { background: var(--brand-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td .mono { font-size: 12.5px; }
.data-table td.num { font-family: var(--mono); text-align: right; }
.data-table .check-col { width: 40px; }
.data-table .actions-col { width: 48px; text-align: right; }

/* ===== Status badges ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  height: 22px;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-badge.online   { color: var(--green); background: var(--green-soft); }
.status-badge.offline  { color: var(--text-dim); background: var(--surface-2); }
.status-badge.warning  { color: var(--amber); background: var(--amber-soft); }
.status-badge.error    { color: var(--red);   background: var(--red-soft); }
.status-badge.success  { color: var(--green); background: var(--green-soft); }
.status-badge.active   { color: #60A5FA; background: var(--brand-soft); }
.status-badge.pending  { color: var(--amber); background: var(--amber-soft); }
.status-badge.overdue  { color: var(--red); background: var(--red-soft); }
.status-badge.completed{ color: var(--text-muted); background: var(--surface-2); }
.status-badge.disputed { color: #A78BFA; background: rgba(167, 139, 250, .16); }
.status-badge.pulse::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(1.4); }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
}
.chip.info { color: #60A5FA; background: var(--brand-soft); }
.chip.risk-low { color: var(--green); background: var(--green-soft); }
.chip.risk-mid { color: var(--amber); background: var(--amber-soft); }
.chip.risk-high { color: var(--red); background: var(--red-soft); }

/* DepositChip — return jade */
.deposit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--jade);
  background: var(--jade-soft);
  font-family: var(--mono);
}
.deposit-chip .material-symbols-rounded { font-size: 14px; }

/* ===== kbd ===== */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  line-height: 1;
}
.kbd-group { display: inline-flex; gap: 4px; align-items: center; }
.kbd-group .plus { color: var(--text-dim); font-size: 11px; }

/* ===== Filter chips ===== */
.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur-fast);
}
.filter-chip:hover { border-color: var(--border-2); color: var(--text); }
.filter-chip.active {
  color: #93C5FD;
  background: var(--brand-soft);
  border-color: var(--brand);
}
.filter-chip .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.filter-chip.active .count { color: #93C5FD; }

/* ===== CSV export button ===== */
.csv-export-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--jade-soft);
  color: var(--jade);
  border: 1px solid rgba(48, 164, 108, .35);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
.csv-export-button:hover { background: rgba(48, 164, 108, .25); }

/* ===== SLA timer ===== */
.sla-timer {
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border-left: 3px solid var(--green);
}
.sla-timer.warn { border-left-color: var(--amber); }
.sla-timer.err  { border-left-color: var(--red); animation: slaBlink 1.2s infinite; }
.sla-timer .sla-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.sla-timer .sla-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--green);
}
.sla-timer.warn .sla-value { color: var(--amber); }
.sla-timer.err  .sla-value { color: var(--red); }
.sla-timer .sla-bar {
  margin-top: 8px;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.sla-timer .sla-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--amber) 60%, var(--red));
  border-radius: 3px;
}
@keyframes slaBlink { 0%,100% { opacity: 1; } 50% { opacity: .7; } }

/* ===== Shelf map (admin variant) ===== */
.shelf-map-admin {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.shelf-cell {
  position: relative;
  aspect-ratio: 1 / 1.2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.shelf-cell:hover { border-color: var(--border-2); transform: translateY(-1px); }
.shelf-cell .shelf-num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
}
.shelf-cell .shelf-status {
  font-size: 10.5px;
  color: var(--text-dim);
}
.shelf-cell.free { border-color: rgba(48,164,108,.35); background: rgba(48,164,108,.08); }
.shelf-cell.occupied { border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.08); }
.shelf-cell.fault { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.1); }
.shelf-cell.disabled { opacity: .5; }
.shelf-cell .shelf-actions {
  position: absolute;
  top: 6px; right: 6px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.shelf-cell:hover .shelf-actions { opacity: 1; }

/* ===== Bulk action bar ===== */
.bulk-action-bar {
  position: sticky;
  bottom: 16px;
  margin: 16px auto 0;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideUp var(--dur) var(--ease);
}
.bulk-action-bar .selected-count {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.bulk-action-bar .selected-count b { color: var(--brand); font-family: var(--mono); }
.bulk-action-bar .actions { display: flex; gap: 8px; margin-left: auto; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Slide-over ===== */
.slide-over-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px);
  z-index: 50;
  animation: fadeIn var(--dur) var(--ease);
}
.slide-over {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 640px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 51;
  display: flex;
  flex-direction: column;
  animation: slideIn var(--dur) var(--ease);
}
.slide-over-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.slide-over-body { flex: 1; overflow-y: auto; padding: 22px; }
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.tab {
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--dur-fast);
  font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--brand);
}
.tab .count {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 999px;
}
.tab-panel { display: none; padding: 20px 0; }
.tab-panel.active { display: block; }

/* ===== Toast / snackbar ===== */
.toast-wrap {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  animation: slideUp var(--dur) var(--ease);
  margin-top: 8px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.warn    { border-left: 3px solid var(--amber); }
.toast.err     { border-left: 3px solid var(--red); }

/* ===== Undo bar ===== */
.undo-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.undo-bar .countdown {
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 600;
}

/* ===== Page hero / section ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header h1 { font-size: 22px; }
.page-header .subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-header-actions { display: flex; gap: 10px; align-items: center; }

.section { margin-bottom: 24px; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}

/* ===== Forms ===== */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.input, .select, .textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13.5px;
  transition: border-color var(--dur-fast);
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ===== Map placeholder ===== */
.map-placeholder {
  background:
    radial-gradient(circle at 30% 40%, rgba(37,99,235,.12), transparent 40%),
    radial-gradient(circle at 65% 60%, rgba(167,139,250,.1), transparent 40%),
    linear-gradient(var(--surface-2), var(--surface));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.map-pin {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 3px rgba(0,0,0,.3);
}
.map-pin.online  { background: var(--green); }
.map-pin.offline { background: var(--text-dim); }
.map-pin.warn    { background: var(--amber); }
.map-grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ===== Utility ===== */
.row { display: flex; gap: 16px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.hidden { display: none !important; }

.mono-id {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.mono-id:hover { background: var(--surface-3); }

/* ===== Login ===== */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(37,99,235,.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(167,139,250,.12), transparent 40%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

/* ===== Photo Queue ===== */
.pq-shell { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - var(--topbar-h)); }
.pq-left {
  background: #0A0F1C;
  position: relative;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.pq-photo {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pq-photo-placeholder {
  width: 78%;
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 20px, rgba(255,255,255,.04) 20px 40px),
    linear-gradient(135deg, #1E293B, #0F172A);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  position: relative;
}
.pq-photo-placeholder::after {
  content: '📷';
  display: block;
  font-size: 64px;
  opacity: .25;
}
.pq-zoom-controls {
  position: absolute;
  top: 16px; right: 16px;
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}
.pq-zoom-controls .btn-icon { width: 28px; height: 28px; color: white; }
.pq-meta-footer {
  padding: 10px 20px;
  background: rgba(0,0,0,.4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 18px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.pq-action-bar {
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pq-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--dur-fast);
}
.pq-action-btn.accept  { background: var(--green); color: white; }
.pq-action-btn.reject  { background: var(--surface-2); color: var(--amber); border-color: rgba(245,158,11,.4); }
.pq-action-btn.rephoto { background: var(--surface-2); color: #93C5FD; border-color: rgba(37,99,235,.4); }
.pq-action-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.pq-action-btn .kbd { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.15); color: white; }
.pq-action-btn.reject .kbd { color: var(--amber); }
.pq-action-btn.rephoto .kbd { color: #93C5FD; }

.pq-right {
  background: var(--surface);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pq-ref-photo {
  width: 100%;
  aspect-ratio: 1;
  max-width: 240px;
  margin: 0 auto;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 14px, rgba(255,255,255,.04) 14px 28px),
    var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-dim);
  font-size: 11.5px;
}
.pq-meta-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  font-size: 12.5px;
}
.pq-meta-list .label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.pq-meta-list .value { color: var(--text); font-weight: 500; margin-top: 2px; }
.pq-counter-strip {
  padding: 10px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
}

/* ===== Index navigator ===== */
.navigator-hero {
  padding: 60px 40px;
  text-align: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(37,99,235,.18), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(167,139,250,.15), transparent 40%);
}
.navigator-hero h1 { font-size: 36px; margin-bottom: 10px; letter-spacing: -.02em; }
.navigator-hero p { color: var(--text-muted); font-size: 15px; max-width: 640px; margin: 0 auto; }
.nav-group {
  padding: 24px 40px;
  max-width: 1280px;
  margin: 0 auto;
}
.nav-group-title {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin-bottom: 14px;
}
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: all var(--dur);
  position: relative;
  overflow: hidden;
}
.nav-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.nav-card .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .05em;
}
.nav-card h3 { margin-top: 6px; font-size: 16px; }
.nav-card p { margin-top: 8px; color: var(--text-muted); font-size: 13px; }
.nav-card .tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.nav-card .tag.hot { background: var(--amber-soft); color: var(--amber); }

/* ===== Responsive fallback ===== */
@media (max-width: 1023px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .pq-shell { grid-template-columns: 1fr; height: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

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