:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #d9e0e7;
    --text: #1f2933;
    --muted: #64748b;
    --green: #5f8f21;
    --green-dark: #3f6f18;
    --lime: #b6c900;
    --red: #cf0808;
    --blue: #096da9;
    --cyan: #23a9d3;
    --magenta: #ca158e;
    --purple: #6e5bb5;
    --orange: #a06c28;
    --shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eff6ff, #f8fafc 45%, #eef7ed);
}

.auth-shell {
    width: min(100%, 440px);
    padding: 24px;
}

.auth-panel,
.panel,
.side-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-panel {
    padding: 34px;
}

.auth-brand {
    margin-bottom: 34px;
}

.auth-panel h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.auth-copy {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.5;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup strong,
.brand-lockup small {
    display: block;
}

.brand-lockup small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0;
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.stacked-form label {
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

.stacked-form input,
.stacked-form select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
}

.check-row input {
    width: 16px;
    min-height: 16px;
}

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}

.btn-secondary {
    background: #e6eef5;
    color: #1f2933;
}

.btn-block {
    width: 100%;
}

.alert {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #edf7ee;
    color: var(--green-dark);
    border: 1px solid #c8e6cb;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
    background: #111827;
    color: #dbeafe;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    color: #fff;
    margin: 0 8px 22px;
}

.side-nav {
    display: grid;
    gap: 4px;
}

.side-nav-group {
    display: grid;
}

.side-nav-group summary {
    list-style: none;
    cursor: pointer;
}

.side-nav-group summary::-webkit-details-marker {
    display: none;
}

.side-nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 6px;
    padding: 10px 12px;
    color: #cbd5e1;
}

.side-nav-caret {
    margin-left: auto;
    transition: transform .18s ease;
}

.side-nav-group[open] .side-nav-caret {
    transform: rotate(180deg);
}

.side-nav-link:hover,
.side-nav-link.is-active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.side-subnav {
    display: grid;
    gap: 2px;
    margin: 2px 0 8px 30px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.side-subnav-link {
    min-height: 34px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    padding: 8px 10px;
    color: #aebbd0;
    font-size: 14px;
}

.side-subnav-link:hover,
.side-subnav-link.is-active {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.side-nav-link svg,
.icon-btn svg,
.profile-menu svg {
    width: 18px;
    height: 18px;
}

.app-main {
    min-width: 0;
}

.topbar {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn,
.avatar {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-soft);
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu-list {
    position: absolute;
    right: 0;
    top: 48px;
    width: 190px;
    display: grid;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.profile-menu-list a,
.profile-menu-list button {
    min-height: 38px;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.profile-menu-list a:hover,
.profile-menu-list button:hover {
    background: var(--surface-soft);
}

.content {
    padding: 18px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 14px;
    align-items: start;
}

.dashboard-primary,
.dashboard-secondary {
    display: grid;
    gap: 14px;
}

.module-band {
    min-height: 210px;
    padding: 24px 36px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

.module-band-tickets {
    background: linear-gradient(90deg, #fff 0 78%, #f8fafc 78% 100%);
}

.module-band-parcel {
    background: #ffc1cf;
}

.module-band-reconciliation {
    background: #fff;
}

.module-band-reports {
    background: #f3f0ff;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h1 {
    margin: 0;
    color: var(--green-dark);
    font-size: 30px;
    line-height: 1.1;
}

.module-band-parcel .section-heading h1 {
    color: var(--orange);
}

.module-band-reconciliation .section-heading h1 {
    color: var(--blue);
}

.module-band-reports .section-heading h1 {
    color: var(--purple);
}

.section-heading p {
    margin: 8px 0 0;
    color: currentColor;
    opacity: .86;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px;
}

.action-grid-dense {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 36px;
}

.action-card {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 6px;
    padding: 14px 24px;
    color: #fff;
    font-weight: 700;
}

.action-card svg {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
}

.action-green {
    background: var(--green);
}

.action-lime {
    background: var(--lime);
}

.action-red {
    background: var(--red);
}

.action-blue {
    background: var(--blue);
}

.action-magenta {
    background: var(--magenta);
}

.action-purple {
    background: var(--purple);
}

.action-gray {
    background: #8b8f94;
}

.action-outline {
    color: #1f2933;
    background: #fff;
    border: 2px solid #4cc3e3;
}

.date-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 72px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.date-strip > div {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 12px;
}

.date-strip > div + div {
    border-left: 1px solid var(--border);
}

.clock-time {
    font-size: 38px;
    font-weight: 800;
}

.date-strip strong {
    display: block;
    font-size: 24px;
}

.date-strip span:not(.clock-time) {
    color: var(--muted);
}

.side-panel,
.panel {
    padding: 18px;
}

.side-panel h2,
.panel h2 {
    margin: 0 0 16px;
    font-size: 18px;
    text-transform: uppercase;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-title-row h2 {
    margin: 0;
}

.calendar-panel h2 {
    font-size: 28px;
    text-transform: none;
}

.calendar-panel h2 span {
    color: #3f7fc5;
}

.calendar-actions {
    display: flex;
    gap: 22px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.calendar-weekdays {
    color: #334155;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.calendar-weekdays span:first-child {
    color: var(--red);
}

.calendar-day {
    min-height: 44px;
    display: grid;
    place-items: center;
    color: #475569;
}

.calendar-day.is-muted {
    color: #a8b2bd;
}

.calendar-day.is-today {
    width: 44px;
    height: 44px;
    justify-self: center;
    align-self: center;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-weight: 800;
}

.compact-list-item {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid #eef2f7;
}

.compact-list-item:first-of-type {
    border-top: 0;
}

.compact-list-item span,
.compact-list-item small,
.empty-state,
.breadcrumbs,
.page-header p {
    color: var(--muted);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 8px 0;
    font-size: 30px;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--blue);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
}

.subworkspace-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.subworkspace-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.subworkspace-link:hover,
.subworkspace-link.is-active {
    border-color: var(--green);
    background: #eef7ed;
    color: var(--green-dark);
}

.workspace-main,
.workspace-side {
    min-width: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    background: #eaf5ed;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 700;
}

.table-filters {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.table-filters label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.table-filters select {
    min-width: 180px;
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
}

.table-action {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--blue);
    font-weight: 700;
    cursor: pointer;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-action-danger {
    color: #b91c1c;
}

.dt-container {
    font-size: 14px;
}

.dt-button {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #1f2933 !important;
}

@media (max-width: 1100px) {
    .app-shell,
    .dashboard-grid,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .side-nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .action-grid,
    .action-grid-dense {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .content,
    .topbar {
        padding: 14px;
    }

    .topbar-logo span:last-child,
    .profile-menu summary > span:not(.avatar) {
        display: none;
    }

    .module-band {
        padding: 20px;
    }

    .action-grid,
    .action-grid-dense,
    .date-strip {
        grid-template-columns: 1fr;
    }

    .page-header {
        display: grid;
    }
}
