/* ============================================================
   CDRRMO Evaluation Report System - Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
    --primary:        #1a3a5c;
    --primary-light:  #2563a8;
    --accent:         #e85d04;
    --accent-light:   #f48c06;
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #3b82f6;
    --light-bg:       #f0f4f8;
    --card-bg:        #ffffff;
    --sidebar-bg:     #0f2744;
    --sidebar-active: #1a3a5c;
    --text-main:      #1e293b;
    --text-muted:     #64748b;
    --border:         #e2e8f0;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:      0 10px 40px rgba(0,0,0,.14);
    --radius:         12px;
    --radius-sm:      8px;
    --radius-lg:      16px;
    --sidebar-width:  260px;
    --topbar-height:  64px;
    --font:           'Plus Jakarta Sans', sans-serif;
    --font-mono:      'DM Mono', monospace;
    --transition:     all .22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--light-bg);
    color: var(--text-main);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ── LOGIN ─────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2744 0%, #1a3a5c 50%, #2563a8 100%);
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}
.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.8rem;
}
.login-logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    box-shadow: 0 4px 12px rgba(26,58,92,.35);
}
.login-logo-text h1 { font-size: 1.1rem; font-weight: 800; color: var(--primary); margin: 0; }
.login-logo-text p  { font-size: .72rem; color: var(--text-muted); margin: 0; }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}
.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
    flex-shrink: 0;
}
.brand-text h2 { font-size: .85rem; font-weight: 700; color: #fff; margin: 0; line-height: 1.2; }
.brand-text p  { font-size: .65rem; color: rgba(255,255,255,.45); margin: 0; }

.sidebar-nav { flex: 1; padding: .75rem 0; }
.nav-section-label {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.3);
    padding: .6rem 1.25rem .3rem;
}
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .6rem 1.25rem;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: .83rem;
    font-weight: 500;
    border-radius: 0;
    margin: 1px .6rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}
.sidebar .nav-link i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active {
    background: var(--primary-light);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37,99,168,.4);
}
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.user-info h6 { font-size: .78rem; font-weight: 600; color: #fff; margin: 0; }
.user-info span { font-size: .65rem; color: rgba(255,255,255,.45); }

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky; top: 0; z-index: 500;
    box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--primary); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.content-area { flex: 1; padding: 1.5rem; }

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.card-header h5 { font-size: .9rem; font-weight: 700; margin: 0; color: var(--primary); }
.card-body { padding: 1.25rem; }

/* ── STATS CARDS ─────────────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
    width: 50px; height: 50px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(37,99,168,.12); color: var(--primary-light); }
.stat-icon.orange { background: rgba(232,93,4,.12); color: var(--accent); }
.stat-icon.green  { background: rgba(16,185,129,.12); color: var(--success); }
.stat-icon.amber  { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.red    { background: rgba(239,68,68,.12); color: var(--danger); }
.stat-icon.indigo { background: rgba(99,102,241,.12); color: #6366f1; }
.stat-body h3 { font-size: 1.6rem; font-weight: 800; margin: 0; line-height: 1; }
.stat-body p  { font-size: .75rem; color: var(--text-muted); margin: 0; margin-top: 2px; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: .45rem 1rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary   { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: var(--primary); color: #fff; }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #c84b03; color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-secondary { background: #f1f5f9; color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: .3rem .7rem; font-size: .75rem; }
.btn-lg { padding: .65rem 1.4rem; font-size: .9rem; }
.btn-outline-primary { background: transparent; color: var(--primary-light); border: 1.5px solid var(--primary-light); }
.btn-outline-primary:hover { background: var(--primary-light); color: #fff; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
    font-family: var(--font);
    font-size: .65rem;
    font-weight: 700;
    padding: .25em .65em;
    border-radius: 20px;
    display: inline-flex; align-items: center; gap: 4px;
    text-transform: uppercase; letter-spacing: .04em;
}
.badge-primary   { background: rgba(37,99,168,.12); color: var(--primary-light); }
.badge-success   { background: rgba(16,185,129,.12); color: #059669; }
.badge-warning   { background: rgba(245,158,11,.12); color: #d97706; }
.badge-danger    { background: rgba(239,68,68,.12); color: #dc2626; }
.badge-info      { background: rgba(59,130,246,.12); color: #2563eb; }
.badge-secondary { background: #f1f5f9; color: var(--text-muted); }
.badge-permanent { background: rgba(16,185,129,.1); color: #059669; }
.badge-job_hire  { background: rgba(245,158,11,.1); color: #d97706; }

/* ── TABLES ─────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td { padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* ── FORMS ─────────────────────────────────────────────────── */
.form-label { font-size: .78rem; font-weight: 600; color: var(--text-main); margin-bottom: .35rem; }
.form-control, .form-select {
    font-family: var(--font);
    font-size: .83rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .85rem;
    width: 100%;
    color: var(--text-main);
    background: #fff;
    transition: var(--transition);
    outline: none;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}
.form-control::placeholder { color: #94a3b8; }
textarea.form-control { resize: vertical; min-height: 90px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-text {
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0 .85rem;
    color: var(--text-muted);
    display: flex; align-items: center;
}

/* ── MISC ─────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary-light) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.section-title { font-size: 1.15rem; font-weight: 800; color: var(--primary); margin-bottom: .25rem; }
.section-sub   { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ── REPORT STATUS ─────────────────────────────────────────── */
.status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: .25em .7em;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
}
.status-draft        { background: #f1f5f9; color: #64748b; }
.status-submitted    { background: rgba(59,130,246,.1); color: #2563eb; }
.status-under_review { background: rgba(245,158,11,.1); color: #d97706; }
.status-evaluated    { background: rgba(16,185,129,.1); color: #059669; }
.status-returned     { background: rgba(239,68,68,.1); color: #dc2626; }

/* ── NOTIFICATION BELL ──────────────────────────────────────── */
.notif-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 17px;
    transition: var(--transition);
}
.notif-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }
.notif-dot {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid #fff;
}

/* ── MODAL OVERRIDE ─────────────────────────────────────────── */
.modal-content { border-radius: var(--radius); border: none; box-shadow: var(--shadow-lg); }
.modal-header {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1rem 1.25rem;
    border-bottom: none;
}
.modal-header .btn-close { filter: invert(1); opacity: .7; }
.modal-title { font-size: .95rem; font-weight: 700; }

/* ── ALERT ─────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: .75rem 1rem;
    font-size: .82rem;
    font-weight: 500;
    display: flex; align-items: center; gap: .5rem;
}
.alert-danger  { background: rgba(239,68,68,.1); color: #dc2626; }
.alert-success { background: rgba(16,185,129,.1); color: #059669; }
.alert-warning { background: rgba(245,158,11,.1); color: #d97706; }
.alert-info    { background: rgba(59,130,246,.1); color: #2563eb; }

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
}
.progress-bar { border-radius: 3px; transition: width .6s ease; }

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb { background: none; padding: 0; margin-bottom: .3rem; font-size: .75rem; }
.breadcrumb-item a { color: var(--primary-light); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--border); }

/* ── SCORE RING ─────────────────────────────────────────────── */
.score-ring {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 4px solid var(--border);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}
.score-ring.outstanding   { border-color: var(--success); color: var(--success); }
.score-ring.very-sat      { border-color: var(--info); color: var(--info); }
.score-ring.satisfactory  { border-color: var(--primary-light); color: var(--primary-light); }
.score-ring.unsatisfactory{ border-color: var(--warning); color: var(--warning); }
.score-ring.poor          { border-color: var(--danger); color: var(--danger); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    :root { --topbar-height: 56px; }
}

/* ── UTILITIES ─────────────────────────────────────────────── */
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.mb-0 { margin-bottom: 0 !important; }
.mt-auto { margin-top: auto; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* Print */
@media print {
    .sidebar, .topbar, .no-print,
    nav[aria-label="breadcrumb"],
    .breadcrumb { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .content-area { padding: 0 !important; }
    .card { border: none !important; box-shadow: none !important; }
    /* suppress text-selection highlight colour */
    ::selection { background: transparent !important; color: inherit !important; }
    ::-moz-selection { background: transparent !important; color: inherit !important; }
}
