/* KEMI ICT Division Management System — Core Styles */

:root {
    --kemi-blue:     #003580;
    --kemi-blue-dk:  #002260;
    --kemi-blue-lt:  #e8eef7;
    --sidebar-w:     250px;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--kemi-blue);
    color: #fff;
    transition: width 0.25s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    /* Override Bootstrap d-flex so the sidebar scrolls as a block */
    display: block !important;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 2px; }

.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-subtitle,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-user-role { display: none; }

.sidebar-brand {
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-logo {
    height: 52px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.65);
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    display: block;
    margin-top: 0.25rem;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    transition: background 0.15s, color 0.15s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: auto;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
}

/* ── Top bar ──────────────────────────────────────────────────── */
.top-bar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    min-height: 50px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
    min-height: 100vh;
    background: #f4f6fb;
    min-width: 0;
}

.content-area {
    max-width: 1400px;
}

/* ── Cards ────────────────────────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s;
}

.stat-card:hover { box-shadow: 0 4px 16px rgba(0,53,128,0.12); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--kemi-blue);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Tables ───────────────────────────────────────────────────── */
.table-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table thead th {
    background: var(--kemi-blue);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    white-space: nowrap;
}

/* ── Badges / Risk ────────────────────────────────────────────── */
.risk-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
}

/* ── Memo / letterhead ────────────────────────────────────────── */
.memo-letterhead {
    font-family: 'Footlight MT Light', 'Garamond', 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    background: #fff;
    color: #000;
}

.memo-header-logo { height: 80px; }

.memo-divider {
    border: none;
    border-top: 3px solid var(--kemi-blue);
    margin: 8px 0;
}

.memo-ref-block {
    font-size: 12pt;
    line-height: 1.8;
}

.memo-body { margin-top: 24px; }

.memo-signature-block {
    margin-top: 48px;
    font-size: 12pt;
}

/* ── Print styles (memos) ─────────────────────────────────────── */
@media print {
    .sidebar, .top-bar, .no-print { display: none !important; }
    .main-content { margin: 0 !important; background: #fff; }
    .content-area { max-width: 100%; }
    .memo-letterhead { padding: 20px; }
    body { background: #fff; }
}

/* ── Intern portal ────────────────────────────────────────────── */
.task-item {
    border-left: 4px solid var(--kemi-blue);
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.task-item.done { border-left-color: #198754; opacity: 0.75; }

/* ── Progress bar ─────────────────────────────────────────────── */
.progress { border-radius: 20px; }
.progress-bar { background: var(--kemi-blue); }

/* ── Scrollbar ────────────────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* ── Utilities ────────────────────────────────────────────────── */
.btn-kemi {
    background: var(--kemi-blue);
    color: #fff;
    border: none;
}
.btn-kemi:hover { background: var(--kemi-blue-dk); color: #fff; }

.text-kemi { color: var(--kemi-blue) !important; }
.bg-kemi   { background: var(--kemi-blue) !important; }
.bg-kemi-lt{ background: var(--kemi-blue-lt) !important; }

.page-header {
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--kemi-blue-lt);
}

/* ── Login page ───────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--kemi-blue) 0%, #1a56b0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.login-logo { height: 70px; object-fit: contain; }
