:root,
html[data-theme="dark"] {
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-hover: #293548;
    --bg-active: #1d4ed826;
    --border: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
    --radius: 10px;
}

html[data-theme="light"] {
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-active: #dbeafe;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #059669;
    --warning: #d97706;
    --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

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

.small {
    font-size: 0.82rem;
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
    color: var(--text);
    background: var(--bg-elevated);
}

.btn:hover {
    background: var(--bg-hover);
}

.btn:active {
    transform: translateY(1px);
}

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

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

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

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

.btn-ghost {
    background: transparent;
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.7rem 1.35rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.input,
select.input,
textarea.input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-group {
    margin-bottom: 0.9rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Alerts */
.alert {
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
}

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

html[data-theme="light"] .alert-error {
    color: #b91c1c;
}

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

html[data-theme="light"] .alert-success {
    color: #047857;
}

/* Auth Screen */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.auth-card {
    width: 100%;
    max-width: 410px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.auth-logo {
    font-size: 2.6rem;
    margin-bottom: 0.5rem;
}

.auth-card h1 {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
}

/* Main SPA Layout */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.85rem;
    gap: 0.85rem;
    z-index: 60;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.sidebar-close-btn {
    display: none;
    margin-left: auto;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 50;
}

.brand-icon {
    font-size: 1.45rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}

.nav-item:hover {
    background: var(--bg-hover);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.drag-over {
    outline: 2px dashed var(--primary);
    background: var(--bg-active);
}

.nav-chevron {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    transition: transform 0.15s;
}

.nav-chevron:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-chevron.collapsed {
    transform: rotate(-90deg);
}

.nav-sub-group {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    margin-left: 1.15rem;
    padding-left: 0.55rem;
    border-left: 1px solid var(--border);
    margin-bottom: 0.2rem;
}

.nav-sub-item {
    padding: 0.42rem 0.65rem;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.nav-sub-item:hover {
    color: var(--text);
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.65rem 0.75rem 0.2rem;
    user-select: none;
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quota-box {
    font-size: 0.78rem;
}

.quota-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    color: var(--text-muted);
}

.quota-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.quota-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.25s;
}

.sidebar-actions {
    display: flex;
    gap: 0.35rem;
}

.sidebar-actions .btn {
    flex: 1;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 8px;
    flex: 1;
    min-width: 0;
}

.user-info:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-meta strong {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.mobile-menu-btn {
    display: none;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 420px;
    margin-right: auto;
}

.search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.45rem 0.75rem 0.45rem 2.1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.88rem;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
}

.top-actions {
    display: flex;
    gap: 0.45rem;
    margin-left: auto;
    flex-shrink: 0;
}

.dropdown-wrap {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 205px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 0.35rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.view-mode-toggle {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.view-mode-toggle .btn.active {
    background: var(--bg-active);
    border-color: var(--primary);
    color: var(--primary);
}

/* Sub-Bar: Breadcrumbs & Bulk Toolbar */
.sub-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    border-bottom: 1px solid var(--border);
    min-height: 48px;
    flex-wrap: wrap;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.crumb {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
}

.crumb:hover,
.crumb.drag-over {
    background: var(--bg-hover);
    color: var(--text);
}

.crumb.active {
    color: var(--text);
    font-weight: 700;
}

.crumb-sep {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.bulk-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.35rem;
}

/* Upload Progress Panel */
.upload-progress-panel {
    margin: 0.75rem 1.25rem 0;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

/* File Viewport */
.file-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem 2.5rem;
}

.file-table-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.file-table th,
.file-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.file-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    user-select: none;
}

.th-sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: relative;
}

.th-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.12s;
}

.th-sort-btn:hover,
.th-sort-btn.active {
    color: var(--text);
}

.th-sort-arrow {
    font-size: 0.68rem;
    color: var(--primary);
}

.th-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 0.12rem 0.42rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s;
}

.th-filter-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.th-filter-btn.active {
    background: var(--bg-active);
    border-color: var(--primary);
    color: var(--primary);
}

.th-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 195px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 0.3rem;
    z-index: 60;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.th-filter-menu .dropdown-item.active {
    background: var(--bg-active);
    color: var(--primary);
    font-weight: 600;
}

.file-table tbody tr {
    transition: background 0.1s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.file-table tbody tr:hover {
    background: var(--bg-hover);
}

.file-table tbody tr.selected {
    background: var(--bg-active);
}

.file-table tbody tr.drag-over {
    outline: 2px dashed var(--primary);
    background: var(--bg-active);
}

.file-table tbody tr.touch-armed,
.grid-card.touch-armed {
    outline: 2px solid var(--primary);
    background: var(--bg-active);
    transform: scale(0.985);
}

.touch-drag-ghost {
    position: fixed;
    z-index: 300;
    pointer-events: none;
    transform: translate(-50%, -115%);
    background: var(--bg-elevated);
    border: 2px solid var(--primary);
    color: var(--text);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    white-space: nowrap;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.item-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    min-width: 200px;
}

.item-thumb {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.item-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg);
    flex-shrink: 0;
}

.item-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    min-width: 0;
}

.item-name {
    font-weight: 500;
    word-break: break-word;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.12rem 0.45rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.badge-vault {
    border-color: var(--warning);
    color: var(--warning);
}

.badge-shared {
    border-color: var(--primary);
    color: var(--primary);
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
}

/* Grid View */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.65rem;
}

.grid-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.12s, border-color 0.12s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.grid-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.grid-card.selected {
    background: var(--bg-active);
    border-color: var(--primary);
}

.grid-card.drag-over {
    outline: 2px dashed var(--primary);
}

.grid-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-preview {
    height: 82px;
    border-radius: 7px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    overflow: hidden;
}

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

.grid-title {
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dual-Pane Split View */
.split-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
    height: calc(100vh - 150px);
    min-height: 420px;
}

.split-pane {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.split-pane.pane-drop-target {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.split-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.split-pane-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    font-size: 0.85rem;
}

.split-pane .file-table-wrap {
    border: none;
    border-radius: 0;
    flex: 1;
    overflow-y: auto;
}

.split-pane .file-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    z-index: 2;
}

@media (max-width: 960px) {
    .split-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }

    .split-pane {
        height: 440px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Non-blocking Drag & Drop Indicator Pill */
.drop-overlay {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: none;
}

.drop-overlay-box {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    border: 2px solid var(--primary);
    border-radius: 999px;
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    font-size: 0.92rem;
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    color: var(--text);
}

.drop-icon {
    font-size: 1.3rem;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-dialog {
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-dialog.modal-lg {
    max-width: 880px;
}

.modal-dialog.modal-fullscreen {
    max-width: 96vw;
    width: 96vw;
    height: 92vh;
    max-height: 92vh;
}

.modal-dialog.modal-fullscreen .modal-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Office Modal Styles */
.office-editor-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.office-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 30;
}

.office-editor-body {
    flex: 1;
    min-height: 0;
    background: #fff;
    color: #1e293b;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#office-quill-editor {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

/* Dark mode adjustments for office containers */
[data-theme="dark"] .office-editor-toolbar {
    background: var(--bg-elevated);
}

.ql-toolbar.ql-snow {
    border: 1px solid var(--border) !important;
    border-top: none !important;
    background: #f8fafc;
    border-radius: 0 !important;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.ql-container.ql-snow {
    border: 1px solid var(--border) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px;
    font-size: 1rem;
    background: #fff;
    color: #0f172a;
    font-family: system-ui, -apple-system, sans-serif;
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ql-editor {
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow-y: auto !important;
    padding: 1.75rem 2.5rem !important;
    font-size: 1.05rem;
    line-height: 1.7;
    background: #ffffff;
    color: #0f172a;
    box-sizing: border-box;
}

.x-spreadsheet {
    width: 100% !important;
    height: 100% !important;
}

/* Presentation / PPTX Viewer */
.pptx-viewer-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.pptx-main-area {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 0.75rem;
    padding: 0.5rem 0;
    position: relative;
    overflow: hidden;
}

.pptx-thumb-nav {
    width: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.25rem;
    flex-shrink: 0;
}

.pptx-thumb-item {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 0.45rem;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.12s, transform 0.1s, box-shadow 0.12s;
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pptx-thumb-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.pptx-thumb-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.pptx-thumb-preview-img {
    width: 100%;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);
}

.pptx-thumb-img-badge {
    align-self: flex-start;
    font-size: 0.68rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    font-weight: 500;
}

.pptx-stage-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    border-radius: 8px;
    padding: 1.5rem;
    overflow: auto;
    position: relative;
}

.pptx-slide-canvas {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    background: #ffffff;
    color: #1e293b;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 3rem;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
}

.pptx-slide-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    word-break: break-word;
}

.pptx-slide-content-area {
    display: flex;
    flex: 1;
    gap: 2rem;
    align-items: center;
    min-height: 0;
}

.pptx-slide-text-col {
    flex: 1;
    min-width: 0;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #334155;
    overflow-y: auto;
    max-height: 100%;
}

.pptx-slide-media-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    max-height: 100%;
}

.pptx-slide-media-col img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
}

.pptx-slide-content-area.media-only {
    justify-content: center;
}

.pptx-slide-content-area.media-only .pptx-slide-media-col {
    width: 100%;
}

.pptx-slide-content-area.media-only .pptx-slide-media-col img {
    max-height: 360px;
}

.pptx-slide-num-badge {
    position: absolute;
    bottom: 0.85rem;
    right: 1.25rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Edit Drawer */
.pptx-edit-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-card, #1e293b);
    color: var(--text, #f8fafc);
    border-left: 1px solid var(--border, #334155);
    box-shadow: -8px 0 25px rgba(0,0,0,0.35);
    z-index: 60;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    overflow-y: auto;
    transition: transform 0.2s ease-in-out;
}

.pptx-edit-drawer.hidden {
    display: none;
}

.pptx-edit-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border, #334155);
    margin-bottom: 1rem;
}

.pptx-edit-img-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.pptx-edit-img-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    word-break: break-all;
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.code-box {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.preview-media-wrap {
    text-align: center;
    background: var(--bg);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.preview-media-wrap img,
.preview-media-wrap video {
    max-width: 100%;
    max-height: 62vh;
    border-radius: 6px;
}

.preview-pdf-frame {
    width: 100%;
    height: 65vh;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.editor-textarea {
    width: 100%;
    min-height: 360px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
    line-height: 1.5;
    resize: vertical;
}

/* Tabs inside Modals */
.tabs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    padding-bottom: 0.45rem;
    overflow-x: auto;
    white-space: nowrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.38rem 0.65rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.tab-btn.active {
    background: var(--bg-active);
    color: var(--primary);
}

/* Public Share View Page */
.share-page-body {
    min-height: 100vh;
    padding: 1.5rem 1rem;
}

.share-container {
    max-width: 880px;
    margin: 0 auto;
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-header .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.share-file-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 1.5rem;
    text-align: center;
}

.share-file-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.share-preview-box {
    margin: 1.25rem auto;
    max-width: 680px;
}

.share-preview-box img,
.share-preview-box video {
    max-width: 100%;
    max-height: 460px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.share-dropzone {
    background: var(--bg-elevated);
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.vault-share-form {
    max-width: 440px;
    margin: 1rem auto 0;
}

.item-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.item-link:hover {
    color: var(--primary);
}

.empty-cell {
    text-align: center !important;
    padding: 2rem !important;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 250;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

/* Right-Click / Long-Touch Context Menu */
.context-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: transparent;
}

.context-menu {
    position: fixed;
    z-index: 150;
    min-width: 235px;
    max-width: 300px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    user-select: none;
}

.context-menu-header {
    padding: 0.45rem 0.7rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.2rem;
    font-size: 0.83rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
}

.context-sub-menu {
    position: relative;
}

.context-sub-menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-left: 0.85rem;
    padding-left: 0.6rem;
    border-left: 2px solid var(--border);
    margin-top: 0.2rem;
    margin-bottom: 0.3rem;
}

.context-sub-menu-items .dropdown-item {
    font-size: 0.84rem;
    padding: 0.4rem 0.65rem;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -260px;
        transition: left 0.2s;
    }

    .sidebar.open {
        left: 0;
        box-shadow: var(--shadow);
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .mobile-menu-btn {
        display: inline-flex;
        flex-shrink: 0;
    }

    .top-bar {
        padding: 0.55rem 0.75rem;
        gap: 0.45rem;
    }

    .hide-mobile {
        display: none !important;
    }

    .file-viewport {
        padding: 0.75rem 0.75rem 2.5rem;
    }

    .sub-bar {
        padding: 0.45rem 0.75rem;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
        gap: 0.45rem;
    }

    .grid-card {
        padding: 0.4rem 0.45rem;
        gap: 0.25rem;
        border-radius: 8px;
    }

    .grid-preview {
        height: 54px;
        font-size: 1.65rem;
        border-radius: 6px;
    }

    .grid-title {
        font-size: 0.76rem;
    }

    .grid-meta {
        font-size: 0.68rem;
    }

    .context-menu-backdrop {
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(1px);
    }

    .context-menu {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1.25rem !important;
        top: auto !important;
        max-width: none;
    }
}

/* Shared Club Calendar (Vereinskalender) */
.cal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.cal-nav-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cal-month-title {
    font-size: 1.15rem;
    font-weight: 700;
    min-width: 170px;
    text-align: center;
}

.cal-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 1.1rem;
    align-items: start;
}

.cal-board {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-day {
    min-height: 92px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    cursor: pointer;
    transition: background 0.12s;
    min-width: 0;
}

.cal-day:nth-child(7n) {
    border-right: none;
}

.cal-day:hover {
    background: var(--bg-hover);
}

.cal-day.other-month {
    opacity: 0.42;
    background: var(--bg);
}

.cal-day.today {
    background: var(--bg-active);
}

.cal-day-num {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.cal-day.today .cal-day-num {
    background: var(--primary);
    color: #fff;
}

.cal-event-pill {
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.16rem 0.38rem;
    border-radius: 5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    line-height: 1.25;
}

.cal-event-pill:hover {
    filter: brightness(1.1);
}

.cal-upcoming-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cal-upcoming-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    cursor: pointer;
    transition: border-color 0.12s;
}

.cal-upcoming-item:hover {
    border-color: var(--primary);
}

.cal-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.3rem;
    flex-shrink: 0;
}

@media (max-width: 980px) {
    .cal-layout {
        grid-template-columns: 1fr;
    }

    .cal-day {
        min-height: 68px;
    }
}

/* Club Member Statistics, Jubilees & Fees Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.1rem;
}

.stats-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.stats-card h4 {
    margin: 0 0 0.25rem;
    font-size: 0.98rem;
}

.stat-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

/* Help & Documentation Center */
.help-wrap {
    padding: 0.25rem 0.5rem 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.help-header {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

.help-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.help-header p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.help-search-box {
    position: relative;
    max-width: 550px;
}

.help-search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.4rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
}

.help-search-box .icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.help-nav-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.help-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.help-pill:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.help-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .help-grid {
        grid-template-columns: 1fr;
    }
}

.help-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: border-color 0.15s;
}

.help-card:hover {
    border-color: var(--primary);
}

.help-card-header {
    padding: 1.1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.help-card-header h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
}

.help-card-body p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.help-steps {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text);
}

.help-steps li {
    margin-bottom: 0.35rem;
}

.help-tip {
    background: rgba(37, 99, 235, 0.08);
    border-left: 3px solid var(--primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.82rem;
    color: var(--text);
}

/* UI Mockup / Screenshot Component */
.help-mockup {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    font-family: system-ui, sans-serif;
}

.mockup-topbar {
    background: #1e293b;
    padding: 6px 10px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.mockup-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.mockup-dot.red { background: #ef4444; }
.mockup-dot.yellow { background: #f59e0b; }
.mockup-dot.green { background: #10b981; }

.mockup-title {
    margin-left: 4px;
    font-weight: 500;
    color: #cbd5e1;
}

.mockup-content {
    padding: 10px 12px;
    background: #0b1120;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.mockup-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.72rem;
    color: #cbd5e1;
    flex-wrap: wrap;
}

.mockup-btn {
    background: #334155;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.mockup-btn-primary {
    background: #2563eb;
    border-color: #3b82f6;
    color: #fff;
}

.mockup-btn-success {
    background: #059669;
    border-color: #10b981;
    color: #fff;
}

.mockup-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}

.mockup-badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.mockup-badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.mockup-badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.mockup-slide-preview {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.mockup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.mockup-table th, .mockup-table td {
    padding: 4px 8px;
    border: 1px solid #334155;
    text-align: left;
}

.mockup-table th {
    background: #0f172a;
    color: #94a3b8;
    font-weight: 600;
}

.stat-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.83rem;
}

.stat-bar-track {
    height: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width 0.25s;
}

/* Weekly Hall & Room Schedule (Hallen- & Wochenplan) */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.55rem;
    align-items: stretch;
}

.week-day-col {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 290px;
    overflow: hidden;
}

.week-day-col.today {
    border-color: var(--primary);
}

.week-day-header {
    padding: 0.55rem 0.65rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.week-day-col.today .week-day-header {
    background: var(--bg-active);
    color: var(--primary);
}

.week-day-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.week-slot-card {
    padding: 0.45rem 0.55rem;
    border-radius: 7px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
}

.week-slot-card:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.week-slot-card.conflict {
    border-color: var(--danger);
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 1100px) {
    .week-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }
    .week-day-col {
        min-height: 160px;
    }
}

@media print {
    .sidebar,
    .top-bar,
    .sub-bar,
    .cal-header-bar button,
    .cal-header-bar select,
    .cal-header-bar label,
    .cal-header-bar a {
        display: none !important;
    }
    .app-shell,
    .main-area,
    .file-viewport {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
    }
    .stats-card,
    .file-table-wrap {
        border-color: #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 1rem !important;
    }
}
