/* ============================= */
/* 🎯 DESIGN SYSTEM VARIABLES    */
/* ============================= */

:root {
    --primary: #1F618D;
    --secondary: #1abc9c;
    --danger: #e74c3c;
    --success: #2e7d32;

    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #333;
    --border: #dcdcdc;

    --shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    --radius: 10px;
}

/* ============================= */
/* RESET & GLOBAL               */
/* ============================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 20px;
    max-width: 100%;
    overflow-x: hidden;
    transition: 0.3s ease;
    line-height: 1.5;
}

/* ============================= */
/* TYPOGRAPHY                   */
/* ============================= */

h1,
h2,
h3,
h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

a {
    text-decoration: none;
    color: var(--secondary);
    transition: 0.2s;
}

a:hover {
    color: #16a085;
}

/* ============================= */
/* THEME SYSTEM                */
/* ============================= */

body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

body.dark-mode .card,
body.dark-mode nav,
body.dark-mode table {
    background: #1e1e1e;
    color: white;
}

body.dark-mode th {
    background: #333;
}

body.green-mode {
    background: #e8f5e9;
    color: #1b5e20;
}

body.green-mode nav,
body.green-mode .card {
    background: #fff;
    border: 1px solid #a5d6a7;
}

/* ============================= */
/* NAVIGATION                  */
/* ============================= */

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: var(--card);
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

nav a {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    color: #2c3e50;
    transition: 0.2s;
}

nav a:hover,
nav a.active {
    background: var(--primary);
    color: #fff;
}

/* ============================= */
/* TABLE SYSTEM                */
/* ============================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--card);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
}

th {
    background: var(--primary);
    color: white;
    padding: 10px;
    text-align: left;
}

td {
    padding: 10px;
    border: 1px solid var(--border);
}

tr:hover {
    background: #f1f1f1;
}

/* ============================= */
/* FORMS SYSTEM               */
/* ============================= */

form {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

input,
select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(31, 97, 141, 0.2);
}

button {
    padding: 8px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: var(--secondary);
}

/* ============================= */
/* DASHBOARD SYSTEM            */
/* ============================= */

.dashboard-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.card {
    background: var(--card);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-6px);
}

.card h3 {
    margin-bottom: 10px;
}

/* ============================= */
/* WELCOME CARD               */
/* ============================= */

.welcome-card {
    width: 600px;
    background: var(--card);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.role-badge {
    background: var(--success);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
}

/* ============================= */
/* FLASH MESSAGES             */
/* ============================= */

.flashes {
    list-style: none;
    margin: 10px 0;
}

.flashes li.danger {
    background: var(--danger);
    color: white;
    padding: 10px;
    border-radius: 6px;
}

/* ============================= */
/* CORE VARIABLES               */
/* ============================= */
:root {
    --primary: #1F618D;
}

/* ============================= */
/* PRINT HEADER                */
/* ============================= */
.print-header {
    text-align: center;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.logo {
    width: 60px;
    display: block;
    margin: auto;
}

/* ============================= */
/* SIGNATURE & FOOTER (HIDDEN ON SCREEN) */
/* ============================= */
.signature,
.print-footer {
    display: none;
}

/* ============================= */
/* RESPONSIVE SYSTEM            */
/* ============================= */
@media (max-width: 1024px) {
    body {
        margin: 10px;
    }

    .welcome-card {
        width: 90%;
    }
}

@media (max-width: 768px) {

    body {
        margin: 8px;
        font-size: 14px;
    }

    nav {
        flex-direction: column;
    }

    nav a {
        width: 100%;
        text-align: center;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    form {
        flex-direction: column;
    }

    input,
    select,
    button {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .welcome-card {
        width: 100%;
        padding: 20px;
    }


}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    button {
        font-size: 14px;
    }
}

/* ============================= */
/* PRINT MODE (FINAL CLEAN)     */
/* ============================= */
@media print {


    /* ❌ Hide system UI */
    nav,
    .menu-toggle,
    .theme-box,
    .back-btn,
    .no-print,
    form,
    button,
    .user-info {
        display: none !important;
    }

    body {
        margin: 30px;
        background: #fff !important;
        color: #000 !important;
        font-size: 10px;
        font-family: Arial, sans-serif;
    }

    /* ================= HEADER ================= */
    .print-header {
        display: block !important;
        text-align: center;
        border-bottom: 3px solid var(--primary);
        margin-bottom: 10px;
    }

    /* ================= META ================= */
    .report-meta {
        display: flex;
        justify-content: space-between;
        font-size: 10px;
        margin-bottom: 10px;
    }

    /* ================= WATERMARK ================= */
    .watermark {
        position: fixed;
        top: 40%;
        left: 20%;
        font-size: 60px;
        color: rgba(0, 0, 0, 0.05);
        transform: rotate(-30deg);
    }

    /* ================= TABLE ================= */
    table {
        width: 100%;
        border-collapse: collapse;
    }

    th {
        background: var(--primary);
        color: #fff;
        font-size: 10px;
    }

    td {
        font-size: 9px;
    }

    th,
    td {
        border: 1px solid #ccc;
        padding: 4px;
        text-align: center;
    }

    /* ================= SECTION ================= */
    .section-title {
        border-left: 4px solid var(--primary);
        padding-left: 6px;
        margin-bottom: 6px;
        font-size: 12px;
    }

    /* ================= SUMMARY ================= */
    .summary-box {
        margin-top: 8px;
        border: 1px solid #ddd;
        padding: 6px;
        background: #f8f9f9;
    }

    /* ================= PAGE BREAK ================= */
    .page-break {
        page-break-after: always;
    }

    /* ================= SIGNATURE ================= */
    .signature {
        display: flex !important;
        justify-content: space-between;
        margin-top: 50px;
    }

    .sign-line {
        border-top: 1px solid #000;
        width: 200px;
        margin-top: 20px;
    }

    /* ================= FOOTER ================= */
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        width: 100%;
        border-top: 1px solid #000;
        text-align: center;
        font-size: 10px;
        padding-top: 5px;
    }

    .page-number:after {
        content: "Page " counter(page);
    }

    .signature-section {
        display: flex;
        justify-content: space-between;
        margin-top: 50px;
    }

    /* LEFT SIDE */
    .sig-left {
        text-align: left;
        width: 45%;
    }

    /* RIGHT SIDE */
    .sig-right {
        text-align: right;
        width: 45%;
    }

    .sign-line {
        border-top: 1px solid #000;
        width: 200px;
        margin-top: 10px;
    }


}