:root {
    --lgb-gold: #f0b429;
    --lgb-gold-dark: #d49a12;
    --lgb-black: #111111;
    --lgb-border: #1a1a1a;
    --lgb-muted: #6b7280;
    --lgb-bg: #ffffff;
    --lgb-card-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
    --lgb-red: #b91c1c;
    --lgb-blue: #1e3a6e;
}

html {
    position: relative;
    min-height: 100%;
    font-size: 13px;
}

@media (min-width: 768px) {
    html { font-size: 14px; }
}

body {
    margin-bottom: 60px;
    background-color: var(--lgb-bg);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--lgb-black);
}

/* ───────── App shell (logged in) ───────── */
body.app-shell {
    background: #f8f9fb;
    margin-bottom: 0;
}

.app-header {
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 72px;
    padding: 0.65rem 1.25rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--lgb-black);
    flex-shrink: 0;
}

.app-brand:hover {
    color: var(--lgb-blue);
}

.app-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
    border: 1px solid var(--lgb-gold);
    border-radius: 6px;
}

.app-brand-text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.app-nav-links {
    align-items: center;
    gap: 0.25rem;
    margin-right: auto;
}

.app-nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
}

.app-nav-link:hover,
.app-nav-link.active {
    color: var(--lgb-blue);
    background: rgba(30, 58, 110, 0.06);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.user-nav-identity {
    text-align: right;
    line-height: 1.2;
}

.user-nav-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.user-nav-role {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.user-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    padding: 0.45rem 0.55rem 0.45rem 0.65rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.user-nav-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(145deg, #3b82c4 0%, #2563a8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.user-nav-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.user-nav-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.user-nav-logout-icon {
    width: 16px;
    height: 16px;
}

.app-main {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.app-footer {
    border-top: 1px solid #e8ecf1;
    background: #fff;
    color: #94a3b8;
    font-size: 0.82rem;
    padding: 1rem 0;
    margin-top: 2rem;
}

.app-site-footer {
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
    padding: 1rem 0 0.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    border: 1px solid #e8ecf1;
    border-radius: 12px;
}

.dashboard-dl dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 0.15rem;
}

.dashboard-dl dd {
    margin-bottom: 0.85rem;
    color: #0f172a;
}

.schema-stat-tile {
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    height: 100%;
    background: #fafbfc;
}

.dash-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    background: #fafbfc;
    transition: box-shadow 0.15s ease;
}

.dash-stat-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.dash-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-icon svg {
    width: 22px;
    height: 22px;
}

.dash-stat-icon-dept {
    background: rgba(30, 58, 110, 0.1);
    color: var(--lgb-blue);
}

.dash-stat-icon-req {
    background: rgba(240, 180, 41, 0.15);
    color: #b45309;
}

.dash-stat-icon-bank {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.dash-stat-icon-vendor {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
}

.dash-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.dash-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.dash-stat-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

@media (max-width: 767px) {
    .app-header-inner {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .user-nav {
        width: 100%;
        justify-content: flex-end;
    }

    .user-nav-identity {
        text-align: left;
        margin-right: auto;
    }
}

.btn-primary {
    background-color: var(--lgb-black);
    border-color: var(--lgb-black);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #000;
    border-color: #000;
}

.badge.bg-success {
    background-color: var(--lgb-gold) !important;
    color: var(--lgb-black) !important;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(240, 180, 41, 0.45);
}

.alert-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.7rem;
    line-height: 1.4;
    border-radius: 6px;
}

.page-alert-slot {
    margin-bottom: 0.4rem;
}

.modal-alert-slot {
    padding: 0.65rem 1rem 0;
}

.modal-alert-slot .alert-compact {
    margin-bottom: 0;
}

.alert-compact .alert-compact-message {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0.25rem;
}

.alert-compact.alert-confirm {
    align-items: center;
}

.inline-confirm-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.alert-compact.alert-dismissible {
    padding-right: 0.75rem;
}

.alert-compact .btn-close {
    position: static;
    flex: 0 0 auto;
    align-self: center;
    padding: 0;
    margin: 0;
    width: 1rem;
    height: 1rem;
    background-size: 0.75rem;
    opacity: 0.7;
}

.alert-compact .btn-close:hover,
.alert-compact .btn-close:focus {
    opacity: 1;
    box-shadow: none;
}

html.dark-mode .alert-compact.alert-success {
    background-color: rgba(22, 101, 52, 0.22);
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

html.dark-mode .alert-compact.alert-danger {
    background-color: rgba(127, 29, 29, 0.22);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

html.dark-mode .alert-compact.alert-warning {
    background-color: rgba(146, 64, 14, 0.22);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fef3c7;
}

html.dark-mode .alert-compact .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.85;
}
