/* =====================================================================
   HMF Engineering & Project Management LMS
   Brand: Black (#111111) + Signature Red (#E31E24)
   ===================================================================== */

:root {
    --hmf-black: #141414;
    --hmf-red: #E31E24;
    --hmf-red-dark: #b8161b;
    --hmf-gray: #6c757d;
    --hmf-light: #f7f7f8;
    --hmf-border: #e7e7ea;
    --font-serif: Georgia, 'Times New Roman', serif;
    --font-sans: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-sans);
    color: #232323;
    background-color: #ffffff;
}

h1, h2, h3, h4, .brand-serif {
    font-family: var(--font-serif);
    letter-spacing: 0.2px;
}

a { color: var(--hmf-red); text-decoration: none; }
a:hover { color: var(--hmf-red-dark); }

/* ---------- Navbar ---------- */
.navbar-hmf {
    background: #ffffff;
    border-bottom: 3px solid var(--hmf-black);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.navbar-hmf .navbar-brand img { height: 42px; }
.navbar-hmf .nav-link {
    color: var(--hmf-black);
    font-weight: 500;
    padding: 0.6rem 0.9rem !important;
}
.navbar-hmf .nav-link:hover,
.navbar-hmf .nav-link.active { color: var(--hmf-red); }

.btn-hmf {
    background-color: var(--hmf-red);
    border-color: var(--hmf-red);
    color: #fff;
    font-weight: 600;
}
.btn-hmf:hover { background-color: var(--hmf-red-dark); border-color: var(--hmf-red-dark); color: #fff; }

.btn-outline-hmf {
    border: 2px solid var(--hmf-black);
    color: var(--hmf-black);
    font-weight: 600;
    background: transparent;
}
.btn-outline-hmf:hover { background: var(--hmf-black); color: #fff; }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, #141414 0%, #262626 60%, #3a0a0b 100%);
    color: #fff;
    padding: 90px 0 70px;
}
.hero h1 { font-weight: 700; font-size: 2.6rem; }
.hero .accent { color: var(--hmf-red); }
.hero p.lead { color: #d7d7d7; }

/* ---------- Sections ---------- */
.section-title {
    position: relative;
    padding-bottom: 14px;
    margin-bottom: 30px;
    font-weight: 700;
}
.section-title::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 60px; height: 4px;
    background: var(--hmf-red);
}
.section-title.centered::after { left: 50%; transform: translateX(-50%); }

.bg-light-hmf { background: var(--hmf-light); }

/* ---------- Cards ---------- */
.card-hmf {
    border: 1px solid var(--hmf-border);
    border-radius: 10px;
    transition: transform .15s ease, box-shadow .15s ease;
    overflow: hidden;
}
.card-hmf:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); }
.card-hmf .card-img-top { height: 170px; object-fit: cover; background: #ddd; }
.badge-hmf { background: var(--hmf-red); color: #fff; }
.badge-dept { background: var(--hmf-black); color: #fff; }

/* ---------- Dashboard layout ---------- */
.sidebar {
    background: var(--hmf-black);
    min-height: calc(100vh - 0px);
    color: #eee;
}
.sidebar a {
    color: #cfcfcf;
    display: block;
    padding: 11px 20px;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}
.sidebar a:hover, .sidebar a.active {
    background: rgba(227,30,36,0.15);
    color: #fff;
    border-left-color: var(--hmf-red);
}
.sidebar .sidebar-heading {
    color: var(--hmf-red);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 18px 20px 6px;
}
.sidebar-scroll { max-height: calc(100vh - 58px); overflow-y: auto; padding-bottom: 20px; }
.sidebar-group-toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-group-toggle:hover { background: rgba(227,30,36,0.1); color: var(--hmf-red); }
.sidebar-group-toggle .chevron { transition: transform .2s ease; font-size: 0.75rem; }
.sidebar-group-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.sidebar-group-toggle[aria-expanded="true"] { color: var(--hmf-red); }
.stat-card {
    border-radius: 12px;
    padding: 22px;
    color: #fff;
    background: var(--hmf-black);
}
.stat-card.red { background: linear-gradient(135deg, var(--hmf-red), var(--hmf-red-dark)); }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; }

/* ---------- Footer ---------- */
footer.site-footer {
    background: var(--hmf-black);
    color: #bdbdbd;
    padding: 50px 0 20px;
}
footer.site-footer h5 { color: #fff; font-family: var(--font-serif); }
footer.site-footer a { color: #bdbdbd; }
footer.site-footer a:hover { color: var(--hmf-red); }
footer .footer-bottom { border-top: 1px solid #333; margin-top: 30px; padding-top: 18px; font-size: 0.85rem; }

/* ---------- Forms ---------- */
.form-control:focus, .form-select:focus {
    border-color: var(--hmf-red);
    box-shadow: 0 0 0 0.2rem rgba(227,30,36,0.15);
}
.auth-card {
    max-width: 460px;
    margin: 60px auto;
    border-top: 4px solid var(--hmf-red);
}

/* ---------- Certificate ---------- */
.certificate {
    border: 10px solid var(--hmf-black);
    padding: 60px;
    text-align: center;
    background: #fffdf8;
    position: relative;
}
.certificate::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 2px solid var(--hmf-red);
}
.certificate h1 { font-family: var(--font-serif); font-size: 2.4rem; }

/* ---------- Misc ---------- */
.table thead { background: var(--hmf-black); color: #fff; }
.status-pill { border-radius: 30px; padding: 3px 12px; font-size: 0.78rem; font-weight: 600; }
.status-published, .status-active, .status-graded, .status-completed { background:#e6f4ea; color:#1e7e34; }
.status-draft, .status-pending, .status-in_progress, .status-submitted { background:#fff3cd; color:#946200; }
.status-archived, .status-suspended, .status-dropped { background:#f8d7da; color:#a71d2a; }

/* =====================================================================
   GLOBAL PRINT RULES
   Applied to every page automatically: hides the sidebar, top navbar,
   buttons, forms, and any element marked .no-print, so window.print()
   / "Save as PDF" from ANY dashboard page shows just the content —
   never the sidebar/navigation chrome.
   ===================================================================== */
@media print {
    .sidebar, #dashSidebar, .navbar, .navbar-hmf, #sidebarToggleBtn,
    .no-print, .btn, form:not(.print-keep), footer.site-footer,
    .dropdown-menu, .modal, .alert .btn-close {
        display: none !important;
    }
    .flex-grow-1 { padding: 0 !important; margin: 0 !important; width: 100% !important; }
    body { background: #fff !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .card, .card-hmf { border: 1px solid #ccc !important; box-shadow: none !important; }
}

/* Reusable print document header: company logo, title, generated-by/date, watermark */
.print-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--hmf-black);
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.print-doc-header img { height: 50px; }
.print-doc-header .print-doc-title { text-align: right; }
.print-doc-header .print-doc-title h2 { margin: 0; font-family: var(--font-serif); }
.print-doc-footer {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    font-size: 0.78rem;
    color: #777;
    display: flex;
    justify-content: space-between;
}
.print-watermark {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    opacity: 0.06;
    width: 60%;
    max-width: 500px;
    z-index: 0;
    pointer-events: none;
}
.print-doc-body { position: relative; z-index: 1; }
