:root {
    --ies-navy: #14213d;
    --ies-green: #0f8a55;
    --ies-green-dark: #0a6c42;
    --ies-sidebar: #f5f8fb;
    --ies-border: #dce3ea;
    --ies-muted: #65758b;
}

body {
    color: var(--ies-navy);
    background: #fff;
}

a { color: #1769aa; }
.icon { flex: 0 0 auto; vertical-align: -0.2em; }
.btn-success { --tblr-btn-bg: var(--ies-green); --tblr-btn-border-color: var(--ies-green); --tblr-btn-hover-bg: var(--ies-green-dark); --tblr-btn-hover-border-color: var(--ies-green-dark); }
.btn:focus-visible, .nav-link:focus-visible, a:focus-visible, .form-control:focus-visible { outline: 3px solid rgba(15, 138, 85, .3); outline-offset: 2px; }

.app-sidebar { background: var(--ies-sidebar); border-right: 1px solid var(--ies-border); }
.app-sidebar .container-fluid { min-height: 100%; }
.brand-link { display: flex; align-items: center; gap: .75rem; color: var(--ies-navy); text-decoration: none; font-size: 1.05rem; font-weight: 700; }
.brand-mark { display: grid; width: 2rem; height: 2rem; place-items: center; }
.brand-mark img { width: 2.25rem; height: 2.25rem; object-fit: contain; }
.app-sidebar .nav-link { border-left: 3px solid transparent; border-radius: 0 .35rem .35rem 0; color: #465977; margin: .1rem 0; padding: .72rem .8rem; }
.app-sidebar .nav-link:hover { color: var(--ies-navy); background: #edf2f6; }
.app-sidebar .nav-link.active { color: var(--ies-green-dark); background: #e5f2ed; border-left-color: var(--ies-green); font-weight: 600; }
.app-sidebar .nav-link-icon { color: currentColor; }
.sidebar-footer { display: flex; align-items: center; gap: .75rem; padding: 1.25rem .75rem; color: #435674; }
.sidebar-footer-icon { display: grid; place-items: center; }
.sidebar-footer small { display: block; color: var(--ies-muted); }

.app-topbar { min-height: 4.25rem; display: flex; align-items: center; border-bottom: 1px solid var(--ies-border); background: #fff; }
.topbar-help { display: inline-flex; align-items: center; gap: .35rem; color: #435674; text-decoration: none; }
.topbar-help .icon { width: 1.2rem; height: 1.2rem; }
.topbar-divider { width: 1px; height: 1.75rem; background: var(--ies-border); }
.page-body { margin-top: 0; padding-top: 1.5rem; }
.page-title { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; color: #101d3c; }

.stat-card { border-color: var(--ies-border); box-shadow: none; }
.stat-icon { color: #536889; padding-top: .15rem; }
.stat-icon .icon { width: 2rem; height: 2rem; }
.stat-card-blue { border-top: 3px solid #206bc4; }
.stat-card-azure { border-top: 3px solid #4299e1; }
.stat-card-red { border-top: 3px solid #d63939; background: linear-gradient(135deg, #fff 72%, #fff1f1); }
.stat-card-green { border-top: 3px solid var(--ies-green); }
.stat-icon-blue, .stat-icon-azure { color: #206bc4; }
.stat-icon-red { color: #d63939; }
.stat-icon-green { color: var(--ies-green); }
.stat-value { font-size: 1.8rem; line-height: 1.25; font-weight: 700; color: #101d3c; }
.card { border-color: var(--ies-border); box-shadow: 0 1px 2px rgba(20, 33, 61, .03); }
.card-title { color: #14213d; font-weight: 700; }
.empty-state, .placeholder-panel { text-align: center; padding: clamp(2rem, 6vw, 4rem) 1rem; background: #f8fafc; }
.empty-state { border: 1px solid #eef2f6; border-radius: .35rem; }
.empty-state-icon { display: inline-grid; width: 4rem; height: 4rem; place-items: center; color: #536889; margin-bottom: 1rem; }
.empty-state-icon .icon { width: 3rem; height: 3rem; }
.empty-state h3, .placeholder-panel h3 { margin-bottom: .5rem; }
.empty-state p, .placeholder-panel p { max-width: 42rem; margin: 0 auto 1.25rem; color: var(--ies-muted); }
.empty-state hr { max-width: 36rem; margin: 1.5rem auto .75rem; }
.empty-state small { color: var(--ies-muted); }
.process-list > div { display: flex; gap: 1rem; }
.process-list > div + div { border-left: 1px solid var(--ies-border); }
.process-list span { display: grid; width: 2rem; height: 2rem; flex: 0 0 2rem; place-items: center; border-radius: 50%; background: #edf2f6; font-weight: 700; }
.process-list p { color: var(--ies-muted); margin: .35rem 0 0; font-size: .9rem; }
.alert-info { color: #174b7a; background: #f0f8ff; border-color: #b9ddfa; }

.auth-page { min-height: 100vh; background: #f7f9fb; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.auth-form-panel { width: min(100%, 31rem); padding: clamp(1.5rem, 5vw, 3.25rem); border: 1px solid var(--ies-border); border-radius: .75rem; background: #fff; box-shadow: 0 18px 50px rgba(20, 33, 61, .08); }
.auth-form-wrap { width: 100%; }
.auth-identity { text-align: center; }
.auth-brand-mark { display: grid; width: 5.25rem; height: 5.25rem; place-items: center; margin: 0 auto 1rem; }
.auth-brand-mark img { width: 5.25rem; height: 5.25rem; object-fit: contain; }
.auth-identity h1 { color: var(--ies-navy); font-size: clamp(2rem, 7vw, 2.65rem); }
.auth-identity p { color: var(--ies-green-dark); letter-spacing: .025em; }
.auth-identity > span { display: block; max-width: 24rem; margin: .75rem auto 0; color: var(--ies-muted); line-height: 1.55; }
.form-control-lg { min-height: 3rem; font-size: 1rem; }
.app-toast-container { z-index: 1090; margin-top: .75rem; }
.app-toast { color: #fff; border: 0; }
.app-toast .toast-header { color: #fff; background: transparent; border-bottom-color: rgba(255,255,255,.22); }
.app-toast-success { background: #0f8a55; }
.app-toast-danger { background: #d63939; }
.app-toast .toast-body { background: rgba(0,0,0,.04); }
.table-actions { white-space: nowrap; }
.incident-details summary { cursor: pointer; color: #1769aa; }
.manual-index { top: 1.5rem; gap: .35rem; }
.manual-index a { padding: .35rem .5rem; border-radius: .25rem; text-decoration: none; }
.manual-index a:hover { background: #edf2f6; }
.manual-content section { scroll-margin-top: 1rem; }
.manual-content section + section { border-top: 1px solid var(--ies-border); margin-top: 2rem; padding-top: 2rem; }
.manual-content h3 { color: var(--ies-navy); }

@media (min-width: 992px) {
    .app-sidebar { width: 17rem; }
    .page-wrapper { margin-left: 17rem; }
}

@media (max-width: 991.98px) {
    .app-sidebar .container-fluid { min-height: auto; }
    .app-topbar { min-height: 3.5rem; }
    .process-list > div + div { border-left: 0; }
    .auth-shell { padding: 1.25rem; }
}

@media (max-width: 575.98px) {
    .page-body { padding-top: 1.25rem; }
    .page-header .col-auto { width: 100%; }
    .page-header .col-auto .btn { width: 100%; }
    .app-topbar .topbar-help, .app-topbar .topbar-divider { display: none; }
    .auth-form-panel { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
