:root {
    --app-navy: #121a3d;
    --app-navy-2: #1b2555;
    --app-blue: #0a84ff;
    --app-cyan: #16c7f3;
    --app-sky: #eaf7ff;
    --app-mist: #f5f9ff;
    --app-line: #e4ecf7;
    --app-text: #121a2f;
    --app-muted: #667085;
    --app-radius: 22px;
    --app-shadow: 0 18px 45px rgba(18, 26, 61, .10);
    --app-shadow-soft: 0 10px 28px rgba(18, 26, 61, .075);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(22, 199, 243, .13), transparent 35rem),
        linear-gradient(180deg, #ffffff 0%, var(--app-mist) 48%, #ffffff 100%);
    color: var(--app-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main.container-fluid { max-width: 1480px; }
a { color: var(--app-blue); }
.text-muted { color: var(--app-muted) !important; }

.app-navbar {
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid rgba(228,236,247,.9);
    backdrop-filter: blur(12px);
}
.app-navbar .navbar-brand {
    color: var(--app-navy) !important;
    letter-spacing: -.02em;
}
.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
    box-shadow: 0 12px 26px rgba(10,132,255,.26);
}
.brand-subtitle {
    display: block;
    color: var(--app-muted);
    font-size: .73rem;
    font-weight: 600;
    line-height: 1;
}
.app-navbar .nav-link {
    color: #34405f !important;
    font-weight: 700;
    border-radius: 999px;
    padding: .55rem .85rem !important;
    margin: .12rem .08rem;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    background: var(--app-sky);
    color: var(--app-blue) !important;
}
.navbar-toggler { border: 0; box-shadow: none !important; }
.user-pill {
    background: #f3f7ff;
    border: 1px solid var(--app-line);
    color: var(--app-navy);
    border-radius: 999px;
    padding: .55rem .8rem;
    font-weight: 700;
}

.card {
    border: 1px solid rgba(228,236,247,.95);
    border-radius: var(--app-radius);
    overflow: hidden;
}
.card.shadow-sm { box-shadow: var(--app-shadow-soft) !important; }
.card-header {
    border-bottom: 1px solid var(--app-line);
    background: #fff;
    font-weight: 800;
    letter-spacing: -.01em;
}
.card-body { position: relative; }

.btn {
    border-radius: 999px;
    font-weight: 800;
    padding-left: 1rem;
    padding-right: 1rem;
}
.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
    box-shadow: 0 12px 22px rgba(10,132,255,.22);
}
.btn-primary:hover,
.btn-primary:focus {
    border-color: transparent;
    filter: brightness(.96);
    box-shadow: 0 16px 30px rgba(10,132,255,.28);
}
.btn-outline-primary {
    color: var(--app-blue);
    border-color: rgba(10,132,255,.35);
    background: #fff;
}
.btn-outline-primary:hover { background: var(--app-blue); border-color: var(--app-blue); }
.btn-outline-secondary,
.btn-outline-light { border-radius: 999px; }

.form-control,
.form-select {
    border-radius: 16px;
    border-color: var(--app-line);
    padding: .72rem .9rem;
}
.form-control:focus,
.form-select:focus {
    border-color: rgba(10,132,255,.45);
    box-shadow: 0 0 0 .25rem rgba(10,132,255,.12);
}
.form-label { font-weight: 800; color: #27324f; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th {
    color: #5d6a84;
    font-size: .77rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #f8fbff;
    border-bottom: 1px solid var(--app-line);
}
.table-hover tbody tr:hover { background: #f7fbff; }
.badge { border-radius: 999px; padding: .45rem .7rem; text-transform: capitalize; }

.app-hero {
    position: relative;
    overflow: hidden;
    border-radius: 34px;
    padding: clamp(1.4rem, 3vw, 2.8rem);
    background:
        radial-gradient(circle at 88% 20%, rgba(22,199,243,.38), transparent 17rem),
        linear-gradient(135deg, var(--app-navy) 0%, var(--app-navy-2) 55%, #0b63ce 100%);
    color: #fff;
    box-shadow: var(--app-shadow);
}
.app-hero::after {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    right: -120px;
    bottom: -160px;
    border-radius: 50%;
    border: 54px solid rgba(255,255,255,.08);
}
.app-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.16);
    color: #dff6ff;
    border-radius: 999px;
    padding: .45rem .8rem;
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.app-hero h1 {
    max-width: 760px;
    font-size: clamp(2.1rem, 5vw, 4.35rem);
    font-weight: 900;
    line-height: .98;
    letter-spacing: -.055em;
}
.hero-highlight {
    color: var(--app-cyan);
}
.app-hero p { max-width: 690px; color: rgba(255,255,255,.78); font-size: 1.08rem; }
.hero-device {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 30px;
    color: var(--app-navy);
    box-shadow: 0 28px 80px rgba(0,0,0,.23);
}
.hero-device .mini-bar {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--app-blue), var(--app-cyan));
}
.hero-device .mini-card {
    border: 1px solid var(--app-line);
    border-radius: 18px;
    background: #fff;
}
.metric-ring {
    width: 94px;
    height: 94px;
    border-radius: 50%;
    background: conic-gradient(var(--app-blue) 0 68%, var(--app-cyan) 68% 85%, #e9eff8 85% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
}
.metric-ring span {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.stat-card {
    min-height: 136px;
    background: #fff;
}
.stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 82px;
    height: 82px;
    border-radius: 0 0 0 100%;
    background: linear-gradient(135deg, rgba(10,132,255,.08), rgba(22,199,243,.16));
}
.stat-card .stat-label { color: var(--app-muted); font-weight: 800; }
.stat-card .display-6 { color: var(--app-navy); letter-spacing: -.05em; }
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-sky);
    color: var(--app-blue);
    font-size: 1.25rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.feature-list li {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .65rem 0;
    color: #34405f;
}
.feature-list li::before {
    content: "";
    width: 10px;
    height: 10px;
    margin-top: .43rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--app-blue), var(--app-cyan));
    box-shadow: 0 0 0 5px rgba(10,132,255,.09);
    flex: 0 0 auto;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 18% 14%, rgba(22,199,243,.22), transparent 22rem),
        radial-gradient(circle at 100% 100%, rgba(10,132,255,.28), transparent 28rem),
        linear-gradient(135deg, #ffffff 0%, #f5f9ff 45%, #eaf7ff 100%);
}
.login-panel {
    width: min(1120px, 96vw);
    border-radius: 34px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 30px 90px rgba(18,26,61,.17);
    border: 1px solid rgba(228,236,247,.9);
}
.login-brand-side {
    position: relative;
    min-height: 620px;
    padding: clamp(1.6rem, 4vw, 3.4rem);
    background:
        radial-gradient(circle at 84% 20%, rgba(22,199,243,.28), transparent 16rem),
        linear-gradient(140deg, var(--app-navy) 0%, #152056 55%, #086bd9 100%);
    color: #fff;
    overflow: hidden;
}
.login-brand-side::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    right: -130px;
    bottom: -140px;
    border-radius: 50%;
    border: 62px solid rgba(255,255,255,.07);
}
.login-brand-side h1 {
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: .98;
    letter-spacing: -.06em;
    font-weight: 950;
}
.login-brand-side p { color: rgba(255,255,255,.78); font-size: 1.05rem; max-width: 540px; }
.login-card { width: 100%; border: 0; border-radius: 0; }
.login-form-side { padding: clamp(1.6rem, 4vw, 3rem); }
.login-mockup {
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    max-width: 390px;
    border-radius: 30px;
    background: rgba(255,255,255,.98);
    color: var(--app-navy);
    padding: 1.25rem;
    box-shadow: 0 26px 70px rgba(0,0,0,.25);
}
.login-mockup .mock-row {
    height: 10px;
    border-radius: 999px;
    background: #e7eef8;
    margin-bottom: .7rem;
}
.login-mockup .mock-row.primary { background: linear-gradient(90deg, var(--app-blue), var(--app-cyan)); width: 72%; }
.login-note {
    background: #f6faff;
    border: 1px solid var(--app-line);
    border-radius: 18px;
    padding: .9rem;
}

.proof-preview {
    max-height: 520px;
    width: 100%;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 1rem;
}
footer {
    border-top: 1px solid var(--app-line) !important;
    background: rgba(255,255,255,.92) !important;
}

@media (max-width: 991.98px) {
    .user-pill { width: 100%; justify-content: center; }
    .login-brand-side { min-height: auto; }
    .login-mockup { max-width: none; }
    .app-hero h1 { letter-spacing: -.04em; }
}

/* V1.0.3 Mobile-first refinements
   The app should feel like a phone workflow first, then expand gracefully on desktop. */
.app-main {
    width: 100%;
    padding-left: .85rem;
    padding-right: .85rem;
}
.page-toolbar,
.page-heading {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.page-heading h1,
.page-toolbar h1 { line-height: 1.1; }
.page-actions {
    display: flex;
    align-items: stretch;
    gap: .5rem;
    flex-wrap: wrap;
}
.touch-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: .45rem;
    flex-wrap: wrap;
}
.mobile-help-text {
    color: var(--app-muted);
    font-size: .9rem;
    margin-top: .25rem;
}
.form-actions {
    display: flex;
    gap: .65rem;
    align-items: stretch;
    flex-wrap: wrap;
}
.capture-card .form-control,
.capture-card .form-select,
.capture-card textarea,
.login-card .form-control {
    min-height: 48px;
}
.capture-card input[type="file"] {
    padding-top: .86rem;
    padding-bottom: .86rem;
}
.card-header .btn,
.page-actions .btn,
.touch-actions .btn,
.form-actions .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mobile-card-table td[data-label] .btn,
.touch-actions .btn {
    white-space: nowrap;
}
.mobile-card-table .primary-mobile-value {
    font-weight: 900;
    color: var(--app-navy);
}
.proof-frame {
    width: 100%;
    height: min(65vh, 620px);
    border: 0;
    border-radius: .75rem;
}
.details-list dt {
    color: var(--app-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.details-list dd {
    font-weight: 700;
    color: var(--app-text);
}
.report-filter-form {
    display: flex;
    gap: .5rem;
    align-items: stretch;
    flex-wrap: wrap;
}
.report-filter-form input[type="month"] { min-width: 180px; }
.empty-state-row td { text-align: center !important; }

@media (max-width: 991.98px) {
    .app-navbar .container-fluid { padding-left: .85rem; padding-right: .85rem; }
    .app-mobile-menu {
        margin-top: .8rem;
        padding: .85rem;
        border: 1px solid var(--app-line);
        border-radius: 22px;
        background: #fff;
        box-shadow: 0 18px 38px rgba(18, 26, 61, .08);
    }
    .app-navbar .nav-link {
        border-radius: 16px;
        padding: .8rem .95rem !important;
        margin: .08rem 0;
        background: #f8fbff;
    }
    .app-user-actions,
    .app-logout-btn,
    .user-pill { width: 100%; }
    .user-pill {
        display: flex;
        justify-content: center;
        text-align: center;
    }
    .app-logout-btn { justify-content: center; }
    .app-hero { border-radius: 24px; }
    .hero-device { display: none; }
    .stat-card { min-height: auto; }
}

@media (max-width: 767.98px) {
    body {
        background: linear-gradient(180deg, #ffffff 0%, #f7fbff 52%, #ffffff 100%);
    }
    .app-main {
        padding-left: .7rem;
        padding-right: .7rem;
    }
    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }
    .brand-subtitle { display: none; }
    .navbar-brand { max-width: 75%; }
    .card { border-radius: 18px; }
    .card-body { padding: 1rem; }
    .card-header {
        padding: .9rem 1rem;
        align-items: stretch !important;
    }
    .btn {
        min-height: 46px;
        padding-top: .62rem;
        padding-bottom: .62rem;
    }
    .btn-sm {
        min-height: 42px;
        padding: .5rem .85rem;
    }
    .page-toolbar,
    .page-heading { display: block; }
    .page-actions,
    .page-toolbar > .btn,
    .page-heading > .btn,
    .page-heading > div,
    .page-toolbar > div { margin-top: .75rem; width: 100%; }
    .page-actions .btn,
    .page-toolbar > .btn,
    .page-heading > .btn,
    .page-heading > div .btn,
    .page-toolbar > div .btn,
    .form-actions .btn,
    .report-filter-form .btn { width: 100%; }
    .report-filter-form,
    .report-filter-form input[type="month"] { width: 100%; }

    .app-hero {
        padding: 1.15rem;
        border-radius: 22px;
    }
    .app-hero .eyebrow { font-size: .68rem; }
    .app-hero h1 {
        font-size: 2.05rem;
        line-height: 1.02;
    }
    .app-hero p { font-size: .96rem; }
    .app-hero .btn { width: 100%; }

    .login-shell {
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        background: #fff;
    }
    .login-panel {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        border: 0;
    }
    .login-brand-side {
        min-height: auto;
        padding: 1.25rem 1rem;
        border-radius: 0 0 28px 28px;
    }
    .login-brand-side .mb-5 { margin-bottom: 1.25rem !important; }
    .login-brand-side h1 {
        font-size: 2.1rem;
        line-height: 1.04;
    }
    .login-brand-side p { font-size: .95rem; }
    .login-brand-side .eyebrow { font-size: .68rem; }
    .login-mockup { display: none; }
    .login-form-side {
        padding: 1.1rem .9rem 1.5rem;
        align-items: flex-start !important;
    }
    .login-card { box-shadow: none !important; }
    .login-card h2 { font-size: 1.7rem; }

    .mobile-card-table-wrapper {
        overflow: visible !important;
    }
    table.mobile-card-table,
    table.mobile-card-table thead,
    table.mobile-card-table tbody,
    table.mobile-card-table th,
    table.mobile-card-table td,
    table.mobile-card-table tr {
        display: block;
    }
    table.mobile-card-table thead { display: none; }
    table.mobile-card-table tbody {
        padding: .75rem;
        display: grid;
        gap: .75rem;
        background: #f8fbff;
    }
    table.mobile-card-table tr {
        border: 1px solid var(--app-line);
        border-radius: 18px;
        padding: .85rem;
        background: #fff;
        box-shadow: 0 10px 26px rgba(18, 26, 61, .055);
    }
    table.mobile-card-table tr.empty-state-row {
        box-shadow: none;
        text-align: center;
    }
    table.mobile-card-table td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        align-items: flex-start;
        border: 0 !important;
        padding: .4rem 0 !important;
        text-align: right !important;
        word-break: break-word;
    }
    table.mobile-card-table td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--app-muted);
        text-align: left;
        flex: 0 0 42%;
        font-size: .78rem;
        text-transform: uppercase;
        letter-spacing: .04em;
    }
    table.mobile-card-table td.mobile-primary {
        display: block;
        text-align: left !important;
        border-bottom: 1px solid var(--app-line) !important;
        padding-bottom: .65rem !important;
        margin-bottom: .2rem;
    }
    table.mobile-card-table td.mobile-primary::before {
        display: block;
        margin-bottom: .12rem;
    }
    table.mobile-card-table td.mobile-actions {
        display: block;
        text-align: stretch !important;
        padding-top: .75rem !important;
        border-top: 1px dashed var(--app-line) !important;
    }
    table.mobile-card-table td.mobile-actions::before { display: none; }
    table.mobile-card-table td.mobile-actions .btn,
    table.mobile-card-table td.mobile-actions a.btn {
        width: 100%;
    }

    .details-list dt,
    .details-list dd {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .details-list dd {
        margin-bottom: .9rem;
        padding-bottom: .75rem;
        border-bottom: 1px solid var(--app-line);
    }
    .proof-preview { max-height: 58vh; }
    .proof-frame { height: 58vh; }
    footer .container-fluid { display: block !important; text-align: center; }
    footer .badge { margin-top: .35rem; }
}

@media (min-width: 768px) {
    .app-main {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Alpha additions */
.upload-drop-zone{border:2px dashed rgba(26,104,255,.25);border-radius:24px;padding:2rem;text-align:center;background:linear-gradient(180deg,#f8fbff,#fff)}
.ocr-text-box{white-space:pre-wrap;max-height:420px;overflow:auto;background:#07152f;color:#dbeafe;border-radius:18px;padding:1rem;font-size:.85rem;line-height:1.45}
.details-list dt{color:#64748b;font-weight:700}.details-list dd{word-break:break-word}.app-footer{border-top:1px solid rgba(15,23,42,.08);background:#fff}.form-actions .btn{min-height:44px}.table .form-control-sm{min-width:120px}.proof-frame{width:100%;min-height:70vh;border:0;border-radius:18px}.proof-preview{max-width:100%;max-height:75vh;border-radius:18px;box-shadow:0 20px 50px rgba(15,23,42,.15)}
@media (max-width: 768px){
  .upload-drop-zone{padding:1.25rem}.page-heading{gap:1rem}.page-actions{display:grid;width:100%;grid-template-columns:1fr;gap:.5rem}.page-actions .btn{width:100%}.btn-lg{font-size:1rem}.app-main{padding-left:.75rem!important;padding-right:.75rem!important}.card-body{padding:1rem}.mobile-card-table td.mobile-actions form{display:grid!important;gap:.35rem;margin-top:.4rem}.mobile-card-table td.mobile-actions .btn{width:100%;margin-bottom:.25rem}.proof-frame{min-height:62vh}.ocr-text-box{max-height:300px}
}
