/* ═══════════════════════════════════════════════════════════
   iFive Panel – Professional Design System v2.0
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ────────────────────────────────────── */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #0ea5e9;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --info: #06b6d4;

    --bg-body: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-solid: #1e293b;
    --bg-input: rgba(15, 23, 42, 0.6);
    --bg-sidebar: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --bg-topbar: rgba(15, 23, 42, 0.85);
    --bg-hover: rgba(99, 102, 241, 0.08);
    --bg-table-header: rgba(99, 102, 241, 0.15);
    --bg-table-row-hover: rgba(99, 102, 241, 0.06);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #e2e8f0;

    --border: rgba(148, 163, 184, 0.1);
    --border-focus: rgba(99, 102, 241, 0.5);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Light Theme Override ─────────────────────────────── */
[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-solid: #ffffff;
    --bg-input: rgba(241, 245, 249, 0.9);
    --bg-topbar: rgba(255, 255, 255, 0.9);
    --bg-hover: rgba(99, 102, 241, 0.06);
    --bg-table-header: rgba(99, 102, 241, 0.08);
    --bg-table-row-hover: rgba(99, 102, 241, 0.04);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-heading: #0f172a;

    --border: rgba(148, 163, 184, 0.25);
    --border-focus: rgba(99, 102, 241, 0.5);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(14, 165, 233, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
}

[data-theme="light"] .card-footer {
    background: rgba(241, 245, 249, 0.5);
}

[data-theme="light"] .topbar-brand h1 {
    -webkit-text-fill-color: unset;
    background: none;
    color: var(--primary);
}

[data-theme="light"] .auth-box h2 {
    -webkit-text-fill-color: unset;
    background: none;
    color: var(--primary);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(14, 165, 233, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ─── Topbar ───────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-brand img {
    height: 28px;
    border-radius: 6px;
}

.topbar-brand h1 {
    font-size: 1.05rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-brand .version {
    font-size: 0.6rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* ─── Theme Toggle ─────────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
}

.theme-toggle .toggle-option {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-toggle .toggle-option.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

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

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    text-transform: uppercase;
}

.topbar-user .user-info {
    text-align: right;
}

.topbar-user .user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.topbar-user .user-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ─── Page Layout ──────────────────────────────────────── */
.page-wrapper {
    padding-top: 52px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px;
}

/* ─── Cards ────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-table-header);
    color: var(--text-heading);
}

.card-header .card-icon {
    font-size: 1.2rem;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.3);
}

/* ─── Dashboard Cards ──────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.dash-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.dash-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.dash-card:hover::before {
    opacity: 1;
}

.dash-card .card-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.dash-card .card-icon-wrap.blue {
    background: rgba(14, 165, 233, 0.15);
}

.dash-card .card-icon-wrap.indigo {
    background: rgba(99, 102, 241, 0.15);
}

.dash-card .card-icon-wrap.green {
    background: rgba(16, 185, 129, 0.15);
}

.dash-card .card-icon-wrap.orange {
    background: rgba(245, 158, 11, 0.15);
}

.dash-card .card-icon-wrap.red {
    background: rgba(239, 68, 68, 0.15);
}

.dash-card .card-icon-wrap.cyan {
    background: rgba(6, 182, 212, 0.15);
}

.dash-card .card-icon-wrap.purple {
    background: rgba(147, 51, 234, 0.15);
}

.dash-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.dash-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.4;
}

/* ─── Storage Panel ────────────────────────────────────── */
.storage-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.storage-panel .storage-info {
    flex: 1;
    min-width: 200px;
}

.storage-panel .storage-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.storage-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

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

.storage-bar .storage-fill.safe {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.storage-bar .storage-fill.warn {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.storage-bar .storage-fill.danger {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.storage-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.storage-stat {
    text-align: center;
    min-width: 80px;
}

.storage-stat .val {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-heading);
}

.storage-stat .lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    color: #ffffff !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-hover));
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    color: #ffffff !important;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-hover));
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    color: #ffffff !important;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    color: #ffffff !important;
}

.btn-info {
    background: linear-gradient(135deg, var(--info), #0891b2);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
    color: #ffffff !important;
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.25);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 0.74rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ─── Forms ────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 36px;
}

/* ─── Tables ───────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

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

.data-table thead th {
    padding: 14px 16px;
    background: var(--bg-table-header);
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
    cursor: pointer;
    user-select: none;
}

.data-table thead th:hover {
    background: rgba(99, 102, 241, 0.2);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

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

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

.data-table td {
    padding: 12px 16px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table td a {
    color: var(--primary);
    font-weight: 500;
}

.data-table td a:hover {
    color: var(--secondary);
}

/* ─── Badges ───────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(14, 165, 233, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ─── Alerts ───────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
    border-color: rgba(6, 182, 212, 0.3);
}

/* ─── Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.breadcrumb li::after {
    content: '›';
    color: var(--text-muted);
    font-size: 1.1rem;
}

.breadcrumb li:last-child::after {
    display: none;
}

.breadcrumb li a {
    color: var(--text-secondary);
    font-weight: 500;
}

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

.breadcrumb li:last-child a {
    color: var(--primary);
    font-weight: 600;
}

/* ─── Login / Auth Pages ───────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

.auth-box .auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.auth-box h2 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.auth-box .auth-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.auth-box .form-group {
    text-align: left;
}

.auth-box .form-control {
    padding: 12px 16px;
    font-size: 0.92rem;
}

.auth-box .btn {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    margin-top: 8px;
}

/* ─── Page Title ───────────────────────────────────────── */
.page-title {
    margin-bottom: 20px;
}

.page-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

/* ─── Row / Grid Helpers ───────────────────────────────── */
.row {
    display: grid;
    gap: 20px;
}

.row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.row-auto {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ─── Toolbar ──────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input {
    min-width: 280px;
    padding: 8px 14px 8px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ─── Checkbox Custom ──────────────────────────────────── */
input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: 700;
}

/* ─── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* ─── Footer ───────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ─── Animations ───────────────────────────────────────── */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-in {
    animation: slideUp 0.4s ease-out both;
}

.animate-in:nth-child(1) {
    animation-delay: 0.05s;
}

.animate-in:nth-child(2) {
    animation-delay: 0.1s;
}

.animate-in:nth-child(3) {
    animation-delay: 0.15s;
}

.animate-in:nth-child(4) {
    animation-delay: 0.2s;
}

.animate-in:nth-child(5) {
    animation-delay: 0.25s;
}

.animate-in:nth-child(6) {
    animation-delay: 0.3s;
}

/* ─── Server List ──────────────────────────────────────── */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.server-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.server-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
}

.server-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Editor Page ──────────────────────────────────────── */
.editor-topbar {
    height: 50px;
    background: var(--bg-card-solid);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.editor-topbar .file-path {
    flex: 1;
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    max-width: 700px;
}

.editor-topbar .editor-actions {
    display: flex;
    gap: 8px;
}

/* ─── Settings Grid ────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ─── File Upload ──────────────────────────────────────── */
input[type="file"] {
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
}

input[type="file"]::file-selector-button {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* ─── Stat Cards ───────────────────────────────────────── */
.stat-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-align: center;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ─── Two-Column Layout ────────────────────────────────── */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    align-items: start;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
    .split-layout {
        grid-template-columns: 1fr;
    }

    .row-2,
    .row-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-user .user-info {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .auth-box {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .topbar-brand h1 {
        font-size: 1rem;
    }

    .page-title h2 {
        font-size: 1.3rem;
    }
}