:root {
    --primary-color: #C69543;
    /* Gold-ish approximation for premium feel/ASME */
    --primary-hover: #A67C33;
    --background-gradient-start: #0f172a;
    --background-gradient-end: #334155;
    --card-background: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --input-focus-ring: rgba(198, 149, 67, 0.3);
    --radius: 16px;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--background-gradient-start), var(--background-gradient-end));
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}

/* Hidden Admin Button - Top Left */
/* Logo Position */
.logo-container {
    position: absolute;
    top: 30px;
    left: 40px;
    z-index: 10;
}

.logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    cursor: pointer;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.05);
}

.container {
    background-color: var(--card-background);
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 24px;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-section {
    text-align: center;
    padding: 10px 0;
}

#login-status {
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 20px 0;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-group {
    margin-bottom: 28px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #334155;
    font-size: 0.95rem;
}

.select-wrapper {
    position: relative;
}

select,
textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #f8fafc;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.75rem;
    color: var(--text-secondary);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}

textarea {
    resize: vertical;
    min-height: 140px;
}

.button-group {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.btn-primary.hidden,
.btn-secondary.hidden,
.hidden {
    display: none !important;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #fff;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* Utilities */
.hidden {
    display: none !important;
}

.dynamic-section h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

/* Admin Overlay */
#admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

#admin-panel {
    background: white;
    width: 100%;
    max-width: none;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ... */

.admin-header {
    padding: 20px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#close-admin {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.admin-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#dept-list {
    width: 400px;
    /* Increased from 250px */
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 10px;
    background: #f8fafc;
}

#file-viewer {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: monospace;
    white-space: pre-wrap;
    background: #fff;
    text-align: left;
    /* font-size removed to allow child classes to control it */
}

.viewer-meta {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.viewer-body {
    margin-top: 16px;
    font-size: 1.5rem;
    /* 1.5x bigger */
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.dept-folder {
    margin-bottom: 10px;
}

.dept-name {
    font-weight: 600;
    padding: 8px;
    cursor: pointer;
    background: #3b82f6;
    /* Blue color */
    color: white;
    /* White text for contrast */
    border-radius: 6px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    transition: background-color 0.2s;
}

.dept-name:hover {
    background: #2563eb;
    /* Darker blue on hover */
}

.dept-arrow {
    display: inline-block;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

/* Admin Table Overhaul */
.table-container {
    height: 100%;
    overflow: auto;
    background: #fff;
}

#submissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
    table-layout: fixed;
}

#submissions-table th,
#submissions-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

#submissions-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

#submissions-table tbody tr:hover {
    background-color: #fbfcfd;
}

#submissions-table td {
    color: var(--text-primary);
    vertical-align: top;
    line-height: 1.5;
    word-wrap: break-word;
}

.timestamp-col {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.request-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-icon {
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon:hover {
    background: #e2e8f0;
}

.action-icon.view {
    color: var(--primary-color);
}

.action-icon.done {
    color: #22c55e;
}

.action-icon.delete {
    color: #ef4444;
}

/* Highlight for completed entries */
#submissions-table tbody tr.row-done {
    background-color: #f0fdf4;
    /* Very light green */
    transition: background-color 0.3s;
}

#submissions-table tbody tr.row-done:hover {
    background-color: #dcfce7;
}

.btn-filter,
.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    background: none;
    border: none;
    transition: background-color 0.2s;
    border-radius: 20px;
    padding: 2px 0;
}

.filter-label {
    padding-top: 4px;
    /* Move slightly down as requested */
}

#admin-sort-container .custom-options {
    z-index: 2000;
}

#admin-filters .btn-filter {
    border: 1px solid #e2e8f0;
}

.filter-label input {
    cursor: pointer;
}

.btn-filter:hover {
    background: #f1f5f9 !important;
}

/* File List Item Styles (Small fixes) */

.category-arrow.collapsed {
    transform: rotate(90deg);
}

.category-files-container {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease-out, opacity 0.3s ease;
    opacity: 1;
    margin-left: 10px;
}

.category-files-container.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}

.animation-wrapper {
    min-height: 0;
    overflow: hidden;
}

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border-radius: 6px;
}

.file-row:hover {
    background: #f1f5f9;
}

.file-item {
    padding: 8px 4px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-secondary);
    flex-grow: 1;
}

.file-item:hover {
    color: var(--primary-color);
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
}

.delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    color: #ef4444;
    /* Red for delete */
}

.check-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
    margin-left: 8px;
}

.check-btn:hover {
    opacity: 1;
    transform: scale(1);
}

/* Custom Dropdown Styles */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #f8fafc;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: var(--primary-color);
}

.custom-select-container.active .custom-select-trigger {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--input-focus-ring);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-arrow {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.custom-select-container.active .custom-arrow {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--primary-color);
    border-top: none;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow);
}

.custom-select-container.active .custom-options {
    display: block;
}

.custom-option {
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.custom-option:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.custom-option.selected {
    background: #f0fdf4;
    color: var(--primary-hover);
    font-weight: 600;
}

.file-row.completed {
    background-color: #dcfce7;
    /* Light green */
    border-left: 4px solid #22c55e;
    /* Green accent */
}

.file-row.completed .file-item {
    color: #15803d;
    /* Darker green text */
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* File Manager Styles */
.file-upload-container {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    /* Align button and list at top */
    gap: 15px;
    /* Space between button and list */
}

.btn-file-add {
    background-color: #f8fafc;
    border: 2px dashed var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
    /* Prevent button text wrapping */
}

.btn-file-add:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #f0fdf4;
}

.file-list {
    margin-top: 0;
    /* Remove top margin since it's side-by-side */
    display: flex;
    flex-wrap: wrap;
    /* Allow files to wrap if many */
    gap: 8px;
    flex: 1;
    /* Take remaining width */
}

.file-list-item {
    display: inline-flex;
    /* Inline flex for side-by-side items */
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #eee;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    max-width: 250px;
    /* Limit width of single item */
}

.file-name {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-primary);
    margin-right: 8px;
}

.btn-remove-file {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-remove-file:hover {
    background-color: #fee2e2;
}

/* Toast Notification Styles */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background-color: #22c55e;
    /* Green */
}

.toast-error {
    background-color: #ef4444;
    /* Red */
}

.toast-info {
    background-color: #3b82f6;
    /* Blue */
}

/* Delete Confirmation Modal */
#google-login-btn {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#delete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    /* Higher than admin overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.confirmation-box {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 2px solid #ef4444;
    /* Red border as requested */
    animation: scaleIn 0.2s ease-out;
}

.confirmation-icon {
    font-size: 3rem;
    margin-bottom: 5px;
}

.confirmation-box h3 {
    color: #ef4444;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.confirmation-box p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirmation-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #dc2626;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}