:root {
    --bg-color: #0f172a;
    --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    --surface: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
    --danger: #ef4444;
    --font-family: 'Inter', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    max-width: 420px;
    width: 100%;
    padding: 2.5rem;
    background: var(--surface);
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.6s ease-out;
}

/* Dashboard needs more width for tables */
body:has(#dashboardSection) .container {
    max-width: 1000px;
}

/* Fallback for browsers without :has() */
.dashboard-container {
    max-width: 1000px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.6s ease-out;
    margin-bottom: 2rem;
}

/* Typography */
h1 {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

input,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    margin-bottom: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

input:focus+label {
    color: var(--accent);
}

::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Buttons */
button {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
    letter-spacing: 0.025em;
    font-family: inherit;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: none;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.4);
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    width: auto;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
}

.btn-refresh {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    width: auto;
}

/* Utility Classes */
.hidden {
    display: none !important;
    opacity: 0;
}

.visible-step {
    animation: slideIn 0.4s ease-out forwards;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-secondary);
}

.no-margin {
    margin-bottom: 0 !important;
}

.uppercase {
    text-transform: uppercase;
}

/* Dashboard Specific */
.login-card {
    max-width: 400px;
    margin: 6rem auto;
    text-align: center;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.error-message {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* File Upload */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    background-color: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.05);
    transform: scale(1.02);
}

.drop-zone.dragover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    display: block;
}

.file-info {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Toast notifications */
#toastContainer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.toast {
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

/* Rate Limited Button State */
button.rate-limited {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    animation: pulse-warning 1.5s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Security Panel Styles */
.btn-security {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-security:hover {
    background: rgba(34, 197, 94, 0.3);
}

.btn-security.active {
    background: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.security-panel {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.security-section h3 {
    font-size: 0.95rem;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.security-list {
    max-height: 200px;
    overflow-y: auto;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.security-item.blocked {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
}

.ip-address {
    font-family: monospace;
    font-weight: 500;
}

.ip-type {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.ip-type.admin {
    color: #fbbf24;
}

.ip-type.student {
    color: #60a5fa;
}

.ip-details {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ip-details .failures {
    color: #f87171;
}

.ip-details .countdown {
    color: #fbbf24;
}

.ip-details .status-blocked {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.7rem;
    background: rgba(239, 68, 68, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

.btn-unblock {
    background: rgba(34, 197, 94, 0.2);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-unblock:hover {
    background: rgba(34, 197, 94, 0.4);
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--border);
    border-radius: 0.25rem;
    overflow: hidden;
    margin-top: 1rem;
    display: none;
}

.progress-bar div {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Status Messages */
#statusMessage {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: none;
}

#statusMessage.show {
    display: block;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dashboard Specific Styles */
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.code-pill {
    background-color: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-weight: bold;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

th,
td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Animations */
@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);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: normal;
}

.radio-label input[type="radio"] {
    margin: 0;
    width: auto;
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-hard {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-soft {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Sync Status Indicators */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: help;
}

.sync-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.sync-status.synced {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}
.sync-status.synced .dot {
    background: #10b981;
    animation: none;
}

.sync-status.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}
.sync-status.pending .dot {
    background: #f59e0b;
}

.sync-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
.sync-status.error .dot {
    background: #ef4444;
    animation: pulse 1s infinite;
}

.sync-status.empty {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.sync-status.empty .dot {
    background: #64748b;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Deadline Card */
.deadline-card {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.5rem;
    animation: fadeIn 0.5s ease-out;
}

.deadline-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.deadline-type {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.deadline-type.hard {
    color: var(--error);
    font-weight: 600;
}

.deadline-type.soft {
    color: var(--success);
}

.warning-box {
    background: rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    color: #fca5a5;
    font-weight: 500;
}

.warning-box span {
    font-weight: 700;
    color: #fff;
}

/* File List */
.file-list {
    margin: 1rem 0;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    animation: slideIn 0.2s ease-out;
}

.file-item-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.file-item-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
    box-shadow: none;
}

.file-item-remove:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: scale(1.1);
}

/* Dashboard Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: none;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-action.btn-view:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
}

.btn-action.btn-edit:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: #fbbf24;
}

.btn-action.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

.btn-action.btn-sync:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
}

.btn-action.btn-download:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
}

/* Submissions Panel */
.submissions-panel {
    margin-top: 2rem;
    animation: slideIn 0.3s ease-out;
}

.submissions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.btn-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    width: auto;
    box-shadow: none;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.submissions-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-badge {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.submissions-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.submissions-table {
    width: 100%;
}

.file-count-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* File Details Modal */
.file-details-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.file-detail-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-detail-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-detail-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: popIn 0.2s ease-out;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary {
    flex: 1;
}

.btn-secondary {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sync button */
.btn-sync-main {
    background: linear-gradient(135deg, var(--success), #059669);
}

/* Verify button */
.btn-verify {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.btn-verify:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1);
}

/* Download button */
.btn-download-main {
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
}

/* Maintenance button */
.btn-maintenance {
    background: rgba(251, 146, 60, 0.2);
    color: #fdba74;
    border: 1px solid rgba(251, 146, 60, 0.3);
    box-shadow: none;
}

.btn-maintenance:hover {
    background: rgba(251, 146, 60, 0.4);
}

/* Nuclear/Reset button */
.btn-nuclear {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: none;
}

.btn-nuclear:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6);
}

/* Header actions */
.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Field hints */
.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* ======================= */
/* RESPONSIVE MOBILE       */
/* ======================= */

@media (max-width: 768px) {
    body {
        padding: 1rem;
        align-items: flex-start;
    }

    .container {
        padding: 1.5rem;
        border-radius: 1rem;
        max-width: 100%;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    input, select {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    button {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .drop-zone {
        padding: 1.5rem;
    }

    .file-icon {
        font-size: 2rem;
    }

    .deadline-card {
        padding: 0.75rem;
    }

    .deadline-date {
        font-size: 1rem;
    }

    /* File list mobile */
    .file-item {
        padding: 0.5rem 0.75rem;
    }

    .file-item-name {
        font-size: 0.85rem;
        max-width: 150px;
    }

    .file-item-size {
        font-size: 0.7rem;
    }

    /* Toast mobile */
    #toastContainer {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    .toast {
        width: 100%;
    }

    /* Dashboard mobile */
    .dashboard-container {
        max-width: 100%;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .grid-form {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .action-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .btn-action {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .code-pill {
        font-size: 0.75rem;
        padding: 0.15rem 0.35rem;
    }

    /* Modal mobile */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
    }

    .modal-actions {
        flex-direction: column;
    }

    /* Submissions panel mobile */
    .submissions-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .submissions-table-container {
        max-height: 300px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    /* Hide some columns on very small screens */
    .hide-mobile {
        display: none;
    }
}

/* Keyboard focus styles */
button:focus,
input:focus,
select:focus,
.btn-action:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* File Explorer */
.explorer-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.explorer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.explorer-item:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

.explorer-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.explorer-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explorer-size {
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumb-item {
    color: var(--accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.15s;
}

.breadcrumb-item:hover:not(.active) {
    background: var(--bg-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    cursor: default;
}