/* ==========================================================================
   IDAS — Inland Document Acknowledgement System
   Theme: Modern Corporate · Inland Blue · Professional Legal Document Portal
   ========================================================================== */

:root {
    --inland-blue: #0b3b8c;
    --inland-blue-700: #0a3278;
    --inland-blue-600: #1565c0;
    --inland-blue-100: #dbe7fb;
    --inland-blue-50: #eef3fb;
    --inland-gold: #c9a227;
    --ink: #1f2a3d;
    --muted: #5b6b82;
    --border: #dbe3ef;
    --surface: #ffffff;
    --bg: #f4f6fa;
    --success: #1e8e4e;
    --success-50: #e3f4ea;
    --warning: #f0b429;
    --danger: #d64545;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 38, 84, .06), 0 1px 3px rgba(16, 38, 84, .08);
    --shadow: 0 6px 24px rgba(16, 38, 84, .08);

    --bs-primary: var(--inland-blue);
    --bs-primary-rgb: 11, 59, 140;
    --bs-link-color: var(--inland-blue-600);
    --bs-link-color-rgb: 21, 101, 192;
    --bs-link-hover-color: var(--inland-blue);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--border);
    --bs-border-radius: 8px;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); font-size: .95rem; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
.text-muted, .form-text { color: var(--muted) !important; }
.mono { font-family: "JetBrains Mono", Consolas, "Courier New", monospace; letter-spacing: .02em; }
.fw-semibold { font-weight: 600 !important; }
.text-pre-wrap { white-space: pre-wrap; }
.small-caps { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--inland-blue-600); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 8px; }
.btn-primary {
    --bs-btn-bg: var(--inland-blue); --bs-btn-border-color: var(--inland-blue);
    --bs-btn-hover-bg: var(--inland-blue-700); --bs-btn-hover-border-color: var(--inland-blue-700);
    --bs-btn-active-bg: var(--inland-blue-700); --bs-btn-active-border-color: var(--inland-blue-700);
    --bs-btn-disabled-bg: #6f88b8; --bs-btn-disabled-border-color: #6f88b8;
}
.btn-outline-primary {
    --bs-btn-color: var(--inland-blue); --bs-btn-border-color: var(--inland-blue);
    --bs-btn-hover-bg: var(--inland-blue); --bs-btn-hover-border-color: var(--inland-blue);
    --bs-btn-active-bg: var(--inland-blue); --bs-btn-active-border-color: var(--inland-blue);
}
.btn-ack {
    background: linear-gradient(135deg, var(--inland-blue) 0%, var(--inland-blue-600) 100%);
    color: #fff; border: 0; padding: .9rem 2rem; font-size: 1.05rem; letter-spacing: .06em;
    box-shadow: 0 8px 20px rgba(11, 59, 140, .25);
}
.btn-ack:hover, .btn-ack:focus { color: #fff; filter: brightness(1.07); box-shadow: 0 10px 24px rgba(11, 59, 140, .32); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--inland-blue-600); box-shadow: 0 0 0 .2rem rgba(21, 101, 192, .15); }
.form-check-input:checked { background-color: var(--inland-blue); border-color: var(--inland-blue); }
.form-label { font-weight: 600; font-size: .86rem; color: #33415c; }
.required::after { content: " *"; color: var(--danger); }

/* ---------- Public navbar ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.site-header .navbar { padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand img { width: 46px; height: 42px; object-fit: contain; }
.admin-sidebar .brand img, .admin-offcanvas .brand img { background: #fff; border-radius: 10px; padding: 4px; width: 46px; height: 46px; }
.brand-name { font-weight: 800; letter-spacing: .14em; color: var(--inland-blue); line-height: 1; font-size: 1.05rem; }
.brand-sub { display: block; font-size: .64rem; letter-spacing: .2em; color: var(--muted); font-weight: 600; margin-top: .25rem; }
.site-header .nav-link { font-weight: 600; color: #33415c; padding-left: .9rem !important; padding-right: .9rem !important; }
.site-header .nav-link.active, .site-header .nav-link:hover { color: var(--inland-blue); }

/* ---------- Hero / landing ---------- */
.hero {
    background: radial-gradient(1200px 400px at 85% -10%, rgba(255, 255, 255, .14), transparent 60%),
                linear-gradient(135deg, var(--inland-blue) 0%, #0e4aa8 55%, var(--inland-blue-600) 100%);
    color: #fff; position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; inset: auto -10% -60% auto; width: 520px; height: 520px; border-radius: 50%;
    border: 70px solid rgba(255, 255, 255, .05);
}
.hero h1 { font-weight: 800; letter-spacing: -.02em; }
.hero .lead { color: #d6e4ff; }
.hero-badge { display: inline-flex; gap: .5rem; align-items: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); padding: .35rem .8rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.hero-card { background: rgba(255, 255, 255, .97); color: var(--ink); border-radius: 16px; box-shadow: 0 30px 60px rgba(4, 20, 60, .35); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--inland-blue-50); color: var(--inland-blue); font-size: 1.35rem; }
.step-number { width: 34px; height: 34px; border-radius: 50%; background: var(--inland-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }

/* ---------- Cards / panels ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: #fff; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; border-top-left-radius: var(--radius) !important; border-top-right-radius: var(--radius) !important; }
.card-title-sm { font-size: .95rem; font-weight: 700; color: var(--inland-blue); margin: 0; display: flex; align-items: center; gap: .5rem; }
.page-title { font-weight: 800; color: var(--inland-blue); letter-spacing: -.01em; }
.section-band { background: linear-gradient(135deg, var(--inland-blue) 0%, var(--inland-blue-600) 100%); color: #fff; }
.section-band .breadcrumb-item, .section-band .breadcrumb-item a, .section-band .breadcrumb-item::before { color: #c9dbff !important; }

.detail-list { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: .55rem 1rem; margin: 0; }
.detail-list dt { color: var(--muted); font-weight: 500; font-size: .86rem; }
.detail-list dd { margin: 0; font-weight: 500; word-break: break-word; }
@media (max-width: 575.98px) { .detail-list { grid-template-columns: 1fr; gap: .1rem; } .detail-list dd { margin-bottom: .6rem; } }

/* ---------- Status badges ---------- */
.status-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; padding: .3rem .65rem; border-radius: 99px; white-space: nowrap; }
.status-submitted { background: #eef1f6; color: #4a5a73; }
.status-sent { background: #e6f0ff; color: #1556b8; }
.status-viewed { background: #fff4d9; color: #8a6100; }
.status-acknowledged { background: var(--success-50); color: var(--success); }

/* ---------- Workflow stepper ---------- */
.workflow { display: flex; justify-content: space-between; position: relative; margin: 0; padding: 0; list-style: none; }
.workflow::before { content: ""; position: absolute; top: 17px; left: 8%; right: 8%; height: 3px; background: var(--border); z-index: 0; }
.workflow li { flex: 1; text-align: center; position: relative; z-index: 1; font-size: .78rem; color: var(--muted); font-weight: 600; }
.workflow .dot { width: 36px; height: 36px; border-radius: 50%; margin: 0 auto .4rem; display: flex; align-items: center; justify-content: center; background: #fff; border: 3px solid var(--border); color: var(--muted); }
.workflow li.done .dot { background: var(--inland-blue); border-color: var(--inland-blue); color: #fff; }
.workflow li.done { color: var(--inland-blue); }
.workflow li.current .dot { border-color: var(--inland-blue-600); color: var(--inland-blue-600); box-shadow: 0 0 0 5px rgba(21, 101, 192, .12); }

/* ---------- Upload dropzone ---------- */
.dropzone {
    border: 2px dashed #b9c8e2; border-radius: var(--radius); background: var(--inland-blue-50);
    padding: 2rem 1rem; text-align: center; cursor: pointer; transition: all .15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--inland-blue-600); background: #e3ecfb; }
.dropzone .bi { font-size: 2.4rem; color: var(--inland-blue-600); }
.file-list .file-item { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.file-list .file-item + .file-item { margin-top: .5rem; }
.file-list .file-item.invalid { border-color: #f1b5b5; background: #fff6f6; }
.file-icon { font-size: 1.6rem; line-height: 1; }
.file-meta { min-width: 0; flex: 1; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-summary { font-size: .82rem; color: var(--muted); }
.progress { height: .6rem; border-radius: 99px; }
.progress-bar { background: linear-gradient(90deg, var(--inland-blue), var(--inland-blue-600)); }

/* ---------- Documents table ---------- */
.doc-table td, .doc-table th { vertical-align: middle; }
.doc-table thead th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: #f8fafd; border-bottom-width: 1px; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f6f9ff; }

/* ---------- Acknowledgement ---------- */
.ack-panel { background: linear-gradient(180deg, #fff 0%, var(--inland-blue-50) 100%); border: 1px solid var(--inland-blue-100); border-radius: var(--radius); }
.ack-success { background: var(--success-50); border: 1px solid #bfe5cd; border-radius: var(--radius); color: #145f35; }
.success-check { width: 84px; height: 84px; border-radius: 50%; background: var(--success-50); color: var(--success); display: inline-flex; align-items: center; justify-content: center; font-size: 2.6rem; box-shadow: 0 0 0 10px rgba(30, 142, 78, .07); }
.evidence-note { font-size: .78rem; color: var(--muted); }

/* ---------- Receipt (paper) ---------- */
.receipt-paper { background: #fff; max-width: 820px; margin: 0 auto; border-radius: 6px; box-shadow: var(--shadow); padding: 2.75rem 3rem; position: relative; }
.receipt-paper::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: linear-gradient(90deg, var(--inland-blue), var(--inland-blue-600)); border-radius: 6px 6px 0 0; }
.receipt-head { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 3px solid var(--inland-blue); }
.receipt-head img { width: 72px; height: 64px; object-fit: contain; }
.receipt-company { font-weight: 800; letter-spacing: .12em; color: var(--inland-blue); font-size: 1.45rem; line-height: 1.1; }
.receipt-title { text-align: center; font-weight: 800; letter-spacing: .16em; color: var(--inland-blue); font-size: 1.3rem; margin: 1.6rem 0 1.4rem; }
.receipt-table { width: 100%; }
.receipt-table th { width: 190px; color: var(--muted); font-weight: 600; padding: .4rem 0; vertical-align: top; }
.receipt-table td { padding: .4rem 0; font-weight: 500; }
.receipt-docs { margin: .3rem 0 0 1.2rem; padding: 0; }
.receipt-docs li { padding: .15rem 0; }
.receipt-statement { border-top: 1px solid var(--border); margin-top: 1.4rem; padding-top: 1rem; font-style: italic; color: #33415c; }
.receipt-evidence { background: var(--inland-blue-50); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.2rem; margin-top: 1.4rem; display: flex; gap: 1.25rem; align-items: center; }
.receipt-evidence .qr { width: 132px; height: 132px; flex: 0 0 auto; }
.receipt-evidence .sig { font-family: Consolas, monospace; font-size: .68rem; word-break: break-all; color: #33415c; }
.receipt-footer { font-size: .72rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 1.4rem; padding-top: .6rem; }
@media (max-width: 767.98px) {
    .receipt-paper { padding: 1.75rem 1.25rem; }
    .receipt-table th { width: auto; display: block; padding-bottom: 0; }
    .receipt-table td { display: block; padding-top: 0; }
    .receipt-evidence { flex-direction: column; align-items: flex-start; }
}

/* ---------- Verification ---------- */
.verify-result { border-radius: var(--radius); overflow: hidden; }
.verify-result .verify-head { padding: 1.25rem 1.5rem; color: #fff; display: flex; gap: 1rem; align-items: center; }
.verify-valid .verify-head { background: linear-gradient(135deg, #167a43, var(--success)); }
.verify-invalid .verify-head { background: linear-gradient(135deg, #a32f2f, var(--danger)); }
.verify-pending .verify-head { background: linear-gradient(135deg, #8a6100, #c99400); }
.verify-head .bi { font-size: 2.2rem; }

/* ---------- Footer ---------- */
.site-footer { background: #0a2a63; color: #b9c9e8; font-size: .84rem; flex-shrink: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Admin shell ---------- */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 260px; flex: 0 0 260px; background: linear-gradient(180deg, #0a2f72 0%, var(--inland-blue) 100%); color: #c9dbff; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.admin-sidebar .brand-name { color: #fff; }
.admin-sidebar .brand-sub { color: #9fb7e6; }
.admin-sidebar .nav-link { color: #c9dbff; border-radius: 8px; padding: .65rem .9rem; font-weight: 600; display: flex; align-items: center; gap: .7rem; margin: .1rem .75rem; }
.admin-sidebar .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-sidebar .nav-link.active { background: #fff; color: var(--inland-blue); box-shadow: var(--shadow-sm); }
.admin-sidebar .nav-section { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #8aa6db; padding: 1.2rem 1.6rem .4rem; font-weight: 700; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; position: sticky; top: 0; z-index: 1020; }
.admin-content { padding: 1.5rem; }
@media (max-width: 991.98px) {
    .admin-sidebar { display: none; }
    .admin-content { padding: 1rem; }
}
.offcanvas.admin-offcanvas { background: linear-gradient(180deg, #0a2f72 0%, var(--inland-blue) 100%); color: #c9dbff; width: 270px; }
.offcanvas.admin-offcanvas .nav-link { color: #c9dbff; font-weight: 600; padding: .65rem 1rem; border-radius: 8px; display: flex; gap: .7rem; }
.offcanvas.admin-offcanvas .nav-link.active { background: #fff; color: var(--inland-blue); }

/* ---------- KPI cards ---------- */
.kpi-card { padding: 1.15rem 1.25rem; display: flex; gap: 1rem; align-items: center; height: 100%; }
.kpi-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex: 0 0 auto; }
.kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1.05; color: var(--ink); }
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi-blue .kpi-icon { background: var(--inland-blue-50); color: var(--inland-blue); }
.kpi-amber .kpi-icon { background: #fff4d9; color: #a37200; }
.kpi-green .kpi-icon { background: var(--success-50); color: var(--success); }
.kpi-sky .kpi-icon { background: #e4f4fd; color: #0b7bb5; }
.kpi-violet .kpi-icon { background: #efe9fc; color: #5b3cc4; }
.chart-box { position: relative; height: 290px; }

/* ---------- Filter panel & grid ---------- */
.filter-panel .form-label { font-size: .76rem; margin-bottom: .2rem; }
.grid-table { font-size: .875rem; }
.grid-table td { white-space: nowrap; }
.grid-table td.wrap { white-space: normal; min-width: 220px; }
.dropdown-menu { border-color: var(--border); box-shadow: var(--shadow); border-radius: 10px; font-size: .9rem; }
.dropdown-item .bi { width: 1.25rem; display: inline-block; color: var(--inland-blue-600); }
.pagination { --bs-pagination-active-bg: var(--inland-blue); --bs-pagination-active-border-color: var(--inland-blue); --bs-pagination-color: var(--inland-blue); }

/* ---------- Timeline (audit trail) ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.75rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 1.25rem 1rem; }
.timeline .tl-icon { position: absolute; left: -1.75rem; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--inland-blue-100); color: var(--inland-blue); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.timeline .tl-icon.tl-ack { background: var(--success); border-color: var(--success); color: #fff; }
.timeline .tl-icon.tl-warn { background: #fdecec; border-color: #f3b4b4; color: var(--danger); }
.timeline .tl-time { font-size: .76rem; color: var(--muted); }
.timeline .tl-meta { font-size: .76rem; color: var(--muted); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 160px); display: flex; align-items: center; }
.auth-card { max-width: 440px; width: 100%; margin: 0 auto; }

/* ---------- Misc ---------- */
.preview-frame { width: 100%; height: 75vh; border: 0; background: #525659; border-radius: 0 0 8px 8px; }
.preview-image { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }
.otp-input { letter-spacing: .6em; font-family: Consolas, monospace; font-size: 1.15rem; text-align: center; max-width: 180px; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.empty-state .bi { font-size: 2.6rem; color: #b9c8e2; }

/* ---------- Print ---------- */
@media print {
    body { background: #fff !important; }
    .no-print, .site-header, .site-footer, .admin-sidebar, .admin-topbar { display: none !important; }
    .receipt-paper { box-shadow: none; padding: 0; max-width: none; }
    main, .admin-content, .container { padding: 0 !important; margin: 0 !important; max-width: none !important; }
}
