/* Modern Reset & Base Styles */
:root {
    /* Color Palette */
    --primary-color: #0056b3;
    --primary-hover: #004494;
    --secondary-color: #6c757d;
    --accent-color: #0d6efd;

    --bg-body: #f4f7f6;
    --bg-card: #ffffff;

    --text-main: #2c3e50;
    --text-muted: #6c757d;

    --border-color: #e9ecef;
    --input-border: #ced4da;
    --input-focus: #86b7fe;

    --success-bg: #d1e7dd;
    --success-text: #0f5132;
    --warning-bg: #fff3cd;
    --warning-text: #664d03;
    --danger-bg: #f8d7da;
    --danger-text: #842029;

    /* Spacing & Layout */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

/* Custom Scrollbar Styling */
* {
    scrollbar-width: auto;
    scrollbar-color: #0056b3 #f0f0f0;
}

*::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

*::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0056b3, #004494);
    border-radius: 10px;
    border: 3px solid #f0f0f0;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #004494, #003366);
    box-shadow: 0 0 6px rgba(0, 86, 179, 0.5);
}

*::-webkit-scrollbar-corner {
    background: #f0f0f0;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Header Section */
.header-card {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

.emblem {
    max-width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.header-title h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin: 0 0 5px 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-title h2 {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.user-bar span {
    margin-right: 15px;
    color: var(--text-main);
    font-weight: 500;
}

.btn-logout {
    color: var(--danger-text);
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.btn-logout:hover {
    background-color: var(--danger-bg);
}

/* Section Headings */
.section-title {
    font-size: 18px;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #fff;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--input-focus);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead th {
    background-color: #e3f2fd;
    /* Light Blue Header */
    color: var(--text-main);
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #e2e6ea;
}

/* Zebra Striping */
.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.category-row td {
    background-color: #e9ecef;
    font-weight: 700;
    color: var(--primary-color);
    padding: 12px 15px;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Input inside table */
.table-input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
}

.table-input:focus {
    border-color: var(--input-focus);
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.table-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 38px;
    font-family: inherit;
    font-size: 14px;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 30px;
    font-size: 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-block;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    padding: 12px 30px;
    font-size: 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
    margin-right: 10px;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

#submitBtn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.alert-success {
    color: var(--success-text);
    background-color: var(--success-bg);
    border-color: #badbcc;
}

.alert-warning {
    color: var(--warning-text);
    background-color: var(--warning-bg);
    border-color: #ffecb5;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.summary-table th,
.summary-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.summary-table th {
    font-weight: 600;
    color: var(--text-muted);
}

.summary-table td {
    font-weight: 700;
    text-align: right;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .header-title h1 {
        font-size: 22px;
    }

    .card {
        padding: 20px;
    }
}