/* ============================================================
   I2ST (주식회사 투에스티) — 누수감지 관제 플랫폼
   Light theme · CI red #D71920
   ============================================================ */

:root {
  /* I2ST 브랜드 */
  --brand:         #D71920;
  --brand-hover:   #B8151B;
  --brand-light:   #FFF0F1;
  --brand-muted:   #FCE4E6;

  /* 배경 */
  --bg:            #FFFFFF;
  --bg-page:       #F4F6F8;
  --bg-nav:        #FFFFFF;
  --bg-card:       #FFFFFF;
  --bg-input:      #FFFFFF;
  --bg-hover:      #F8F9FA;
  --bg-subtle:     #F0F2F5;

  /* 테두리 */
  --border:        #E5E8EB;
  --border-strong: #D1D5DB;
  --border-focus:  #D71920;

  /* 텍스트 */
  --text:          #1A1A1A;
  --text-secondary:#374151;
  --text-muted:    #6B7280;
  --text-link:     #D71920;

  /* 상태 색상 (라이트 배경용) */
  --green:         #16A34A;
  --green-bg:      #ECFDF3;
  --red:           #DC2626;
  --red-bg:        #FEF2F2;
  --yellow:        #CA8A04;
  --yellow-bg:     #FFFBEB;
  --orange:        #EA580C;
  --orange-bg:     #FFF7ED;
  --gray:          #9CA3AF;
  --gray-bg:       #F3F4F6;
  --blue:          #2563EB;
  --blue-bg:       #EFF6FF;

  /* 기타 */
  --radius:        8px;
  --radius-sm:     4px;
  --radius-lg:     12px;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 24px rgba(0,0,0,0.1);
  --transition:    0.15s ease;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR',
          'Apple SD Gothic Neo', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;

  --nav-height: 64px;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

/* ── Navigation ─────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  border-bottom: 2px solid var(--brand);
  box-shadow: var(--shadow);
  z-index: 100;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-brand {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-brand:hover { text-decoration: none; color: var(--text); }
.nav-brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}
.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav-brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
}
.nav-brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover {
  color: var(--brand);
  background: var(--brand-light);
  text-decoration: none;
}
.nav-link.active {
  color: var(--brand);
  background: var(--brand-light);
  font-weight: 600;
}

/* ── Layout ─────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 24px) 24px 40px;
}
.page-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.section-gap { margin-top: 24px; }

/* ── Stat Cards ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
  border-left-width: 4px;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon { font-size: 1.75rem; line-height: 1; }

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}

.stat-card.stat-alarm   { border-left-color: var(--red); }
.stat-card.stat-alarm   .stat-number { color: var(--red); }
.stat-card.stat-wire    { border-left-color: var(--yellow); }
.stat-card.stat-wire    .stat-number { color: var(--yellow); }
.stat-card.stat-offline { border-left-color: var(--gray); }
.stat-card.stat-offline .stat-number { color: var(--gray); }
.stat-card.stat-normal  { border-left-color: var(--green); }
.stat-card.stat-normal  .stat-number { color: var(--green); }

.stat-card.stat-alarm-active  { background: var(--red-bg); border-color: #FECACA; }
.stat-card.stat-wire-active   { background: var(--yellow-bg); border-color: #FDE68A; }

/* ── Cards ──────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.card-body { padding: 20px; }

/* ── Tables ─────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.table th {
  padding: 11px 16px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
  background: var(--bg-subtle);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr.row-alarm { background: var(--red-bg); }
.table tbody tr.row-alarm:hover { background: #FEE2E2; }

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px !important;
}

/* ── Badges ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid #FECACA; }
.badge-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid #BBF7D0; }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid #FDE68A; }
.badge-gray   { background: var(--gray-bg);   color: #6B7280;       border: 1px solid var(--border); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid #BFDBFE; }
.badge-brand  { background: var(--brand-light); color: var(--brand); border: 1px solid var(--brand-muted); }
.badge-clickable {
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}
.badge-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-muted); color: var(--text); }

.btn-danger {
  background: var(--bg);
  color: var(--red);
  border-color: #FECACA;
}
.btn-danger:hover { background: var(--red-bg); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--brand); background: var(--brand-light); }

.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-icon { padding: 6px; }

/* ── Alarm Items ─────────────────────────────── */
.alarm-list { padding: 4px 0; }
.alarm-item {
  display: grid;
  grid-template-columns: auto 1fr 1fr 2fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background var(--transition);
}
.alarm-item:last-child { border-bottom: none; }
.alarm-item:hover { background: var(--bg-hover); }
.alarm-item.alarm-leak { border-left: 4px solid var(--red); background: var(--red-bg); }
.alarm-item.alarm-wire { border-left: 4px solid var(--yellow); background: var(--yellow-bg); }
.alarm-imei   { font-family: var(--mono); color: var(--text-muted); font-size: 0.8rem; }
.alarm-company { font-weight: 700; color: var(--text); }
.alarm-address { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alarm-time   { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; text-align: right; }

/* ── Device table list ───────────────────────── */
.devices-table-wrap {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.devices-table .col-radio { width: 40px; text-align: center; }
.devices-table .col-imei { font-family: var(--mono); font-size: 0.82rem; white-space: nowrap; }
.devices-table .col-actions { width: 88px; text-align: right; white-space: nowrap; }
.devices-table tbody tr { cursor: pointer; }
.devices-table tbody tr.row-selected { background: var(--brand-light); }
.devices-table tbody tr.row-selected td { border-bottom-color: var(--brand-muted); }
.devices-table .imei-link {
  color: var(--brand);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
}
.devices-table .imei-link:hover { text-decoration: underline; color: var(--brand-hover); }
.devices-table .cell-muted { color: var(--text-muted); font-size: 0.82rem; }
.devices-table .cell-empty { color: var(--text-muted); font-style: italic; }

.device-edit-panel {
  position: sticky;
  bottom: 16px;
  background: var(--bg-card);
  border: 2px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  margin-top: 8px;
  z-index: 10;
}
.device-edit-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.device-edit-panel-title { font-weight: 800; font-size: 0.95rem; color: var(--brand); }
.device-edit-panel-imei { font-family: var(--mono); color: var(--text-muted); font-size: 0.82rem; }
.device-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 14px;
}
.device-edit-grid .form-group { margin: 0; }
.device-edit-grid .form-label { font-size: 0.75rem; margin-bottom: 4px; }
.device-edit-grid .form-input { padding: 6px 10px; font-size: 0.82rem; }
.device-edit-grid .span-2 { grid-column: span 2; }
.device-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
}

.import-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.import-bar .import-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Filter Bar ──────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}
.search-input::placeholder { color: var(--text-muted); }

.select-input {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.select-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}

/* ── Forms ───────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:read-only { background: var(--bg-subtle); color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ── Modal ───────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
}
.modal-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-subtle);
}
.btn-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.3rem; cursor: pointer; line-height: 1;
  padding: 2px 6px; border-radius: var(--radius-sm);
}
.btn-close:hover { background: var(--border); color: var(--text); }

/* ── Pagination ──────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 4px;
}
.page-btn {
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand-muted); }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Toast ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 320px;
  pointer-events: all;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--green-bg); color: var(--green); border: 1px solid #BBF7D0; }
.toast-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #FECACA; }
.toast-info    { background: var(--blue-bg);  color: var(--blue);  border: 1px solid #BFDBFE; }

/* ── Login Page ──────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FFFFFF 0%, #F4F6F8 50%, #FFF0F1 100%);
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo-wrap {
  text-align: center;
  margin-bottom: 20px;
}
.login-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}
.login-company {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.login-title {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}
.login-error {
  background: var(--red-bg);
  border: 1px solid #FECACA;
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 14px;
  display: none;
}
.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.login-footer a { color: var(--text-muted); }
.login-footer a:hover { color: var(--brand); }

/* ── Misc ────────────────────────────────────── */
.text-muted { color: var(--text-muted); font-size: 0.82rem; }
.text-link  { color: var(--text-link); font-size: 0.82rem; font-weight: 600; }
.text-link:hover { color: var(--brand-hover); }
.mono       { font-family: var(--mono); font-size: 0.82rem; }

.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.refresh-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.refresh-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--gray-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.page-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -8px 0 16px;
}

/* ── 404 ─────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-page);
  padding: 20px;
  text-align: center;
}
.error-page-logo { height: 48px; width: auto; }
.error-page h1 { font-size: 1.5rem; font-weight: 800; }

/* ── Login tabs ──────────────────────────────── */
.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: none;
}
.login-tab.active {
  background: var(--brand);
  color: #fff;
}
.login-panel { display: none; }
.login-panel.active { display: block; }

/* ── Alarm popup (업체) ─────────────────────── */
.alarm-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.alarm-popup-overlay.open { display: flex; }
.alarm-popup {
  background: #fff;
  border: 3px solid var(--red);
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: alarmShake 0.4s ease;
}
@keyframes alarmShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.alarm-popup-header {
  background: var(--red-bg);
  color: var(--red);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 16px 20px;
  border-bottom: 1px solid #FECACA;
}
.alarm-popup-body { padding: 20px; font-size: 0.9rem; line-height: 1.6; }
.alarm-popup-footer { padding: 12px 20px 16px; text-align: right; }

/* ── Admin panels ────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.pending-card {
  border-left: 4px solid var(--yellow);
  background: var(--yellow-bg);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: calc(var(--nav-height) + 16px) 16px 32px; }
  .nav-inner  { padding: 0 16px; gap: 12px; }
  .nav-brand-sub { display: none; }
  .alarm-item { grid-template-columns: auto 1fr; gap: 8px; }
  .alarm-address, .alarm-imei { display: none; }
  .form-row   { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .login-card { padding: 32px 24px; }
}
