:root {
    /* High-Density Professional Palette */
    --bg-main: #f1f5f9;
    --bg-panel: #ffffff;
    --border-main: #e2e8f0;
    
    --text-main: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* NCLP Section Colors */
    --color-anotace: #3b82f6;
    --color-semantika: #8b5cf6;
    --color-editorial: #10b981;
    --color-data: #f59e0b;
    
    --accent-primary: #4f46e5;
    --row-hover: #f1f5f9;
    --row-selected: #e0f2fe;
    --row-selected-border: #3b82f6;
    
    /* Boxy Expert Metrics - Now with Rounded Corners */
    --spacer: 4px;
    --font-size-ui: 10px;
    --font-size-data: 13px;
    --row-padding: 1px 8px;
    --radius: 6px;
    
    /* Sidebar Theme */
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-hover: rgba(255,255,255,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    font-size: var(--font-size-data);
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: content-box; }

.sidebar ::-webkit-scrollbar-thumb { background: #475569; }
.sidebar ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Sidebar - Unified & High Contrast */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

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

.sidebar-header h1 {
    font-size: 0.9rem;
    font-weight: 800;
    color: #38bdf8;
    text-transform: uppercase;
}
.sidebar-home-link {
    color: inherit;
    text-decoration: none;
    text-transform: none;
}
.sidebar-home-link:hover {
    text-decoration: underline;
}

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

.nav-item, .nav-sub-item {
    padding: 6px 12px;
    margin: 2px 6px;
    cursor: default;
    font-size: 15px;
    color: var(--sidebar-text);
    transition: all 0.1s;
    border-radius: var(--radius);
}

.nav-item:hover, .nav-sub-item:hover {
    color: white;
    background: var(--sidebar-hover);
}

.nav-item.active, .nav-sub-item.active {
    background: #0ea5e9;
    color: white;
}

/* Category Groups */
.nav-category-group {
    list-style: none;
}

.nav-category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 4px 12px;
    font-size: 11px;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.nav-category:hover {
    color: white;
}

.chevron {
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg); /* Expanded state */
    transition: transform 0.2s;
    margin-bottom: 2px;
}

.collapsed .chevron {
    transform: rotate(-45deg); /* Collapsed state (pointing right) */
}

.nav-category-items {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 2000px; /* Large enough to fit any list */
    transition: max-height 0.3s ease-out;
}

.collapsed .nav-category-items {
    max-height: 0;
}


/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacer);
    gap: var(--spacer);
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    padding: 4px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border-main);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-group {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 600px;
}

.search-group input {
    width: 100%;
    height: 32px;
    padding: 0 15px;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: var(--font-size-data);
    background: #f8fafc;
    transition: all 0.2s;
}

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

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-group label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.control-group select {
    height: 24px;
    padding: 0 4px;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    font-size: 12px;
    background: #f8fafc;
}

.view-toggle-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 1px 8px;
    border-radius: 10px;
    cursor: default;
}

.view-toggle-group label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Split Containers & Splitter */
.split-container {
    flex: 1;
    display: flex;
    gap: 0;
    overflow: hidden;
}

.list-pane, .detail-pane {
    background: white;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-pane { flex: 1; padding: 16px; overflow-y: auto; background: #f8fafc; }

.splitter {
    width: var(--spacer);
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    z-index: 10;
}

.splitter:hover, .splitter.active {
    background: var(--accent-primary);
    opacity: 0.2;
}

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

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

thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-main);
    text-align: left;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
}

tbody tr { cursor: default; }
tbody tr:hover { background: var(--row-hover); }
tbody tr.selected { 
    background: var(--row-selected); 
    box-shadow: inset 3px 0 0 0 var(--row-selected-border);
    transition: background 0.1s ease;
}

tbody td {
    padding: 2px 10px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--font-size-data);
}

.detail-table td.wrap-cell {
    white-space: normal;
    height: auto;
    padding: 6px 10px;
    line-height: 1.4;
}

/* Detail View - Specified Metrics */
.detail-header {
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-main);
}

.detail-header h2 {
    font-size: 1.25rem; /* Reasonably sized heading */
    font-weight: 700;
    line-height: 1.2;
}

.col-klic {
    font-family: 'JetBrains Mono', monospace !important;
    font-weight: 600;
    font-size: inherit;
    color: var(--text-muted);
}

/* Group Cards */
.detail-group-container {
    margin-bottom: 16px;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden; /* Ensures title bar respects corners */
}

.detail-group-title {
    padding: 2px 10px;
    font-size: 10px; /* Micro categories */
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.annotationCategory-table .detail-group-title { background: var(--color-anotace) !important; }
.semanticContentCategory-table .detail-group-title { background: var(--color-semantika) !important; }
.editorialCategory-table .detail-group-title { background: var(--color-editorial) !important; }
.dataFieldCategory-table .detail-group-title { background: var(--color-data) !important; }

.detail-table td {
    padding: 6px 12px;
    height: auto;
}

.field-label {
    width: 220px;
    font-size: inherit;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    background: #f8fafc;
    border-right: 1px solid var(--border-main);
}

/* Inputs & Buttons - Specified Metrics */
input[type="text"], input[type="date"], select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 0 !important;
    font-family: inherit;
    font-size: var(--font-size-data);
}

.hero-btn, .primary-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    font-size: 12px;
}

.secondary-btn {
    background: #e2e8f0;
    color: #1e293b;
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 12px;
}

.secondary-btn:hover { background: #cbd5e1; }

.error-message {
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle {
    padding: 2px 10px;
    border-radius: 2px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    font-size: 11px;
}

.view-toggle.active {
    background: #475569;
    color: white;
}

.tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Semantic Navigation Links */
.semantic-link {
    color: var(--color-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    padding: 0 2px;
    margin: 0 -2px;
    border-radius: 0 !important;
}

.semantic-link:hover {
    text-decoration: underline;
    background-color: rgba(37, 99, 235, 0.08);
}

/* FHIR Explorer Styles */
.fhir-explorer {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

.fhir-section {
    background: #f8fafc;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    padding: 16px;
}

.fhir-section h3 {
    font-size: 14px;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.fhir-interactive {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.fhir-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fhir-input-row label {
    width: 120px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.fhir-input-row select, .fhir-input-row input {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border-main);
    border-radius: 4px;
    padding: 0 10px;
}

.fhir-result-container {
    margin-top: 16px;
}

.fhir-url-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: #1e293b;
    color: #38bdf8;
    padding: 8px 12px;
    border-radius: 4px 4px 0 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.fhir-json-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 0 0 4px 4px;
    overflow-x: auto;
    max-height: 400px;
    white-space: pre-wrap;
}

.fhir-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}


/* Tab Navigation System */
.tab-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tab-bar {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-main);
    padding: 0 10px;
    background: #f8fafc;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 16px;
}

.tab-item {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    user-select: none;
}

.tab-item:hover {
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.05);
}

.tab-item.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

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

.not-implemented {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    border: 2px dashed var(--border-main);
    border-radius: var(--radius);
    background: white;
}

/* Tiptap Editor Styles */
.editor-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    background: white;
    height: 100%;
    overflow: hidden;
}

.tiptap-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-main);
}

.tiptap-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
}

.tiptap-toolbar button:hover {
    background: #e2e8f0;
    color: var(--accent-primary);
}

.tiptap-toolbar button.active {
    background: #4f46e5;
    color: white;
}

.tiptap-toolbar .separator {
    width: 1px;
    height: 16px;
    background: var(--border-main);
    margin: 4px 4px;
}

.tiptap-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    outline: none;
}

.tiptap-content .ProseMirror {
    min-height: 200px;
}

.tiptap-content .ProseMirror:focus {
    outline: none;
}

/* Tiptap Content Typography */
.ProseMirror p { margin-bottom: 1em; line-height: 1.6; }
.ProseMirror h1, .ProseMirror h2, .ProseMirror h3 { margin: 1.5em 0 0.5em; color: var(--text-main); }
.ProseMirror ul, .ProseMirror ol { padding-left: 1.5em; margin-bottom: 1em; }
.ProseMirror blockquote { border-left: 3px solid var(--accent-primary); padding-left: 15px; color: var(--text-muted); font-style: italic; }
.ProseMirror table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
.ProseMirror table td, .ProseMirror table th { border: 1px solid var(--border-main); padding: 8px; }
.ProseMirror table th { background: #f8fafc; font-weight: 700; }
.ProseMirror img { max-width: 100%; height: auto; border-radius: var(--radius); }

.osn-marker { display: none; }

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

.modal-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.modal-overlay.popover {
    background: transparent;
    backdrop-filter: none;
}

.modal-overlay.popover .modal-container {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-main);
    min-width: 450px;
    width: auto;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 600;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 24px;
}

/* Inline Detail Styles */
.inline-detail-container {
    position: relative;
    padding: 0;
    border: 1px solid var(--border-main);
    border-radius: 0 !important;
    margin: 0;
    background: white;
    box-shadow: none;
    overflow: hidden;
}

.inline-detail-container .detail-table td {
    padding: 0;
    height: 24px;
}

.inline-header {
    display: flex;
    justify-content: flex-end;
    padding: 2px 8px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-main);
}

.close-inline {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.2s;
}

/* Force zero padding and no radius inside inline detail */
.inline-detail-container .detail-group-container {
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none;
    border-right: none;
    border-top: none;
}

.inline-detail-container .detail-group-container:last-child {
    border-bottom: none;
}

.inline-detail-container .detail-group-title {
    border-radius: 0 !important;
}

/* Remove padding from the parent table cell when it contains an inline detail */
.detail-table td:has(.inline-detail-container) {
    padding: 0 !important;
}

.close-inline:hover {
    background: #f1f5f9;
    color: #ef4444;
}

/* Administrace & Ke Stažení Page Layouts */
.admin-container {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.admin-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.admin-subheader {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.admin-card {
    background: white;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-card.full-width {
    width: 100%;
}

.admin-card-header {
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-card-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.step-badge {
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-desc {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 13px;
}

.warning-alert {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 10px 12px;
    color: #b45309;
    font-size: 12px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.info-alert {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 10px 12px;
    color: #1d4ed8;
    font-size: 12px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.file-upload-zone {
    border: 2px dashed var(--border-main);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.file-upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.02);
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.file-upload-label input[type="file"] {
    display: none;
}

.upload-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%234f46e5" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z" /></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.upload-text {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 13px;
}

.file-name-display {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.action-row {
    display: flex;
    justify-content: flex-start;
}

.hero-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.hero-btn:hover:not(.disabled) {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

.hero-btn.disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.console-wrapper {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-main);
}

.console-header {
    background: #f1f5f9;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-main);
}

.admin-log-console {
    background: #0f172a;
    color: #38bdf8;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    height: 150px;
    overflow-y: auto;
    margin: 0;
    white-space: pre-wrap;
}

/* ── Account Menu ───────────────────────────────────────────────────────── */
.account-menu {
    position: relative;
    flex-shrink: 0;
    margin-left: 8px;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-main);
    background: #f8fafc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
    white-space: nowrap;
}

.account-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-main);
}

.account-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.account-chevron {
    font-size: 9px;
    color: var(--text-muted);
    margin-left: 2px;
}

.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: white;
    border: 1px solid var(--border-main);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
    animation: dropdown-in 0.1s ease;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.account-dropdown-header {
    padding: 10px 14px 9px;
    border-bottom: 1px solid var(--border-main);
    background: #f8fafc;
}

.account-dropdown-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.account-dropdown-username {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

.account-dropdown-item {
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.account-dropdown-item.danger {
    color: #dc2626;
    border-top: 1px solid var(--border-main);
}

.account-dropdown-item.danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* ── Login Card ─────────────────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.05);
    width: 340px;
    overflow: hidden;
    border: 1px solid var(--border-main);
}

.login-card-header {
    background: white;
    padding: 32px 32px 8px;
    text-align: center;
    border-bottom: none;
}

.login-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-subtitle {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-card-body {
    padding: 20px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-field input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius) !important;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-main);
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.login-field input:focus {
    outline: none;
    border-color: #a5b4fc;
    background: white;
    box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.25);
}

.login-btn {
    width: 100%;
    height: 38px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: background 0.15s, box-shadow 0.15s;
    margin-top: 4px;
}

.login-btn:hover {
    background: #4f46e5;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.login-btn:active {
    background: #4338ca;
    box-shadow: none;
}

.login-error {
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    display: none;
}

/* Downloads Table Custom Styles */
.downloads-table {
    width: 100%;
    border-collapse: collapse;
}

.downloads-table th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-main);
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
}

.downloads-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: var(--text-main);
}

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

.file-name-cell {
    font-weight: 600;
    color: var(--text-main);
}

.download-link-btn {
    text-decoration: none;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
}

