/* Incident Management System — layout and components on top of Bootstrap 5 */
:root {
    --brand: #1f3a5f;
    --sidebar-w: 250px;
    --bg: #f3f5f8;
}
body { background: var(--bg); color: #1f2933; font-size: .935rem; }

/* auth pages */
.auth-body { min-height: 100vh; display: flex; background: linear-gradient(160deg, #1f3a5f 0%, #2d5a87 100%); }
.auth-wrap { margin: auto; width: 100%; max-width: 440px; padding: 24px 16px; }
.auth-card { border: 0; border-radius: 10px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; background: #f59e0b; color: #fff; font-size: 24px; }
.brand-mark.sm { width: 34px; height: 34px; font-size: 16px; border-radius: 8px; flex: 0 0 auto; }

/* app shell */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--brand); color: #fff; flex: 0 0 var(--sidebar-w); position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: #fff; text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-brand:hover { color: #fff; }
.org-logo { max-height: 34px; max-width: 70px; background: #fff; border-radius: 4px; padding: 2px; }
.sidebar .nav-link { color: rgba(255,255,255,.82); padding: 8px 16px; font-size: .9rem; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.12); border-left-color: #f59e0b; }
.sidebar .nav-link i { margin-right: 6px; opacity: .9; }
.nav-section { padding: 14px 16px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.55); }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid #e5e7eb; padding: 8px 20px; min-height: 56px; }
.content { padding: 20px; }
.support-banner { background: #b45309; color: #fff; text-align: center; padding: 6px 12px; font-size: .875rem; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .content { padding: 16px; }
    .topbar { padding: 8px 12px; }
}

/* cards & tables */
.card { border: 1px solid #e5e7eb; border-radius: 8px; }
.card-header { background: #fff; font-weight: 600; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: #6b7280; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #4b5563; background: #f9fafb; }
.dataTables_wrapper .dataTables_filter input { margin-left: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-actions h2 { margin: 0; font-size: 1.25rem; }
.form-label { font-weight: 500; font-size: .875rem; }
.required::after { content: " *"; color: #dc2626; }
.help { color: #6b7280; font-size: .82rem; }
.btn.loading { pointer-events: none; opacity: .7; }
.notif-menu { width: 340px; max-height: 420px; overflow-y: auto; }
.notif-item.unread { background: #eff6ff; }
.perm-group { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; background: #fff; }
.perm-group h6 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: #4b5563; }
.checklist li { padding: 6px 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.json-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; min-height: 460px; }
.select-multi { min-height: 140px; }

/* risk matrix */
.rm-grid { border-collapse: separate; border-spacing: 3px; }
.rm-grid th, .rm-grid td { text-align: center; font-size: .8rem; }
.rm-cell { width: 92px; height: 54px; border-radius: 6px; cursor: pointer; font-weight: 600; user-select: none; border: 2px solid transparent; }
.rm-cell:hover { border-color: #111827; }
.rm-axis { background: #f3f4f6; border-radius: 6px; padding: 4px; min-width: 92px; }
.rm-axis input { font-size: .78rem; }
.rm-vertical { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 600; color: #374151; }
.level-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid rgba(0,0,0,.15); }
