/* =========================================================================
   DRMS – application styles (Bootstrap 5.3 theme layer)
   ========================================================================= */
:root {
    --app-topbar-h: 60px;
    --app-sidebar-w: 270px;
    --app-sidebar-bg: #0f1d33;
    --app-sidebar-bg-2: #13284a;
    --app-sidebar-fg: #b8c4d6;
    --app-accent: #2f6fed;
    --bs-primary: #2f6fed;
    --bs-primary-rgb: 47, 111, 237;
    --bs-link-color: #2459c8;
    --bs-link-color-rgb: 36, 89, 200;
    --bs-body-bg: #f3f5f9;
    --bs-border-radius: .5rem;
}

body.app { background: var(--bs-body-bg); padding-top: var(--app-topbar-h); }

.btn-primary { --bs-btn-bg: var(--app-accent); --bs-btn-border-color: var(--app-accent); --bs-btn-hover-bg: #2459c8; --bs-btn-hover-border-color: #2459c8; --bs-btn-active-bg: #1e4aa6; }
.text-primary { color: var(--app-accent) !important; }

/* ---------- top bar ---------- */
.app-topbar { height: var(--app-topbar-h); z-index: 1040; }
.brand-badge { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #2f6fed, #6a4cf5); color: #fff; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.25); }
.avatar-empty { display: inline-grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; font-size: 2rem; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: calc(100vh - var(--app-topbar-h)); }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-main > .container-fluid { flex: 1 0 auto; }
.app-narrow { max-width: 1100px; }

/* ---------- sidebar ---------- */
.app-sidebar { background: linear-gradient(180deg, var(--app-sidebar-bg), var(--app-sidebar-bg-2)); color: var(--app-sidebar-fg); }
.app-sidebar .offcanvas-header { color: #fff; border-color: rgba(255,255,255,.1) !important; }
@media (min-width: 992px) {
    .app-sidebar { position: sticky; top: var(--app-topbar-h); height: calc(100vh - var(--app-topbar-h)); width: var(--app-sidebar-w); flex: 0 0 var(--app-sidebar-w); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
}
@media (max-width: 991.98px) {
    .app-sidebar { --bs-offcanvas-width: 290px; }
}
.sidebar-user { border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-nav .nav-header { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #6f86a8; padding: 1.1rem 1.25rem .35rem; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .65rem; color: var(--app-sidebar-fg); padding: .5rem 1.25rem; font-size: .9rem; border-left: 3px solid transparent; transition: background .15s, color .15s; }
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link:focus { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav .nav-link.active { color: #fff; background: rgba(47,111,237,.25); border-left-color: #5b8cff; }
.sidebar-nav .nav-link .fa-fw { opacity: .85; }
.sidebar-nav .caret { font-size: .7rem; transition: transform .2s; }
.sidebar-nav .nav-group:not(.collapsed) .caret { transform: rotate(180deg); }
.sidebar-nav .sub-nav { background: rgba(0,0,0,.15); }
.sidebar-nav .sub-nav .nav-link { padding: .4rem 1.25rem .4rem 3.1rem; font-size: .85rem; }

/* ---------- content ---------- */
.page-title { font-weight: 650; color: #1b2a41; }
.breadcrumb { --bs-breadcrumb-divider: '›'; }
.card { border-radius: .75rem; }
.card-header:first-child { border-radius: .75rem .75rem 0 0; }
.form-label { font-weight: 500; font-size: .9rem; margin-bottom: .3rem; }
.form-label .req { color: #dc3545; margin-left: 2px; }
.form-text { font-size: .8rem; }
.app-footer { margin-top: auto; }
.back-to-top { position: fixed; right: 1rem; bottom: 1rem; display: none; z-index: 1030; border-radius: 50%; width: 38px; height: 38px; }
.back-to-top.show { display: inline-block; }

/* stat tiles on dashboard */
.stat-tile { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: .9rem; color: #fff; text-decoration: none; min-height: 104px; box-shadow: 0 4px 14px rgba(15,29,51,.12); transition: transform .15s, box-shadow .15s; }
.stat-tile:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,29,51,.18); }
.stat-tile .icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.18); font-size: 1.4rem; flex: 0 0 52px; }
.stat-tile .value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.stat-tile .label { font-size: .85rem; opacity: .92; }
.bg-grad-1 { background: linear-gradient(135deg, #2f6fed, #5b8cff); }
.bg-grad-2 { background: linear-gradient(135deg, #e5484d, #ff7a7d); }
.bg-grad-3 { background: linear-gradient(135deg, #f08c00, #ffb347); }
.bg-grad-4 { background: linear-gradient(135deg, #12a150, #3fd48a); }
.bg-grad-5 { background: linear-gradient(135deg, #6a4cf5, #9b85ff); }
.bg-grad-6 { background: linear-gradient(135deg, #0b8fac, #36c6e0); }

/* tables */
.table-app { font-size: .875rem; }
.table-app thead th { background: #eef2f8; color: #34465f; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.table-app td { vertical-align: middle; }
.table-app td.text-wrap-cell { min-width: 220px; white-space: normal; }
.doc-link { display: inline-flex; align-items: center; gap: .25rem; text-decoration: none; margin-right: .35rem; font-size: 1.05rem; }
.actions { white-space: nowrap; }
.actions .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .8rem; }
div.dt-container .dt-buttons .btn { --bs-btn-padding-y: .25rem; --bs-btn-font-size: .8rem; }
div.dt-container { font-size: .875rem; }

/* profile view */
.profile-photo { width: 150px; height: 180px; object-fit: cover; border-radius: .6rem; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.kv { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: .35rem 1rem; font-size: .92rem; }
.kv dt { color: #5d6b82; font-weight: 500; }
.kv dd { margin: 0; color: #1b2a41; word-break: break-word; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .5rem; } }

/* login */
.auth-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% 10%, #dfe8ff 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #ece4ff 0%, transparent 60%), #f3f5f9; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; border-radius: 1rem; }

/* printable documents (CV, CAS, salary…) */
.doc-sheet { background: #fff; max-width: 1000px; margin: 0 auto; padding: 2rem; border-radius: .75rem; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.doc-sheet h2, .doc-sheet h3 { color: #1b2a41; }
.doc-sheet table { width: 100%; }
.doc-sheet .table th { background: #f2f5fa; }

@media print {
    body.app { padding-top: 0; background: #fff; }
    .app-topbar, .app-sidebar, .app-footer, .back-to-top, .no-print, .breadcrumb, .alert, .dt-buttons, .dt-search, .dt-length, .dt-paging, .dt-info { display: none !important; }
    .app-main > .container-fluid { padding: 0 !important; max-width: none; }
    .card, .doc-sheet { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
    a[href]::after { content: none !important; }
    .actions, th.no-export, td.no-export { display: none !important; }
}

/* ===================== DRMS additions ===================== */
.sidebar-nav .nav-logout { color: #ff9b9b; }
.sidebar-nav .nav-logout:hover { color: #fff; background: rgba(229,72,77,.25); }
.report .kv { grid-template-columns: minmax(160px, 28%) 1fr; }
.report-section { break-inside: auto; }
.report-section h3 { color: #1b2a41; }
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    .no-print { display: none !important; }
    .report .table { font-size: 9.5pt; }
    .report-section h3 { break-after: avoid; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 575.98px) { .stat-tile { gap: .6rem; padding: .9rem; } .stat-tile .icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 1.1rem; } .stat-tile .value { font-size: 1.25rem; } .stat-tile .label { font-size: .78rem; } }
