/*
 * Only the pieces Bootstrap doesn't already provide: brand theme colors,
 * the app shell (top bar + sidebar), the login screen, and a couple of
 * small custom components (status pill, ref-number monospace). Everything
 * else (buttons, cards, alerts, forms, tables, grid) uses Bootstrap classes
 * directly in the markup — duplicating those class names here would win the
 * cascade (this file loads after bootstrap.min.css) and silently override
 * Bootstrap's own component styling.
 */
:root {
    --navy: #0f2a4a;
    --navy-dark: #0a1d33;
    --accent: #c8952a;
    --bg: #f4f6f8;
    --border: #dde3ea;
    --text-muted: #5b6b7c;
}

body {
    background: var(--bg);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Top bar */
.app-topbar {
    background: var(--navy);
}

.app-topbar .navbar-brand span { color: var(--accent); }

.app-search { width: 320px; }

.app-notif-bell { cursor: default; opacity: 0.85; }

/* Shell: sidebar + main content */
.app-shell {
    display: flex;
    min-height: calc(100vh - 56px);
}

.app-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--navy-dark);
    padding: 1rem 0;
}

.sidebar-heading {
    color: #7e93ac;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 1.25rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1.25rem;
    color: #cdd8e6;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

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

.sidebar-link.active {
    color: #fff;
    border-left-color: var(--accent);
    background: rgba(255,255,255,0.08);
}

.app-main {
    flex: 1;
    padding: 1.75rem 2rem 3rem;
    max-width: 1200px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.35rem;
    margin: 0;
}

/* Small custom components not covered by Bootstrap */
.ref-number {
    font-family: "Consolas", monospace;
    font-size: 0.85rem;
    color: var(--navy);
}

.ref-number-wrap {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.btn-copy-ref {
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    padding: 0 0.25rem;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    vertical-align: middle;
    flex-shrink: 0;
}

.btn-copy-ref:hover,
.btn-copy-ref:focus,
.btn-copy-ref:active {
    opacity: 1;
    border: none;
    outline: none;
    box-shadow: none;
}

.btn-copy-ref.copied {
    opacity: 1;
    color: var(--bs-success, #198754);
}

.status-pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #eef1f5;
    color: var(--text-muted);
}

.form-actions {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

/* Login screen */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
}

.login-card {
    background: #fff;
    border-radius: 8px;
    padding: 2.25rem 2.25rem 2rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.login-card h1 {
    font-size: 1.15rem;
    margin: 0 0 0.25rem;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .app-sidebar {
        width: 100%;
        position: static;
    }
    .app-shell { flex-direction: column; }
}

@media print {
    .app-topbar  { display: none !important; }
    .app-sidebar { display: none !important; }
    .app-shell   { display: block !important; }
    .app-main    { padding: 0 !important; max-width: none !important; }
    body { background: #fff !important; }
    .no-print { display: none !important; }
    .page-header > .d-flex { display: none !important; }
    a[href]::after { content: none !important; }
    .card { break-inside: avoid; border-color: #aaa !important; }
    @page { margin: 15mm 12mm; }
}
