﻿/* ============================
   Vitazny Panel — Premium Dark UI
   ============================ */

/* === Stitch Design System: Cyber-Refined VPS Control === */
:root {
    --bg-base:      #0b0c10;
    --bg-card:      rgba(18, 20, 29, 0.75);
    --bg-card-solid:#131520;
    --bg-hover:     rgba(28, 32, 48, 0.85);
    --bg-input:     rgba(15, 17, 26, 0.9);
    --border:       rgba(0, 242, 255, 0.12);
    --border-hover: rgba(0, 242, 255, 0.4);
    --border-glow:  rgba(99, 102, 241, 0.3);

    --text:         #f1f5f9;
    --text-muted:   #94a3b8;
    --text-dim:     #475569;

    --accent:       #00f2ff;
    --accent-2:     #6366f1;
    --accent-light: #74f5ff;
    --success:      #10b981;
    --warning:      #f59e0b;
    --danger:       #ef4444;
    --info:         #00dbe7;

    --sidebar-w:    250px;
    --topbar-h:     64px;
    --radius:       0.75rem;
    --radius-sm:    0.5rem;
    --shadow:       0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow:  0 0 20px rgba(0, 242, 255, 0.15);

    --font:         'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

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

button { font-family: var(--font); cursor: pointer; }

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

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.25s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon { font-size: 1.5rem; }

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #00f2ff, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.15), rgba(99, 102, 241, 0.15));
    color: var(--accent-light);
    border: 1px solid rgba(0, 242, 255, 0.35);
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.12);
}

.nav-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }

.nav-logout { color: var(--danger); opacity: 0.8; }
.nav-logout:hover { background: rgba(239,68,68,0.1); color: var(--danger); opacity: 1; }

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

.lang-switch {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

.lang-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 0.4rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.lang-btn.lang-active { background: rgba(124,58,237,0.2); border-color: var(--accent); color: var(--accent-light); }

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    margin-top: 0.5rem;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

/* === Main Area === */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Topbar === */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 0.25rem;
}

.page-title {
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === Page Content === */
.page-content {
    flex: 1;
    padding: 1.75rem;
    max-width: 1200px;
    width: 100%;
}

/* === Alerts / Flash === */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    margin: 1rem 1.75rem 0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    animation: slideDown 0.2s ease;
}

.alert button {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    font-size: 0.9rem;
}
.alert button:hover { opacity: 1; }

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

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

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* === Card === */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

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

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.card-body { padding: 1.25rem; }

/* === Dashboard === */
.dashboard-grid { display: flex; flex-direction: column; gap: 1.5rem; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stat-icon { font-size: 1.1rem; }
.stat-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.stat-value {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff, var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.uptime-val {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #ffffff, #34d399) !important;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.cpu-fill  { background: linear-gradient(90deg, #00f2ff, #74f5ff); box-shadow: 0 0 10px rgba(0, 242, 255, 0.5); }
.ram-fill  { background: linear-gradient(90deg, #6366f1, #818cf8); box-shadow: 0 0 10px rgba(99, 102, 241, 0.5); }
.disk-fill { background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }

.stat-sub { font-size: 0.78rem; color: var(--text-muted); }

/* Quick stats */
.quick-stats { display: flex; gap: 1rem; }

.quick-stat-card {
    flex: 1;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text);
}
.quick-stat-card:hover {
    border-color: var(--accent);
    background: rgba(0, 242, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.qs-num { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.qs-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.qs-icon { font-size: 2.5rem; opacity: 0.4; }

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.service-item {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
}

.service-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.service-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-green { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot-red   { background: var(--danger); }
.dot-gray  { background: var(--text-dim); }

.service-name { font-size: 0.85rem; font-weight: 600; }
.service-status { font-size: 0.75rem; color: var(--text-muted); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #00f2ff, #6366f1);
    color: #050505;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(0, 242, 255, 0.45);
    color: #000000;
}

.btn-ghost {
    background: var(--bg-hover);
    color: var(--text-muted);
    border-color: var(--border);
    backdrop-filter: blur(8px);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hover); box-shadow: var(--shadow-glow); }

.btn-danger {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); border-color: var(--danger); box-shadow: 0 0 15px rgba(239,68,68,0.3); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; width: 100%; justify-content: center; }
.btn-loading { opacity: 0.7; cursor: wait; }

/* === Forms === */
.form-group { margin-bottom: 1.1rem; }
.form-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.form-input,
.form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.2), 0 0 15px rgba(0, 242, 255, 0.15);
}

.form-input::placeholder { color: var(--text-dim); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}
.input-with-btn .form-input { flex: 1; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* === Tables === */
.table-wrap { overflow-x: auto; }

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

.table thead th {
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-hover); }

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green  { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-blue   { background: rgba(37,99,235,0.15); color: #60a5fa; border: 1px solid rgba(37,99,235,0.3); }
.badge-gray   { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }
.badge-yellow { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-orange { background: rgba(234,88,12,0.15); color: #fb923c; border: 1px solid rgba(234,88,12,0.3); }

/* === Page Header === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.back-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

/* === Empty State === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

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

.empty-state-sm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* === Site Domain Cell === */
.site-domain {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.domain-icon { font-size: 1.2rem; }
.domain-name { font-weight: 600; font-size: 0.9rem; }
.domain-path { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

.db-name { display: flex; align-items: center; gap: 0.5rem; }

.action-btns { display: flex; gap: 0.5rem; }

/* === Detail Grid === */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* === Info List === */
.info-list { padding: 0.5rem 0; }
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-key { font-size: 0.83rem; color: var(--text-muted); font-weight: 500; }
.info-val { font-size: 0.875rem; text-align: right; }

.code { font-family: var(--font-mono); font-size: 0.82rem; }
.code-inline {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: var(--bg-hover);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    margin: 0.5rem 0;
}

/* === Code Block === */
.code-block {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-base);
    padding: 1.25rem;
    overflow-x: auto;
    white-space: pre;
    color: #a5f3fc;
    line-height: 1.6;
}

.code-box {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: var(--accent-light);
    word-break: break-all;
}

/* === PHP Page === */
.php-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.php-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.15s;
}
.php-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.php-card.php-installed { border-color: rgba(16,185,129,0.4); }

.php-card-header { margin-bottom: 0.75rem; }
.php-icon { font-size: 2rem; margin-bottom: 0.25rem; }
.php-version { font-size: 1.1rem; font-weight: 700; }

.php-status { margin-bottom: 1rem; }

.php-packages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}
.pkg-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background: var(--bg-hover);
    border-radius: 3px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.php-install-btn { width: 100%; justify-content: center; }

.info-box {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* === WordPress Page === */
.wp-layout { display: flex; flex-direction: column; gap: 1.5rem; }

.wp-checklist {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}
.wp-checklist h4 { font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--text-muted); }
.check-item { font-size: 0.85rem; padding: 0.25rem 0; }

.install-progress { margin-bottom: 1rem; }

.progress-bar-wrap {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 60px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-60px); } to { transform: translateX(60px); } }

.log-box {
    max-height: 350px;
    overflow-y: auto;
    font-size: 0.78rem;
}

.success-card { border-color: rgba(16,185,129,0.4) !important; }

.info-table { text-align: left; }
.info-table .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.info-table .info-row span { color: var(--text-muted); }
.info-table code {
    font-family: var(--font-mono);
    background: var(--bg-hover);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.82rem;
    color: var(--accent-light);
}

.alert-warning {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.85rem;
    color: #fbbf24;
}

.wp-installed { text-align: center; padding: 1.5rem; }
.wp-status-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.wp-links { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1rem; }

/* === Settings Page === */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.lang-options { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.25rem; }
.lang-option-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    width: 100%;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.lang-option-btn:hover { border-color: var(--accent); }
.lang-option-btn.active { border-color: var(--accent); background: rgba(124,58,237,0.1); }
.lang-flag { font-size: 1.4rem; }
.check { margin-left: auto; color: var(--success); }

/* === Modal === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    margin: 1.5rem;
    animation: slideUp 0.2s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.1s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

.modal-body { padding: 1.25rem; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* === Sidebar Overlay (mobile) === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text);
    z-index: 300;
    box-shadow: var(--shadow);
    animation: toastIn 0.25s ease;
    max-width: 320px;
}

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

/* === Text Utilities === */
.text-sm { font-size: 0.83rem; }
.text-muted { color: var(--text-muted); }
.link { color: var(--accent-light); }
.link:hover { text-decoration: underline; }

/* === Responsive === */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .sidebar-close { display: block; }
    .sidebar-overlay.open { display: block; }
    .main-area { margin-left: 0; }
    .menu-btn { display: block; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 1rem; }
    .topbar { padding: 0 1rem; }
    .alert { margin: 0.75rem 1rem 0; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .quick-stats { flex-direction: column; }
    .table { font-size: 0.8rem; }
}
