/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fefce8;
    --bg: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: rgba(255,255,255,0.1);
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo i {
    width: 24px;
    height: 24px;
    color: #818cf8;
}

.sidebar-logo h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background var(--transition), border-left var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.92rem;
}

.nav-links li a i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-links li a:hover {
    background: var(--sidebar-hover);
    text-decoration: none;
}

.nav-links li a.active {
    background: var(--sidebar-hover);
    border-left-color: #818cf8;
    color: #fff;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-user i {
    width: 20px;
    height: 20px;
    color: #818cf8;
}

.sidebar-footer-links {
    display: flex;
    gap: 16px;
}

.sidebar-footer-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color var(--transition);
}

.sidebar-footer-links a i {
    width: 14px;
    height: 14px;
}

.sidebar-footer-links a:hover {
    color: #fff;
    text-decoration: none;
}

.logout-link:hover {
    color: #f87171 !important;
}

/* ===== Content ===== */
.content {
    margin-left: 250px;
    padding: 32px 40px;
    flex: 1;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    margin-bottom: 0;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-icon-indigo { background: #eef2ff; color: #4f46e5; }
.stat-icon-green { background: #dcfce7; color: #16a34a; }
.stat-icon-amber { background: #fef3c7; color: #d97706; }
.stat-icon-red { background: #fef2f2; color: #dc2626; }

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 0.88rem;
}

/* ===== Quick Links ===== */
.quick-links {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: box-shadow var(--transition), transform var(--transition);
}

.quick-link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.quick-link i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

/* ===== Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.row-pending {
    background: #fefce8 !important;
}

.row-pending:hover {
    background: #fef9c3 !important;
}

.row-error {
    background: #fef2f2 !important;
}

.row-error:hover {
    background: #fee2e2 !important;
}

.table-empty td {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
}

/* ===== Detail Card ===== */
.detail-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 180px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }

.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 10px;
}
.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--text);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-error { background: #fef2f2; color: #991b1b; }
.badge-warning { background: #fefce8; color: #854d0e; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ===== Filter Bar ===== */
.filter-bar {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--card-bg);
    min-width: 180px;
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-input {
    position: relative;
}

.search-input i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input input {
    padding-left: 36px !important;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--card-bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    text-decoration: none;
}

.tab:hover {
    color: var(--text);
    text-decoration: none;
}

.tab.tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.tab-content-active {
    display: block;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-lg .modal-content {
    max-width: 800px;
}

/* ===== Inline Edit ===== */
.inline-edit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-edit-value {
    font-size: inherit;
    font-weight: inherit;
}

.inline-edit-input {
    font-size: inherit;
    font-weight: inherit;
    padding: 4px 8px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    display: none;
}

.inline-edit.editing .inline-edit-value { display: none; }
.inline-edit.editing .inline-edit-input { display: block; }

.inline-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: color var(--transition);
}

.inline-edit-btn:hover {
    color: var(--primary);
}

.inline-edit-btn i {
    width: 16px;
    height: 16px;
}

/* ===== Drop Zone ===== */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone i {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.drop-zone p strong {
    color: var(--primary);
}

.drop-zone-files {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.drop-zone-file {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.drop-zone-file img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drop-zone-file .remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Cards Grid (for groups) ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.card-stat i {
    width: 16px;
    height: 16px;
}

.card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ===== Messages ===== */
.messages {
    margin-bottom: 24px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid #16a34a; }
.alert-error { background: #fef2f2; color: #991b1b; border-left: 4px solid #dc2626; }
.alert-warning { background: #fefce8; color: #854d0e; border-left: 4px solid #f59e0b; }
.alert-info { background: #e0f2fe; color: #075985; border-left: 4px solid #0284c7; }

/* ===== Grade Cell ===== */
.grade-cell {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

.grade-5 { color: #16a34a; }
.grade-4 { color: #65a30d; }
.grade-3 { color: #d97706; }
.grade-2 { color: #ea580c; }
.grade-1 { color: #dc2626; }

/* ===== Grades Table ===== */
.grades-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.grades-table th,
.grades-table td {
    padding: 10px 12px;
    text-align: center;
    border: 1px solid var(--border);
    font-size: 0.88rem;
}

.grades-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--text-muted);
}

.grades-table td:first-child,
.grades-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 1;
    min-width: 180px;
    font-weight: 500;
}

.grades-table th:first-child {
    background: #f1f5f9;
    z-index: 2;
}

.grades-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ===== Period Selector ===== */
.period-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.period-selector label {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 400px;
    max-width: 95%;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo i {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form .form-group input {
    padding: 12px 14px;
    font-size: 1rem;
}

.login-form .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
}

.login-error {
    background: var(--danger-light);
    color: #991b1b;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* ===== Section Card ===== */
.section-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

.section-card-header {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-card-header h3 {
    margin: 0;
}

.section-card-body {
    padding: 24px;
}

/* ===== File Preview ===== */
.file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.file-preview-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform var(--transition);
}

.file-preview-item:hover {
    transform: scale(1.05);
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .file-type-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.file-preview-item .file-type-icon i {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

/* ===== File Uploader ===== */
.file-uploader {
    width: 100%;
}

.file-uploader__dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: #fafbfc;
    user-select: none;
}

.file-uploader__dropzone:hover,
.file-uploader__dropzone--active {
    border-color: var(--primary);
    border-style: solid;
    background: var(--primary-light);
}

.file-uploader__icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin: 0 auto 12px;
    display: block;
}

.file-uploader__dropzone:hover .file-uploader__icon,
.file-uploader__dropzone--active .file-uploader__icon {
    color: var(--primary);
}

.file-uploader__text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.file-uploader__text strong {
    color: var(--primary);
}

.file-uploader__hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    opacity: 0.7;
}

.file-uploader__counter {
    margin-top: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
}

.file-uploader__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.file-uploader__item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--card-bg);
    transition: transform var(--transition), box-shadow var(--transition);
}

.file-uploader__item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-uploader__item--image {
    aspect-ratio: 1;
}

.file-uploader__item--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.file-uploader__item--file {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
    background: #f8fafc;
}

.file-uploader__file-icon {
    margin-bottom: 6px;
}

.file-uploader__file-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-muted);
}

.file-uploader__file-name {
    font-size: 0.75rem;
    color: var(--text);
    word-break: break-all;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.file-uploader__file-size {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-uploader__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition);
    padding: 0;
}

.file-uploader__item:hover .file-uploader__remove {
    opacity: 1;
}

.file-uploader__remove:hover {
    background: var(--danger);
}

/* ===== Loading Spinner ===== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 16px;
}

/* ===== Utility ===== */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.justify-between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
