:root {
    /* Premium Black & Gold Color Palette */
    --primary-color: #1a1a1a;
    /* Deep Rich Black */
    --secondary-color: #c5a059;
    /* Elegant Metallic Gold */
    --accent-color: #d69e2e;
    /* Bright Gold */

    --success-color: #27ae60;
    /* Vibrant Green (for balance) */
    --warning-color: #e67e22;
    /* Burnt Orange */
    --danger-color: #c0392b;
    /* Deep Red */

    --bg-color: #f4f4f4;
    /* Soft Off-White for contrast */
    --card-bg: #ffffff;
    /* Pure White */

    --text-main: #2c2c2c;
    /* Dark Grey for readability */
    --text-light: #666666;
    /* Medium Grey */
    --border-color: #dcdcdc;
}

* {
    box-sizing: border-box;
}

body {
    /* Offline System Fonts */
    font-family: 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Segoe UI', 'Tahoma', sans-serif;
    margin: 0;
}

/* Header - Premium Black */
.main-header {
    background-color: var(--primary-color);
    background-image: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    color: white;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid var(--secondary-color);
}

.logo-area h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.logo-area h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 0.3rem;
    color: var(--accent-color);
    text-transform: uppercase;
}

.system-status {
    display: flex;
    gap: 1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

/* Cards - Floating Effect */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    margin-bottom: 2.5rem;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: #ffffff;
    padding: 1.2rem 2rem;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.3rem;
}

.card-body {
    padding: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #4a4a4a;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: #fdfdfd;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(214, 158, 46, 0.15);
    background: #fff;
}

/* Buttons - Premium Style */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--accent-color);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #000000;
    color: #ffd700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    color: #2d3748;
}

/* Special Action Button */
#calc-btn {
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    color: #fff;
    border-bottom: 4px solid var(--accent-color);
}

#calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}


/* Custom Upload Button - Black & Gold */
.btn-upload {
    background-color: #000000;
    color: #d69e2e;
    border: 2px solid #d69e2e;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-upload:hover {
    background-color: #d69e2e;
    color: #000000;
    box-shadow: 0 4px 10px rgba(214, 158, 46, 0.3);
}

/* Footer - Elegant */
.main-footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-color);
    color: #a0aec0;
    margin-top: 4rem;
    font-weight: 500;
    font-size: 0.95rem;
    border-top: 5px solid var(--secondary-color);
}

.main-footer p {
    margin: 0;
    letter-spacing: 0.5px;
}

/* Table Style */
.audit-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

.audit-table th {
    background: #2c2c2c;
    color: #fff;
    text-align: center;
    padding: 1.2rem;
    font-size: 1rem;
    border-bottom: 3px solid var(--accent-color);
}

.audit-table th:first-child {
    border-top-right-radius: 8px;
}

.audit-table th:last-child {
    border-top-left-radius: 8px;
}

.audit-table td {
    padding: 1.2rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    background: #fff;
    transition: background 0.2s;
}

.audit-table tr:hover td {
    background-color: #fffbf2;
    /* Very light gold tint */
}


/* Grid Helpers */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.full-width {
    grid-column: span 2;
}

.hidden {
    display: none;
}

/* Header Buttons - Dark Orange */
.btn-header {
    background: #d69e2e;
    /* Gold */
    color: #000000;
    border: 1px solid #b7791f;
    margin-right: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 800;
    /* Bold Black Text */
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-header:hover {
    background: #b7791f;
    /* Darker Gold on hover */
    color: #000000;
    border-color: #975a16;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-header-action {
    background: #b7791f;
    /* Darker Gold for Action */
    color: #000000;
    border: 1px solid #975a16;
}

.btn-header-action:hover {
    background: #975a16;
    color: #ffd700;
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
}

/* Responsive Grid Utility */
.grid-4-responsive {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .grid-4-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }

    .main-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }

    .system-status {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
    }

    .btn-header {
        width: auto;
        /* Let grid handle width */
        justify-content: center;
        margin: 0 !important;
        /* Reset all margins */
        font-size: 0.85rem;
        padding: 0.6rem 0.5rem;
    }

    /* User name should span full width */
    #user-display {
        grid-column: span 2;
        text-align: center;
        margin-left: 0 !important;
        margin-bottom: 0.5rem;
    }

    /* Logout button (usually the last button) - Optional styling */
    /* If we want logout to be red and distinct, it's already red. 
       Maybe make it span full width if it's the last item?
       The structure is: span, a, a, a, a, button.
       That is 6 items. 
       Span is item 1 (full width).
       Items 2,3,4,5,6.
       2-3 (row), 4-5 (row), 6 (logout).
       Item 6 will be on a new row left-aligned by default or stretched if we use auto-fill?
       Let's make sure the last item spans full width if it's odd.
    */
    .system-status> :last-child {
        grid-column: span 2;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .grid-4-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-body {
        padding: 1.2rem;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 1rem;
    }

    .audit-table th,
    .audit-table td {
        padding: 0.8rem;
        font-size: 0.9rem;
        /* Slightly smaller text for tables */
    }

    /* Make the action buttons at bottom stack */
    .action-bar {
        padding: 0 1rem 1rem 1rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}