:root {
  color-scheme: light;
  --green: #087a5a;
  --green-dark: #075e48;
  --mint: #e8f8f2;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --ink: #18211e;
  --muted: #68736f;
  --line: #dfe6e3;
  --blue: #2479d8;
  --blue-soft: #eaf4ff;
  --pink: #dc315f;
  --pink-soft: #ffedf2;
  --orange: #d85d19;
  --orange-soft: #fff0e6;
  --purple: #7627d8;
  --purple-soft: #f2e9ff;
  --coral: #dd4b34;
  --coral-soft: #fff0ec;
  --shadow: 0 12px 32px rgba(21, 48, 39, .08);
  font-family: "Tajawal", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.55; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
input { min-width: 0; }
svg { width: 21px; height: 21px; stroke-width: 1.9; }
.is-hidden { display: none !important; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 43%) 1fr; background: var(--surface); }
.login-brand { position: relative; overflow: hidden; min-height: 100vh; padding: 72px clamp(44px, 7vw, 110px); color: #fff; background: #123f34; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.login-brand::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(90deg, transparent 49%, rgba(255,255,255,.13) 50%, transparent 51%), linear-gradient(transparent 49%, rgba(255,255,255,.13) 50%, transparent 51%); background-size: 76px 76px; }
.login-brand::after { content: ""; position: absolute; width: 440px; height: 440px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; left: -160px; bottom: -170px; box-shadow: 0 0 0 62px rgba(255,255,255,.03), 0 0 0 124px rgba(255,255,255,.03); }
.login-brand > * { position: relative; z-index: 1; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 8px; flex: 0 0 auto; }
.brand-mark--large { width: 72px; height: 72px; background: #05a276; box-shadow: 0 10px 25px rgba(0,0,0,.16); }
.brand-mark--large svg { width: 38px; height: 38px; }
.brand-kicker { margin: 30px 0 8px; color: #9ce2ce; font-weight: 700; }
.login-brand h1 { direction: ltr; text-align: left; margin: 0; font-size: clamp(2.8rem, 5vw, 5.3rem); line-height: .98; letter-spacing: 0; }
.login-brand > p:last-of-type { font-size: 1.15rem; color: #d3e6e0; }
.brand-points { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.brand-points span { display: flex; align-items: center; gap: 7px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 7px; color: #e9f5f1; background: rgba(255,255,255,.05); }
.brand-points svg { width: 18px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px; background: #f9fbfa; }
.login-card { width: min(100%, 430px); padding: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.mobile-login-brand { display: none; }
.login-card header { margin-bottom: 26px; }
.login-card h2 { margin: 0; font-size: 1.65rem; }
.login-card header p { margin: 6px 0 0; color: var(--muted); }
.connection-badge { display: inline-flex; margin-top: 12px; padding: 4px 9px; border-radius: 6px; color: #7b5722; background: #fff4d8; font-size: .8rem; font-weight: 700; }
.connection-badge.is-online { color: var(--green-dark); background: var(--mint); }
.login-card .btn + .btn { margin-top: 10px; }
.secure-note { display: flex; gap: 7px; align-items: center; color: var(--muted); margin: 22px 0 0; font-size: .9rem; }
.secure-note svg { width: 18px; color: var(--green); }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span:first-child, .date-field > span { font-size: .9rem; color: #47524e; font-weight: 700; }
input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,122,90,.12); }
.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 44px; }
.input-wrap svg { position: absolute; z-index: 1; top: 14px; right: 13px; width: 19px; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 9px; margin: 2px 0 20px; }
.check-row input { width: 19px; height: 19px; accent-color: var(--green); }

.btn { min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; font-weight: 700; transition: transform .15s, background .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn--primary { color: #fff; background: var(--green); }
.btn--primary:hover { background: var(--green-dark); }
.btn--outline { color: var(--green-dark); border-color: #a9d8c9; background: #f4fffb; }
.btn--outline:hover { background: var(--mint); }
.btn--ghost { color: var(--ink); background: #f0f3f2; }
.btn--wide { width: 100%; }
.text-button { border: 0; padding: 8px; color: var(--green-dark); background: transparent; font-weight: 700; }
.login-card > .text-button { display: block; margin: 8px auto -8px; }
.icon-btn { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: #45514d; background: #fff; }
.icon-btn:hover { color: var(--green); border-color: #a9d8c9; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 18px; color: #e8f5f1; background: #103e33; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { color: #fff; font-size: 1.05rem; }
.sidebar-brand small { color: #9ebdb4; font-size: .8rem; }
.side-nav { display: grid; gap: 5px; padding-top: 22px; }
.nav-item { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; border-radius: 7px; color: #b9cec8; background: transparent; font-weight: 700; text-align: right; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.is-active { color: #fff; background: var(--green); }
.nav-item svg { width: 20px; }
.sidebar-footer { margin-top: auto; padding: 16px 4px 0; display: flex; align-items: center; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer .icon-btn { color: #b9cec8; border-color: rgba(255,255,255,.1); background: transparent; }
.user-chip { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip small { color: #9ebdb4; font-size: .78rem; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--green-dark); background: #dff4ec; font-weight: 800; }
.avatar--large { width: 42px; height: 42px; }

.workspace { min-width: 0; }
.topbar { height: 88px; padding: 0 clamp(22px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); }
.topbar h1 { margin: 1px 0 0; font-size: 1.35rem; }
.eyebrow { margin: 0; color: var(--muted); font-size: .82rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.content-frame { width: min(100%, 1260px); margin: 0 auto; padding: 30px clamp(20px, 4vw, 48px) 48px; }
.page { display: none; }
.page.is-active { display: block; animation: page-in .2s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.page h2, .page h3, .page p { margin-top: 0; }
.welcome-row, .page-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.welcome-row h2, .page-toolbar h2 { margin-bottom: 3px; font-size: 1.55rem; }
.welcome-row p, .page-toolbar p { margin-bottom: 0; color: var(--muted); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.closing-status { margin-bottom: 14px; padding: 15px 18px; display: flex; align-items: center; gap: 13px; border: 1px solid #ecd79b; border-radius: 8px; background: #fff9e8; }
.closing-status__icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; color: #8a6515; background: #fff0bf; }
.closing-status strong { display: block; color: #684b0d; }
.closing-status p { margin: 1px 0 0; color: #796638; font-size: .88rem; }
.closing-status.is-closed { border-color: #bfe5d7; background: #effaf6; }
.closing-status.is-closed .closing-status__icon { color: var(--green-dark); background: #d9f4ea; }
.closing-status.is-closed strong { color: var(--green-dark); }
.closing-status.is-closed p { color: #557269; }
.metric-card { min-width: 0; padding: 18px; border: 1px solid transparent; border-radius: 8px; background: #fff; }
.metric-card--primary { grid-column: span 2; min-height: 150px; }
.metric-card--primary strong { font-size: 1.9rem; }
.metric-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.metric-card h3 { margin: 0; font-size: .95rem; }
.metric-card .metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.65); }
.metric-card strong { display: block; margin: 16px 0 2px; font-size: 1.55rem; direction: ltr; text-align: right; }
.metric-card strong small { font-size: .82rem; }
.metric-card p { margin: 0; font-size: .82rem; color: var(--muted); }
.metric-card.tone-green { background: var(--mint); border-color: #c8ecdf; color: var(--green-dark); }
.metric-card.tone-pink { background: var(--pink-soft); border-color: #f4ced9; color: var(--pink); }
.metric-card.tone-blue { background: var(--blue-soft); border-color: #cfe4fa; color: var(--blue); }
.metric-card.tone-orange { background: var(--orange-soft); border-color: #f3d8c6; color: var(--orange); }
.metric-card.tone-coral { background: var(--coral-soft); border-color: #f1d4ce; color: var(--coral); }
.metric-card.tone-purple { background: var(--purple-soft); border-color: #decafb; color: var(--purple); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #12a474; }
.dashboard-lower { margin-top: 14px; }
.surface { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.recent-days, .quick-summary, .chart-surface, .report-breakdown, .settings-form, .employees-panel { padding: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading h3 { margin: 0; font-size: 1.05rem; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: .83rem; }
.compact-list { display: grid; }
.compact-row { display: grid; grid-template-columns: 1fr repeat(3, minmax(70px, .65fr)); align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.compact-row:first-child { border-top: 0; }
.compact-row strong { font-size: .9rem; }
.compact-row span { color: var(--muted); font-size: .85rem; }
.compact-row .positive { color: var(--green); font-weight: 800; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 30px; min-height: 175px; }
.donut { width: 132px; height: 132px; display: grid; place-content: center; border-radius: 50%; position: relative; background: conic-gradient(var(--green) 0 56%, var(--pink) 56% 76%, var(--orange) 76% 100%); }
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: #fff; }
.donut span, .donut small { position: relative; z-index: 1; text-align: center; direction: ltr; }
.donut span { font-size: 1.2rem; font-weight: 800; }
.donut small { color: var(--muted); }
.legend { display: grid; gap: 9px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 7px; font-size: .84rem; }
.legend-row i { width: 9px; height: 9px; border-radius: 2px; }
.legend-row strong { direction: ltr; }

.date-field { min-width: 190px; display: grid; gap: 6px; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; }
.entry-column { display: grid; gap: 16px; }
.data-section { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.data-section > header { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.data-section > header h3 { margin: 0; font-size: 1.02rem; }
.data-section > header p { margin: 1px 0 0; color: var(--muted); font-size: .82rem; }
.section-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; }
.tone-green .section-icon, .section-icon.tone-green { color: var(--green); background: var(--mint); }
.tone-pink .section-icon { color: var(--pink); background: var(--pink-soft); }
.tone-blue .section-icon { color: var(--blue); background: var(--blue-soft); }
.tone-orange .section-icon { color: var(--orange); background: var(--orange-soft); }
.tone-coral .section-icon { color: var(--coral); background: var(--coral-soft); }
.tone-purple .section-icon { color: var(--purple); background: var(--purple-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .field { margin: 0; }
.formula-result { margin-top: 14px; padding: 14px; border: 1px solid #b9dfd3; border-radius: 7px; background: #f0faf6; }
.formula-result span, .formula-result small { display: block; }
.formula-result span { color: var(--muted); font-size: .82rem; }
.formula-result strong { display: block; margin: 3px 0; color: var(--green-dark); font-size: 1.5rem; direction: ltr; text-align: right; }
.formula-result small { color: var(--muted); line-height: 1.5; }
.calculate-btn { width: 100%; margin-top: 10px; }
.cigarette-price-grid { display: grid; gap: 8px; }
.cigarette-price-row { min-height: 54px; display: grid; grid-template-columns: 76px minmax(90px, 1fr) minmax(105px, auto); align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fffafb; }
.cigarette-price-row > strong { direction: ltr; font-size: 1rem; }
.cigarette-price-row label { display: grid; grid-template-columns: auto minmax(54px, 88px); align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; }
.cigarette-price-row input { min-height: 38px; padding: 6px 8px; text-align: center; }
.cigarette-price-row output { direction: ltr; color: var(--pink); font-weight: 800; }
.cigarette-totals { margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cigarette-totals div { padding: 12px; border-radius: 7px; background: var(--pink-soft); }
.cigarette-totals span, .cigarette-totals strong { display: block; }
.cigarette-totals span { color: var(--muted); font-size: .8rem; }
.cigarette-totals strong { margin-top: 3px; direction: ltr; }
.cigarette-cash-fields { margin-top: 12px; }
.cigarette-calculator .formula-result { border-color: #f2c8d2; background: #fff5f7; }
.cigarette-calculator .formula-result strong { color: var(--pink); }
.editable-list, .employee-checks { display: grid; gap: 8px; margin-bottom: 12px; }
.editable-row, .employee-check { min-height: 46px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fafcfb; }
.editable-row strong { font-size: .9rem; }
.editable-row span { direction: ltr; font-weight: 700; }
.editable-row .icon-btn { width: 34px; height: 34px; color: #c63838; border: 0; background: transparent; }
.wage-row { min-height: 66px; display: grid; grid-template-columns: minmax(110px, 1fr) minmax(118px, .8fr) minmax(90px, auto); align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fafcfb; }
.wage-person strong, .wage-person small { display: block; }
.wage-person small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.wage-row label { display: grid; grid-template-columns: auto minmax(62px, 88px); align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.wage-row input { min-height: 40px; padding: 6px 8px; text-align: center; }
.wage-row output { direction: ltr; color: var(--coral); font-weight: 800; }
.employee-check { grid-template-columns: auto 1fr auto; }
.employee-check input { width: 19px; height: 19px; accent-color: var(--green); }
.employee-check span:last-child { direction: ltr; color: var(--muted); }
.add-row { width: 100%; }
.save-bar { position: sticky; z-index: 4; bottom: 16px; margin-top: 18px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #addacc; border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 14px 34px rgba(15,55,43,.14); backdrop-filter: blur(10px); }
.save-bar span { display: block; color: var(--muted); font-size: .82rem; }
.save-bar strong { font-size: 1.35rem; color: var(--green-dark); direction: ltr; }

.table-surface { overflow: hidden; }
.table-tools { padding: 16px; display: flex; gap: 10px; border-bottom: 1px solid var(--line); }
.search-box { width: min(100%, 440px); position: relative; }
.search-box input { padding-right: 43px; }
.search-box svg { position: absolute; top: 14px; right: 13px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; text-align: right; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: #4f5c57; background: #f7f9f8; font-size: .84rem; }
td { font-size: .9rem; }
td.number { direction: ltr; text-align: right; font-weight: 700; }
.dual-amount { min-width: 112px; }
.dual-amount span, .dual-amount small { display: block; direction: ltr; text-align: right; }
.dual-amount span { font-weight: 800; }
.dual-amount small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.history-row { cursor: pointer; }
.history-row:hover td, .history-row:focus td { background: #f3faf7; }
.history-row:focus { outline: 2px solid var(--green); outline-offset: -2px; }
.history-details td { padding: 0; white-space: normal; background: #f7faf9; }
.history-detail-grid { padding: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.history-detail-group { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.history-detail-group h4 { margin: 0 0 10px; }
.history-detail-group div { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.history-detail-group div:first-of-type { border-top: 0; }
.history-detail-group strong { direction: ltr; }
.empty-state { min-height: 270px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); }
.empty-state svg { width: 38px; height: 38px; }

.segmented { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #eef2f0; }
.segmented button { min-width: 78px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-weight: 700; }
.segmented button.is-active { color: var(--green-dark); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.09); }
.report-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.chart-surface { margin-bottom: 14px; }
.growth-badge { display: flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 6px; color: var(--green-dark); background: var(--mint); font-weight: 800; font-size: .86rem; }
.growth-badge svg { width: 16px; }
.chart { height: 300px; direction: ltr; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart text { font-family: "Tajawal", Arial, sans-serif; fill: var(--muted); font-size: 12px; }
.report-row { min-height: 58px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; border-top: 1px solid var(--line); }
.report-row:first-child { border-top: 0; }
.report-row span { color: var(--muted); }
.report-row strong { direction: ltr; }
.breakdown-subtitle { margin: 18px 0 0; padding: 14px 0 8px; border-top: 2px solid var(--line); }
.employee-wage-total strong { direction: rtl; }
.change-up { color: var(--green) !important; font-weight: 700; }
.change-down { color: #c93d3d !important; font-weight: 700; }

.settings-grid { display: grid; grid-template-columns: minmax(290px, .8fr) minmax(420px, 1.2fr); gap: 16px; align-items: start; }
.settings-form .btn { margin-top: 4px; }
.employee-list { display: grid; }
.employee-item { min-height: 62px; display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.employee-item:first-child { border-top: 0; }
.employee-item strong, .employee-item small { display: block; }
.employee-item small { color: var(--muted); }
.status-pill { padding: 4px 9px; border-radius: 6px; color: var(--green-dark); background: var(--mint); font-size: .8rem; font-weight: 700; }
.status-pill.inactive { color: #b52c45; background: #ffedf1; }
.switch { position: relative; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: #c7cecb; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; right: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(-18px); }
.employee-item .icon-btn { width: 36px; height: 36px; border: 0; color: #b73737; }

.bottom-nav { display: none; }
.toast { position: fixed; z-index: 100; left: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 7px; color: #fff; background: #183b31; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.modal { width: min(92vw, 440px); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.modal::backdrop { background: rgba(12,32,26,.52); backdrop-filter: blur(3px); }
.modal form > header, .modal form > footer { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.modal form > header { border-bottom: 1px solid var(--line); }
.modal form > header h3 { margin: 0; }
.modal form > header p { margin: 1px 0 0; color: var(--muted); font-size: .84rem; }
.modal form > footer { justify-content: flex-start; border-top: 1px solid var(--line); }
#dialogFields { padding: 18px; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-brand > div:last-child, .nav-item span, .user-chip > div { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-footer { justify-content: center; }
  .user-chip { flex: 0; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .report-metrics { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .history-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .login-view { display: block; min-height: 100svh; background: #f6f9f8; }
  .login-brand { display: none; }
  .login-panel { min-height: 100svh; padding: 22px; }
  .login-card { padding: 25px 20px; box-shadow: none; }
  .mobile-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
  .mobile-login-brand strong { font-size: 1.1rem; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 76px; padding: 0 18px; }
  .topbar .avatar { display: none; }
  .content-frame { padding: 20px 14px 102px; }
  .welcome-row, .page-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .quick-entry { width: 100%; }
  .metrics-grid, .report-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 1.3rem; }
  .metric-card h3 { font-size: .86rem; }
  .dashboard-lower { grid-template-columns: 1fr; }
  .quick-summary { order: -1; }
  .compact-row { grid-template-columns: 1fr repeat(2, minmax(62px, .7fr)); }
  .compact-row span:nth-child(3) { display: none; }
  .entry-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cigarette-cash-fields { grid-template-columns: 1fr 1fr; }
  .wage-row { grid-template-columns: 1fr minmax(118px, .8fr); }
  .wage-row output { grid-column: 1 / -1; padding-top: 7px; border-top: 1px solid var(--line); }
  .date-field { width: 100%; }
  .save-bar { bottom: 82px; padding: 11px 12px; }
  .save-bar .btn { padding-inline: 13px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-width: 0; }
  .chart { height: 240px; }
  .section-heading { align-items: flex-start; }
  .settings-form, .employees-panel, .recent-days, .quick-summary, .chart-surface, .report-breakdown { padding: 16px; }
  .employee-item { grid-template-columns: 1fr auto auto; }
  .employee-item .icon-btn { display: none; }
  .bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; height: 72px; padding: 6px max(4px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 -8px 26px rgba(14,43,34,.07); backdrop-filter: blur(14px); }
  .bottom-nav .nav-item { min-width: 0; height: 58px; padding: 4px 2px; display: flex; flex-direction: column; justify-content: center; gap: 2px; color: #66726e; border-radius: 6px; font-size: .71rem; }
  .bottom-nav .nav-item span { display: block; white-space: nowrap; }
  .bottom-nav .nav-item svg { width: 20px; height: 20px; }
  .bottom-nav .nav-item.is-active { color: var(--green-dark); background: var(--mint); }
  .toast { left: 16px; right: 16px; bottom: 88px; }
}

@media (max-width: 390px) {
  .metrics-grid, .report-metrics { grid-template-columns: 1fr; }
  .metric-card--primary { grid-column: auto; }
  .metric-card { min-height: 110px; }
  .donut-wrap { gap: 18px; }
  .donut { width: 116px; height: 116px; }
  .bottom-nav .nav-item { font-size: .66rem; }
  .cigarette-price-row { grid-template-columns: 62px 1fr; }
  .cigarette-price-row output { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); }
  .cigarette-cash-fields, .cigarette-totals { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
