/* ============================================================
   Cahors Virtual Charging Station - Styles
   Faithful reproduction of the Cahors IRVE management interface
   ============================================================ */

/* === CSS CUSTOM PROPERTIES (LIGHT / DARK) === */
:root {
  --bg-page: #eeeeee;
  --bg-card: #fff;
  --bg-card-hover: #fafafa;
  --bg-table-header: #f5f5f5;
  --text-primary: rgba(0,0,0,.87);
  --text-secondary: rgba(0,0,0,.6);
  --text-hint: rgba(0,0,0,.38);
  --border-color: #e0e0e0;
  --border-light: #f0f0f0;
  --accent-green: #4CAF50;
  --accent-green-dark: #43A047;
  --shadow-card: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
  --shadow-light: 0 1px 3px rgba(0,0,0,.12);
  --toolbar-bg: #fff;
  --toolbar-color: rgba(0,0,0,.54);
  --toolbar-hover: #eee;
  --input-bg: #fff;
  --input-border: #ccc;
  --dialog-bg: #fff;
  --scrollbar-track: #f1f1f1;
  --scrollbar-thumb: #bbb;
  --scrollbar-thumb-hover: #999;
  --footer-bg: #f5f5f5;
}
[data-theme="dark"] {
  --bg-page: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1c2a4a;
  --bg-table-header: #1c2a4a;
  --text-primary: #e0e0e0;
  --text-secondary: rgba(255,255,255,.6);
  --text-hint: rgba(255,255,255,.35);
  --border-color: #2a2a4a;
  --border-light: #232345;
  --accent-green: #66BB6A;
  --accent-green-dark: #4CAF50;
  --shadow-card: 0 2px 4px rgba(0,0,0,.4);
  --shadow-light: 0 1px 3px rgba(0,0,0,.3);
  --toolbar-bg: #16213e;
  --toolbar-color: rgba(255,255,255,.6);
  --toolbar-hover: #1c2a4a;
  --input-bg: #1c2a4a;
  --input-border: #2a2a4a;
  --dialog-bg: #16213e;
  --scrollbar-track: #1a1a2e;
  --scrollbar-thumb: #2a2a4a;
  --scrollbar-thumb-hover: #3a3a5a;
  --footer-bg: #0f0f23;
}

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

html, body { height: auto; overflow-y: auto; }
body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  overflow-y: auto !important;
  transition: background .3s, color .3s;
}

/* === NAVIGATION DRAWER === */
.nav-drawer {
  position: fixed; top: 0; left: 0;
  width: 260px; height: 100vh;
  z-index: 100; overflow: hidden;
  transition: width .3s cubic-bezier(.4,0,.2,1);
}
.nav-drawer__image {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)),
    url('drawer_img.jpg');
  background-size: cover; background-position: center;
}
.nav-drawer__content { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.nav-logo { padding: 16px 16px 8px; display: flex; align-items: center; min-height: 64px; flex-shrink: 0; overflow: hidden; white-space: nowrap; }
.nav-logo svg { width: 200px; height: auto; flex-shrink: 0; }
.nav-divider { border: 0; height: 1px; background: rgba(255,255,255,0.12); margin: 0; flex-shrink: 0; }
.nav-list { list-style: none; padding: 8px 0 24px; flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.nav-list::-webkit-scrollbar { width: 6px; }
.nav-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.15); }
.nav-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 3px; }
.nav-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.55); }
/* Fade indicator at bottom when content overflows */
.nav-drawer__content::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
  pointer-events: none; z-index: 2;
  transition: opacity .3s; opacity: 1;
}
.nav-drawer__content.nav-scroll-end::after { opacity: 0; }
.nav-item {
  display: flex; align-items: center; padding: 0 16px; min-height: 44px;
  cursor: pointer; color: #fff; text-decoration: none; transition: background .2s, padding .3s; font-size: 14px;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: rgba(255,255,255,0.08); }
.nav-item.active { background: #4CAF50; border-radius: 4px; margin: 4px 8px; padding: 0 8px; }
.nav-item .mdi { font-size: 22px; margin-right: 14px; width: 24px; min-width: 24px; text-align: center; flex-shrink: 0; }
.nav-separator { height: 1px; background: rgba(255,255,255,0.12); margin: 4px 16px; list-style: none; }

/* Collapse toggle button */
.nav-collapse-btn {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  height: 36px; margin: 4px 12px 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7); cursor: pointer; font-size: 18px;
  transition: all .2s; overflow: hidden;
}
.nav-collapse-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-collapse-btn .mdi { transition: transform .3s; }
.nav-collapse-btn span {
  font-size: 11px; font-weight: 500; margin-left: 8px; letter-spacing: .3px;
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s, max-width .3s;
  max-width: 120px; opacity: 1;
}

/* === COLLAPSED STATE === */
.nav-drawer.collapsed { width: 60px; }
.nav-drawer.collapsed .nav-logo { padding: 16px 8px 8px; justify-content: center; }
.nav-drawer.collapsed .nav-logo svg { width: 40px; }
.nav-drawer.collapsed .nav-item { padding: 0; justify-content: center; }
.nav-drawer.collapsed .nav-item .mdi { margin-right: 0; font-size: 20px; }
.nav-drawer.collapsed .nav-item span,
.nav-drawer.collapsed .nav-item:not(.mdi) { font-size: 0; }
.nav-drawer.collapsed .nav-item.active { margin: 4px; padding: 0; }
.nav-drawer.collapsed .nav-separator { margin: 4px 8px; }
.nav-drawer.collapsed .nav-collapse-btn .mdi { transform: rotate(180deg); }
.nav-drawer.collapsed .nav-collapse-btn span { max-width: 0; opacity: 0; margin-left: 0; }
.nav-drawer.collapsed .nav-drawer__content::after { display: none; }

/* Hide text in collapsed nav items — target the text node after .mdi */
.nav-drawer.collapsed .nav-list .nav-item {
  font-size: 0; /* hide text */
}
.nav-drawer.collapsed .nav-list .nav-item .mdi {
  font-size: 20px; /* keep icon */
}

/* Tooltip on hover when collapsed */
.nav-drawer.collapsed .nav-item { position: relative; }
.nav-drawer.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  background: #333; color: #fff; padding: 4px 12px; border-radius: 4px;
  font-size: 12px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .2s; z-index: 200;
  margin-left: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.nav-drawer.collapsed .nav-item:hover::after { opacity: 1; }

/* === APP BAR === */
.app-bar {
  position: fixed; top: 0; left: 260px; right: 0; height: 64px;
  background: transparent; display: flex; align-items: center;
  justify-content: flex-end; padding: 0 16px; z-index: 50;
  transition: left .3s cubic-bezier(.4,0,.2,1), background .3s;
}
body.nav-collapsed .app-bar { left: 60px; }
.app-bar__spacer { flex: 1; }
.toolbar-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--toolbar-bg);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.14); margin-right: 12px; color: var(--toolbar-color); font-size: 20px;
}
.toolbar-btn:hover { background: var(--toolbar-hover); }
.lang-select {
  padding: 6px 12px; border: 1px solid var(--input-border); border-radius: 4px;
  font-family: inherit; font-size: 14px; background: var(--input-bg); color: var(--text-primary); cursor: pointer; margin-right: 12px;
}
.toolbar-icon-btn {
  background: none; border: none; cursor: pointer; font-size: 22px;
  color: var(--toolbar-color); padding: 8px; border-radius: 50%; transition: background .2s;
}
.toolbar-icon-btn:hover { background: rgba(128,128,128,.12); }
.toolbar-icon-btn.active { color: var(--accent-green); }
.toolbar-icon-btn.red { color: #f44336; }
/* Dark mode toggle */
.dark-mode-btn {
  background: none; border: none; cursor: pointer; font-size: 22px;
  color: var(--toolbar-color); padding: 8px; border-radius: 50%; transition: background .2s, color .2s;
  margin-right: 4px;
}
.dark-mode-btn:hover { background: rgba(128,128,128,.12); }
[data-theme="dark"] .dark-mode-btn { color: #ffc107; }

/* === MAIN CONTENT === */
.main-content {
  margin-left: 260px; padding: 80px 16px 16px; min-height: 100vh;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
  animation: pageEnter 0.3s ease-out;
}
body.nav-collapsed .main-content { margin-left: 60px; }

/* === PAGE TRANSITIONS === */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pageExit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}
.main-content.page-exit {
  animation: pageExit 0.15s ease-in forwards;
}

/* === CARDS === */
.card {
  background: var(--bg-card); border-radius: 4px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px; overflow: hidden;
  transition: background .3s, box-shadow .3s;
}
.card__title {
  background: var(--accent-green); color: #fff; padding: 16px;
  display: flex; flex-direction: column; position: relative;
}
.card__title-row { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.card__title-row .mdi { margin-right: 8px; font-size: 20px; }
.card__subtitle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 16px; }
.card__expand-btn {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  color: #fff; cursor: pointer; font-size: 20px; padding: 4px;
}

/* === NETWORK LIST === */
.network-list { list-style: none; padding: 0; }
.network-item { display: flex; align-items: center; padding: 8px 16px; min-height: 48px; border-bottom: 1px solid var(--border-color); }
.network-item:last-child { border-bottom: none; }
.network-item__icon { width: 60px; min-width: 60px; display: flex; align-items: center; gap: 8px; }
.network-item__icon .mdi { font-size: 24px; color: var(--text-secondary); }
.network-item__label { width: 80px; min-width: 80px; font-weight: 500; font-size: 13px; color: var(--text-secondary); text-transform: uppercase; }
.network-item__content { flex: 1; font-size: 13px; font-family: 'Roboto', sans-serif; line-height: 1.8; }
.network-item__content strong { font-weight: 700; text-transform: uppercase; font-size: 13px; color: var(--text-primary); margin-right: 2px; }
.network-item__content span { margin-right: 16px; }
.network-item__badge { min-width: 100px; text-align: right; }

/* === BADGES === */
.badge { display: inline-block; padding: 4px 16px; border-radius: 4px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; border: none; cursor: default; }
.badge--green { background: #4CAF50; color: #fff; }
.badge--grey { background: #424242; color: #fff; }
.badge--red { background: #f44336; color: #fff; }
.badge--blue { background: #2196F3; color: #fff; }
.badge--orange { background: #FF9800; color: #fff; }

/* === DIPSWITCH DISPLAY === */
.dipswitch-display { display: flex; gap: 2px; align-items: center; }
.dipswitch-block { width: 14px; height: 20px; border-radius: 2px; }
.dipswitch-block.on { background: #4CAF50; }
.dipswitch-block.off { background: #f44336; }

/* === MAINTENANCE TABS === */
.maint-tabs { display: flex; border-bottom: 2px solid #e0e0e0; margin-bottom: 16px; background: var(--bg-card); }
.maint-tab { padding: 12px 20px; cursor: pointer; font-size: 13px; font-weight: 500; text-transform: uppercase;
  color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s;
  display: flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.maint-tab:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.maint-tab.active { color: #4CAF50; border-bottom-color: #4CAF50; }
.maint-tab .mdi { font-size: 18px; }
.maint-section { background: var(--bg-card); border-radius: 4px; box-shadow: var(--shadow-card); padding: 24px; }
.maint-section h3 { font-size: 16px; font-weight: 500; margin-bottom: 16px; color: var(--text-primary); }
.version-block { margin-bottom: 16px; }
.version-block h4 { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.version-block .version-value { font-size: 15px; font-weight: 400; color: var(--text-primary); }

/* === BUTTONS === */
.btn-export { display: flex; justify-content: flex-end; padding: 12px 16px; }
.btn-export button, .btn-green {
  background: #4CAF50; color: #fff; border: none; padding: 8px 20px; border-radius: 4px;
  font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; cursor: pointer; transition: background .2s;
}
.btn-export button:hover, .btn-green:hover { background: #43A047; }
.btn-outline {
  background: none; border: 1px solid var(--input-border); padding: 8px 20px; border-radius: 4px;
  font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 8px auto;
  color: var(--text-primary);
}

/* === ICON COLORS === */
.text-green { color: #4CAF50 !important; }
.text-blue { color: #2196F3 !important; }
.text-grey { color: #9E9E9E !important; }
.text-red { color: #f44336 !important; }
.text-orange { color: #FF9800 !important; }

/* === PDC LEGEND === */
.pdc-legend { display: flex; justify-content: space-around; padding: 16px; flex-wrap: wrap; }
.pdc-legend__item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pdc-legend__item .mdi { font-size: 48px; }
.pdc-legend__item span { font-size: 12px; color: var(--text-secondary); }

/* === DATA TABLES === */
.data-table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  background: var(--bg-table-header); padding: 10px 12px; text-align: left; font-weight: 500;
  font-size: 12px; color: var(--text-secondary); border-bottom: 2px solid var(--border-color); white-space: nowrap;
}
.data-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table .icon-cell { white-space: nowrap; }
.data-table .icon-cell .mdi { font-size: 20px; margin-right: 2px; }
.data-table tfoot td { padding: 10px 12px; font-weight: 700; border-top: 2px solid var(--border-color); }
.data-table a { color: #1976D2; text-decoration: underline; }

/* === TABS (Configuration page) === */
.tabs { display: flex; border-bottom: 2px solid var(--border-color); background: var(--bg-card); overflow-x: auto; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 12px 20px; font-size: 12px;
  font-weight: 500; text-transform: uppercase; color: var(--text-secondary); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all .2s;
  text-decoration: none;
}
.tab:hover { color: var(--text-primary); background: rgba(128,128,128,.06); }
.tab.active { color: var(--accent-green); border-bottom-color: var(--accent-green); }
.tab .mdi { font-size: 18px; }
.tab-content { padding: 16px; }

/* === FORMS === */
.form-section { border: 1px solid var(--border-color); border-radius: 4px; padding: 16px; margin: 12px 0; background: var(--bg-card); }
.form-section h3 { font-size: 15px; font-weight: 400; margin-bottom: 12px; color: var(--text-secondary); }
.input-group { display: flex; align-items: center; margin-bottom: 8px; border-bottom: 1px solid var(--border-color); padding: 8px 0; }
.input-group label { flex: 1; font-size: 13px; color: var(--text-secondary); }
.input-group input { flex: 2; border: none; outline: none; font-size: 14px; padding: 4px; font-family: inherit; background: transparent; color: var(--text-primary); }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-hint); }
.form-row { display: flex; gap: 16px; margin-bottom: 12px; align-items: center; }
.form-row label { min-width: 120px; font-size: 13px; color: var(--text-secondary); }
.form-row input, .form-row select { flex: 1; padding: 8px; border: 1px solid var(--input-border); border-radius: 4px; font-family: inherit; background: var(--input-bg); color: var(--text-primary); }
.form-row .toggle { width: 40px; height: 20px; border-radius: 10px; background: #ccc; position: relative; cursor: pointer; }
.form-row .toggle.on { background: #4CAF50; }
.form-row .toggle::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  position: absolute; top: 2px; left: 2px; transition: left .2s;
}
.form-row .toggle.on::after { left: 22px; }

/* === DIALOG === */
.dialog-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 40px;
}
.dialog { background: var(--dialog-bg); border-radius: 8px; width: 480px; max-width: 95vw; max-height: 85vh; overflow-y: auto; color: var(--text-primary); }
.dialog__header { background: #4CAF50; color: #fff; padding: 20px; text-align: center; font-weight: 500; font-size: 16px; letter-spacing: 1px; }
.dialog__body { padding: 16px; }
.dialog__actions { display: flex; gap: 8px; padding: 16px; }
.dialog__actions .btn-green { flex: 1; text-align: center; }

/* === FAULT DETAIL POPUP === */
.fault-popup-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55); z-index: 300; display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fault-popup {
  background: var(--dialog-bg, #fff); border-radius: 12px; width: 560px; max-width: 95vw;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,.25);
  color: var(--text-primary); animation: popIn .25s ease;
}
@keyframes popIn { from { transform: scale(.92) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.fault-popup__header {
  padding: 20px 24px; border-radius: 12px 12px 0 0; display: flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 600; letter-spacing: .5px; color: #fff;
}
.fault-popup__header.sev-low { background: #1565c0; }
.fault-popup__header.sev-medium { background: #e65100; }
.fault-popup__header.sev-high { background: #d32f2f; }
.fault-popup__header.sev-critical { background: #b71c1c; }
.fault-popup__header .mdi { font-size: 24px; }
.fault-popup__header .fp-close {
  margin-left: auto; background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.fault-popup__header .fp-close:hover { background: rgba(255,255,255,.35); }
.fault-popup__body { padding: 20px 24px; }
.fault-popup__body h4 { margin: 0 0 12px; font-size: 14px; color: var(--text-secondary, #666); text-transform: uppercase; letter-spacing: 1px; }
.fault-popup__body h4:not(:first-child) { margin-top: 20px; }
.fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 8px; }
.fp-field { display: flex; flex-direction: column; gap: 2px; }
.fp-field .fp-label { font-size: 11px; color: var(--text-secondary, #999); text-transform: uppercase; letter-spacing: .5px; }
.fp-field .fp-value { font-size: 14px; font-weight: 500; }
.fp-severity-badge {
  display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #fff;
}
.fp-severity-badge.sev-low { background: #1565c0; }
.fp-severity-badge.sev-medium { background: #e65100; }
.fp-severity-badge.sev-high { background: #d32f2f; }
.fp-severity-badge.sev-critical { background: #b71c1c; }
.fp-snapshot-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fp-snapshot-table th { text-align: left; padding: 6px 8px; background: var(--table-header, #f5f5f5); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--input-border, #e0e0e0); }
.fp-snapshot-table td { padding: 6px 8px; border-bottom: 1px solid var(--input-border, #eee); }
.fp-snapshot-table .fp-delta { font-size: 11px; font-weight: 600; }
.fp-snapshot-table .fp-delta.neg { color: #d32f2f; }
.fp-snapshot-table .fp-delta.pos { color: #2e7d32; }
.fp-snapshot-table .fp-delta.zero { color: #999; }
.fp-params { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-param-chip {
  background: var(--chip-bg, #e8eaf6); color: var(--text-primary, #333);
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-family: 'Roboto Mono', monospace;
}
.fault-pill-clickable {
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.fault-pill-clickable:hover {
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(244,67,54,.4);
}

/* === SESSION TABLE === */
.session-filters { display: flex; gap: 12px; padding: 16px; align-items: center; flex-wrap: wrap; }
.session-filters label { font-size: 13px; color: var(--text-secondary); }
.session-filters input, .session-filters select { padding: 6px 10px; border: 1px solid var(--input-border); border-radius: 4px; font-family: inherit; background: var(--input-bg); color: var(--text-primary); }

/* === MAINTENANCE === */
.maint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.maint-card { background: var(--bg-card); border-radius: 4px; box-shadow: var(--shadow-light); padding: 16px; transition: background .3s; }
.maint-card h3 { font-size: 15px; font-weight: 500; margin-bottom: 12px; color: var(--accent-green); display: flex; align-items: center; gap: 8px; }
.maint-card h3 .mdi { font-size: 22px; }
.maint-card .info-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.maint-card .info-row:last-child { border-bottom: none; }

/* === FOOTER === */
.app-footer {
  margin-left: 260px; background: var(--footer-bg); padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-secondary); border-top: 1px solid var(--border-color);
  transition: margin-left .3s cubic-bezier(.4,0,.2,1), background .3s, color .3s;
}
body.nav-collapsed .app-footer { margin-left: 60px; }
.app-footer a { color: var(--accent-green); text-decoration: none; text-transform: uppercase; font-weight: 500; letter-spacing: .5px; }
.app-footer a:hover { text-decoration: underline; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* === MOBILE DRAWER OVERLAY === */
.nav-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 99; opacity: 0; transition: opacity .3s ease;
}
.nav-overlay.visible { display: block; opacity: 1; }

/* Hamburger menu button (hidden on desktop, shown on tablet/mobile) */
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--toolbar-bg, #fff); cursor: pointer; font-size: 22px;
  color: var(--toolbar-color, rgba(0,0,0,.65)); box-shadow: 0 2px 4px rgba(0,0,0,.14);
  margin-right: 8px; flex-shrink: 0;
}
.menu-toggle:hover { background: var(--toolbar-hover, #eee); }

/* ===== TABLET (max 1024px) ===== */
@media (max-width: 1024px) {
  .nav-drawer {
    position: fixed; left: -260px; z-index: 100; height: 100vh;
    width: 260px !important; transition: left .3s ease;
    transform: none !important;
  }
  .nav-drawer.collapsed { width: 260px !important; left: -260px; }
  .nav-drawer.mobile-open { left: 0 !important; }
  .main-content, .app-footer { margin-left: 0 !important; }
  .app-bar { left: 0 !important; }
  body.nav-collapsed .main-content,
  body.nav-collapsed .app-footer { margin-left: 0 !important; }
  body.nav-collapsed .app-bar { left: 0 !important; }
  /* Show hamburger */
  .menu-toggle { display: flex !important; }
  /* Reset collapsed styles on mobile — show full nav text */
  .nav-drawer.collapsed .nav-item { font-size: 14px; padding: 0 16px; justify-content: flex-start; }
  .nav-drawer.collapsed .nav-item .mdi { margin-right: 14px; font-size: 22px; }
  .nav-drawer.collapsed .nav-logo { padding: 16px 16px 8px; justify-content: flex-start; }
  .nav-drawer.collapsed .nav-logo svg { width: 200px; }
  .nav-drawer.collapsed .nav-separator { margin: 4px 16px; }
  .nav-drawer.collapsed .nav-collapse-btn { display: none; }
  .nav-collapse-btn { display: none; }
}

/* ===== MOBILE (max 768px) ===== */
@media (max-width: 768px) {
  .app-bar { padding: 0 8px; }
  .main-content { padding: 72px 8px 8px; }
  /* Tables scroll horizontally */
  .data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data-table { min-width: 600px; }
  /* Stack cards vertically */
  .card-grid, .maint-grid { grid-template-columns: 1fr !important; }
  /* Reduce font sizes */
  h1, .section-title { font-size: 1.2rem; }
  h2 { font-size: 1.1rem; }
  /* Footer stack */
  .app-footer { flex-direction: column; gap: 4px; text-align: center; padding: 12px; font-size: 12px; }
  /* Network items stack */
  .network-item { flex-wrap: wrap; }
  .network-item__content { flex-basis: 100%; margin-top: 4px; }
  /* PDC legend */
  .pdc-legend { gap: 8px; }
  /* Tabs scroll */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { padding: 10px 14px; font-size: 11px; }
}

/* ===== SMALL MOBILE (max 480px) ===== */
@media (max-width: 480px) {
  .main-content { padding: 68px 4px 4px; }
  .app-bar h1 { font-size: 0.9rem; }
  .card__title { padding: 10px; }
  .card__title-row { font-size: 15px; }
  .card__subtitle-row { font-size: 13px; }
  .lang-select { font-size: 12px; padding: 4px 8px; }
}
