/* ========================================
   Online Classshare – Stylesheet
   ======================================== */

:root {
    --color-bg: #f5f5f5;
    --color-surface: #ffffff;
    --color-primary: #333333;
    --color-primary-hover: #555555;
    --color-danger: #888888;
    --color-danger-hover: #666666;
    --color-text: #1a1a1a;
    --color-text-muted: #888888;
    --color-border: #e0e0e0;
    --color-sidebar: #fafafa;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

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

.login-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.login-form { text-align: left; }

.login-hint {
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ---- App Layout ---- */
.app-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
    text-decoration: none;
}
.logo:hover { text-decoration: none; }

.user-badge {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    padding: 4px 10px;
    background: var(--color-bg);
    border-radius: var(--radius);
}

.breadcrumb, .breadcrumb-sep {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
.breadcrumb-current {
    font-size: 0.875rem;
    color: var(--color-text);
}
.breadcrumb-link {
    font-size: 0.875rem;
}

.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    background: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    padding: 16px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
}
.nav-item:hover, .nav-item.active {
    background: #e2e8f0;
    text-decoration: none;
}
.nav-item-sm {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 12px 4px;
}

.nav-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--color-surface);
}

.nav-hint {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.copy-tree {
    margin-top: 4px;
}

.sidebar-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.sidebar-section h4 {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.content-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    gap: 6px;
}
.btn:hover {
    background: #f1f5f9;
    text-decoration: none;
}

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

.btn-danger {
    color: var(--color-danger);
    border-color: var(--color-danger);
}
.btn-danger:hover { background: #f0f0f0; }

.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; }

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: var(--color-danger); }

/* ---- Forms ---- */
.form-field {
    margin-bottom: 14px;
}
.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text);
}
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: border-color 0.15s;
}
.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ---- Messages ---- */
.msg {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.msg-error {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
}
.msg-success {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
}

/* ---- Modal ---- */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}

.modal-content {
    position: relative;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 28px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}
.modal-content h3 {
    margin-bottom: 16px;
    font-size: 1.15rem;
}

/* ---- Student Grid ---- */
.student-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.student-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.student-card:hover {
    border-color: var(--color-primary);
}

.student-info { flex: 1; }
.student-name {
    font-weight: 600;
    font-size: 1rem;
}
.student-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

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

/* ---- Folder Tree ---- */
.folder-view { margin-bottom: 24px; }

.tree-item {
    padding: 4px 0;
}

.tree-toggle {
    cursor: pointer;
    font-size: 0.7rem;
    margin-right: 4px;
    color: var(--color-text-muted);
    user-select: none;
}
.tree-link {
    font-weight: 500;
}
.tree-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-left: 8px;
}
.tree-actions {
    margin-left: 8px;
}
.tree-children { display: none; }

.breadcrumb-nav {
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    font-size: 0.9rem;
}

/* ---- File List ---- */
.file-list { margin-top: 16px; }
.file-list h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 6px;
}
.file-icon { font-size: 1.2rem; }
.file-name { flex: 1; font-size: 0.9rem; }
.file-size, .file-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.file-actions { display: flex; gap: 4px; }

/* ---- Viewer ---- */
.viewer-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

.pdf-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pdf-viewer {
    max-width: 100%;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}
.pdf-viewer canvas {
    max-width: 100%;
    height: auto;
}

.image-viewer {
    max-width: 100%;
}
.image-viewer img {
    max-width: 100%;
    max-height: 75vh;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.generic-viewer {
    text-align: center;
    padding: 60px 20px;
}

.file-info-card {
    display: inline-block;
    padding: 24px 32px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.file-info-card h3 { margin-bottom: 10px; }
.file-info-card p { color: var(--color-text-muted); margin-bottom: 6px; }

/* ---- Annotation Sidebar ---- */
.annotation-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.annotation-item {
    padding: 8px 10px;
    background: var(--color-bg);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.annotation-item strong {
    font-size: 0.8rem;
}
.annotation-item p {
    margin-top: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}
.annotation-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-left: 6px;
}

.annotation-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.85rem;
    resize: vertical;
    margin-bottom: 6px;
}
.annotation-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ---- QR Modal ---- */
#qrcode {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}
#qrcode canvas, #qrcode img {
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.login-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px;
    background: var(--color-bg);
    border-radius: var(--radius);
}
.login-link-box label {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}
.login-link-box input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
}

/* ---- Utilities ---- */
.loading {
    text-align: center;
    color: var(--color-text-muted);
    padding: 24px;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: 32px;
    font-size: 0.9rem;
}

/* ---- Toast (non-blocking notification) ---- */
#toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ---- Annotate button ---- */
.annotate-btn {
    background: var(--color-primary) !important;
    color: #fff !important;
    text-align: center;
    font-weight: 600;
}

/* ---- Sidebar-wide (student dashboard) ---- */
.sidebar-wide {
    width: 220px;
    background: #f0f0f0;
}

.sidebar-actions {
    padding: 10px 12px;
}

.sidebar-add-btn {
    width: 100%;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 8px 12px;
    cursor: pointer;
}
.sidebar-add-btn:hover { background: #555; }

.sidebar-tree {
    padding: 4px 10px;
}

.sidebar-hint {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #999;
}

.sbt-item { margin-bottom: 2px; }

.sbt-link {
    display: block;
    padding: 7px 12px;
    font-size: 0.82rem;
    color: #333;
    text-decoration: none;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}
.sbt-link:hover { background: #e8e8e8; text-decoration: none; }
.sbt-item.active > .sbt-link {
    background: #333;
    color: #fff;
    font-weight: 600;
}

.sbt-label { }

.sbt-toggle, .sbt-count { display: none; }

.sbt-children { display: none; }

/* ---- Folder title (right side) ---- */
.folder-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* ---- File Grid (thumbnails) ---- */
.file-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 0;
}

.file-card {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.15s, border-color 0.15s;
    position: relative;
    width: 120px;
    aspect-ratio: 3 / 4;
    width: 120px;
    aspect-ratio: 3 / 4;
}
.file-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #aaa;
    text-decoration: none;
}

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

.pdf-thumb-canvas {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.grid-thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.8rem;
    color: #bbb;
    text-transform: uppercase;
    font-weight: 600;
}

.file-card-meta { display: none; }

.file-card-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
    background: transparent;
    width: 120px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    cursor: pointer;
}
.file-card-upload:hover {
    border-color: #888;
    background: #f5f5f5;
    box-shadow: none;
}

.upload-plus {
    font-size: 3rem;
    font-weight: 200;
    color: #bbb;
}

.drag-over {
    outline: 3px dashed #888;
    outline-offset: -6px;
}

/* ── Inline Viewer ────────────────────────────────── */
.viewer-toolbar {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 12px; background: #fafafa;
    border-bottom: 1px solid #e0e0e0; margin-bottom: 8px;
    border-radius: 8px;
    flex-wrap: wrap;
}
.viewer-toolbar button {
    padding: 5px 10px; border: 1px solid #ddd; border-radius: 6px;
    background: #fff; color: #333; cursor: pointer; font-size: 0.85rem;
}
.viewer-toolbar button:hover { background: #eee; }

.annot-toolbar {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 10px; background: #fafafa;
    border-bottom: 1px solid #e0e0e0; margin-bottom: 8px;
    border-radius: 8px; flex-wrap: wrap;
}
.annot-toolbar button, .annot-toolbar select {
    padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px;
    background: #fff; color: #333; cursor: pointer; font-size: 0.8rem;
}
.annot-toolbar button:hover { background: #eee; }
.annot-toolbar button.active { background: #333; color: #fff; border-color: #333; }
.annot-toolbar input[type=color] { width: 28px; height: 28px; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; padding: 2px; }
.annot-toolbar select { font-size: 0.8rem; }

.viewer-content img { max-width: 100%; display: block; }

.pdf-page-wrap {
    position: relative; margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08); background: #fff;
}
.pdf-page-canvas { display: block; max-width: 100%; height: auto; }

.ann-overlay { pointer-events: auto; touch-action: none; }

@media (prefers-color-scheme: dark) {
    .viewer-toolbar, .annot-toolbar { background: #1c1c1c; border-color: #333; }
    .viewer-toolbar button, .annot-toolbar button, .annot-toolbar select {
        background: #252525; color: #ccc; border-color: #333;
    }
    .viewer-toolbar button:hover, .annot-toolbar button:hover { background: #333; }
    .pdf-page-wrap { background: #1c1c1c; }
    .annot-toolbar button.active { background: #888; border-color: #888; }
}

/* ---- Student tile grid (teacher dashboard) ---- */
.student-tile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 0;
}

.student-tile {
    width: 120px;
    aspect-ratio: 3 / 4;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
    position: relative;
}
.student-tile:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #aaa;
}
.student-tile:active { cursor: grabbing; }

.student-tile.drag-target {
    border-color: #333;
    border-style: dashed;
    background: #f0f0f0;
}

.student-tile-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    text-align: center;
    padding: 4px 8px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-tile-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 4px 6px 8px;
    opacity: 0;
    transition: opacity 0.15s;
}
.file-card:hover .student-tile-actions { opacity: 1; }

.student-tile-card { cursor: grab; user-select: none; position: relative; display: flex; flex-direction: column; padding-bottom: 26px; }
.student-tile-card:active { cursor: grabbing; }
.student-tile-card.drag-target { border: 2px dashed #888; }

.student-tile-avatar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.student-tile-avatar svg {
    width: 60%;
    height: 60%;
}

.student-tile-qr {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.student-tile-qr:hover { opacity: 1; }
.student-tile-qr svg { width: 100%; height: 100%; }

/* ── Top action bar (grid cards) ── */
.card-actions-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 3px 0;
    background: #ddd;
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 10;
}
.card-action-btn {
    width: 20px; height: 20px;
    border: none; background: #bbb;
    cursor: pointer; border-radius: 3px;
    font-size: 0.6rem; color: #444;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.card-action-btn:hover { background: #999; }

@media (prefers-color-scheme: dark) {
    .card-actions-bar { background: #222; }
    .card-action-btn { background: #333; color: #aaa; }
    .card-action-btn:hover { background: #555; }
}

/* ── Sidebar item action buttons ── */
.sidebar-actions-row {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    display: flex; gap: 3px;
    opacity: 0; transition: opacity 0.15s;
}
.sbt-item:hover .sidebar-actions-row { opacity: 1; }

.sidebar-action-btn {
    width: 18px; height: 18px;
    border: none; background: rgba(0,0,0,0.06);
    cursor: pointer; border-radius: 3px;
    font-size: 0.55rem; color: #888;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.sidebar-action-btn:hover { background: rgba(0,0,0,0.12); }

@media (prefers-color-scheme: dark) {
    .card-action-btn { background: rgba(255,255,255,0.04); color: #aaa; }
    .card-action-btn:hover { background: rgba(255,255,255,0.1); }
    .sidebar-action-btn { background: rgba(255,255,255,0.06); color: #aaa; }
    .sidebar-action-btn:hover { background: rgba(255,255,255,0.12); }
    .card-actions-right { background: rgba(0,0,0,0.3); }
}

.student-tile-add {
    border: 2px dashed #ccc;
    background: transparent;
    cursor: pointer;
}
.student-tile-add span {
    font-size: 3rem;
    font-weight: 200;
    color: #bbb;
}
.student-tile-add:hover {
    border-color: #888;
    background: #f5f5f5;
    box-shadow: none;
}
@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    .student-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .student-actions { flex-wrap: wrap; }
    .file-item { flex-wrap: wrap; }
    .viewer-main { padding: 8px; }
}

/* ========================================
   Dark Mode
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #111;
        --color-surface: #1c1c1c;
        --color-primary: #555;
        --color-primary-hover: #777;
        --color-danger: #999;
        --color-danger-hover: #bbb;
        --color-text: #ccc;
        --color-text-muted: #888;
        --color-border: #333;
        --color-sidebar: #181818;
        --shadow: 0 1px 3px rgba(0,0,0,0.4);
        --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
    }

    body { background: var(--color-bg); color: var(--color-text); }
    .app-header { background: var(--color-surface); border-color: var(--color-border); }
    .sidebar { background: var(--color-sidebar); border-color: var(--color-border); }
    .sidebar-wide { background: var(--color-sidebar); }
    .btn { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
    .btn:hover { background: var(--color-sidebar); }
    .btn-primary { background: var(--color-primary); color: #fff; }
    .btn-primary:hover { background: var(--color-primary-hover); }
    .btn-danger { color: var(--color-danger); border-color: var(--color-danger); }
    .btn-danger:hover { background: rgba(255,255,255,0.05); }
    .nav-item { color: var(--color-text); }
    .nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.05); }
    .nav-select { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }

    .sidebar-add-btn { background: #555; color: #eee; }
    .sidebar-add-btn:hover { background: #777; }
    .student-tile { background: var(--color-surface); border-color: var(--color-border); }
    .student-tile:hover { border-color: var(--color-text-muted); }
    .student-tile-name { color: var(--color-text); }
    .student-tile-add { border-color: var(--color-border); }
    .student-tile-add span { color: var(--color-text-muted); }
    .student-tile-add:hover { background: var(--color-sidebar); border-color: var(--color-text-muted); }
    .student-tile-card.drag-target { border-color: #888; }

    .sbt-link { background: var(--color-surface); color: var(--color-text); }
    .sbt-link:hover { background: rgba(255,255,255,0.05); }
    .sbt-item.active > .sbt-link { background: var(--color-primary); color: #fff; }
    .sidebar-hint { color: var(--color-text-muted); }

    .file-card { background: var(--color-surface); border-color: var(--color-border); }
    .file-card:hover { border-color: var(--color-text-muted); }
    .file-card-thumb { background: var(--color-sidebar); }
    .file-card-name { color: var(--color-text); }
    .file-card-upload { border-color: var(--color-border); }
    .file-card-upload:hover { background: var(--color-sidebar); border-color: var(--color-text-muted); }

    .folder-title { color: var(--color-text); border-color: var(--color-border); }
    .breadcrumb-nav { background: var(--color-surface); border-color: var(--color-border); }

    .modal-content { background: var(--color-surface); }
    .form-field input, .form-field textarea, .form-field select {
        background: var(--color-sidebar);
        border-color: var(--color-border);
        color: var(--color-text);
    }
    .form-field input:focus, .form-field textarea:focus { border-color: var(--color-primary); }

    .login-page { background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%); }
    .msg-error { background: rgba(255,255,255,0.05); border-color: #444; color: #aaa; }
    .msg-success { background: rgba(255,255,255,0.05); border-color: #444; color: #aaa; }

    .empty-state, .loading { color: var(--color-text-muted); }
    .user-badge { background: var(--color-sidebar); color: var(--color-text-muted); }

    .student-card { background: var(--color-surface); border-color: var(--color-border); }
    .file-item { background: var(--color-surface); border-color: var(--color-border); }
    .file-info-card { background: var(--color-surface); border-color: var(--color-border); }

    .login-link-box { background: var(--color-sidebar); }
    .login-link-box input { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
    .annotation-item { background: var(--color-sidebar); }

    .grid-thumb-icon { color: var(--color-text-muted); }
    #toast { background: #555; color: #eee; }
}
