:root {
    --navy-950: #091126;
    --navy-900: #101b36;
    --navy-800: #172544;
    --navy-700: #233354;
    --ink: #15223c;
    --muted: #7e8aa4;
    --muted-light: #a8b4ca;
    --paper: #f4f7fb;
    --white: #ffffff;
    --line: #e6ebf3;
    --mint: #8ee6c1;
    --mint-dark: #237d63;
    --blue: #6d8df4;
    --blue-soft: #eef2ff;
    --amber: #f5c66a;
    --amber-soft: #fff7e7;
    --red: #e78686;
    --red-soft: #fff0f0;
    --shadow: 0 16px 42px rgba(21, 34, 60, .08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 250px;
    flex: 0 0 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 18px 20px;
    color: #e8eefc;
    background: var(--navy-900);
}
.brand, .login-logo { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--mint);
    border: 1px solid rgba(142, 230, 193, .24);
    border-radius: 13px;
    background: rgba(142, 230, 193, .08);
}
.brand-mark svg { width: 31px; height: 31px; }
.brand strong, .login-logo strong { display: block; font-size: 16px; letter-spacing: .01em; }
.brand span, .login-logo span { display: block; margin-top: 3px; color: var(--muted-light); font-size: 11px; }
.nav-list { display: grid; gap: 8px; margin-top: 64px; }
.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: #a9b6ce;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.is-active { color: #fff; background: var(--navy-700); border-color: rgba(255,255,255,.05); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.nav-icon { width: 22px; color: var(--mint); font-size: 19px; line-height: 1; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.period-hint { display: flex; align-items: center; gap: 10px; padding: 13px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.04); }
.period-hint strong { display: block; color: #e6ecf9; font-size: 11px; }
.period-hint small { display: block; margin-top: 4px; color: var(--muted-light); font-size: 10px; }
.hint-dot, .sync-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(142,230,193,.1); }
.sidebar-link { margin: 15px 12px 0; padding: 4px 0; color: #a9b6ce; border: 0; background: none; font-size: 11px; }

.main-shell { min-width: 0; flex: 1; }
.topbar { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px clamp(22px, 5vw, 70px) 20px; background: var(--paper); }
.topbar-heading { display: flex; align-items: center; gap: 14px; }
.topbar-kicker { margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.03em; }
h2 { margin-bottom: 7px; font-size: 18px; letter-spacing: -.02em; }
h3 { margin-bottom: 5px; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.sync-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.role-badge { padding: 7px 9px; color: var(--mint-dark); border: 1px solid #c5f1df; border-radius: 8px; background: #e8fbf3; font-size: 10px; font-weight: 750; white-space: nowrap; }
.role-badge.is-viewer { color: #64708a; border-color: #dbe1eb; background: #f0f2f6; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 750; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: var(--navy-950); background: var(--mint); box-shadow: 0 8px 18px rgba(64, 169, 130, .19); }
.button-primary:hover { background: #a0efd0; box-shadow: 0 10px 24px rgba(64, 169, 130, .25); }
.button-secondary { color: var(--ink); border-color: var(--line); background: var(--white); }
.button-secondary:hover { border-color: #cbd6e8; background: #fbfcfe; }
.button-ghost { min-height: 35px; padding: 0 10px; color: var(--muted); background: transparent; }
.button-ghost:hover { color: var(--ink); background: var(--paper); }
.button-danger { color: #b74d55; border-color: #f0cccc; background: var(--red-soft); }
.button-wide { width: 100%; margin-top: 18px; }
.mobile-menu { display: none; width: 37px; height: 37px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: var(--white); }

.content { max-width: 1520px; padding: 0 clamp(22px, 5vw, 70px) 60px; }
.view { display: none; animation: view-in .22s ease both; }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--white); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 25px 0; }
.panel-header p { margin: 0; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(300px, .78fr); gap: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { min-height: 108px; padding: 18px 19px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: 0 9px 25px rgba(21,34,60,.045); }
.stat-card.is-accent { border-color: #c5f1df; background: linear-gradient(140deg, #f5fffb 0%, #fff 80%); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; }
.stat-value { margin-top: 12px; color: var(--ink); font-size: 19px; font-weight: 780; letter-spacing: -.03em; }
.stat-note { margin-top: 5px; color: var(--muted); font-size: 10px; }
.stat-value.urgent { color: #c67843; }
.due-panel { position: relative; min-height: 270px; overflow: hidden; padding: 26px; color: #edf3ff; border: 0; background: linear-gradient(135deg, var(--navy-900), #1a3156); box-shadow: 0 16px 35px rgba(16,27,54,.17); }
.due-panel::after { content: ""; position: absolute; width: 250px; height: 250px; right: -70px; top: -100px; border: 1px solid rgba(142,230,193,.18); border-radius: 50%; box-shadow: 0 0 0 20px rgba(142,230,193,.025), 0 0 0 45px rgba(142,230,193,.025); }
.due-panel .eyebrow { position: relative; z-index: 1; color: #8fa3c7; }
.due-date { position: relative; z-index: 1; margin: 20px 0 8px; color: #fff; font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -.055em; }
.due-relative { position: relative; z-index: 1; color: var(--mint); font-size: 12px; font-weight: 700; }
.due-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.due-meta span { padding: 7px 9px; color: #b7c6df; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; font-size: 10px; }
.due-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.button-on-dark { color: var(--navy-950); background: var(--mint); }
.button-outline-light { color: #e6eefc; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.05); }
.button-outline-light:hover { background: rgba(255,255,255,.11); }
.trip-panel { min-height: 270px; padding-bottom: 21px; }
.trip-summary { padding: 20px 25px 0; }
.trip-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.trip-title { font-size: 20px; letter-spacing: -.035em; }
.status-pill, .type-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 100px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-pill.active { color: #218060; background: #e8fbf3; }
.status-pill.completed { color: #6e7890; background: #eef1f6; }
.status-pill.readonly { color: #64708a; background: #eef1f6; }
.trip-info-list { display: grid; gap: 13px; margin: 26px 0 0; }
.trip-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0f2f7; font-size: 11px; }
.trip-info:last-child { border-bottom: 0; }
.trip-info span { color: var(--muted); }
.trip-info strong { font-weight: 730; text-align: right; }
.card-link { color: #4d70d0; border: 0; background: none; font-size: 11px; font-weight: 750; }
.card-link:hover { color: #274da8; }
.history-panel { margin-top: 18px; padding-bottom: 6px; }
.history-list { padding: 12px 25px 8px; }
.history-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: center; gap: 12px; min-height: 62px; border-bottom: 1px solid #f0f2f7; }
.history-row:last-child { border-bottom: 0; }
.history-date strong { display: block; font-size: 12px; }
.history-date small, .history-cell small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.history-cell { color: var(--muted); font-size: 10px; }
.history-cell strong { color: var(--ink); font-size: 11px; font-weight: 680; }
.payment-tag { padding: 6px 8px; border-radius: 8px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.payment-tag.initial { color: #4d70d0; background: var(--blue-soft); }
.payment-tag.early { color: #1d8061; background: #e8fbf3; }
.payment-tag.late { color: #a46a22; background: var(--amber-soft); }
.payment-tag.normal { color: var(--muted); background: #f1f3f7; }
.empty-panel { display: grid; place-items: center; min-height: 290px; padding: 36px; text-align: center; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 16px; color: var(--mint-dark); border-radius: 18px; background: #e8fbf3; font-size: 26px; }
.empty-panel p { max-width: 355px; margin: 0 auto 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.empty-panel h2 { margin-bottom: 8px; }
.empty-wide { grid-column: 1 / -1; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-intro-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; }
.schedule-trip-picker { display: grid; gap: 6px; min-width: 210px; }
.schedule-trip-picker span { color: var(--muted); font-size: 10px; font-weight: 750; }
.page-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.page-intro .schedule-start-note { margin-top: 4px; color: var(--muted-light); font-size: 10px; }
.page-intro h2 { margin-bottom: 5px; font-size: 22px; }
.trip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 15px; }
.trip-card { position: relative; min-height: 200px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: 0 9px 25px rgba(21,34,60,.045); transition: .18s ease; }
.trip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.trip-card.is-selected { border-color: #a3e8cf; box-shadow: 0 0 0 3px rgba(142,230,193,.18), var(--shadow); }
.trip-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.trip-card h3 { margin: 0; font-size: 16px; }
.trip-card-dates { display: flex; align-items: center; gap: 8px; margin-top: 28px; color: var(--muted); font-size: 11px; }
.trip-card-dates strong { color: var(--ink); font-size: 12px; }
.trip-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 22px; padding-top: 13px; border-top: 1px solid #f0f2f7; }
.trip-card-footer span { color: var(--muted); font-size: 10px; }

.schedule-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(285px, .7fr); gap: 18px; align-items: start; }
.mobile-agenda { display: none; }
.calendar-panel { padding-bottom: 20px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 25px 18px; }
.calendar-toolbar h2 { margin: 0; font-size: 18px; text-transform: capitalize; }
.calendar-nav { display: flex; gap: 7px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-size: 16px; }
.icon-button:hover { background: var(--paper); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 18px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-weekday { padding: 10px 8px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 95px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.calendar-day.is-outside { background: #fafbfd; }
.calendar-day.is-outside .day-number { color: #bdc6d5; }
.calendar-day.is-today .day-number { color: var(--mint-dark); background: #dff9ed; }
.calendar-day.is-disabled { cursor: default; background: #fafbfd; }
.calendar-day:not(.is-disabled):hover { background: #fbfffd; }
.day-number { width: 24px; height: 24px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 8px; color: var(--ink); font-size: 11px; font-weight: 750; }
.day-entry { display: block; min-height: 45px; padding: 6px; overflow: hidden; color: var(--ink); border-radius: 8px; text-align: left; }
.day-entry:hover { filter: brightness(.98); }
.day-entry.is-paid { box-shadow: inset 0 0 0 1px var(--mint-dark); }
.day-entry.type-work { background: #edf2ff; }
.day-entry.type-weekend { background: #f2f3f7; }
.day-entry.type-move { background: #fff5dd; }
.day-entry.type-setup { background: #e6faf2; }
.day-type { display: block; font-size: 9px; font-weight: 800; line-height: 1.2; }
.day-city { display: block; max-width: 100%; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.day-add { display: grid; place-items: center; width: 100%; min-height: 45px; color: #b8c1d1; border: 1px dashed #dce2ec; border-radius: 8px; background: transparent; font-size: 16px; opacity: 0; transition: .15s ease; }
.calendar-day:not(.is-disabled):hover .day-add { opacity: 1; }
.schedule-list-panel { padding-bottom: 10px; }
.allowance-panel { padding-bottom: 8px; border-bottom: 1px solid #f0f2f7; }
.allowance-period-list { display: grid; gap: 8px; padding: 10px 25px 14px; }
.allowance-period-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.allowance-period-row.is-paid { border-color: #c5f1df; background: #f1fcf7; }
.allowance-period-row.is-current { border-style: dashed; background: #fffaf0; }
.allowance-period-row strong, .allowance-period-row span { display: block; }
.allowance-period-row strong { font-size: 11px; }
.allowance-period-row > div > span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.allowance-progress { color: #a46a22; font-size: 10px; white-space: nowrap; }
.allowance-period-status { color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.allowance-empty { padding: 8px 25px 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.schedule-list { display: grid; gap: 0; padding: 7px 25px; }
.schedule-list-row { display: grid; grid-template-columns: 45px 1fr auto; align-items: center; gap: 10px; min-height: 61px; border-bottom: 1px solid #f0f2f7; }
.schedule-list-row:last-child { border-bottom: 0; }
.schedule-list-date { color: var(--muted); font-size: 10px; text-align: center; }
.schedule-list-date strong { display: block; color: var(--ink); font-size: 16px; line-height: 1; }
.schedule-list-info strong { display: block; font-size: 11px; }
.schedule-list-info span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.schedule-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.allowance-check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; cursor: pointer; }
.allowance-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--mint-dark); cursor: pointer; }
.allowance-check input:disabled { cursor: wait; opacity: .6; }
.mobile-agenda-empty { padding: 26px 20px; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.mobile-day-row { width: 100%; display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 17px; color: var(--ink); border: 0; border-top: 1px solid var(--line); background: var(--white); text-align: left; }
.mobile-day-row:first-child { border-top: 0; }
.mobile-day-row:hover { background: #fbfffd; }
.mobile-day-row.is-paid { background: #f4fcf8; }
.mobile-day-date { color: var(--muted); text-align: center; }
.mobile-day-date strong { display: block; color: var(--ink); font-size: 18px; line-height: 1; }
.mobile-day-date span { display: block; margin-top: 4px; font-size: 10px; text-transform: uppercase; }
.mobile-day-content { min-width: 0; }
.mobile-day-content strong, .mobile-day-content span, .mobile-day-content small { display: block; }
.mobile-day-content strong { font-size: 12px; }
.mobile-day-content span { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-day-content small { margin-top: 4px; overflow: hidden; color: var(--muted-light); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-day-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.mobile-day-row.is-paid .mobile-day-status { color: var(--mint-dark); font-weight: 750; }
.mobile-day-status b { color: #a9b6ce; font-size: 18px; font-weight: 400; line-height: 1; }
.type-pill.work { color: #4d70d0; background: var(--blue-soft); }
.type-pill.weekend { color: #6f788d; background: #f0f2f6; }
.type-pill.move { color: #a46a22; background: var(--amber-soft); }
.type-pill.setup { color: #218060; background: #e8fbf3; }
.legend { display: flex; flex-wrap: wrap; gap: 7px 12px; padding: 0 25px 18px; }
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.work { background: var(--blue); }.legend-dot.weekend { background: #b8c0d0; }.legend-dot.move { background: var(--amber); }.legend-dot.setup { background: var(--mint-dark); }.legend-dot.paid { background: #56b992; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.field-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.field-input, .field-select, .field-textarea { width: 100%; min-height: 42px; padding: 0 12px; color: var(--ink); border: 1px solid #dfe5ef; border-radius: 10px; outline: none; background: #fbfcfe; font-size: 12px; transition: .15s ease; }
.field-textarea { min-height: 80px; padding-top: 11px; resize: vertical; }
.field-input:focus, .field-select:focus, .field-textarea:focus { border-color: #91d9bf; box-shadow: 0 0 0 3px rgba(142,230,193,.18); background: #fff; }
.form-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-error { margin: 10px 0 0; color: #b74d55; font-size: 11px; }
.preview-box { margin-top: 16px; padding: 12px 13px; border-radius: 11px; color: var(--ink); background: #f4f8ff; font-size: 11px; line-height: 1.5; }
.preview-box strong { font-weight: 800; }
.preview-box.is-early { background: #e8fbf3; }
.preview-box.is-late { background: var(--amber-soft); }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(9,17,38,.52); backdrop-filter: blur(5px); animation: fade-in .18s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: min(100%, 530px); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; border-radius: 21px; background: var(--white); box-shadow: 0 28px 80px rgba(9,17,38,.27); animation: modal-in .2s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.modal-close { width: 31px; height: 31px; flex: 0 0 31px; color: var(--muted); border: 0; border-radius: 9px; background: var(--paper); font-size: 19px; line-height: 1; }
.modal-close:hover { color: var(--ink); background: var(--line); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.modal-actions .button { min-width: 105px; }
.modal-actions .button-danger { margin-right: auto; }

.login-overlay { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #0b1430, #182b4b); }
.login-card { width: min(100%, 390px); padding: 31px; border: 1px solid rgba(255,255,255,.08); border-radius: 23px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-copy { margin: 25px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-card .brand-mark { color: var(--mint-dark); border-color: #c5f1df; background: #e8fbf3; }
.login-card .brand span { color: var(--muted); }
.toast-root { position: fixed; z-index: 50; right: 22px; bottom: 22px; display: grid; gap: 9px; width: min(360px, calc(100vw - 44px)); }
.toast { padding: 13px 15px; color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: var(--navy-900); box-shadow: 0 13px 30px rgba(9,17,38,.2); font-size: 12px; line-height: 1.45; animation: toast-in .2s ease both; }
.toast.is-error { border-color: rgba(231,134,134,.4); background: #6c2733; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.loading { display: grid; place-items: center; min-height: 260px; color: var(--muted); font-size: 12px; }
.loading::before { content: ""; width: 22px; height: 22px; margin-bottom: 13px; border: 2px solid #dce4ee; border-top-color: var(--mint-dark); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.server-error { padding: 20px; color: #9e4c54; border: 1px solid #f0cccc; border-radius: var(--radius-lg); background: var(--red-soft); font-size: 12px; line-height: 1.6; }

@media (max-width: 1120px) {
    .sidebar { width: 220px; flex-basis: 220px; }
    .dashboard-grid, .schedule-layout { grid-template-columns: 1fr; }
    .schedule-list-panel { min-height: 0; }
}
@media (max-width: 760px) {
    .sidebar { position: fixed; z-index: 15; top: 0; bottom: 0; left: 0; width: 250px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 20px 0 40px rgba(9,17,38,.18); }
    body.sidebar-open::after { content: ""; position: fixed; z-index: 14; inset: 0; background: rgba(9,17,38,.38); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .mobile-menu { display: grid; place-items: center; }
    .topbar { min-height: 84px; padding: 18px 18px 15px; }
    .topbar-actions { gap: 9px; }
    .sync-status { display: none; }
    .topbar-actions .button { min-height: 37px; padding: 0 11px; font-size: 11px; }
    .topbar-actions .button span { display: none; }
    .content { padding: 0 18px 40px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid .stat-card:last-child { grid-column: 1 / -1; min-height: 88px; }
    .history-row { grid-template-columns: 1fr auto; gap: 5px; padding: 10px 0; }
    .history-cell { display: none; }
    .history-row .payment-tag { grid-column: 2; grid-row: 1 / span 2; }
    .panel-header, .history-list, .trip-summary { padding-left: 18px; padding-right: 18px; }
    .calendar-grid { margin: 0 10px; }
    .calendar-panel { display: none; }
    .mobile-agenda { display: block; margin-bottom: 18px; overflow: hidden; }
    .mobile-agenda .calendar-toolbar { padding: 18px; }
    .mobile-agenda .calendar-toolbar h2 { font-size: 17px; }
    .schedule-list-heading, .schedule-list-panel .schedule-list { display: none; }
    .allowance-period-list { padding-left: 18px; padding-right: 18px; }
    .allowance-empty { padding-left: 18px; padding-right: 18px; }
    .calendar-day { min-height: 76px; padding: 5px; }
    .day-entry { min-height: 38px; padding: 5px; }
    .day-type { font-size: 8px; }
    .day-city { margin-top: 2px; font-size: 8px; }
    .day-add { min-height: 38px; }
    .calendar-weekday { padding: 8px 2px; font-size: 8px; }
    .legend { padding-left: 18px; padding-right: 18px; }
    .schedule-list-row { grid-template-columns: 45px 1fr; padding: 8px 0; }
    .schedule-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field.full { grid-column: auto; }
    .modal-card { padding: 20px; }
}
@media (max-width: 430px) {
    .due-panel { padding: 21px; }
    .due-date { font-size: 31px; }
    .due-meta { margin-top: 20px; }
    .due-actions .button { flex: 1 1 100%; }
    .page-intro { align-items: flex-start; flex-direction: column; }
    .page-intro-actions { width: 100%; align-items: stretch; flex-direction: column; }
    .schedule-trip-picker { width: 100%; }
    .calendar-day { min-height: 65px; }
    .day-number { width: 20px; height: 20px; font-size: 10px; }
    .day-entry { min-height: 31px; }
    .day-city { display: none; }
}
