:root {
  --navy-950: #07111f;
  --navy-900: #0b1728;
  --navy-800: #14243a;
  --navy-700: #203650;
  --red: #c51f2b;
  --red-dark: #a91622;
  --red-soft: #fbeaec;
  --green: #15966a;
  --green-soft: #e8f7f1;
  --amber: #d78b13;
  --amber-soft: #fff5df;
  --blue: #2878d0;
  --blue-soft: #eaf3fd;
  --bg: #f3f6fa;
  --surface: #fff;
  --surface-alt: #f7f9fc;
  --text: #122033;
  --muted: #69778a;
  --line: #e4eaf1;
  --shadow: 0 10px 30px rgba(11, 23, 40, .07);
  --radius: 16px;
  --sidebar-width: 274px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "IBM Plex Sans Arabic", "Inter", sans-serif; min-width: 320px; }
html[lang="en"] body { font-family: "Inter", "IBM Plex Sans Arabic", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-width); background: var(--navy-950); color: #fff; z-index: 30; display: flex; flex-direction: column; padding: 20px 16px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 5px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { width: 52px; height: 52px; object-fit: contain; object-position: center; background: transparent; border-radius: 0; filter: drop-shadow(0 3px 8px rgba(0,0,0,.22)); }
.brand-copy { display: grid; line-height: 1.35; }
.brand-copy strong { font: 800 1.2rem "Inter", sans-serif; letter-spacing: .04em; }
.brand-copy span { color: #9cafc6; font-size: .76rem; }
.system-status { margin: 18px 5px 12px; padding: 12px 14px; border-radius: 12px; display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.06); }
.system-status div { display: grid; }
.system-status small { color: #90a3bb; font-size: .7rem; }
.system-status strong { font-size: .8rem; font-weight: 600; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: #28c98a; box-shadow: 0 0 0 5px rgba(40,201,138,.12); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(40,201,138,0); } }
.nav-list { display: grid; gap: 4px; margin-top: 8px; }
.nav-item { width: 100%; border: 0; color: #aebcd0; background: transparent; display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 10px; text-align: start; font-size: .9rem; transition: .2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, var(--red), #a81521); box-shadow: 0 8px 20px rgba(197,31,43,.24); }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-item span:nth-child(2) { flex: 1; }
.nav-item b { min-width: 22px; height: 21px; border-radius: 7px; display: grid; place-items: center; color: #b7c5d7; background: rgba(255,255,255,.08); font-size: .7rem; }
.nav-item.active b { background: rgba(255,255,255,.18); color: #fff; }
.nav-item b.warning-badge { color: #ffd88c; background: rgba(255,190,61,.13); }
.nav-item b.danger-badge { color: #ff9aa2; background: rgba(239,68,68,.13); }
.sidebar-footer { margin-top: auto; padding-top: 16px; }
.user-card { border-top: 1px solid rgba(255,255,255,.1); margin-top: 10px; padding: 18px 4px 2px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; background: #fff; color: var(--red); border-radius: 50%; font: 700 .8rem "Inter", sans-serif; }
.user-card > div:nth-child(2) { display: grid; flex: 1; }
.user-card strong { font-size: .8rem; }
.user-card span { font-size: .68rem; color: #8fa1b8; }
.main-content { margin-inline-start: var(--sidebar-width); min-height: 100vh; }
.topbar { height: 88px; padding: 0 34px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.topbar-start { display: flex; gap: 12px; align-items: center; }
.topbar h1 { margin: 0; font-size: 1.45rem; line-height: 1.35; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-time { display: flex; gap: 9px; align-items: center; padding-inline-end: 16px; margin-inline-end: 4px; border-inline-end: 1px solid var(--line); }
.live-time svg { width: 19px; color: var(--red); }
.live-time div { display: grid; }
.live-time small { color: var(--muted); font-size: .7rem; }
.live-time strong { direction: ltr; font: 600 .8rem "Inter", sans-serif; }
.icon-btn, .language-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); height: 40px; min-width: 40px; border-radius: 10px; display: inline-grid; place-items: center; position: relative; }
.language-btn { grid-auto-flow: column; gap: 7px; padding: 0 12px; font: 600 .78rem "Inter", sans-serif; }
.icon-btn svg, .language-btn svg { width: 18px; height: 18px; }
.icon-btn:hover, .language-btn:hover { background: var(--surface-alt); border-color: #ced7e2; }
.icon-btn.subtle { color: #8fa1b8; background: transparent; border: 0; min-width: 28px; }
.notification-btn > span { position: absolute; width: 17px; height: 17px; background: var(--red); color: #fff; font: 700 .62rem "Inter"; border-radius: 50%; display: grid; place-items: center; top: -5px; inset-inline-end: -4px; border: 2px solid #fff; }
.mobile-menu { display: none; }
.toolbar { padding: 22px 34px 0; display: flex; align-items: center; gap: 12px; }
.select-wrap { height: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 7px; padding-inline: 11px 7px; }
.select-wrap svg { width: 18px; color: var(--muted); }
select { color: var(--text); border: 0; outline: 0; background-color: transparent; padding: 0 6px; min-width: 145px; }
.period-tabs { display: flex; align-items: center; background: #e8edf3; border-radius: 10px; padding: 3px; }
.period-tabs button { border: 0; background: transparent; color: var(--muted); padding: 7px 13px; border-radius: 8px; font-size: .78rem; }
.period-tabs button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.primary-btn, .secondary-btn, .text-btn { min-height: 42px; border-radius: 10px; padding: 0 16px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; font-weight: 600; font-size: .84rem; }
.primary-btn { margin-inline-start: auto; border: 1px solid var(--red); background: var(--red); color: #fff; box-shadow: 0 6px 14px rgba(197,31,43,.16); }
.primary-btn:hover { background: var(--red-dark); }
.primary-btn svg { width: 17px; }
.secondary-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.text-btn { border: 0; background: transparent; color: var(--red); }
.text-btn.full { width: 100%; }
.page-content { padding: 22px 34px 40px; }
.fade-in { animation: fadeIn .28s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: var(--card-color, var(--blue)); opacity: .05; inset-inline-end: -28px; top: -24px; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; color: var(--card-color, var(--blue)); background: var(--card-soft, var(--blue-soft)); display: grid; place-items: center; }
.kpi-icon svg { width: 19px; }
.trend { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 20px; color: var(--green); background: var(--green-soft); font: 600 .67rem "Inter"; direction: ltr; }
.trend.down { color: var(--red); background: var(--red-soft); }
.kpi-card > small { color: var(--muted); font-size: .76rem; }
.kpi-value { margin: 5px 0 2px; display: flex; align-items: baseline; gap: 5px; direction: ltr; justify-content: flex-end; unicode-bidi: plaintext; }
html[dir="ltr"] .kpi-value { justify-content: flex-start; }
.kpi-value strong { font: 700 1.75rem "Inter"; color: var(--text); }
.kpi-value span { color: var(--muted); font-size: .74rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 18px; margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { padding: 18px 20px 14px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.card-head h2 { font-size: 1rem; margin: 0; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: .73rem; }
.legend { display: flex; align-items: center; gap: 13px; font-size: .67rem; color: var(--muted); }
.legend span::before { content: ""; width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-inline-end: 5px; background: var(--legend); }
.chart-wrap { height: 260px; padding: 0 16px 16px; }
.chart-wrap.tall { height: 310px; }
canvas { width: 100%; height: 100%; display: block; }
.station-list { padding: 2px 18px 16px; }
.station-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.station-row:last-child { border-bottom: 0; }
.station-symbol { width: 40px; height: 40px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.station-symbol svg { width: 19px; }
.station-row h3 { margin: 0 0 2px; font-size: .82rem; }
.station-row p { margin: 0; color: var(--muted); font-size: .68rem; }
.station-metric { text-align: end; }
.station-metric strong { font: 700 .92rem "Inter"; display: block; }
.station-metric span { font-size: .65rem; color: var(--green); }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; }
.table-wrap { width: 100%; overflow-x: auto; padding: 0 20px 14px; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th { color: var(--muted); text-align: start; font-size: .68rem; font-weight: 500; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 13px 10px; font-size: .77rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.asset-cell { display: flex; gap: 9px; align-items: center; }
.asset-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-alt); color: var(--muted); display: grid; place-items: center; }
.asset-icon svg { width: 17px; }
.asset-cell strong { display: block; font: 600 .76rem "Inter"; }
.asset-cell span { display: block; font-size: .65rem; color: var(--muted); }
.status { display: inline-flex; gap: 5px; align-items: center; border-radius: 20px; padding: 4px 8px; font-size: .65rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status.running, .status.completed { color: var(--green); background: var(--green-soft); }
.status.standby, .status.scheduled { color: var(--blue); background: var(--blue-soft); }
.status.maintenance, .status.pending { color: var(--amber); background: var(--amber-soft); }
.status.stopped, .status.overdue { color: var(--red); background: var(--red-soft); }
.progress { min-width: 92px; }
.progress-line { height: 6px; background: var(--line); border-radius: 10px; overflow: hidden; }
.progress-line i { display: block; height: 100%; width: var(--progress); background: var(--green); border-radius: inherit; }
.progress small { color: var(--muted); font: 600 .64rem "Inter"; }
.alerts-list { padding: 0 18px 16px; }
.alert-item { display: flex; gap: 11px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border: 0; }
.alert-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.alert-item.critical .alert-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.alert-item.warning .alert-dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.alert-item > div { flex: 1; }
.alert-item strong { display: block; font-size: .76rem; }
.alert-item p { margin: 3px 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.alert-item time { font-size: .63rem; color: #9aa7b7; }
.page-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.station-card { padding: 20px; }
.station-card-top { display: flex; justify-content: space-between; gap: 10px; }
.station-card h2 { margin: 12px 0 2px; font-size: 1rem; }
.station-card > p { margin: 0 0 16px; color: var(--muted); font-size: .72rem; }
.mini-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mini-kpi { border-radius: 10px; background: var(--surface-alt); padding: 11px; }
.mini-kpi span { display: block; color: var(--muted); font-size: .64rem; }
.mini-kpi strong { font: 700 .9rem "Inter"; }
.station-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 13px; }
.station-footer span { color: var(--muted); font-size: .67rem; }
.station-footer button { border: 0; background: none; color: var(--red); font-size: .72rem; font-weight: 600; }
.filter-row { display: flex; gap: 10px; margin-bottom: 16px; }
.search-box { min-width: 260px; background: var(--surface); border: 1px solid var(--line); height: 42px; border-radius: 10px; display: flex; gap: 8px; align-items: center; padding: 0 12px; }
.search-box svg { width: 18px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.page-card { padding: 20px; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.report-card { padding: 18px; display: flex; gap: 13px; align-items: start; }
.report-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--red); background: var(--red-soft); }
.report-icon svg { width: 20px; }
.report-card h3 { margin: 0 0 3px; font-size: .85rem; }
.report-card p { margin: 0 0 11px; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.report-card button { border: 0; background: transparent; padding: 0; color: var(--red); font-size: .7rem; font-weight: 600; }
.settings-grid { display: grid; gap: 12px; }
.users-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.summary-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 15px; display: flex; align-items: center; gap: 11px; box-shadow: var(--shadow); }
.summary-tile > span { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; color: var(--red); background: var(--red-soft); }
.summary-tile svg { width: 18px; }
.summary-tile div { display: grid; }
.summary-tile strong { font: 700 1.2rem "Inter"; }
.summary-tile small { color: var(--muted); font-size: .68rem; }
.users-toolbar { display: flex; gap: 10px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.users-toolbar .primary-btn { margin-inline-start: auto; }
.user-identity { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font: 700 .72rem "Inter"; }
.user-identity strong { display: block; font-size: .76rem; }
.user-identity span { display: block; color: var(--muted); font-size: .65rem; }
.role-pill { display: inline-flex; padding: 4px 8px; border-radius: 7px; background: var(--surface-alt); color: var(--text); font-size: .66rem; font-weight: 600; }
.row-actions { display: flex; gap: 5px; }
.row-action { width: 31px; height: 31px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.row-action:hover { color: var(--red); border-color: var(--red); }
.row-action.danger:hover { color: #fff; background: var(--red); }
.row-action svg { width: 15px; }
.permissions-box { border: 1px solid var(--line); border-radius: 11px; padding: 13px; margin: 2px 0 14px; }
.permissions-box legend { padding: 0 7px; color: var(--text); font-size: .76rem; font-weight: 600; }
.permissions-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.permission-check, .inline-check { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: .7rem; }
.permission-check { padding: 8px 9px; border-radius: 8px; background: var(--surface-alt); }
.permission-check input, .inline-check input { width: 16px; height: 16px; accent-color: var(--red); }
.password-field small { color: var(--muted); font-size: .62rem; }
.compact-modal { width: min(460px,100%); }
.account-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.profile-card { padding: 24px; text-align: center; }
.profile-card .user-avatar { width: 76px; height: 76px; font-size: 1.2rem; margin: 0 auto 12px; }
.profile-card h2 { margin: 0; font-size: 1.05rem; }
.profile-card p { margin: 3px 0 15px; color: var(--muted); font-size: .72rem; }
.profile-meta { border-top: 1px solid var(--line); padding-top: 14px; text-align: start; display: grid; gap: 10px; }
.profile-meta span { color: var(--muted); font-size: .64rem; display: block; }
.profile-meta strong { font-size: .75rem; }
.account-form { padding: 22px; }
.account-form h2 { margin: 0 0 3px; font-size: 1rem; }
.account-form > p { margin: 0 0 16px; color: var(--muted); font-size: .7rem; }
.security-note { display: flex; gap: 9px; padding: 11px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); margin-bottom: 14px; font-size: .68rem; line-height: 1.5; }
.security-note svg { width: 18px; flex: 0 0 auto; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { font-size: .82rem; display: block; }
.setting-row span { color: var(--muted); font-size: .68rem; }
.switch { width: 42px; height: 24px; background: #cfd7e1; border-radius: 30px; border: 0; padding: 3px; }
.switch::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }
html[dir="rtl"] .switch.on::after { transform: translateX(-18px); }
.notification-panel { position: fixed; z-index: 60; inset-block: 0; inset-inline-end: 0; width: min(390px, 94vw); background: var(--surface); box-shadow: -18px 0 45px rgba(0,0,0,.15); transform: translateX(105%); transition: transform .28s ease; padding: 22px; overflow-y: auto; }
html[dir="rtl"] .notification-panel { transform: translateX(-105%); }
.notification-panel.open { transform: translateX(0) !important; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel-head p { margin: 3px 0 0; font-size: .7rem; color: var(--muted); }
.notification-panel .alert-item { padding: 16px 2px; }
.modal-backdrop { display: none; position: fixed; z-index: 70; inset: 0; background: rgba(4,13,25,.55); align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-backdrop.open { display: flex; }
.modal { width: min(620px,100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.25); padding: 22px; animation: modalIn .25s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.97); } }
form { padding-top: 18px; }
form label { display: grid; gap: 6px; font-size: .74rem; color: var(--muted); margin-bottom: 13px; }
form input, form select, form textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--surface); color: var(--text); resize: vertical; }
form input:focus, form select:focus, form textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(197,31,43,.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.modal-actions { display: flex; justify-content: end; gap: 9px; padding-top: 4px; }
.modal-actions .primary-btn { margin: 0; }
.toast { position: fixed; z-index: 90; bottom: 24px; inset-inline-end: 24px; display: flex; align-items: center; gap: 9px; color: #fff; background: #14243a; border-radius: 11px; padding: 12px 16px; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(20px); pointer-events: none; transition: .25s; font-size: .8rem; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast svg { width: 18px; color: #35d399; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state svg { width: 40px; color: #b4c0ce; }
.empty-state h3 { color: var(--text); margin: 10px 0 3px; }
.sidebar-overlay { display: none; }

body.dark { --bg: #08111f; --surface: #101d2e; --surface-alt: #142338; --text: #eef4fb; --muted: #93a4b8; --line: #22344b; --shadow: 0 10px 30px rgba(0,0,0,.16); --red-soft: rgba(197,31,43,.16); --green-soft: rgba(21,150,106,.16); --amber-soft: rgba(215,139,19,.16); --blue-soft: rgba(40,120,208,.17); }
body.dark .topbar { background: rgba(16,29,46,.94); }
body.dark .period-tabs { background: #081524; }
body.dark .brand-logo { filter: drop-shadow(0 3px 8px rgba(0,0,0,.3)); }
body.dark .notification-btn > span { border-color: var(--surface); }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .content-grid, .lower-grid { grid-template-columns: 1fr; }
  .page-grid, .report-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .users-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 850px) {
  .sidebar { transform: translateX(105%); transition: transform .25s ease; }
  html[dir="ltr"] .sidebar { transform: translateX(-105%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(4,13,25,.5); opacity: 0; pointer-events: none; z-index: 25; transition: .25s; }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .main-content { margin-inline-start: 0; }
  .mobile-menu { display: inline-grid; }
  .live-time { display: none; }
  .toolbar { flex-wrap: wrap; padding-inline: 20px; }
  .page-content { padding-inline: 20px; }
  .topbar { padding-inline: 20px; }
  .primary-btn { margin-inline-start: 0; }
}
@media (max-width: 600px) {
  .topbar { height: 76px; }
  .topbar h1 { font-size: 1.12rem; }
  .topbar p { display: none; }
  .topbar-actions { gap: 6px; }
  #themeToggle { display: none; }
  .language-btn { min-width: 40px; padding: 0 9px; }
  .language-btn svg { display: none; }
  .toolbar { padding-top: 14px; }
  .select-wrap { flex: 1; }
  .select-wrap select { width: 100%; }
  .period-tabs { width: 100%; order: 3; }
  .period-tabs button { flex: 1; padding-inline: 4px; }
  .toolbar .primary-btn span:last-child { display: none; }
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
  .page-grid, .report-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .permissions-grid { grid-template-columns: 1fr 1fr; }
  .users-summary { grid-template-columns: 1fr 1fr; }
  .users-toolbar { flex-wrap: wrap; }
  .users-toolbar .search-box { width: 100%; }
  .account-layout { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; }
  .search-box { min-width: 0; }
  .card-head { flex-direction: column; }
}

@media print {
  .sidebar, .topbar-actions, .toolbar, .mobile-menu { display: none !important; }
  .main-content { margin: 0; }
  .topbar { position: static; padding: 20px; }
  .page-content { padding: 20px; }
  .card, .kpi-card { box-shadow: none; break-inside: avoid; }
}
