/**
 * OpenOlat Theme Editor — style.css
 * Vollständiges CSS (kein Framework, kein Build-Prozess).
 * Farbschema: edumod.ch Branding (Dunkelblau).
 */

/* ============================================================
   1. CSS-Variablen
   ============================================================ */

:root {
    /* Farben */
    --color-primary:       #1e3a5f;
    --color-primary-light: #e8eef4;
    --color-accent:        #3b82f6;
    --color-accent-hover:  #2563eb;
    --color-bg:            #ffffff;
    --color-bg-subtle:     #f8fafc;
    --color-border:        #e2e8f0;
    --color-text:          #1e293b;
    --color-text-muted:    #64748b;
    --color-success:       #16a34a;
    --color-warning:       #d97706;
    --color-error:         #dc2626;

    /* Typografie */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro',
                 Menlo, Consolas, monospace;

    /* Abstände */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Radien, Schatten */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Layout */
    --topbar-height: 48px;
    --sidebar-width: 240px;
    --preview-min-width: 320px;
}

/* ============================================================
   2. Reset & Grundlagen
   ============================================================ */

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

/* Kritisch: hidden-Attribut darf nicht von display:flex überschrieben werden */
[hidden] { display: none !important; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

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

img { max-width: 100%; height: auto; }

pre, code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

/* ============================================================
   3. Login-Seite
   ============================================================ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg-subtle);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-md);
}

.login-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl) var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.login-subtitle {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

.login-form {
    margin-bottom: var(--spacing-lg);
}

.login-footer-text {
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ============================================================
   4. Formulare & Buttons
   ============================================================ */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.form-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s;
}
.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input-sm {
    padding: 0.325rem 0.5rem;
    font-size: 0.8125rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover {
    background: var(--color-bg-subtle);
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.325rem 0.625rem;
    font-size: 0.8125rem;
}

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

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

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

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}
.btn-icon:hover {
    background: var(--color-primary-light);
    color: var(--color-text);
}

/* Alerts */

.alert {
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    margin-bottom: var(--spacing-md);
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--color-error);
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--color-success);
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: var(--color-warning);
}

/* ============================================================
   5. Top Bar
   ============================================================ */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0 var(--spacing-md);
    background: var(--color-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
}

.topbar-brand {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.topbar-brand:hover {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
}

.topbar-project {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.topbar-actions .btn {
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    background: transparent;
}
.topbar-actions .btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.topbar-actions .btn:disabled {
    color: rgba(255, 255, 255, 0.4);
}

.topbar-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 0 var(--spacing-sm);
}

/* ============================================================
   6. App-Layout (Drei-Spalten)
   ============================================================ */

.app-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

/* --- Sidebar (Links) --- */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--color-bg-subtle);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: var(--spacing-md);
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid var(--color-border);
}

.sidebar-heading {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

.sidebar-actions-row {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
}

.sidebar-empty {
    font-size: 0.8125rem;
    padding: var(--spacing-sm) 0;
}

.sidebar-search {
    margin-bottom: var(--spacing-sm);
}

/* Gruppen-Navigation */

.group-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.group-nav-item {
    display: block;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
}
.group-nav-item:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}
.group-nav-item.active {
    background: var(--color-primary);
    color: #fff;
}

/* Asset-Navigation */

.asset-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.asset-nav-item {
    display: block;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    color: var(--color-text);
    border-radius: var(--radius-sm);
}
.asset-nav-item:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}

/* Projektliste */

.project-card {
    display: block;
    padding: var(--spacing-sm) 0.625rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 2px;
}
.project-card:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}

.project-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.project-card-meta {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* --- Editor-Bereich (Mitte) --- */

.editor-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Tabs */

.editor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    overflow-x: auto;
    flex-shrink: 0;
}

.tab {
    padding: 0.625rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
    color: var(--color-text);
    background: var(--color-primary-light);
}
.tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Tab-Panels */

.editor-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.tab-panel {
    padding: var(--spacing-lg);
    height: 100%;
}

.panel-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Compile-Log */

.compile-log {
    border-top: 1px solid var(--color-border);
    background: #1e293b;
    color: #e2e8f0;
    max-height: 200px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.compile-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    border-bottom: 1px solid #334155;
}

.compile-log-header .btn-icon {
    color: #94a3b8;
}
.compile-log-header .btn-icon:hover {
    color: #e2e8f0;
    background: #334155;
}
.compile-log-header .btn-ghost {
    color: #94a3b8;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
}
.compile-log-header .btn-ghost:hover {
    color: #e2e8f0;
    background: #334155;
}

.compile-log-output {
    flex: 1;
    overflow: auto;
    padding: var(--spacing-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --- Preview (Rechts) --- */

/* Resize Handle */

.resize-handle {
    width: 5px;
    cursor: col-resize;
    background: var(--color-border);
    flex-shrink: 0;
    transition: background 0.15s;
    position: relative;
}

.resize-handle:hover,
.resize-handle:active {
    background: var(--color-accent);
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 30px;
    border-left: 1px solid var(--color-text-muted);
    border-right: 1px solid var(--color-text-muted);
    opacity: 0.4;
}

.resize-handle:hover::after {
    opacity: 0.8;
}

.preview-area {
    min-width: 200px;
    width: 40%;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-subtle);
    flex-shrink: 0;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.preview-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.preview-status {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    flex: 1;
}

.preview-frame-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ============================================================
   7. Dialoge
   ============================================================ */

.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.dialog {
    width: 100%;
    max-width: 480px;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.dialog-sm {
    max-width: 380px;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.dialog-title {
    font-size: 1rem;
    font-weight: 700;
}

.dialog-body {
    padding: var(--spacing-lg);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
}

/* ============================================================
   8. Utilities
   ============================================================ */

.text-muted    { color: var(--color-text-muted); }
.text-success  { color: var(--color-success); }
.text-warning  { color: var(--color-warning); }
.text-error    { color: var(--color-error); }
.text-mono     { font-family: var(--font-mono); }
.text-sm       { font-size: 0.8125rem; }
.text-xs       { font-size: 0.75rem; }
.text-center   { text-align: center; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Badge (z. B. "geändert" bei Variablen) */

.badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
}

.badge-modified {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-error {
    background: #fef2f2;
    color: #dc2626;
}

/* ============================================================
   9. Variablen-Editor
   ============================================================ */

.variables-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.variable-list {
    flex: 1;
    overflow-y: auto;
}

.variable-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--color-border);
}
.variable-row:last-child {
    border-bottom: none;
}

.variable-modified {
    background: #eff6ff;
}

.variable-name {
    flex: 0 0 240px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.variable-control {
    flex: 1;
    min-width: 0;
}

.variable-control .form-input-sm {
    max-width: 280px;
}

.variable-type {
    flex: 0 0 auto;
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    font-size: 0.625rem;
    text-transform: uppercase;
}

.variable-actions {
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--color-border);
}

/* Color Input Group */

.color-input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.color-input-group input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
}
.color-input-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
.color-input-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.color-input-group .form-input-sm {
    width: 100px;
    font-family: var(--font-mono);
}

/* Configurator Split (Navbar/Footer) */

.configurator-split {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.configurator-section {
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}
.configurator-section:last-child {
    border-bottom: none;
}

.configurator-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.configurator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-sm) var(--spacing-md);
}

/* Toggle Switch */

.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
    background: var(--color-accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* ============================================================
   10. Code-Editor
   ============================================================ */

.code-editor-layout {
    display: flex;
    height: 100%;
}

.code-file-list {
    width: 200px;
    min-width: 200px;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    background: var(--color-bg-subtle);
    padding: var(--spacing-sm) 0;
}

.code-file-item {
    display: block;
    padding: 0.325rem 0.75rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.code-file-item:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}
.code-file-item.active {
    background: var(--color-primary);
    color: #fff;
}

.code-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.code-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    overflow-x: auto;
    flex-shrink: 0;
}

.code-tab {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.code-tab.active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
    background: var(--color-bg);
}
.code-tab .dirty-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--color-warning);
    border-radius: 50%;
}
.code-tab-close {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.code-tab-close:hover {
    color: var(--color-error);
}

.code-textarea {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    padding: var(--spacing-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    tab-size: 2;
}

.code-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    background: var(--color-bg-subtle);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* ============================================================
   11. Project Card Actions
   ============================================================ */

.project-card {
    position: relative;
}

.project-card-actions {
    display: none;
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    gap: 2px;
}

.project-card:hover .project-card-actions {
    display: flex;
}

/* ============================================================
   12. Notifications
   ============================================================ */

.notification-area {
    position: fixed;
    top: calc(var(--topbar-height) + var(--spacing-sm));
    right: var(--spacing-md);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

.notification-toast {
    pointer-events: auto;
    cursor: pointer;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   13. Sidebar Fill
   ============================================================ */

.sidebar-fill {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-fill .project-list,
.sidebar-fill .group-nav {
    flex: 1;
    overflow-y: auto;
}

/* ============================================================
   14. Topbar Actions Inner
   ============================================================ */

.topbar-actions-inner {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ============================================================
   15. Contrast Checker
   ============================================================ */

.contrast-table {
    width: 100%;
    border-collapse: collapse;
}

.contrast-table th,
.contrast-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--color-border);
}

.contrast-table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--color-bg-subtle);
}

.contrast-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    vertical-align: middle;
    margin-right: 0.375rem;
}

.contrast-ratio {
    font-family: var(--font-mono);
    font-weight: 600;
}

.contrast-level {
    font-weight: 600;
}

/* ============================================================
   16. Styles Scanner
   ============================================================ */

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.color-palette-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: default;
}

.color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--color-border);
}

.color-count {
    color: var(--color-text-muted);
    font-size: 0.625rem;
}

/* ============================================================
   17. Slideshow Preview
   ============================================================ */

.slideshow-images {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.slideshow-thumb {
    position: relative;
    width: 160px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.slideshow-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slideshow-thumb-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.5);
}

.slideshow-thumb-actions .btn-icon {
    color: #fff;
    font-size: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
}

/* ============================================================
   18. Asset Cards
   ============================================================ */

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.asset-card {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg);
}

.asset-card-preview {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-subtle);
    overflow: hidden;
}

.asset-card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.asset-card-icon {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 0.5rem;
}

.asset-card-info {
    padding: 0.5rem 0.625rem;
    border-top: 1px solid var(--color-border);
}

.asset-card-name {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.asset-card-meta {
    display: flex;
    gap: var(--spacing-sm);
    font-size: 0.625rem;
    color: var(--color-text-muted);
}

.asset-card-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: none;
}

.asset-card:hover .asset-card-delete {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   19. Drag & Drop Zone
   ============================================================ */

.drop-zone {
    position: relative;
}

.drop-zone-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(59, 130, 246, 0.08);
    border: 2px dashed var(--color-accent);
    border-radius: var(--radius-md);
    z-index: 10;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-accent);
    pointer-events: none;
}

.drop-zone.dragover .drop-zone-overlay {
    display: flex;
}

/* Import Drop Zone (in dialog) */

.import-drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

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

.import-drop-hint p {
    margin: 0 0 var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.import-drop-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

/* Scrollbar-Styling (Webkit) */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}
