/* RescueLink — Admin panel (concept design) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Sidebar */
  --sidebar-bg: #0A0000;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(230, 57, 70, 0.15);
  --sidebar-text: rgba(255, 255, 255, 0.5);
  --sidebar-text-active: #FFFFFF;
  --sidebar-width: 260px;

  /* Content */
  --bg-page: #F3F5F9;
  --bg-card: #FFFFFF;
  --bg-row-hover: #F8FAFC;
  --bg-row-stripe: #FAFBFD;

  /* Brand */
  --fire-red: #E63946;
  --fire-orange: #F77F00;
  --fire-gradient: linear-gradient(135deg, #E63946 0%, #F77F00 100%);

  /* Accents */
  --accent-blue: #3B82F6;
  --accent-teal: #0D9488;
  --accent-amber: #D97706;
  --accent-purple: #7C3AED;
  --accent-green: #16A34A;
  --accent-red: #DC2626;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-link: #3B82F6;

  /* Borders & Shadows */
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ── Login ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
}

.login-card {
  background: var(--bg-card);
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
}

.login-title {
  font-size: 1.6rem;
  color: var(--fire-red);
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-error {
  background: #FEE2E5;
  color: var(--accent-red);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.btn-full {
  width: 100%;
}

/* ═══════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(to bottom, #000000 0%, #1A0000 40%, #5C0D0D 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

/* Classic diamond crosshatch pattern on sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.045) 0px,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 12px),
    repeating-linear-gradient(-45deg,
      rgba(255, 255, 255, 0.045) 0px,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 12px);
  pointer-events: none;
}

.sidebar-brand {
  padding: 24px 22px 20px;
  position: relative;
  z-index: 1;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo:hover {
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--fire-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.sidebar-logo-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0 18px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.25);
  padding: 20px 22px 8px;
  position: relative;
  z-index: 1;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--fire-gradient);
  border-radius: 0 3px 3px 0;
}

.nav-item svg.nav-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  stroke: var(--sidebar-text);
}

.nav-item.active svg.nav-icon {
  stroke: var(--fire-red);
}

.nav-item:hover svg.nav-icon {
  stroke: rgba(255, 255, 255, 0.7);
}

.nav-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-text);
  transition: color 0.15s;
}

.nav-item.active .nav-label {
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.nav-item:hover .nav-label {
  color: rgba(255, 255, 255, 0.8);
}

.nav-badge {
  margin-left: auto;
  background: var(--fire-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  cursor: pointer;
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--fire-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
}

.user-logout {
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.user-logout svg {
  width: 18px;
  height: 18px;
  stroke: rgba(255, 255, 255, 0.45);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s;
}

.user-logout:hover svg {
  stroke: var(--fire-red);
}

/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

/* ═══════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════ */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-count {
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search */
.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.search-input {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-primary);
  width: 260px;
  outline: none;
  transition: all 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #fff;
}

/* Primary button (gradient) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--fire-gradient);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.25);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ═══════════════════════════════════════
   STATS ROW
   ═══════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 32px 8px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-icon.red {
  background: #FEE2E5;
}

.stat-icon.red svg {
  stroke: var(--fire-red);
}

.stat-icon.blue {
  background: #DBEAFE;
}

.stat-icon.blue svg {
  stroke: var(--accent-blue);
}

.stat-icon.green {
  background: #DCFCE7;
}

.stat-icon.green svg {
  stroke: var(--accent-green);
}

.stat-icon.purple {
  background: #EDE9FE;
}

.stat-icon.purple svg {
  stroke: var(--accent-purple);
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-family: 'Space Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
}

.stat-change.up {
  background: #DCFCE7;
  color: #16A34A;
}

.stat-change.neutral {
  background: #F3F4F6;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   TABLE CARD
   ═══════════════════════════════════════ */
.table-container {
  margin: 16px 32px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.table-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-page);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.table-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
}

.table-tab:hover {
  color: var(--text-primary);
}

.table-tab.active {
  background: #fff;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.table-actions-bar {
  display: flex;
  gap: 8px;
}

.btn-icon-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon-sm:hover {
  background: var(--bg-page);
  border-color: var(--text-muted);
}

.btn-icon-sm svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Table */
.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-container thead th:first-child {
  padding-left: 20px;
}

.table-container thead th:last-child {
  padding-right: 20px;
  text-align: right;
}

.table-container tbody tr {
  transition: background 0.1s;
  border-bottom: 1px solid var(--border-light);
}

.table-container tbody tr:last-child {
  border-bottom: none;
}

.table-container tbody tr:hover {
  background: var(--bg-row-hover);
}

.table-container tbody td {
  padding: 14px 16px;
  font-size: 14px;
  vertical-align: middle;
}

.table-container tbody td:first-child {
  padding-left: 20px;
}

.table-container tbody td:last-child {
  padding-right: 20px;
  text-align: right;
}

/* Building name cell */
.building-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.building-icon-cell {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.building-icon-cell svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.building-icon-cell.type-office {
  background: #DBEAFE;
}

.building-icon-cell.type-office svg {
  stroke: var(--accent-blue);
}

.building-icon-cell.type-commercial {
  background: #FEF3C7;
}

.building-icon-cell.type-commercial svg {
  stroke: var(--accent-amber);
}

.building-icon-cell.type-residential {
  background: #DCFCE7;
}

.building-icon-cell.type-residential svg {
  stroke: var(--accent-green);
}

.building-icon-cell.type-event {
  background: #EDE9FE;
}

.building-icon-cell.type-event svg {
  stroke: var(--accent-purple);
}

.building-name-cell {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.building-id-cell {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.building-id-code {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-alt, rgba(255,255,255,0.06));
  padding: 2px 8px;
  border-radius: 4px;
  user-select: all;
  cursor: pointer;
}

.address-cell {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Type badge */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.type-badge.office {
  background: #EFF6FF;
  color: #1D4ED8;
}

.type-badge.commercial {
  background: #FFF7ED;
  color: #B45309;
}

.type-badge.residential {
  background: #F0FDF4;
  color: #15803D;
}

.type-badge.event {
  background: #FAF5FF;
  color: #7C3AED;
}

.type-badge.industrial {
  background: #FFF7ED;
  color: #B45309;
}

.type-badge.default {
  background: #F3F4F6;
  color: var(--text-secondary);
}

.type-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Status */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.status-dot.draft {
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15);
}

.status-text {
  font-weight: 500;
}

.status-text.active {
  color: var(--accent-green);
}

.status-text.draft {
  color: var(--text-muted);
}

/* Action buttons */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  text-decoration: none;
}

.action-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-btn.edit svg {
  stroke: var(--accent-blue);
}

.action-btn.edit:hover {
  background: #EFF6FF;
  border-color: rgba(59, 130, 246, 0.3);
}

.action-btn.view svg {
  stroke: var(--accent-purple);
}

.action-btn.view:hover {
  background: #FAF5FF;
  border-color: rgba(124, 58, 237, 0.3);
}

.action-btn.delete svg {
  stroke: var(--accent-red);
}

.action-btn.delete:hover {
  background: #FEF2F2;
  border-color: rgba(220, 38, 38, 0.3);
}

.action-btn.link svg {
  stroke: var(--accent-teal);
}

.action-btn.link:hover {
  background: #F0FDFA;
  border-color: rgba(13, 148, 136, 0.3);
}

/* Tooltip */
.action-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--sidebar-bg);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s;
}

.action-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Table footer/pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-page);
}

.table-footer-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.page-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--sidebar-bg);
  color: #fff;
  border-color: var(--sidebar-bg);
}

.page-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ═══════════════════════════════════════
   PAGES (form, extract, clients)
   ═══════════════════════════════════════ */
.page {
  padding: 24px 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.back-link:hover {
  color: var(--fire-red);
  text-decoration: none;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-secondary);
}

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
  color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.form-section legend {
  font-size: 1rem;
  font-weight: 600;
  padding: 0 8px;
}

.form-subgroup--internal {
  background: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--accent-blue, #3B82F6);
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
  padding: 14px 16px 10px;
  margin-bottom: 12px;
}

.form-subgroup-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-blue, #3B82F6);
  margin-bottom: 10px;
}

.form-subgroup-note {
  font-size: 0.75rem;
  color: var(--text-muted, #9CA3AF);
  font-style: italic;
  margin-top: 2px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.form-row .form-group {
  flex: 1;
}

.checkbox-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  margin-top: 8px;
}

.checkbox-group-label:first-child {
  margin-top: 0;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--fire-red);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-page);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
}

.btn-secondary:hover {
  background: var(--border);
  text-decoration: none;
}

.btn-outline {
  background: none;
  border: 2px dashed var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
}

.btn-outline:hover {
  border-color: var(--fire-red);
  color: var(--fire-red);
}

/* ── Dynamic list rows ── */
.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.dynamic-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  background: var(--bg-page);
  border-radius: 6px;
}

.dynamic-row .form-group {
  flex: 1;
  min-width: 0;
}

.dynamic-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  width: 100%;
  outline: none;
}

.dynamic-row input:focus {
  border-color: var(--accent-blue);
}

.dynamic-row-vertical {
  flex-direction: column;
  gap: 8px;
}

.dynamic-row-vertical .form-group {
  flex: none;
  width: 100%;
}

.dynamic-row-vertical textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
}

.btn-remove-row {
  background: none;
  border: none;
  color: var(--accent-red);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 20px;
}

.btn-add-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: 2px dashed var(--border);
  color: var(--text-secondary);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
  font-family: 'DM Sans', sans-serif;
}

.btn-add-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-add-row:hover {
  border-color: var(--fire-red);
  color: var(--fire-red);
}

/* ── Floor plan rows ── */
.floor-plan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-page);
  border-radius: 6px;
}

.floor-plan-row .plan-label {
  flex: 1;
  font-size: 0.9rem;
}

.floor-plan-row .plan-path {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.floor-plan-upload {
  margin-top: 8px;
}

/* ── Hydrant map (admin) ── */
.form-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.hydrant-type-selector {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-place-building {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e65100;
  background: transparent;
  border: 1px solid #e65100;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-place-building:hover {
  background: rgba(230, 81, 0, 0.08);
}

.btn-place-building.is-active {
  background: #e65100;
  color: #fff;
}

.hydrant-map-admin {
  width: 100%;
  height: 350px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  z-index: 1;
}

.hydrant-pins-info {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hydrant-admin-marker {
  background: none;
  border: none;
}

.hydrant-admin-pin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d32f2f;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.hydrant-admin-pin.hydrant-pin-underground {
  background: #1565c0;
}

/* Adopted from OSM — inner ring indicator */
.hydrant-admin-pin.hydrant-pin-osm-adopted {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.building-admin-marker {
  background: none;
  border: none;
}

.building-admin-pin {
  width: 20px;
  height: 20px;
  background: #ff9800;
  border: 3px solid #e65100;
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ── AI Extraction ── */
.extract-text-section {
  margin-bottom: 16px;
}

.extract-text-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.extract-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}

.extract-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.extract-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.extract-divider::before,
.extract-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.drop-zone {
  border: 3px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.drop-zone.drag-over {
  border-color: var(--fire-red);
  background: rgba(230, 57, 70, 0.05);
}

.drop-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.drop-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.file-item-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.file-item-size {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.file-item-remove {
  background: none;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  font-size: 1.1rem;
}

/* Progress */
.progress-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.progress-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--fire-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 16px auto 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--fire-red);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% {
    width: 0%;
    margin-left: 0;
  }

  50% {
    width: 60%;
    margin-left: 20%;
  }

  100% {
    width: 0%;
    margin-left: 100%;
  }
}

/* Review / confidence colors */
.review-header {
  margin-bottom: 20px;
}

.review-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.conf-high {
  color: var(--accent-green);
  font-size: 0.85rem;
  font-weight: 500;
}

.conf-high::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #DCFCE7;
  border: 2px solid var(--accent-green);
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.conf-medium {
  color: var(--accent-amber);
  font-size: 0.85rem;
  font-weight: 500;
}

.conf-medium::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #FEF3C7;
  border: 2px solid var(--accent-amber);
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.conf-low {
  color: var(--accent-red);
  font-size: 0.85rem;
  font-weight: 500;
}

.conf-low::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #FEE2E5;
  border: 2px solid var(--accent-red);
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.field-confidence-high {
  border-color: var(--accent-green) !important;
  background: #F0FDF4;
}

.field-confidence-medium {
  border-color: var(--accent-amber) !important;
  background: #FFFBEB;
}

.field-confidence-low {
  border-color: var(--accent-red) !important;
  background: #FEF2F2;
}

.field-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* Detected floor plans */
.detected-plans {
  margin-top: 24px;
}

.detected-plans h4 {
  margin-bottom: 12px;
}

.plan-candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
}

.plan-candidate input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--fire-red);
  flex-shrink: 0;
}

.plan-candidate-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-page);
  flex-shrink: 0;
}

.plan-candidate-info {
  flex: 1;
}

.plan-candidate-page {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.plan-candidate-label input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  width: 100%;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 90%;
}

.modal-card p {
  margin-bottom: 16px;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-overlay .loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--fire-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

/* ── Toast notifications ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 3000;
  animation: slideIn 0.3s ease;
}

.toast-success {
  background: var(--accent-green);
}

.toast-error {
  background: var(--accent-red);
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Client panel ── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff;
  color: #333;
  border: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: box-shadow 0.15s, background 0.15s;
}

.btn-google:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.google-icon {
  flex-shrink: 0;
}

.sidebar-client {
  background: #16213e;
}

.buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.building-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.building-card-body {
  padding: 20px;
  flex: 1;
}

.building-card-name {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.building-card-address {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.building-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.building-card-meta .meta-tag {
  background: var(--bg-page);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.building-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-page);
}

.form-section-readonly {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.readonly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.readonly-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.readonly-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
}

.empty-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.plan-replace-btn {
  white-space: nowrap;
  cursor: pointer;
}

/* ── Client management (admin) ── */
.badge {
  display: inline-block;
  background: var(--fire-red);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badges-cell {
  max-width: 300px;
}

.badges-cell .badge {
  margin: 2px;
}

.text-muted {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.buildings-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.checklist-item:hover {
  background: #e8edf3;
}

.checklist-item input[type="checkbox"] {
  margin-top: 3px;
}

.checklist-label {
  display: flex;
  flex-direction: column;
}

.checklist-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Clients table (uses .table-container when inside that wrapper) ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-page);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  border-bottom: 1px solid var(--border-light);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-row-hover);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: 500;
  text-decoration: none;
}

.btn-edit {
  background: #DBEAFE;
  color: #1D4ED8;
}

.btn-edit:hover {
  background: #BFDBFE;
}

.btn-delete {
  background: #FEE2E5;
  color: var(--accent-red);
}

.btn-delete:hover {
  background: #FECACA;
}

.btn-view {
  background: #DCFCE7;
  color: var(--accent-green);
  text-decoration: none;
}

.btn-view:hover {
  background: #BBF7D0;
  text-decoration: none;
}

.btn-live {
  background: #FEF3C7;
  color: #92400E;
}

.btn-live:hover {
  background: #FDE68A;
}

/* LIVE modal overrides */
.evac-live-modal-card {
  max-width: 520px;
}

.evac-live-modal-header {
  margin-bottom: 20px;
}

.evac-live-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.evac-live-modal-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.building-id {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Fire system location upload row ── */

.location-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.location-file-name {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: white;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s;
}

.btn-outline-sm:hover {
  border-color: var(--fire-red);
  color: var(--fire-red);
}

.btn-link-red {
  background: none;
  border: none;
  color: var(--accent-red);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 4px;
  white-space: nowrap;
}

.btn-link-red:hover {
  text-decoration: underline;
}

/* ── Display Settings — toggle switches ── */

.visibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.toggle-switch:hover {
  border-color: var(--fire-red);
  background: #FFF5F5;
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-track {
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
}

.toggle-switch input:checked~.toggle-track {
  background: var(--fire-red);
}

.toggle-thumb {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.toggle-switch input:checked~.toggle-track .toggle-thumb {
  left: 21px;
}

.toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-switch input:checked~.toggle-track+.toggle-label {
  color: var(--fire-red);
}

/* ══════════════════════════════════════════════════════
   SYSTEMY PPOŻ — fsys-* components (row/list layout)
   ══════════════════════════════════════════════════════ */

.fsys-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Category section ── */

.fsys-section {
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  overflow: hidden;
}

.fsys-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  border-left: 3px solid transparent;
  border-image: var(--fire-gradient) 1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.fsys-section-hdr svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── List of rows ── */

.fsys-list {
  background: var(--bg-tertiary);
}

/* ── Single device row ── */

.fsys-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-primary);
  transition: background 0.15s;
}

.fsys-row:last-child {
  border-bottom: none;
}

.fsys-row:hover {
  background: var(--bg-hover);
}

/* Inactive row: dim info and upload, keep toggle at full opacity */
.fsys-row:not(.is-active) .fsys-row-info,
.fsys-row:not(.is-active) .fsys-row-upload {
  opacity: 0.38;
  transition: opacity 0.2s;
}

.fsys-row.is-active .fsys-row-info,
.fsys-row.is-active .fsys-row-upload {
  opacity: 1;
  transition: opacity 0.2s;
}

/* ── Toggle switch ── */

.fsys-toggle {
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
}

.fsys-cb {
  display: none;
}

.fsys-track {
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  background: #252D3D;
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.fsys-cb:checked+.fsys-track {
  background: var(--fire-red);
  border-color: var(--fire-red);
}

.fsys-thumb {
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.fsys-cb:checked+.fsys-track .fsys-thumb {
  transform: translateX(16px);
  background: #ffffff;
}

/* ── Device name column ── */

.fsys-row-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 190px;
  flex-shrink: 0;
}

.fsys-abbr {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
}

.fsys-row.is-active .fsys-abbr {
  color: var(--fire-red);
}

.fsys-name {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
}

/* ── Upload slot — always visible, right side ── */

.fsys-row-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 5px 10px;
  flex-shrink: 0;
}

.fsys-row-upload--standalone {
  margin-left: 0;
  margin-top: 8px;
}

.fsys-file-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fsys-file-label {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 140px;
}

.fsys-file-pick {
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}

.fsys-file-pick:hover {
  border-color: rgba(230, 57, 70, 0.6);
  color: var(--text-primary);
}

.fsys-file-clear {
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.fsys-file-clear:hover {
  color: var(--fire-red);
}

/* ── PWP special section ── */

.fsys-section--pwp .fsys-section-hdr {
  border-image: none;
  border-left-color: var(--fire-orange);
}

.fsys-pwp-body {
  background: var(--bg-tertiary);
  padding: 12px 14px;
}

/* ── OSM Hydrant markers ── */

.osm-hyd-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transition: filter 0.15s;
}

.osm-hyd-pin:hover {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.7)) brightness(1.15);
}

/* ── OSM Hydrant popup ── */

.osm-hyd-popup-wrapper .leaflet-popup-content-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  padding: 0;
  color: var(--text-primary);
}

.osm-hyd-popup-wrapper .leaflet-popup-tip-container {
  display: none;
}

.osm-hyd-popup-wrapper .leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

.osm-hyd-popup {
  min-width: 200px;
}

.osm-hyd-popup-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fire-red);
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--border-primary);
}

.osm-hyd-popup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  padding: 6px 0;
}

.osm-hyd-popup-table td {
  padding: 4px 14px;
  vertical-align: top;
}

.osm-hyd-popup-table td:first-child {
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 8px;
}

.osm-hyd-popup-table td:last-child {
  color: var(--text-primary);
}

.osm-hyd-popup-table td a {
  color: var(--fire-orange);
  text-decoration: none;
}

.osm-hyd-popup-table td a:hover {
  text-decoration: underline;
}

.osm-hyd-popup-footer {
  font-size: 10px;
  color: var(--text-muted);
  padding: 6px 14px 10px;
  border-top: 1px solid var(--border-primary);
}

/* ── OSM Refresh button (Leaflet control) ── */

.osm-refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.osm-refresh-btn:hover {
  border-color: rgba(230, 57, 70, 0.5);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.osm-refresh-btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.osm-refresh-btn.is-loading svg {
  animation: osm-spin 0.8s linear infinite;
}

@keyframes osm-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ── OSM Layer control (dark theme override) ── */

.hydrant-map-admin .leaflet-control-layers {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  color: var(--text-primary) !important;
  font-size: 12px !important;
}

.hydrant-map-admin .leaflet-control-layers-toggle {
  background-color: var(--bg-card) !important;
}

.hydrant-map-admin .leaflet-control-layers-list {
  padding: 6px 10px !important;
}

.hydrant-map-admin .leaflet-control-layers label {
  color: var(--text-primary) !important;
  cursor: pointer;
}

.hydrant-map-admin .leaflet-control-layers-separator {
  border-top-color: var(--border-primary) !important;
}

/* ── OSM info banner ── */

.osm-hydrant-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(87, 160, 211, 0.08);
  border: 1px solid rgba(87, 160, 211, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.osm-hydrant-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
  stroke: #57A0D3;
}

/* ══════════════════════════════════════════════════════
   CSS variable aliases for fire-systems panel
   (maps dark-theme vars to light-theme equivalents)
   ══════════════════════════════════════════════════════ */

:root {
  --border-primary: var(--border);
  --bg-secondary: var(--bg-page);
  --bg-tertiary: var(--bg-card);
  --bg-hover: var(--bg-row-hover);
}

/* ══════════════════════════════════════════════════════
   INFORMACJE PRZECIWPOŻAROWE — fire resistance panel
   ══════════════════════════════════════════════════════ */

.fire-resistance-panel {
  margin-top: 12px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.fres-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.fres-label svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fres-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 720px) {
  .fres-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fres-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fres-field-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.fres-input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fire-red);
  background: var(--bg-card);
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
  font-family: 'Space Mono', monospace;
}

.fres-input:focus {
  border-color: var(--fire-red);
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.1);
}

.fres-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-family: 'DM Sans', sans-serif;
}

/* ══════════════════════════════════════════════════════
   AREA MODULES — 4 map upload cards + floor plans sub-header
   ══════════════════════════════════════════════════════ */

.area-modules-section {
  margin-top: 16px;
}

.area-modules-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  border-image: var(--fire-gradient) 1;
}

.area-modules-hdr svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.area-module-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.area-module-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.area-module-title svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-module-card .fsys-row-upload--standalone {
  margin-top: 0;
}

/* Per-card color tinting: order matches FIRE_AREA_KEYS = ev_vehicles, gas_valves, assembly_points, fire_zones */
.area-modules-grid .area-module-card:nth-child(1) {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.area-modules-grid .area-module-card:nth-child(1) .area-module-title {
  color: #1D4ED8;
}

.area-modules-grid .area-module-card:nth-child(1) .area-module-title svg {
  stroke: #1D4ED8;
}

.area-modules-grid .area-module-card:nth-child(2) {
  background: #FEFCE8;
  border-color: #FDE68A;
}

.area-modules-grid .area-module-card:nth-child(2) .area-module-title {
  color: #92400E;
}

.area-modules-grid .area-module-card:nth-child(2) .area-module-title svg {
  stroke: #92400E;
}

.area-modules-grid .area-module-card:nth-child(3) {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.area-modules-grid .area-module-card:nth-child(3) .area-module-title {
  color: #166534;
}

.area-modules-grid .area-module-card:nth-child(3) .area-module-title svg {
  stroke: #166534;
}

.area-modules-grid .area-module-card:nth-child(4) {
  background: #FFF1F2;
  border-color: #FECDD3;
}

.area-modules-grid .area-module-card:nth-child(4) .area-module-title {
  color: #9F1239;
}

.area-modules-grid .area-module-card:nth-child(4) .area-module-title svg {
  stroke: #9F1239;
}

.area-modules-grid .area-module-card:nth-child(5) {
  background: #F3E8FF;
  border-color: #E9D5FF;
}

.area-modules-grid .area-module-card:nth-child(5) .area-module-title {
  color: #6B21A8;
}

.area-modules-grid .area-module-card:nth-child(5) .area-module-title svg {
  stroke: #6B21A8;
}

.area-modules-grid .area-module-card:nth-child(6) {
  background: #CCFBF1;
  border-color: #99F6E4;
}

.area-modules-grid .area-module-card:nth-child(6) .area-module-title {
  color: #0F766E;
}

.area-modules-grid .area-module-card:nth-child(6) .area-module-title svg {
  stroke: #0F766E;
}

.area-modules-grid .area-module-card:nth-child(7) {
  background: #FFEDD5;
  border-color: #FED7AA;
}

.area-modules-grid .area-module-card:nth-child(7) .area-module-title {
  color: #C2410C;
}

.area-modules-grid .area-module-card:nth-child(7) .area-module-title svg {
  stroke: #C2410C;
}

/* ══════════════════════════════════════════════════════
   NFC ENCODE BUTTON
   ══════════════════════════════════════════════════════ */

.nfc-tag-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nfc-url-display {
  display: block;
  font-size: 12px;
  font-family: 'Space Mono', monospace;
  color: var(--accent-blue);
  text-decoration: none;
  word-break: break-all;
  padding: 5px 10px;
  background: #F0F7FF;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  transition: border-color 0.15s;
}

.nfc-url-display:hover {
  border-color: var(--accent-blue);
}

.nfc-url-placeholder {
  color: var(--text-muted);
  font-family: inherit;
  font-style: italic;
  background: var(--bg-row-hover);
  border-color: var(--border);
}

.nfc-encode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-encode-nfc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn-encode-nfc svg {
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.btn-encode-nfc:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-encode-nfc:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-encode-nfc.is-loading .btn-encode-label {
  opacity: 0;
}

.btn-encode-nfc.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-encode-nfc.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin: auto;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: nfcSpin 0.7s linear infinite;
}

@keyframes nfcSpin {
  to {
    transform: rotate(360deg);
  }
}

.nfc-write-status {
  font-size: 12px;
  min-width: 0;
}

.nfc-status-pending {
  color: var(--text-secondary);
  animation: nfcPulse 1.2s ease-in-out infinite;
}

@keyframes nfcPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

.nfc-status-success {
  color: var(--success, #3FB950);
  font-weight: 600;
}

.nfc-status-error {
  color: var(--error, #E5534B);
}

/* ══════════════════════════════════════════════════════
   NFC WRITE MODAL
   ══════════════════════════════════════════════════════ */

.nfc-write-modal-card {
  background: var(--bg-card);
  padding: 36px 28px 28px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

/* ── Animation container ── */
.nfc-write-anim {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue, #3B82F6);
  transition: color 0.4s ease;
}

.nfc-write-anim[data-state="success"] {
  color: var(--success, #3FB950);
}

.nfc-write-anim[data-state="error"] {
  color: var(--error, #E5534B);
}

.nfc-write-svg {
  width: 120px;
  height: 120px;
  overflow: visible;
}

/* Rings — pulse outward when waiting */
.nfc-ring {
  transform-origin: 60px 60px;
  opacity: 0.25;
}

.nfc-write-anim[data-state="waiting"] .nfc-ring-1 {
  animation: nfcRingPulse 1.8s ease-out infinite 0s;
}

.nfc-write-anim[data-state="waiting"] .nfc-ring-2 {
  animation: nfcRingPulse 1.8s ease-out infinite 0.35s;
}

.nfc-write-anim[data-state="waiting"] .nfc-ring-3 {
  animation: nfcRingPulse 1.8s ease-out infinite 0.7s;
}

.nfc-write-anim[data-state="success"] .nfc-ring,
.nfc-write-anim[data-state="error"] .nfc-ring {
  opacity: 0.15;
  animation: none;
}

@keyframes nfcRingPulse {
  0% {
    opacity: 0.15;
    transform: scale(0.85);
  }

  40% {
    opacity: 0.6;
    transform: scale(1);
  }

  100% {
    opacity: 0.15;
    transform: scale(1.05);
  }
}

/* Dot — blink when waiting */
.nfc-dot {
  transform-origin: 60px 60px;
}

.nfc-write-anim[data-state="waiting"] .nfc-dot {
  animation: nfcDotBlink 1.8s ease-in-out infinite;
}

@keyframes nfcDotBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* Wave lines — steady */
.nfc-wave {
  opacity: 0.8;
}

/* ── Text elements ── */
.nfc-write-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  transition: color 0.3s;
}

.nfc-write-modal-msg {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  min-height: 2.5em;
  white-space: pre-line;
}

.nfc-write-modal-url {
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  color: var(--text-muted);
  word-break: break-all;
  max-width: 100%;
  padding: 4px 8px;
  background: var(--bg-row-hover);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ── Actions ── */
.nfc-write-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

/* ══════════════════════════════════════════════════════
   ZAGROŻENIA I UWAGI — expandable hazard cards
   ══════════════════════════════════════════════════════ */

/* Container for all hazard cards */
#hazards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === Collapsed state (default) === */
.hazard-card-admin {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.hazard-card-admin:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.hazard-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}

.hazard-card-header .hazard-collapse-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  color: var(--text-secondary);
}

.hazard-card-admin.expanded .hazard-collapse-icon {
  transform: rotate(90deg);
}

.hazard-card-summary {
  flex: 1;
  min-width: 0;
}

.hazard-card-summary-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hazard-card-summary-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.hazard-card-header .btn-remove-row {
  position: static;
  margin: 0;
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 1rem;
}

/* === Expanded state === */
.hazard-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 14px;
}

.hazard-card-admin.expanded .hazard-card-body {
  max-height: 800px;
  padding: 0 14px 14px;
  overflow: visible;
}

/* Title input — full width, clear */
.hazard-card-body .form-group {
  margin-bottom: 10px;
}

.hazard-card-body input[name="hazard_title"] {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
}

.hazard-card-body input[name="hazard_title"]:focus {
  border-color: var(--accent-blue);
}

/* Quill editor container */
.hazard-quill-wrapper {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.hazard-quill-wrapper .ql-toolbar {
  background: #F9FAFB;
  border: none;
  border-bottom: 1px solid var(--border);
}

.hazard-quill-wrapper .ql-container {
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
}

.hazard-quill-editor {
  min-height: 180px;
}

/* File row */
.hazard-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
}

.hazard-file-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .hazard-card-body {
    padding: 0 10px;
  }
  .hazard-card-admin.expanded .hazard-card-body {
    padding: 0 10px 12px;
  }
  .hazard-quill-editor {
    min-height: 140px;
  }
}

/* ── InfoLink: Module Switcher ── */

.module-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px 10px 10px;
}

.module-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.3);
  transition: all 0.15s;
}

/* Inactive — each button shows its module color (muted) */
.module-btn--rescuelink:not(.active) {
  color: rgba(248, 113, 113, 0.55);
}

.module-btn--infolink:not(.active) {
  color: rgba(147, 197, 253, 0.55);
}

.module-btn--evaclink:not(.active) {
  color: rgba(134, 239, 172, 0.55);
}

/* Hover — per-module tinted glow */
.module-btn--rescuelink:hover:not(.active) {
  background: rgba(230, 57, 70, 0.12);
  color: #F87171;
  border-color: rgba(230, 57, 70, 0.15);
}

.module-btn--infolink:hover:not(.active) {
  background: rgba(30, 136, 229, 0.12);
  color: #93C5FD;
  border-color: rgba(30, 136, 229, 0.15);
}

.module-btn--evaclink:hover:not(.active) {
  background: rgba(46, 125, 50, 0.12);
  color: #86EFAC;
  border-color: rgba(46, 125, 50, 0.15);
}

.module-btn svg {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-btn--rescuelink.active {
  background: linear-gradient(135deg, #C62828 0%, #EF5350 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(230, 57, 70, 0.5);
}

.module-btn--infolink.active {
  background: linear-gradient(135deg, #1565C0 0%, #1E88E5 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(30, 136, 229, 0.5);
}

/* ── InfoLink: Board form rows — card layout ── */

.board-form-row {
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.board-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -4px;
}

.board-remove-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}

.board-remove-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-remove-btn:hover {
  color: var(--accent-red);
  background: #FEF2F2;
}

.board-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.board-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.board-title-input {
  width: 100%;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 10px 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.board-title-input:focus {
  border-color: var(--accent-blue);
}

.board-title-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Toolbar */
/* Quill board editor wrapper */
.board-quill-wrap {
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.board-quill-wrap:focus-within {
  border-color: var(--accent-blue);
}

.board-quill-wrap .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
  padding: 6px 8px;
}

.board-quill-wrap .ql-container.ql-snow {
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
}

.board-quill-wrap .ql-editor {
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.65;
  color: var(--text-primary);
}

/* Toggle switch row */
.board-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.board-toggle-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.board-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: #D1D5DB;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.board-toggle-row input:checked~.board-toggle-track {
  background: #1B8BD1;
}

.board-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.board-toggle-row input:checked~.board-toggle-track .board-toggle-thumb {
  transform: translateX(16px);
}

/* Drag & drop file zone */
.board-dropzone {
  border: 2px dashed #D1D5DB;
  border-radius: 10px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.board-dropzone:hover,
.board-dropzone.drag-over {
  border-color: var(--accent-blue);
  background: #F0F7FF;
}

.board-dropzone-hint {
  font-size: 13px;
  color: #9CA3B0;
  pointer-events: none;
  text-align: center;
}

.board-dropzone.drag-over .board-dropzone-hint {
  color: var(--accent-blue);
}

/* File selected state */
.board-file-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F0F7FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  font-size: 12px;
}

.board-file-icon {
  width: 14px;
  height: 14px;
  stroke: var(--accent-blue);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.board-file-label {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-file-clear {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.board-file-clear:hover {
  color: var(--accent-red);
  background: #FEF2F2;
}

/* ── InfoLink: btn-danger ── */

.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: #FEE2E2;
  color: #DC2626;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: #FECACA;
}

.btn-danger-sm {
  padding: 4px 10px;
  border: 1px solid #FECACA;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: #FEF2F2;
  color: #DC2626;
  transition: background 0.15s;
}

.btn-danger-sm:hover {
  background: #FEE2E2;
}

/* ── InfoLink: checkbox-item in users page ── */

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}

.ilu-building-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.ilu-building-label strong {
  font-weight: 600;
}

.ilu-building-label small {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── InfoLink: compact-section (boards / contacts / NFC / display settings) ── */

.compact-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0;
}

.compact-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 44px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-row-stripe);
  gap: 8px;
}

.compact-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.compact-section-label svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-add-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-add-inline svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.btn-add-inline:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #2563EB;
}

/* Dynamic list inside compact-section — rows have their own border-top */
.cs-list {
  padding: 0;
  gap: 0;
}

.cs-list .dynamic-row {
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  margin: 0;
}

.cs-list .dynamic-row:last-child {
  border-bottom: none;
}

/* ── compact-section: display settings toggles ── */

.cs-toggles {
  display: flex;
  flex-direction: column;
}

.cs-toggle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}

.cs-toggle-item:last-child {
  border-bottom: none;
}

.cs-toggle-item:hover {
  background: var(--bg-row-hover);
}

.cs-toggle-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cs-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #CBD5E1;
  transition: background 0.2s;
  flex-shrink: 0;
}

.cs-toggle-item input:checked~.cs-toggle-track {
  background: #2563EB;
}

.cs-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.cs-toggle-item input:checked~.cs-toggle-track .cs-toggle-thumb {
  transform: translateX(16px);
}

.cs-toggle-label {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* .board-expand-toggle replaced by .board-toggle-row above */

/* ── InfoLink: board color picker ── */

.board-color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.board-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  flex-shrink: 0;
  padding: 0;
}

.board-color-dot:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.board-color-dot.active {
  border-color: #1E293B;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15);
  transform: scale(1.15);
}

/* ── Client form — module radio + badges ── */

.module-radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.module-radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.module-radio-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.module-radio-btn svg {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-radio-option input:checked~.module-radio-btn--rl {
  background: rgba(230, 57, 70, 0.08);
  border-color: rgba(230, 57, 70, 0.4);
  color: #E63946;
}

.module-radio-option input:checked~.module-radio-btn--il {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.4);
  color: #2563EB;
}

/* Module checkboxes (client form) — same visual style as radio, but multi-select */
.module-checkbox-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.module-checkbox-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.module-checkbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.module-checkbox-btn svg {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-checkbox-option input:checked~.module-checkbox-btn--rl {
  background: rgba(230, 57, 70, 0.08);
  border-color: rgba(230, 57, 70, 0.4);
  color: #E63946;
}

.module-checkbox-option input:checked~.module-checkbox-btn--il {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.4);
  color: #2563EB;
}

.module-checkbox-option input:checked~.module-checkbox-btn--el {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.4);
  color: #16a34a;
}

.module-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.module-badge--rl {
  background: #fde8ea;
  color: #c0132a;
  border: 1px solid #f5a8b0;
}

.module-badge--il {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.module-badge--el {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

/* ═══════════════════════════════════════
   SIDEBAR — InfoLink Mode
   ═══════════════════════════════════════ */

/* Logo swap */
.sidebar-logo--il {
  display: none;
}

.sidebar--infolink .sidebar-logo--rl {
  display: none;
}

.sidebar--infolink .sidebar-logo--il {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.sidebar-logo-icon--il {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
}

/* Sidebar background */
.sidebar--infolink {
  background: linear-gradient(160deg, #0a1628 0%, #0d2a6e 40%, #1e40af 70%, #2563EB 100%);
}

/* Replace grid pattern with subtle dots */
.sidebar--infolink::before {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 1;
}

/* Module switcher — active/hover colors handled by universal .module-btn--X rules above */

/* Dividers & section labels */
.sidebar--infolink .sidebar-divider {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar--infolink .sidebar-section-label {
  color: rgba(255, 255, 255, 0.45);
}

/* Nav items */
.sidebar--infolink .nav-item {
  color: rgba(255, 255, 255, 0.75);
}

.sidebar--infolink .nav-item:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.sidebar--infolink .nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(29, 78, 216, 0.30) 100%);
  border-color: rgba(59, 130, 246, 0.4);
  color: #fff;
}

.sidebar--infolink .nav-item .nav-icon {
  opacity: 0.8;
}

.sidebar--infolink .nav-item.active .nav-icon,
.sidebar--infolink .nav-item:hover .nav-icon {
  opacity: 1;
}

/* Badge */
.sidebar--infolink .nav-badge {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  color: #fff;
}

/* Footer */
.sidebar--infolink .sidebar-footer {
  background: rgba(0, 0, 0, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar--infolink .user-avatar {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.sidebar--infolink .user-name {
  color: #ffffff;
}

.sidebar--infolink .user-role {
  color: rgba(255, 255, 255, 0.6);
}

.sidebar--infolink .user-logout {
  color: rgba(255, 255, 255, 0.55);
}

.sidebar--infolink .user-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ═══════════════════════════════════════
   EvacLink Module Theme — Green
   ═══════════════════════════════════════ */

.module-btn--evaclink.active {
  background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(46, 125, 50, 0.5);
}

/* Logo swap */
.sidebar-logo--rl {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.sidebar-logo--el {
  display: none;
}

.sidebar--evaclink .sidebar-logo--rl {
  display: none;
}

.sidebar--evaclink .sidebar-logo--el {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.sidebar-logo-el-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Sidebar background */
.sidebar--evaclink {
  background: linear-gradient(160deg, #0a1f0a 0%, #0d3b1a 40%, #1a6b35 70%, #2E7D32 100%);
}

/* Grid texture */
.sidebar--evaclink::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 1;
}

/* Module switcher — active/hover colors handled by universal .module-btn--X rules above */

/* Dividers & section labels */
.sidebar--evaclink .sidebar-divider {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar--evaclink .sidebar-section-label {
  color: rgba(255, 255, 255, 0.45);
}

/* Nav items */
.sidebar--evaclink .nav-item {
  color: rgba(255, 255, 255, 0.75);
}

.sidebar--evaclink .nav-item:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.sidebar--evaclink .nav-item.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(21, 128, 61, 0.30) 100%);
  border-color: rgba(34, 197, 94, 0.4);
  color: #fff;
}

.sidebar--evaclink .nav-item .nav-icon {
  opacity: 0.8;
}

.sidebar--evaclink .nav-item.active .nav-icon,
.sidebar--evaclink .nav-item:hover .nav-icon {
  opacity: 1;
}

/* Badge */
.sidebar--evaclink .nav-badge {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  color: #fff;
}

/* Footer */
.sidebar--evaclink .sidebar-footer {
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar--evaclink .user-avatar {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}

.sidebar--evaclink .user-name {
  color: #ffffff;
}

.sidebar--evaclink .user-role {
  color: rgba(255, 255, 255, 0.6);
}

.sidebar--evaclink .user-logout {
  color: rgba(255, 255, 255, 0.55);
}

.sidebar--evaclink .user-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ═══════════════════════════════════════
   EvacLink — Form: Contact & Floor rows
   ═══════════════════════════════════════ */

/* ── Contact rows ── */

.evac-contact-row {
  align-items: center;
  /* vertical center, not flex-start */
  padding: 6px 8px;
  gap: 6px;
}

/* Reset the global margin-top: 20px (designed for label+input pairs, not bare rows) */
.evac-contact-row .btn-remove-row,
.evac-contact-row .btn-row-move,
.evac-floor-row .btn-remove-row {
  margin-top: 0;
}

.evac-icon-select {
  flex-shrink: 0;
  width: 126px;
  height: 36px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}

/* Override width: 100% from .dynamic-row input — use flex instead */
.evac-contact-input {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
}

.evac-contact-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

/* ── Up/Down move buttons ── */
.btn-row-move {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.1s, color 0.1s;
  font-family: inherit;
}

.btn-row-move:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ── Floor rows ── */

.evac-floor-row {
  align-items: center;
  padding: 6px 8px;
  gap: 8px;
}

.floor-label-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F1F5F9;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: 'Space Mono', monospace;
}

.floor-name-input {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
}

.floor-name-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.floor-file-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.floor-file-status {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.floor-file-none {
  color: var(--text-muted);
}

.floor-file-existing {
  color: var(--accent-teal);
}

.floor-file-pending {
  color: var(--accent-green);
}

/* ── EvacLink: green primary button ── */
#page-evac-dashboard .btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.28);
}

#page-evac-dashboard .btn-primary:hover {
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.45);
}

/* ══════════════════════════════════════════════════════
   SETTINGS PAGE
   ══════════════════════════════════════════════════════ */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
}

@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #E5E8EE);
  border-radius: 12px;
  overflow: hidden;
}

.settings-card--full {
  grid-column: 1 / -1;
}

.settings-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid var(--border, #E5E8EE);
  background: var(--surface, #F8F9FB);
}

.settings-card-title svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent, #C0392B);
}

.settings-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-hint {
  font-size: 13px;
  color: var(--text-muted, #6B7280);
  margin: 0;
  line-height: 1.5;
}

.settings-module-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, #C0392B);
  margin-top: 4px;
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--border, #E5E8EE);
  margin: 4px 0;
}

/* Info rows (profile / sysinfo) */
.settings-info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.settings-info-row span {
  color: var(--text-muted, #6B7280);
  min-width: 160px;
  flex-shrink: 0;
}

.settings-info-row strong {
  color: var(--text, #1A202C);
}

/* Export buttons */
.settings-export-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Object count badges */
.settings-counts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-count-badge {
  background: var(--surface, #F8F9FB);
  border: 1px solid var(--border, #E5E8EE);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.settings-count-badge strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent, #C0392B);
}

/* Template rows */
.settings-templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border, #E5E8EE);
  border-radius: 8px;
  background: var(--surface, #F8F9FB);
}

.settings-template-name {
  font-size: 14px;
  font-weight: 500;
}

.settings-template-actions {
  display: flex;
  gap: 8px;
}

.settings-empty-note {
  font-size: 13px;
  color: var(--text-muted, #6B7280);
  padding: 16px;
  text-align: center;
  background: var(--surface, #F8F9FB);
  border-radius: 8px;
  border: 1px dashed var(--border, #E5E8EE);
  margin: 0;
}

/* ══════════════════════════════════════════════════════
   CLIENT MANAGEMENT — Enhanced list + Detail page
   ══════════════════════════════════════════════════════ */

/* Stat cards color variants */
.stat-card--green .stat-value {
  color: #16a34a;
}

.stat-card--yellow .stat-value {
  color: #ca8a04;
}

.stat-card--red .stat-value {
  color: #dc2626;
}

/* Filter/sort bar */
.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-select {
  padding: 6px 12px;
  border: 1px solid var(--border, #E5E8EE);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card-bg, #fff);
  color: var(--text, #1A202C);
  cursor: pointer;
}

/* Page count badge */
.page-count {
  background: var(--surface, #F0F1F4);
  color: var(--text-muted, #6B7280);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
}

/* Client table cells */
.client-cell-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #1A202C);
}

.client-cell-email {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
}

.text-center {
  text-align: center;
}

/* Status indicator */
.client-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.client-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.client-status--active {
  color: #16a34a;
}

.client-status--active .client-status-dot {
  background: #16a34a;
}

.client-status--grace {
  color: #ca8a04;
}

.client-status--grace .client-status-dot {
  background: #ca8a04;
}

.client-status--suspended {
  color: #dc2626;
}

.client-status--suspended .client-status-dot {
  background: #dc2626;
}

/* View button (blue) */
.btn-view {
  background: var(--accent, #2563EB);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.btn-view:hover {
  opacity: 0.85;
}

/* ── Client Detail Page ── */

.client-summary-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #E5E8EE);
  border-radius: 12px;
  padding: 24px;
  margin: 0 24px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.client-summary-info {
  flex: 1;
  min-width: 200px;
}

.client-summary-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #1A202C);
  margin: 0 0 4px;
}

.client-summary-meta {
  font-size: 13px;
  color: var(--text-muted, #6B7280);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.client-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
}

.client-summary-badge--active {
  background: #dcfce7;
  color: #16a34a;
}

.client-summary-badge--grace {
  background: #fef9c3;
  color: #a16207;
}

.client-summary-badge--suspended {
  background: #fee2e2;
  color: #dc2626;
}

/* Actions bar */
.client-actions-bar {
  padding: 0 24px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-suspend {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-action-grace {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-action-reactivate {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Detail tabs */
.cd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border, #E5E8EE);
  margin: 0 24px;
  overflow-x: auto;
}

.cd-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted, #6B7280);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.cd-tab.active {
  color: var(--accent, #C0392B);
  border-bottom-color: var(--accent, #C0392B);
}

.cd-tab-content {
  padding: 24px;
}

/* Grace period date input in modal */
.grace-date-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grace-date-form input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--border, #E5E8EE);
  border-radius: 8px;
  font-size: 14px;
}

/* Invoice table */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border, #E5E8EE);
}

.invoice-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.invoice-status--paid {
  background: #dcfce7;
  color: #16a34a;
}

.invoice-status--pending {
  background: #fef9c3;
  color: #a16207;
}

.invoice-status--overdue {
  background: #fee2e2;
  color: #dc2626;
}

.invoice-status--draft {
  background: #f0f1f4;
  color: #6B7280;
}

/* ═══════════════════════════════════════
   EVAC COMMAND CENTER
   ═══════════════════════════════════════ */

.evac-cmd-toggle-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.evac-cmd-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.evac-cmd-toggle input {
  display: none;
}

.evac-cmd-toggle-track {
  width: 48px;
  height: 26px;
  background: #d1d5db;
  border-radius: 13px;
  position: relative;
  transition: background .3s;
}

.evac-cmd-toggle input:checked+.evac-cmd-toggle-track {
  background: var(--accent-red);
}

.evac-cmd-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform .3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.evac-cmd-toggle input:checked+.evac-cmd-toggle-track .evac-cmd-toggle-thumb {
  transform: translateX(22px);
}

.evac-cmd-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.evac-cmd-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

@media (max-width: 1100px) {
  .evac-cmd-layout {
    grid-template-columns: 1fr;
  }
}

.evac-cmd-main {
  min-width: 0;
}

.evac-cmd-progress-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.evac-cmd-progress-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.evac-cmd-progress-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.evac-cmd-progress-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent-green), #4ade80);
  transition: width .5s ease;
}

.evac-cmd-companies {
  display: grid;
  gap: 8px;
}

.evac-cmd-company {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .3s;
}

.evac-cmd-company .cmd-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #d1d5db;
}

.evac-cmd-company .cmd-company-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

.evac-cmd-company .cmd-company-time {
  font-size: 12px;
  color: var(--text-muted);
}

.evac-cmd-company.status-evacuated {
  border-color: var(--accent-green);
  background: #f0fdf4;
}

.evac-cmd-company.status-evacuated .cmd-status-dot {
  background: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .15);
}

.evac-cmd-company.status-alert {
  border-color: var(--accent-red);
  background: #fef2f2;
}

.evac-cmd-company.status-alert .cmd-status-dot {
  background: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.evac-cmd-company .cmd-alert-text {
  font-size: 12px;
  color: var(--accent-red);
  font-weight: 500;
}

.evac-cmd-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Log panel */
.evac-cmd-log {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 600px;
}

.evac-cmd-log-title {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.evac-cmd-log-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.evac-cmd-log-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.evac-cmd-log-entry {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.evac-cmd-log-entry:last-child {
  border-bottom: none;
}

.evac-cmd-log-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.evac-cmd-log-text {
  margin-top: 2px;
}

.evac-cmd-log-entry.type-alert .evac-cmd-log-text {
  color: var(--accent-red);
  font-weight: 600;
}

.evac-cmd-log-entry.type-evacuation .evac-cmd-log-text {
  color: var(--accent-green);
  font-weight: 600;
}

/* Export button in log title */
.evac-cmd-log-export-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.evac-cmd-log-export-btn:hover {
  background: var(--surface, #F0F1F4);
  color: var(--text-secondary);
}

/* ── Evac link config (RescueLink → EvacLink integration) ── */
.evac-link-config {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(0,204,68,0.05);
  border: 1px solid rgba(0,204,68,0.15);
  border-radius: 8px;
}
.evac-link-config .form-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}
.evac-link-config .form-input {
  width: 100%;
  margin-bottom: 4px;
}