/* ═══════════════════════════════════════════════════════
   WOMS – Global Stylesheet
   Bootstrap 5.3 companion styles
═══════════════════════════════════════════════════════ */

:root {
    --sidebar-width: 260px;
    --navbar-height: 56px;
    --sidebar-bg: #1e2a3a;
    --sidebar-text: #c8d4e4;
    --sidebar-active-bg: rgba(13, 110, 253, 0.15);
    --sidebar-active-text: #4da3ff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
}

/* ─── Layout ─── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
}

.main-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

/* ─── Sidebar ─── */
#sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,.15);
}

.sidebar-header {
    background: rgba(255,255,255,.04);
    color: #fff;
}

.sidebar-footer {
    background: rgba(0,0,0,.15);
}

/* Nav links */
#sidebar .nav-link {
    color: var(--sidebar-text);
    border-radius: 8px;
    padding: .45rem .85rem;
    font-size: .88rem;
    transition: background .15s, color .15s;
}

#sidebar .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}

#sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

#sidebar .nav-label {
    font-size: .7rem;
    letter-spacing: .06em;
    color: #6c8099;
}

/* ─── Content wrapper ─── */
.content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
    transition: margin-left .25s ease;
}

/* ─── Sidebar overlay (mobile) ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1020;
}

.sidebar-overlay.show {
    display: block;
}

/* ─── Mobile: hide sidebar off-canvas ─── */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.show {
        transform: translateX(0);
    }
    .content-wrapper {
        margin-left: 0;
        padding: 1rem;
    }
}

/* ─── Page header ─── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.page-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: #1a2232;
}

/* ─── Cards ─── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f2f5;
    font-weight: 600;
    padding: .875rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

/* ─── Stat cards ─── */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .8rem;
    opacity: .85;
    margin-top: .2rem;
}

/* ─── Tables ─── */
.table-card .table {
    margin: 0;
    font-size: .88rem;
}

.table-card .table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

.table-card .table td {
    vertical-align: middle;
}

/* ─── Progress (OJT hours) ─── */
.hours-progress {
    height: 8px;
    border-radius: 4px;
}

/* ─── Badges ─── */
.badge {
    font-weight: 500;
    letter-spacing: .03em;
}

/* ─── DTR calendar ─── */
.dtr-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.dtr-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    cursor: default;
}

.dtr-cell.present  { background: #d1f7c4; color: #166534; }
.dtr-cell.absent   { background: #fee2e2; color: #991b1b; }
.dtr-cell.excused  { background: #fef3c7; color: #92400e; }
.dtr-cell.holiday  { background: #e0f2fe; color: #075985; }
.dtr-cell.empty    { background: #f3f4f6; color: #9ca3af; }
.dtr-cell.today    { outline: 2px solid #0d6efd; }

/* ─── Login page ─── */
body.login-page {
    background: linear-gradient(135deg, #0d6efd 0%, #0a4fb5 100%) !important;
}

body.login-page .card {
    box-shadow: 0 8px 32px rgba(0,0,0,.18) !important;
}

/* ─── Misc utilities ─── */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

.avatar-sm {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
}

.nav-tabs .nav-link {
    font-size: .88rem;
}

/* ─── Scrollbar (Webkit) ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
