:root {
    --navy-950: #061a42;
    --navy-900: #08255f;
    --navy-800: #0c347a;
    --blue-700: #155eef;
    --blue-600: #2563eb;
    --cyan-500: #06b6d4;
    --slate-900: #14213d;
    --slate-700: #46536d;
    --slate-500: #74809a;
    --slate-300: #cfd7e6;
    --slate-200: #e5eaf2;
    --slate-100: #f3f6fa;
    --white: #fff;
    --success: #169c50;
    --warning: #d98500;
    --danger: #d92d20;
    --shadow: 0 12px 34px rgba(13, 38, 76, .09);
    --radius: 15px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--slate-900);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--slate-100);
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.btn {
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 700;
    transition: .18s ease;
}
.btn:disabled { cursor: wait; opacity: .7; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue-700), #0c4dd7); box-shadow: 0 7px 16px rgba(21, 94, 239, .2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(21, 94, 239, .28); }
.btn-secondary { color: var(--blue-700); background: #fff; border-color: #c6d4ed; }
.btn-block { width: 100%; }
.eyebrow { color: var(--blue-700); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }

.alert { margin: 0 0 18px; padding: 12px 14px; border-radius: 9px; font-size: 14px; line-height: 1.45; }
.alert-error { color: #9f1c15; background: #fff1f0; border: 1px solid #ffc9c5; }
.alert-success { color: #08783a; background: #edfff4; border: 1px solid #b6edcc; }

/* Login */
.login-page { overflow-x: hidden; background: #fff; }
.login-shell { display: grid; grid-template-columns: minmax(480px, 56%) minmax(420px, 44%); min-height: 100vh; }
.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 7vh 10%;
    color: #fff;
    background: radial-gradient(circle at 70% 25%, #155eef 0, #0b347d 30%, #061a42 75%);
}
.login-brand::after {
    position: absolute; inset: 0; content: '';
    background: linear-gradient(125deg, transparent 0 70%, rgba(255,255,255,.05) 70% 71%, transparent 71%);
}
.network-pattern {
    position: absolute; inset: 0;
    opacity: .16;
    background-image: radial-gradient(circle, #48c8e7 1.3px, transparent 1.5px);
    background-size: 54px 54px;
    mask-image: linear-gradient(145deg, #000, transparent 65%);
}
.login-logo { position: relative; z-index: 2; width: min(430px, 78%); margin-bottom: 55px; }
.brand-copy { position: relative; z-index: 2; max-width: 520px; }
.brand-line { display: block; width: 82px; height: 4px; margin-bottom: 25px; border-radius: 4px; background: var(--cyan-500); }
.brand-copy h1 { margin: 0 0 20px; font-size: clamp(38px, 4vw, 62px); line-height: 1.07; letter-spacing: -.04em; }
.brand-copy p { margin: 0; color: #dce8ff; font-size: 19px; }
.city-lines { position: absolute; right: -4%; bottom: -10%; left: -4%; height: 34%; border-top: 1px solid rgba(75,199,230,.3); background: repeating-linear-gradient(90deg, transparent 0 48px, rgba(73,191,255,.13) 49px 50px), repeating-linear-gradient(0deg, transparent 0 38px, rgba(73,191,255,.08) 39px 40px); transform: perspective(450px) rotateX(55deg); }
.login-panel { display: grid; place-items: center; padding: 40px; background: linear-gradient(145deg, #fff, #f7f9fd); }
.login-card { width: min(520px, 100%); padding: 52px; border: 1px solid #edf0f6; border-radius: 20px; background: rgba(255,255,255,.95); box-shadow: 0 22px 60px rgba(15,35,75,.13); }
.login-lock { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 16px; color: var(--blue-700); font-size: 32px; border-radius: 50%; background: #edf4ff; }
.login-card h2 { margin: 0; text-align: center; color: var(--navy-950); font-size: 34px; letter-spacing: -.03em; }
.login-card > p { margin: 8px 0 30px; text-align: center; color: var(--slate-500); }
.login-card label { display: block; margin: 0 0 20px; color: var(--slate-900); font-size: 14px; font-weight: 650; }
.input-wrap { display: flex; align-items: center; gap: 11px; height: 52px; margin-top: 8px; padding: 0 14px; border: 1px solid var(--slate-300); border-radius: 9px; background: #fff; transition: .15s; }
.input-wrap:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
.input-wrap span { color: var(--slate-500); }
.input-wrap input { width: 100%; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; }
.login-card .check-row { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.check-row input { width: 17px; height: 17px; accent-color: var(--blue-700); }
.secure-note { margin-top: 28px; padding-top: 22px; color: var(--slate-500); text-align: center; border-top: 1px solid var(--slate-200); font-size: 13px; }

/* Installer */
.install-page { padding: 50px 22px; background: radial-gradient(circle at top left, #e9f1ff, #f5f7fb 45%); }
.installer-shell { width: min(1040px, 100%); margin: auto; }
.installer-heading { margin-bottom: 26px; text-align: center; }
.installer-logo { width: 270px; margin-bottom: 22px; }
.installer-heading h1 { margin: 6px 0 8px; font-size: 36px; }
.installer-heading p { margin: 0; color: var(--slate-500); }
.installer-card { padding: 36px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.installer-card h2 { margin: 26px 0 15px; padding-bottom: 10px; color: var(--navy-900); font-size: 17px; border-bottom: 1px solid var(--slate-200); }
.installer-card h2:first-of-type { margin-top: 0; }
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }
.installer-card label { color: var(--slate-700); font-size: 13px; font-weight: 700; }
.installer-card input { width: 100%; height: 45px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--slate-300); border-radius: 8px; outline: 0; }
.installer-card input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.installer-card .btn { margin-top: 28px; }

/* App */
.app-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 242px; flex-direction: column; color: #d8e6ff; background: linear-gradient(180deg, var(--navy-950), #06235a 70%, #041736); box-shadow: 8px 0 25px rgba(5,27,69,.08); }
.sidebar-logo { display: block; padding: 24px 24px 17px; }
.sidebar-logo img { display: block; width: 176px; }
.sidebar-nav { padding: 12px 12px; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; min-height: 45px; margin-bottom: 4px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 550; transition: .16s; }
.sidebar-nav a span { width: 20px; color: #aecdff; text-align: center; font-size: 18px; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-nav a.active { color: #fff; background: linear-gradient(90deg, var(--blue-700), #0c4ccd); box-shadow: 0 8px 20px rgba(4,20,59,.28); }
.sidebar-nav a.active span { color: #fff; }
.sidebar-logout { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-logout button { width: 100%; padding: 10px; color: #cfe0ff; text-align: left; border: 0; background: transparent; }
.app-main { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 10px 28px; border-bottom: 1px solid var(--slate-200); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
.company-switcher-wrap { display: flex; align-items: center; gap: 12px; }
.company-switcher-wrap label { color: var(--slate-500); font-size: 13px; font-weight: 700; }
.company-switcher-wrap select { min-width: 310px; height: 44px; padding: 0 38px 0 13px; color: var(--slate-900); border: 1px solid var(--slate-300); border-radius: 9px; background: #fff; font-weight: 650; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.active-company-logo { width: 72px; height: 38px; margin-right: 5px; object-fit: contain; border-right: 1px solid var(--slate-200); padding-right: 10px; }
.topbar-user > span:last-child { display: flex; flex-direction: column; font-size: 12px; }
.topbar-user small { margin-top: 2px; color: var(--slate-500); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; border-radius: 50%; background: linear-gradient(135deg, var(--blue-700), var(--navy-900)); font-size: 12px; font-weight: 800; }
.notification-button { position: relative; width: 38px; height: 38px; margin-right: 8px; color: var(--navy-900); border: 0; border-radius: 50%; background: #f5f7fb; }
.notification-button span { position: absolute; top: -2px; right: -1px; display: grid; place-items: center; min-width: 16px; height: 16px; color: #fff; border-radius: 50%; background: var(--blue-700); font-size: 9px; font-weight: 800; }
.dashboard-content { padding: 27px 28px 45px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.page-heading h1 { margin: 3px 0 0; color: var(--navy-950); font-size: 31px; letter-spacing: -.035em; }
.page-heading > span { color: var(--slate-500); font-size: 12px; }
.loading-label::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border: 2px solid #b8c5da; border-top-color: var(--blue-700); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(175px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { display: flex; align-items: flex-start; gap: 12px; min-height: 136px; padding: 20px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: 0 5px 17px rgba(21,45,85,.05); }
.kpi-card > div { min-width: 0; }
.kpi-card small { display: block; min-height: 35px; color: var(--slate-700); font-size: 12.5px; font-weight: 650; }
.kpi-card strong { display: block; margin: 4px 0 8px; overflow: hidden; color: var(--navy-950); font-size: clamp(18px, 1.55vw, 25px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.kpi-card em { color: var(--blue-700); font-size: 11px; font-style: normal; font-weight: 650; }
.kpi-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 11px; font-size: 21px; }
.kpi-icon.blue { color: var(--blue-700); background: #eaf1ff; }
.kpi-icon.cyan { color: #079db9; background: #e5f9fc; }
.kpi-icon.navy { color: var(--navy-900); background: #e9eef8; }
.dashboard-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: 0 5px 17px rgba(21,45,85,.05); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 19px 21px; border-bottom: 1px solid var(--slate-200); }
.panel-heading h2 { margin: 0; color: var(--navy-950); font-size: 16px; }
.panel-heading p { margin: 4px 0 0; color: var(--slate-500); font-size: 12px; }
.panel-heading > span { color: var(--slate-500); font-size: 11px; }
.empty-chart { position: relative; padding: 17px 21px 12px; }
.empty-chart svg { display: block; width: 100%; height: 230px; }
.empty-chart > span { display: block; margin-top: 2px; color: var(--slate-500); text-align: center; font-size: 11px; }
.status-donut-wrap { display: flex; align-items: center; justify-content: space-around; min-height: 282px; padding: 24px; }
.status-donut { display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--cyan-500) 0 42%, var(--blue-700) 42% 72%, var(--navy-900) 72% 90%, #d9e0eb 90%); box-shadow: inset 0 0 0 30px #fff; }
.status-donut span { display: flex; flex-direction: column; color: var(--navy-950); text-align: center; font-size: 27px; font-weight: 800; }
.status-donut small { color: var(--slate-500); font-size: 11px; font-weight: 600; }
.status-legend { min-width: 170px; margin: 0; padding: 0; list-style: none; }
.status-legend li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; color: var(--slate-700); border-bottom: 1px solid #eef1f6; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.cyan { background: var(--cyan-500); }.dot.blue { background: var(--blue-700); }.dot.navy { background: var(--navy-900); }.dot.gray { background: #d9e0eb; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 17px; color: var(--slate-500); text-align: left; background: #f8fafc; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 17px; color: var(--slate-700); border-top: 1px solid var(--slate-200); font-size: 12.5px; vertical-align: middle; }
td strong { color: var(--slate-900); }
.table-subtitle { display: block; max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--slate-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.empty-cell { padding: 38px; color: var(--slate-500); text-align: center; }
.error-text, .negative { color: var(--danger) !important; }.warning { color: var(--warning) !important; }.positive { color: var(--success) !important; }
.status-pill { display: inline-block; min-width: 88px; padding: 6px 10px; text-align: center; border-radius: 20px; font-size: 10.5px; font-weight: 700; }
.status-in_progress { color: #075ec5; background: #e5f0ff; }
.status-pending { color: #a15c00; background: #fff3d8; }
.status-completed { color: #08783a; background: #e4f8ec; }
.status-paused { color: #5d687e; background: #edf0f5; }
.status-active { color: #08783a; background: #e4f8ec; }
.status-inactive { color: #5d687e; background: #edf0f5; }
.status-draft { color: #5d687e; background: #edf0f5; }
.status-closed { color: #334155; background: #e2e8f0; }
.status-cancelled { color: #a11f18; background: #fee4e2; }
.status-approved { color: #08783a; background: #e4f8ec; }
.status-reopened { color: #a15c00; background: #fff3d8; }
.status-rejected { color: #a11f18; background: #fee4e2; }
.status-paid { color: #08783a; background: #e4f8ec; }
.status-partial { color: #075ec5; background: #e5f0ff; }

/* CRUD masters */
.crud-heading { align-items: center; }
.crud-heading p { max-width: 680px; margin: 7px 0 0; color: var(--slate-500); font-size: 13px; }
.crud-panel { overflow: hidden; }
.crud-toolbar { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--slate-200); }
.search-box { display: flex; align-items: center; flex: 1; min-width: 220px; height: 43px; padding: 0 13px; color: var(--slate-500); border: 1px solid var(--slate-300); border-radius: 9px; background: #fff; }
.search-box:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-box input { width: 100%; height: 100%; margin-left: 9px; border: 0; outline: 0; background: transparent; }
.crud-toolbar > select { min-width: 170px; height: 43px; padding: 0 12px; border: 1px solid var(--slate-300); border-radius: 9px; background: #fff; }
.crud-panel > .alert { margin: 15px 20px 0; }
.crud-table td { height: 64px; }
.actions-column { width: 110px; text-align: right; }
.row-actions { text-align: right; white-space: nowrap; }
.icon-button { width: 34px; height: 34px; margin-left: 5px; color: var(--blue-700); border: 1px solid #ccd8ec; border-radius: 8px; background: #fff; font-weight: 800; }
.action-link { display: inline-grid; place-items: center; vertical-align: middle; }
.icon-button:hover { background: #edf4ff; border-color: #9bb7e8; }
.icon-button.danger { color: var(--danger); }
.table-link { color: var(--blue-700); }
.color-swatch { display: inline-block; width: 17px; height: 17px; margin-right: 7px; vertical-align: -4px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #cbd5e1; }
.crud-footer { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 10px 20px; color: var(--slate-500); border-top: 1px solid var(--slate-200); font-size: 12px; }
.crud-footer > div { display: flex; align-items: center; gap: 10px; }
.pagination-button { width: 34px; height: 34px; color: var(--navy-900); border: 1px solid var(--slate-300); border-radius: 8px; background: #fff; font-size: 20px; }
.pagination-button:disabled { cursor: not-allowed; opacity: .4; }

.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 25px; background: rgba(4, 17, 45, .58); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(760px, 100%); max-height: calc(100vh - 50px); overflow: auto; border-radius: 16px; background: #fff; box-shadow: 0 25px 80px rgba(2,16,44,.28); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 22px 25px; border-bottom: 1px solid var(--slate-200); background: #fff; }
.modal-header h2 { margin: 4px 0 0; color: var(--navy-950); font-size: 23px; }
.modal-close { cursor: pointer; }
.modal-header .modal-close { width: 38px; height: 38px; color: var(--slate-500); border: 0; border-radius: 50%; background: #f2f5f9; font-size: 25px; }
.modal-body { padding: 24px 25px; }
.modal-body label { color: var(--slate-700); font-size: 13px; font-weight: 700; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; margin-top: 7px; padding: 0 12px; border: 1px solid var(--slate-300); border-radius: 8px; outline: 0; background: #fff; }
.modal-body input, .modal-body select { height: 44px; }
.modal-body textarea { padding-top: 11px; resize: vertical; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.modal-body input[type="color"] { padding: 5px; }
.modal-body .alert { margin: 18px 0 0; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 17px 25px; border-top: 1px solid var(--slate-200); background: #fff; }
.toast-container { position: fixed; right: 25px; bottom: 25px; z-index: 150; }

/* Purchase orders, sites and budgets */
.order-heading { align-items: center; }
.order-heading .eyebrow { display: block; margin-top: 10px; }
.order-heading p, .section-header p { margin: 7px 0 0; color: var(--slate-500); font-size: 13px; }
.back-link { color: var(--blue-700); font-size: 13px; font-weight: 700; }
.order-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.mini-stat { min-height: 112px; padding: 20px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.mini-stat > span { display: block; margin-bottom: 12px; color: var(--slate-500); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.mini-stat strong, .mini-stat a { display: block; color: var(--navy-950); font-size: 16px; }
.order-sites-panel { overflow: hidden; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--slate-200); }
.section-header h2 { margin: 4px 0 0; font-size: 21px; }
.header-actions { display: flex; gap: 10px; }
.order-sites-panel > .alert { margin: 16px 20px 0; }
.form-help { margin: 0 0 18px; color: var(--slate-500); font-size: 13px; line-height: 1.55; }
.import-summary { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0 10px; padding: 13px; border-radius: 9px; background: #edf4ff; font-size: 13px; }
.compact-table td, .compact-table th { padding: 9px 11px; font-size: 12px; }
.budget-card { width: min(1120px, 100%); }
.budget-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; color: var(--slate-500); font-size: 13px; }
.budget-table input, .budget-table select { width: 100%; min-width: 90px; height: 38px; padding: 0 8px; border: 1px solid var(--slate-300); border-radius: 7px; background: #fff; }
.budget-table .line-item { min-width: 220px; }
.budget-table td { padding: 8px; }
.line-total { min-width: 115px; font-weight: 700; white-space: nowrap; }

/* Expenses */
.expense-lines-panel { overflow: hidden; }
.expense-lines-panel > .alert { margin: 16px 20px 0; }
.expense-lines-panel tfoot td { background: #f8fafc; border-top: 2px solid var(--slate-300); font-weight: 700; }
.expense-workflow { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-top: 1px solid var(--slate-200); background: #fbfcfe; }
.expense-workflow label { color: var(--slate-700); font-size: 12px; font-weight: 700; }
.expense-workflow select { min-width: 160px; height: 42px; margin-left: 8px; padding: 0 10px; border: 1px solid var(--slate-300); border-radius: 8px; background: #fff; }
.allocation-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 24px 0 10px; }
.allocation-heading h3 { margin: 0 0 4px; color: var(--navy-950); font-size: 16px; }
.allocation-heading p { margin: 0; color: var(--slate-500); font-size: 12px; }
.allocation-table input, .allocation-table select { width: 100%; min-width: 150px; height: 40px; padding: 0 9px; border: 1px solid var(--slate-300); border-radius: 7px; background: #fff; }
.allocation-table .allocation-site { min-width: 340px; }
.allocation-table td { padding: 8px; }
.destinations-text { display: block; max-width: 320px; color: var(--slate-500); font-size: 11px; line-height: 1.45; }

@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .order-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { min-height: 380px; padding: 60px 8%; }
    .login-logo { width: 320px; margin-bottom: 32px; }
    .login-panel { padding: 35px 18px; }
    .app-shell { grid-template-columns: 76px 1fr; }
    .sidebar { width: 76px; }
    .sidebar-logo { padding: 17px 10px; overflow: hidden; }
    .sidebar-logo img { width: 155px; max-width: none; transform: translateX(-2px); }
    .sidebar-nav a { justify-content: center; padding: 0; }
    .sidebar-nav a span { width: auto; }
    .sidebar-nav a { font-size: 0; }
    .sidebar-logout { padding: 10px; }.sidebar-logout button { overflow: hidden; font-size: 0; }.sidebar-logout button::before { content: '↪'; font-size: 20px; }
    .app-main { grid-column: 2; }
    .company-switcher-wrap label { display: none; }
    .company-switcher-wrap select { min-width: 230px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
    .form-grid-2 { grid-template-columns: 1fr; }.span-2 { grid-column: auto; }
    .installer-card { padding: 24px 18px; }
    .login-card { padding: 36px 24px; }
    .topbar { align-items: stretch; gap: 10px; padding: 10px 14px; }
    .topbar-user > span:last-child, .notification-button { display: none; }
    .company-switcher-wrap, .company-switcher-wrap select { width: 100%; min-width: 0; }
    .dashboard-content { padding: 20px 14px 35px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .status-donut-wrap { flex-direction: column; gap: 18px; }
    .status-legend { width: 100%; }
    .crud-heading { align-items: stretch; flex-direction: column; gap: 15px; }
    .crud-toolbar { align-items: stretch; flex-direction: column; }
    .crud-toolbar > select, .search-box { width: 100%; }
    .modal-backdrop { padding: 10px; }
    .modal-card { max-height: calc(100vh - 20px); }
    .order-summary-grid { grid-template-columns: 1fr; }
    .section-header, .header-actions { align-items: stretch; flex-direction: column; }
    .expense-workflow, .allocation-heading { align-items: stretch; flex-direction: column; }
}
