:root {
    --brand: #1e3a5f;
    --brand-dark: #142943;
    --accent: #2b6cb0;
}

body {
    background: #f4f6f9;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    background: var(--brand-dark);
    height: 56px;
    flex-shrink: 0;
}

.app-body { display: flex; flex: 1; min-height: 0; }

.sidebar {
    width: 240px;
    background: var(--brand);
    flex-shrink: 0;
    overflow-y: auto;
    transition: margin-left .2s ease;
}

.sidebar .nav-link {
    color: rgba(255,255,255,.85);
    padding: .55rem 1rem;
    border-radius: 0;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.content { flex: 1; min-width: 0; }

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        z-index: 1030;
        margin-left: -240px;
    }
    .sidebar.show { margin-left: 0; box-shadow: 4px 0 12px rgba(0,0,0,.2); }
}

/* ---------- Dashboard cards ---------- */
.stat-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: .6rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}

/* ---------- Generic ---------- */
.table-responsive-card thead { display: none; }
@media (max-width: 767.98px) {
    .table-responsive-card table, .table-responsive-card tbody, .table-responsive-card tr, .table-responsive-card td {
        display: block; width: 100%;
    }
    .table-responsive-card tr {
        margin-bottom: .75rem;
        border: 1px solid #e2e6ea;
        border-radius: .5rem;
        padding: .5rem .75rem;
        background: #fff;
    }
    .table-responsive-card td {
        border: none;
        padding: .3rem 0;
    }
    .table-responsive-card td::before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        min-width: 120px;
        color: #6c757d;
    }
}

/* =========================================================
   SLIP DOCUMENT — matches printed "Loading Advice" format
   ========================================================= */
.slip-wrapper {
    max-width: 620px;
    margin: 0 auto;
}

.slip-doc {
    background: #fdf6e3;
    border: 2px solid #333;
    padding: 1.25rem;
    font-family: "Courier New", Consolas, monospace;
    color: #1a1a1a;
}

.slip-doc .slip-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slip-doc .slip-brand-row .brand-logo {
    font-weight: 700;
    font-size: 1rem;
}

.slip-doc .brand-logo-img {
    max-height: 48px;
    max-width: 140px;
    object-fit: contain;
}

.slip-doc .slip-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: underline;
    letter-spacing: 1px;
    margin: .25rem 0 .5rem;
}

.slip-doc .slip-company-name {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .1rem;
}

.slip-doc .slip-company-address {
    text-align: center;
    font-size: .85rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid #333;
    padding-bottom: .5rem;
}

.slip-doc .slip-meta-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-weight: 700;
    font-size: .95rem;
    border-bottom: 1px solid #333;
    padding: .35rem 0;
}

.slip-doc .slip-datetime {
    text-align: center;
    font-weight: 700;
    font-size: .95rem;
    padding: .35rem 0;
    border-bottom: 1px solid #333;
}

.slip-doc .slip-validity {
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    padding: .35rem 0;
    border-bottom: 1px solid #333;
}

.slip-doc .slip-fields {
    padding: .75rem 0;
    border-bottom: 1px solid #333;
}

.slip-doc .slip-fields .row-line {
    display: grid;
    grid-template-columns: 150px 20px 1fr;
    padding: .25rem 0;
    font-size: .95rem;
}

.slip-doc .slip-fields .row-line .label { font-weight: 700; }
.slip-doc .slip-fields .row-line .value { font-weight: 600; }

.slip-doc .slip-verify-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: .75rem 0;
    border-bottom: 1px solid #333;
    gap: 1rem;
    flex-wrap: wrap;
}

.slip-doc .slip-qr-box {
    text-align: center;
}

.slip-doc .slip-qr-box img { width: 110px; height: 110px; }

.slip-doc .signature-row {
    display: flex;
    justify-content: space-between;
    padding-top: .75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.slip-doc .signature-block {
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.slip-doc .signature-block img {
    max-height: 55px;
    max-width: 160px;
    display: block;
    margin: 0 auto .25rem;
}

.slip-doc .signature-block .sig-blank {
    height: 55px;
}

.slip-doc .signature-block .sig-line {
    border-top: 1px solid #333;
    padding-top: .2rem;
    font-size: .8rem;
    font-weight: 700;
    margin-top: .25rem;
}

.slip-doc .slip-footer-note {
    text-align: center;
    font-size: .75rem;
    margin-top: .75rem;
    font-style: italic;
    color: #444;
}

.slip-doc .demo-badge {
    display: inline-block;
    font-size: .65rem;
    background: #f0ad4e;
    color: #1a1a1a;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

/* ---------- Print ---------- */
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .app-body, .content, .container-fluid { display: block !important; padding: 0 !important; margin: 0 !important; width: 100% !important; }
    .slip-wrapper { max-width: 100%; }
    .slip-doc {
        border: 1.5px solid #000;
        background: #fff;
        box-shadow: none;
    }
    @page { size: A4; margin: 12mm; }
}
