/* ==========================================================================
   NasSync Cloud - Dashboard Modern Styling System (CSS)
   ========================================================================== */

:root {
    /* Theme Color System - HSL Tailored Dark Theme */
    --bg-base: hsl(222, 25%, 8%);
    --bg-surface: hsl(222, 22%, 12%);
    --bg-surface-elevated: hsl(222, 20%, 16%);
    --bg-hover: hsl(222, 20%, 20%);
    
    --primary: hsl(212, 100%, 60%);
    --primary-hover: hsl(212, 100%, 68%);
    --primary-glow: hsla(212, 100%, 60%, 0.25);
    
    --accent-green: hsl(150, 75%, 48%);
    --accent-blue: hsl(195, 85%, 55%);
    --accent-orange: hsl(35, 95%, 55%);
    --accent-red: hsl(350, 85%, 60%);

    --text-main: hsl(210, 30%, 96%);
    --text-muted: hsl(215, 18%, 68%);
    --text-subtle: hsl(215, 14%, 48%);

    --border-color: hsla(215, 20%, 30%, 0.4);
    --border-highlight: hsla(212, 100%, 60%, 0.4);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Login Security Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 11, 17, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.brand-icon.lg {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
    font-size: 1.8rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px var(--primary-glow);
}

.login-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.error-msg {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-bottom: 16px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-outline-danger {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

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

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

/* Layout Setup */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 270px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 12px 28px 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), hsl(230, 90%, 65%));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.brand-text .version {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 2px 8px;
    border-radius: 20px;
}

/* Sidebar Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

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

.nav-item.active {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.badge {
    margin-left: auto;
    background-color: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.nav-item.active .badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

.server-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-subtle);
}

.status-indicator.online {
    background-color: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.status-info {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.status-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-green);
}

/* Main Content Area */
.main-content {
    margin-left: 270px;
    flex: 1;
    padding: 32px 40px;
}

/* Topbar Header */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.topbar-title h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar-title .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-clock {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

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

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-icon.danger:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

/* Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-fast);
}

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

.metric-card.primary {
    background: linear-gradient(135deg, var(--bg-surface) 0%, hsl(222, 24%, 15%) 100%);
    border-color: var(--border-highlight);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.metric-icon.accent-blue {
    background-color: hsla(195, 85%, 55%, 0.15);
    color: var(--accent-blue);
}

.metric-icon.accent-green {
    background-color: hsla(150, 75%, 48%, 0.15);
    color: var(--accent-green);
}

.metric-icon.accent-orange {
    background-color: hsla(30, 95%, 55%, 0.15);
    color: hsl(30, 95%, 60%);
}

.metric-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-value-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
}

.metric-value-group h3 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.metric-sub {
    font-size: 0.85rem;
    color: var(--text-subtle);
}

.metric-card h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 4px;
}

.metric-desc {
    font-size: 0.82rem;
    color: var(--text-subtle);
    margin-top: 4px;
}

.progress-bar-container {
    height: 8px;
    background-color: var(--bg-base);
    border-radius: 4px;
    margin: 14px 0 8px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-blue));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Active Synchronizations Panel Styling */
.active-sync-card {
    border-color: var(--border-highlight);
    background: linear-gradient(135deg, var(--bg-surface) 0%, hsl(222, 22%, 14%) 100%);
}

.no-active-sync {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-base);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.no-active-sync i {
    font-size: 1.2rem;
    color: var(--accent-green);
}

.live-sync-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.live-sync-item:last-child {
    margin-bottom: 0;
}

.live-sync-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-sync-device {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-sync-filename {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dashboard Content Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

.card-body.p-0 {
    padding: 0;
}

/* Storage Distribution Bar List */
.storage-item {
    margin-bottom: 16px;
}

.storage-item:last-child {
    margin-bottom: 0;
}

.storage-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.storage-item-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.mini-progress-container {
    height: 6px;
    background-color: var(--bg-base);
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background-color: var(--bg-base);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-filename {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.76rem;
    color: var(--text-subtle);
    display: flex;
    gap: 12px;
}

/* Devices Section */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.device-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-fast);
}

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

.device-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.device-avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, hsl(212, 100%, 60%), hsl(195, 85%, 55%));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.device-title h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.device-status {
    font-size: 0.76rem;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.device-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-green);
}

.device-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-base);
    border-radius: var(--radius-sm);
}

.device-stat {
    display: flex;
    flex-direction: column;
}

.device-stat-label {
    font-size: 0.72rem;
    color: var(--text-subtle);
}

.device-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

/* File Explorer Toolbar */
.explorer-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-group select {
    padding: 12px 16px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
}

/* Data Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-weight: 600;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

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

.data-table .text-right {
    text-align: right;
}

.data-table .text-center {
    text-align: center;
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.file-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.category-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--bg-surface-elevated);
    color: var(--text-muted);
}

/* Tab Content Logic */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-spinner {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Breadcrumbs Bar */
.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.88rem;
    font-weight: 600;
}

.breadcrumb-item {
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

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

.breadcrumb-item.active {
    color: var(--text-main);
    cursor: default;
}

.breadcrumb-separator {
    color: var(--text-subtle);
    font-size: 0.8rem;
}

.folder-row {
    cursor: pointer;
    transition: var(--transition-fast);
}

.folder-row:hover {
    background-color: var(--bg-hover) !important;
}

.folder-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: hsla(35, 95%, 55%, 0.15);
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 16px 8px;
    }
    .brand-text, .nav-item span, .sidebar-footer {
        display: none;
    }
    .main-content {
        margin-left: 70px;
        padding: 20px;
    }
}

/* Devices Section Header with action button */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.section-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Add Device Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 20, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ── Preview Modal (full-screen) ─────────────────────────────────────────── */
.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 15, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    z-index: 950;
    animation: fadeIn 0.2s ease;
}

.preview-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.preview-filename {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.preview-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.preview-text {
    width: 100%;
    height: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.83rem;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-all;
    overflow: auto;
    line-height: 1.6;
}

/* ── Button small variant ───────────────────────────────────────────────── */
.btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
}

/* ── File drop zone (upload modal) ──────────────────────────────────────── */
.file-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.file-drop-zone:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
}

.file-drop-zone i {
    font-size: 1.6rem;
}

/* ── Select styling for modals ───────────────────────────────────────────── */
.modal-card select {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.modal-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-card select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

