:root{
    --brand-primary:#15231c;
    --brand-accent:#79c143;
    --bg:#f4f5f4;
    --card:#ffffff;
    --line:#dfe4e0;
    --text:#17211c;
    --muted:#6d7771;
    --danger:#9f3030;
    --radius:12px;
}
*{
    box-sizing:border-box;
}
html{
    min-height:100%;
}
body{
    min-height:100%;
    margin:0;
    color:var(--text);
    background:var(--bg);
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
a{
    color:inherit;
}
.app-shell{
    min-height:100vh;
    display:grid;
    grid-template-columns:235px minmax(0,1fr);
}
.sidebar{
    position:sticky;
    top:0;
    height:100vh;
    display:flex;
    flex-direction:column;
    padding:18px 14px;
    color:#fff;
    background:var(--brand-primary);
}
.brand-block{
    display:flex;
    align-items:center;
    gap:11px;
    min-height:58px;
    padding:0 7px 18px;
    border-bottom:1px solid rgba(255,255,255,.12);
}
.brand-mark,
.business-logo-wrap{
    width:44px;
    height:44px;
    flex:0 0 44px;
    display:grid;
    place-items:center;
    overflow:hidden;
    border-radius:10px;
    background:#fff;
}
.brand-mark{
    color:#fff;
    background:var(--brand-accent);
    font-weight:900;
}
.brand-mark.large{
    width:62px;
    height:62px;
    margin:0 auto;
    border-radius:14px;
    font-size:21px;
}
.business-logo{
    width:100%;
    height:100%;
    padding:5px;
    object-fit:contain;
}
.brand-copy{
    min-width:0;
}
.brand-copy strong,
.brand-copy small{
    display:block;
}
.brand-copy strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:14px;
}
.brand-copy small{
    margin-top:3px;
    color:rgba(255,255,255,.68);
    font-size:10px;
}
.main-nav{
    display:grid;
    gap:3px;
    padding-top:16px;
}
.main-nav a{
    padding:10px 11px;
    border-radius:8px;
    text-decoration:none;
    font-size:14px;
    font-weight:650;
}
.main-nav a:hover{
    background:rgba(255,255,255,.09);
}
.sidebar-bottom{
    margin-top:auto;
}
.account-card{
    padding:11px;
    border-radius:9px;
    background:rgba(255,255,255,.08);
}
.account-card b,
.account-card small{
    display:block;
}
.account-card small{
    margin-top:3px;
    color:rgba(255,255,255,.65);
    font-size:11px;
}
.logout-link{
    display:block;
    padding:10px 11px 0;
    color:rgba(255,255,255,.7);
    font-size:12px;
    text-decoration:none;
}
.main{
    min-width:0;
}
.topbar{
    height:72px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:0 24px;
    border-bottom:1px solid var(--line);
    background:#fff;
}
.topbar h1{
    margin:0;
    font-size:22px;
}
.topbar-business{
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}
.content{
    width:min(1180px,100%);
    padding:22px;
    margin:0 auto;
}
.card,
.welcome-card{
    padding:18px;
    margin-bottom:15px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:#fff;
}
.card h2,
.welcome-card h2{
    margin:0 0 7px;
    font-size:19px;
}
.card p,
.welcome-card p{
    margin:5px 0;
    color:var(--muted);
}
.welcome-card{
    display:flex;
    align-items:center;
    min-height:125px;
    color:#fff;
    border:0;
    background:var(--brand-primary);
}
.welcome-card small{
    color:var(--brand-accent);
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.welcome-card h2{
    margin-top:5px;
    font-size:26px;
}
.welcome-card p{
    color:rgba(255,255,255,.72);
}
.simple-action-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-bottom:16px;
}
.simple-action{
    display:flex;
    align-items:center;
    gap:13px;
    min-height:92px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:#fff;
    text-decoration:none;
}
.simple-action:hover{
    border-color:var(--brand-accent);
}
.action-icon{
    width:44px;
    height:44px;
    flex:0 0 44px;
    display:grid;
    place-items:center;
    border-radius:10px;
    color:#fff;
    background:var(--brand-primary);
    font-weight:900;
}
.simple-action b,
.simple-action small{
    display:block;
}
.simple-action small{
    margin-top:4px;
    color:var(--muted);
}
.compact-card{
    padding:16px;
}
.section-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
}
.button-row,
.page-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}
.grid{
    display:grid;
    gap:14px;
}
.grid.two{
    grid-template-columns:repeat(2,minmax(0,1fr));
}
.form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:11px;
}
.field{
    display:grid;
    gap:6px;
    margin-bottom:12px;
}
.field.full{
    grid-column:1/-1;
}
label{
    color:#334039;
    font-size:12px;
    font-weight:750;
}
input,
select,
textarea{
    width:100%;
    min-height:43px;
    padding:9px 10px;
    border:1px solid #cfd7d2;
    border-radius:8px;
    color:var(--text);
    background:#fff;
    font:inherit;
}
input[type=color]{
    padding:4px;
}
input[type=checkbox]{
    width:auto;
    min-height:auto;
}
textarea{
    min-height:100px;
    resize:vertical;
}
small{
    color:var(--muted);
}
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:8px 13px;
    border:1px solid var(--line);
    border-radius:8px;
    color:var(--text);
    background:#fff;
    text-decoration:none;
    cursor:pointer;
    font:inherit;
    font-size:13px;
    font-weight:750;
}
.btn.primary{
    color:#fff;
    border-color:var(--brand-primary);
    background:var(--brand-primary);
}
.btn.danger{
    color:#fff;
    border-color:var(--danger);
    background:var(--danger);
}
.btn.small{
    min-height:32px;
    padding:5px 9px;
    font-size:12px;
}
.btn.full{
    width:100%;
}
.alert{
    padding:11px 13px;
    margin-bottom:13px;
    border-radius:8px;
}
.alert.success{
    border:1px solid #9bc78b;
    background:#eff8eb;
}
.alert.error{
    border:1px solid #dba1a1;
    background:#fff1f1;
}
.settings-links{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:11px;
    margin-bottom:14px;
}
.settings-link-card{
    display:block;
    padding:14px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
    text-decoration:none;
}
.settings-link-card b,
.settings-link-card span{
    display:block;
}
.settings-link-card span{
    margin-top:4px;
    color:var(--muted);
    font-size:12px;
}
.logo-preview,
.logo-placeholder{
    height:150px;
    display:grid;
    place-items:center;
    margin-bottom:14px;
    border:1px dashed #c8d1cb;
    border-radius:10px;
    background:#f8faf9;
}
.logo-preview img{
    max-width:90%;
    max-height:125px;
    object-fit:contain;
}
.logo-placeholder{
    color:var(--muted);
}
.remove-logo-form{
    margin-top:9px;
}
.colour-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}
.simple-details{
    margin:12px 0;
    border:1px solid var(--line);
    border-radius:9px;
    background:#fafbfa;
}
.simple-details summary{
    padding:11px 12px;
    cursor:pointer;
    font-size:13px;
    font-weight:750;
}
.details-content{
    padding:0 12px 12px;
}
.builder-intro{
    padding:15px 18px;
}
.builder-grid{
    align-items:start;
}
.simple-check-list{
    display:grid;
    gap:8px;
    margin:12px 0;
}
.simple-check-list label,
.advanced-check{
    display:flex;
    align-items:center;
    gap:8px;
    padding:9px 10px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fafbfa;
}
.role-check-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}
.role-check-grid label{
    display:flex;
    align-items:center;
    gap:7px;
    padding:8px;
    border:1px solid var(--line);
    border-radius:7px;
    background:#fff;
}
.simple-field-list{
    display:grid;
    gap:8px;
}
.simple-field-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:11px;
    border:1px solid var(--line);
    border-radius:9px;
}
.simple-field-row b,
.simple-field-row small{
    display:block;
}
.simple-field-row small{
    margin-top:4px;
}
.row-actions{
    display:flex;
    align-items:center;
    gap:6px;
}
.inline-form{
    display:inline;
}
.empty-state{
    padding:24px;
    text-align:center;
    color:var(--muted);
}
.empty-state.compact{
    padding:15px;
}
.simple-module-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}
.simple-module-option{
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fafbfa;
}
.portal-active-check{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:10px;
}
.slug-input{
    display:flex;
    align-items:center;
    overflow:hidden;
    border:1px solid #cfd7d2;
    border-radius:8px;
    background:#f6f8f7;
}
.slug-input span{
    padding-left:9px;
    color:var(--muted);
    font-size:11px;
}
.slug-input input{
    border:0;
    border-radius:0;
    background:#fff;
}
.table-wrap{
    overflow:auto;
}
table{
    width:100%;
    border-collapse:collapse;
}
th,
td{
    padding:10px;
    border-bottom:1px solid var(--line);
    text-align:left;
    vertical-align:top;
}
.auth-page{
    min-height:100vh;
    background:#edf1ee;
}
.login-shell{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:18px;
}
.login-card{
    width:min(410px,100%);
    padding:26px;
    border:1px solid var(--line);
    border-radius:15px;
    background:#fff;
    box-shadow:0 18px 45px rgba(21,35,28,.1);
}
.login-card h1,
.login-card p{
    text-align:center;
}
.login-card h1{
    margin:15px 0 5px;
    font-size:24px;
}
.login-card p{
    margin:0 0 18px;
    color:var(--muted);
}
.login-logo{
    display:block;
    max-width:220px;
    max-height:100px;
    margin:0 auto;
    object-fit:contain;
}
.powered{
    display:block;
    margin-top:14px;
    text-align:center;
}
.mobile-nav{
    display:none;
}
.muted{
    color:var(--muted);
}
@media(max-width:900px){
    .app-shell{
        grid-template-columns:1fr;
    }
    .sidebar{
        position:relative;
        height:auto;
        display:block;
        padding:12px 14px;
    }
    .main-nav,
    .sidebar-bottom{
        display:none;
    }
    .brand-block{
        min-height:50px;
        padding-bottom:0;
        border:0;
    }
    .topbar{
        height:60px;
        padding:0 15px;
    }
    .topbar h1{
        font-size:19px;
    }
    .topbar-business{
        display:none;
    }
    .content{
        padding:14px 14px 82px;
    }
    .mobile-nav{
        position:fixed;
        z-index:50;
        left:0;
        right:0;
        bottom:0;
        display:flex;
        justify-content:space-around;
        gap:3px;
        padding:8px 8px calc(8px + env(safe-area-inset-bottom));
        border-top:1px solid var(--line);
        background:#fff;
    }
    .mobile-nav a{
        min-width:65px;
        padding:8px 6px;
        border-radius:7px;
        text-align:center;
        text-decoration:none;
        font-size:11px;
        font-weight:750;
    }
}
@media(max-width:700px){
    .grid.two,
    .form-grid,
    .settings-links,
    .simple-action-grid,
    .simple-module-grid,
    .colour-row,
    .role-check-grid{
        grid-template-columns:1fr;
    }
    .welcome-card{
        min-height:105px;
    }
    .welcome-card h2{
        font-size:22px;
    }
    .button-row,
    .page-actions{
        display:grid;
        grid-template-columns:1fr;
    }
    .button-row .btn,
    .page-actions .btn{
        width:100%;
    }
    .simple-field-row{
        display:block;
    }
    .row-actions{
        margin-top:9px;
    }
}


/* Empire33 operational modules and original Daily Takings */
.main-nav a.active{
    background:rgba(255,255,255,.12);
}
.weekly-heading{
    align-items:flex-end;
    margin-bottom:14px;
}
.weekly-heading h2{
    margin:0 0 4px;
}
.weekly-kpi-row{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.summary-kpi-grid,
.report-kpi-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:10px;
}
.weekly-sheet-card{
    margin-top:14px;
}
.daily-takings-grid{
    display:grid;
    grid-template-columns:repeat(7,minmax(140px,1fr));
    gap:9px;
    overflow-x:auto;
    padding-bottom:4px;
}
.daily-takings-card{
    min-width:140px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#f9fbfa;
}
.daily-takings-card header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:8px;
    padding-bottom:9px;
    margin-bottom:10px;
    border-bottom:1px solid var(--line);
}
.daily-takings-card header strong,
.daily-takings-card header small{
    display:block;
}
.daily-takings-card .field{
    margin-bottom:8px;
}
.daily-takings-card input{
    min-height:39px;
}
.extra-daily-block{
    padding:12px;
    margin-bottom:12px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#f9fbfa;
}
.extra-daily-block h3{
    margin:0 0 10px;
}
.extra-seven-day-grid{
    display:grid;
    grid-template-columns:repeat(7,minmax(100px,1fr));
    gap:8px;
    overflow-x:auto;
}
.weekly-save-bar{
    position:sticky;
    z-index:12;
    bottom:12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:11px 13px;
    margin-top:16px;
    border:1px solid var(--line);
    border-radius:11px;
    background:rgba(255,255,255,.96);
    box-shadow:0 10px 28px rgba(21,35,28,.12);
    backdrop-filter:blur(8px);
}
.standard-field-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
}
.standard-field-option{
    display:flex;
    align-items:center;
    gap:8px;
    padding:11px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#fafbfa;
}
.supplier-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}
.supplier-card-head{
    display:flex;
    justify-content:space-between;
    gap:10px;
}
.supplier-card h3{
    margin:0 0 4px;
}
.supplier-outstanding{
    padding:13px;
    margin:13px 0 9px;
    border-radius:9px;
    background:#f2f6f3;
}
.supplier-outstanding span,
.supplier-outstanding b{
    display:block;
}
.supplier-outstanding span{
    color:var(--muted);
    font-size:11px;
    font-weight:800;
}
.supplier-outstanding b{
    margin-top:4px;
    font-size:22px;
}
.scanner-upload-panel{
    padding:14px;
    margin-bottom:16px;
    border:1px dashed #bdc9c1;
    border-radius:11px;
    background:#f6f9f7;
}
.scan-status{
    padding:10px 0;
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}
.scan-progress-wrap{
    height:8px;
    overflow:hidden;
    border-radius:999px;
    background:#dde5df;
}
.scan-progress{
    width:0;
    height:100%;
    transition:width .3s ease;
    background:var(--brand-accent);
}
.scan-warnings{
    padding:11px;
    margin-top:10px;
    border:1px solid #ddb36e;
    border-radius:8px;
    background:#fff8e9;
}
.scan-warnings ul{
    margin:6px 0 0;
    padding-left:20px;
}
.invoice-preview{
    margin-top:12px;
}
.invoice-preview img,
.invoice-preview-object{
    display:block;
    width:100%;
    max-height:430px;
    border:1px solid var(--line);
    border-radius:9px;
    object-fit:contain;
    background:#fff;
}
.invoice-preview-object{
    min-height:420px;
}
.supplier-entry-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
}
.confidence-panel{
    padding:11px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#f8faf9;
}
.confidence-items{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:8px;
}
.confidence-items span{
    padding:6px 8px;
    border-radius:7px;
    background:#fff;
    font-size:12px;
}
.invoice-save-button{
    min-width:210px;
}
.invoice-filter,
.report-filter{
    display:flex;
    align-items:end;
    gap:8px;
}
.invoice-filter input{
    flex:1;
}
.invoice-filter select{
    max-width:260px;
}
.status-pill{
    display:inline-flex;
    padding:5px 8px;
    border-radius:999px;
    font-size:11px;
    font-weight:800;
    background:#edf1ef;
}
.status-pill.paid{
    color:#286516;
    background:#eaf5e5;
}
.status-pill.overdue{
    color:#8c2424;
    background:#fdeaea;
}
.status-pill.part-paid{
    color:#75550e;
    background:#fff3d8;
}
.danger-zone{
    border-color:#e1abab;
}
.good{
    color:#2e6c1b;
}
.bad{
    color:#9b2e2e;
}
.strategy-warning{
    padding:11px 13px;
    margin-bottom:9px;
    border-left:4px solid #c38a24;
    border-radius:7px;
    background:#fff7e7;
}
.payment-plan-kpis{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:8px;
    margin-top:14px;
}
.payment-plan-kpis>div{
    padding:11px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#f8faf9;
}
.payment-plan-kpis span,
.payment-plan-kpis b{
    display:block;
}
.payment-plan-kpis span{
    color:var(--muted);
    font-size:11px;
    font-weight:800;
}
.payment-plan-kpis b{
    margin-top:4px;
    font-size:18px;
}
.coverage-note{
    padding:10px 12px;
    margin-top:11px;
    border-radius:8px;
    background:#edf5e9;
}
.payment-list{
    display:grid;
    gap:9px;
}
.payment-recommendation,
.supplier-payment-plan{
    padding:13px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
}
.payment-recommendation{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.payment-recommendation h3,
.supplier-payment-plan h3{
    margin:0 0 4px;
}
.recommendation-amount{
    display:flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}
.supplier-payment-plan.priority{
    border:2px solid var(--brand-accent);
    background:#f7fbf4;
}
.supplier-payment-plan>header{
    display:flex;
    justify-content:space-between;
    gap:12px;
}
.invoice-payment-line{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:10px;
    margin-top:8px;
    border-radius:8px;
    background:#f6f8f7;
}
.invoice-payment-line small{
    display:block;
    margin-top:4px;
}
.report-filter .field{
    min-width:180px;
    margin:0;
}
.mobile-card-table td small{
    display:block;
    margin-top:3px;
}
@media(max-width:1100px){
    .summary-kpi-grid,
    .report-kpi-grid,
    .payment-plan-kpis{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
    .supplier-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .standard-field-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
@media(max-width:760px){
    .weekly-kpi-row,
    .summary-kpi-grid,
    .report-kpi-grid,
    .payment-plan-kpis,
    .supplier-grid,
    .standard-field-grid,
    .supplier-entry-row{
        grid-template-columns:1fr;
    }
    .daily-takings-grid{
        display:block;
        overflow:visible;
    }
    .daily-takings-card{
        min-width:0;
        margin-bottom:10px;
    }
    .extra-seven-day-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        overflow:visible;
    }
    .weekly-save-bar{
        bottom:72px;
    }
    .invoice-filter,
    .report-filter{
        display:grid;
        grid-template-columns:1fr;
    }
    .invoice-filter select{
        max-width:none;
    }
    .payment-recommendation,
    .supplier-payment-plan>header,
    .invoice-payment-line{
        display:block;
    }
    .recommendation-amount{
        margin-top:9px;
        justify-content:space-between;
    }
    .invoice-payment-line>div:last-child{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:8px;
        margin-top:8px;
    }
    .mobile-card-table thead{
        display:none;
    }
    .mobile-card-table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td{
        display:block;
        width:100%;
    }
    .mobile-card-table tr{
        padding:10px;
        margin-bottom:9px;
        border:1px solid var(--line);
        border-radius:9px;
    }
    .mobile-card-table td{
        display:flex;
        justify-content:space-between;
        gap:12px;
        padding:6px 0;
        border:0;
        text-align:right;
    }
    .mobile-card-table td::before{
        content:attr(data-label);
        color:var(--muted);
        text-align:left;
        font-size:11px;
        font-weight:800;
    }
}

.custom-summary-list{
    display:grid;
    gap:9px;
}
.custom-summary-item{
    padding:12px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#f9fbfa;
}
.custom-day-values{
    display:grid;
    grid-template-columns:repeat(7,minmax(75px,1fr));
    gap:7px;
    margin-top:9px;
}
.custom-day-values span{
    padding:8px;
    border-radius:7px;
    background:#fff;
}
.custom-day-values small,
.custom-day-values strong{
    display:block;
}
.custom-day-values strong{
    margin-top:3px;
}
.custom-weekly-value{
    margin-top:7px;
    font-size:16px;
}
@media(max-width:760px){
    .custom-day-values{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}


/* Rename standard Daily Takings fields */
.standard-heading-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin:14px 0;
}
.rename-standard-list{
    display:grid;
    gap:9px;
}
.rename-standard-row{
    display:grid;
    grid-template-columns:95px minmax(0,1fr);
    gap:12px;
    align-items:end;
    padding:11px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fafbfa;
}
.show-field-toggle{
    min-height:43px;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 8px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
}
.show-field-toggle input{
    width:auto;
    min-height:auto;
}
.rename-field-input{
    margin:0;
}
.show-field-spacer{
    align-self:center;
    color:var(--muted);
    font-size:11px;
    font-weight:700;
}
@media(max-width:700px){
    .standard-heading-grid,
    .rename-standard-row{
        grid-template-columns:1fr;
    }
}
