:root {
    --navy: #1B3A5C;
    --green: #2ECC71;
    --teal: #0F6E56;
    --blue: #185FA5;
    --blue-lt: #E6F1FB;
    --blue-dk: #0C447C;
    --red: #A32D2D;
    --red-lt: #FCEBEB;
    --amber: #854F0B;
    --amber-lt: #FAEEDA;
    --g100: #F5F6F7;
    --g200: #D5DCE3;
    --g500: #8A9BAC;
    --g900: #1A1A2E;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'SF Mono', 'Fira Code', monospace
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--g900);
    background: #F0F2F5
}
.auth-screen {
    display: none;
}

.auth-screen.active {
    display: flex;
}
.app-body {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px)
}

.sidebar {
    width: 210px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #E8EDF2;
    padding: 8px 0 24px;
    overflow-y: auto;
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    z-index: 50;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.nav-group {
    font-size: 10px;
    font-weight: 700;
    color: #9AA7B5;
    text-transform: uppercase;
    letter-spacing: .7px;
    padding: 16px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 1px 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: #51606F;
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px;
    transition: background .12s ease, color .12s ease;
}

.nav-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #9AA7B5;
    transition: color .12s ease;
}

.nav-item:hover {
    background: #F4F7FA;
    color: #1B3A5C;
}

.nav-item:hover .nav-ico {
    color: #5A6B7B;
}

.nav-item.active {
    background: #E9F2FB;
    color: #0C447C;
    font-weight: 600;
}

.nav-item.active .nav-ico {
    color: #185FA5;
}

/* Lot trash — indented red sub-item under Recycling lots */
.nav-subitem {
    margin-left: 22px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 12px;
    color: #B14242;
}

.nav-subitem .nav-ico {
    width: 16px;
    height: 16px;
    color: #CC9595;
}

.nav-subitem:hover {
    background: #FCEFEF;
    color: #8E2D2D;
}

.nav-subitem:hover .nav-ico {
    color: #B14242;
}

.main-content {
    flex: 1;
    margin-left: 210px;
    padding: 20px;
    min-height: calc(100vh - 64px);
    overflow-x: hidden;
}

.card {
    background: #fff;
    border: .5px solid #D5DCE3;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08)
}

.stat-card {
    background: #fff;
    border: .5px solid #D5DCE3;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08)
}

.stat-label {
    font-size: 11px;
    color: #8A9BAC;
    margin-bottom: 2px
}

.stat-value {
    font-size: 22px;
    font-weight: 500;
    color: #1B3A5C
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px
}

.fg {
    display: flex;
    flex-direction: column;
    gap: 3px
}

.fg label {
    font-size: 11px;
    font-weight: 500;
    color: #8A9BAC
}

.fg input,
.fg select,
.fg textarea {
    font-size: 13px;
    padding: 7px 9px;
    border: .5px solid #D5DCE3;
    border-radius: 6px;
    background: #F5F6F7;
    color: #1A1A2E;
    width: 100%
}

.fg input:focus,
.fg select:focus,
.fg textarea:focus {
    outline: none;
    border-color: #185FA5;
    box-shadow: 0 0 0 2px rgba(24, 95, 165, .12)
}

.fg input[readonly] {
    color: #185FA5;
    font-weight: 500;
    background: #E6F1FB
}

.fg textarea {
    resize: vertical;
    min-height: 58px
}

.g2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.g3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px
}

.g4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px
}

.s2 {
    grid-column: span 2
}

.s3 {
    grid-column: span 3
}

.s4 {
    grid-column: 1/-1
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: 6px;
    border: .5px solid #D5DCE3;
    background: transparent;
    color: #1A1A2E;
    cursor: pointer;
    white-space: nowrap
}

.btn:hover {
    background: #F5F6F7
}

.btn.primary {
    background: #1B3A5C;
    color: #E6F1FB;
    border-color: #1B3A5C
}

.btn.primary:hover {
    background: #0C2A45
}

.btn.green {
    background: #0F6E56;
    color: #EAF3DE;
    border-color: #0F6E56
}

.btn.sm {
    padding: 3px 9px;
    font-size: 11px
}

.btn.danger {
    color: #A32D2D;
    border-color: #A32D2D
}

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500
}

.pill.green {
    background: #EAF3DE;
    color: #27500A
}

.pill.blue {
    background: #E6F1FB;
    color: #0C447C
}

.pill.amber {
    background: #FAEEDA;
    color: #633806
}

.pill.red {
    background: #FCEBEB;
    color: #791F1F
}

.pill.purple {
    background: #EEEDFE;
    color: #3C3489
}

.pill.gray {
    background: #F5F6F7;
    color: #8A9BAC
}

.pill.teal {
    background: #E1F5EE;
    color: #085041
}

.table-card {
    background: #fff;
    border: .5px solid #D5DCE3;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08)
}

.table-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: .5px solid #D5DCE3;
    gap: 8px;
    flex-wrap: wrap
}

.table-title {
    font-size: 13px;
    font-weight: 500;
    color: #1B3A5C
}

.tf {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.tf input,
.tf select {
    font-size: 11px;
    padding: 4px 8px;
    border: .5px solid #D5DCE3;
    border-radius: 6px;
    background: #F5F6F7;
    color: #1A1A2E
}

table.dt {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px
}

table.dt th {
    background: #F5F6F7;
    color: #8A9BAC;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 7px 10px;
    text-align: left;
    border-bottom: .5px solid #D5DCE3;
    white-space: nowrap
}

table.dt td {
    padding: 8px 10px;
    border-bottom: .5px solid #D5DCE3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle
}

table.dt tr:last-child td {
    border-bottom: none
}

table.dt tr:hover td {
    background: #FAFBFC
}

.mono {
    font-family: var(--mono);
    font-size: 10px;
    color: #8A9BAC
}

.t-empty {
    padding: 2.5rem;
    text-align: center;
    color: #8A9BAC;
    font-size: 12px
}

.info-box {
    background: #E6F1FB;
    border: .5px solid #185FA5;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 11px;
    color: #0C447C;
    margin-bottom: 12px;
    line-height: 1.6
}

.warn-box {
    background: #FAEEDA;
    border: .5px solid #854F0B;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 11px;
    color: #633806;
    margin-bottom: 12px;
    line-height: 1.6
}

.alert-box {
    background: #FCEBEB;
    border: .5px solid #A32D2D;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 11px;
    color: #791F1F;
    margin-bottom: 12px;
    line-height: 1.6
}

.ok-box {
    background: #EAF3DE;
    border: .5px solid #3B6D11;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 11px;
    color: #27500A;
    margin-bottom: 12px;
    line-height: 1.6
}

.hint {
    font-size: 10px;
    color: #8A9BAC;
    margin-top: 3px
}

.ph {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px
}

.ph-title {
    font-size: 18px;
    font-weight: 500;
    color: #1B3A5C
}

.ph-sub {
    font-size: 11px;
    color: #8A9BAC;
    margin-top: 2px
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .main-content {
        margin-left: 0 !important;
        padding: 12px !important
    }

    .g2,
    .g3,
    .g4 {
        grid-template-columns: 1fr
    }

    .s2,
    .s3,
    .s4 {
        grid-column: span 1
    }
}

.auth-screen.active~.app-body {
    display: none !important
}

/* Connection status pulse animation */
@keyframes conn-pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .4
    }
}

#conn-dot.pulsing {
    animation: conn-pulse 0.9s ease-in-out infinite;
}
