/* Simple IPAM - Liquid Glass iOS Design System v3.0 */
/* Inspired by iOS 26 Liquid Glass / visionOS */

/* ============ CSS VARIABLES ============ */
:root {
    /* Liquid Glass Light Mode */
    --bg-primary: #f0f1f6;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e9ef;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: rgba(0,0,0,0.03);

    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #6b6b80;
    --text-tertiary: #a0a0b2;

    /* Accent Colors - iOS Blue */
    --primary: #007aff;
    --secondary: #5856d6;
    --accent: #007aff;
    --accent-light: rgba(0,122,255,0.10);
    --accent-glow: rgba(0,122,255,0.25);

    /* Status */
    --success: #30d158;
    --success-light: rgba(48,209,88,0.12);
    --danger: #ff453a;
    --danger-light: rgba(255,69,58,0.12);
    --warning: #ff9f0a;
    --warning-light: rgba(255,159,10,0.12);
    --info: #64d2ff;
    --info-light: rgba(100,210,255,0.12);

    /* Liquid Glass */
    --glass-bg: rgba(255,255,255,0.65);
    --glass-bg-strong: rgba(255,255,255,0.82);
    --glass-border: rgba(255,255,255,0.45);
    --glass-blur: 24px;
    --glass-saturate: 180%;

    /* Borders & Shadows */
    --border: rgba(0,0,0,0.06);
    --border-color: rgba(0,0,0,0.06);
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 12px 40px rgba(0,0,0,0.10);
    --shadow-glass: 0 2px 16px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.5);

    /* Radii */
    --radius: 16px;
    --radius-lg: 22px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    /* Transitions */
    --transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============ DARK MODE ============ */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-card: #1c1c1e;
    --bg-input: #2c2c2e;
    --bg-hover: rgba(255,255,255,0.06);

    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --text-tertiary: #636366;

    --accent: #0a84ff;
    --accent-light: rgba(10,132,255,0.15);
    --accent-glow: rgba(10,132,255,0.30);
    --success: #30d158;
    --success-light: rgba(48,209,88,0.15);
    --danger: #ff453a;
    --danger-light: rgba(255,69,58,0.15);
    --warning: #ff9f0a;
    --warning-light: rgba(255,159,10,0.15);
    --info-light: rgba(100,210,255,0.15);

    --glass-bg: rgba(30,30,32,0.72);
    --glass-bg-strong: rgba(44,44,46,0.85);
    --glass-border: rgba(255,255,255,0.08);

    --border: rgba(255,255,255,0.08);
    --border-color: rgba(255,255,255,0.08);
    --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.3), 0 12px 40px rgba(0,0,0,0.4);
    --shadow-glass: 0 2px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    overflow-x: hidden;
}

/* ============ NAVBAR - Liquid Glass ============ */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: saturate(var(--glass-saturate)) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(var(--glass-saturate)) blur(var(--glass-blur));
    border-bottom: 0.5px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 12px rgba(0,0,0,0.04);
}

[data-theme="dark"] .navbar {
    background: rgba(20,20,22,0.78);
    box-shadow: 0 1px 12px rgba(0,0,0,0.2);
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.navbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    text-decoration: none;
}

a.navbar-title {
    text-decoration: none;
    color: var(--accent);
}

.navbar-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.navbar-link:hover {
    background: var(--accent-light);
}

/* ============ STATS GRID ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.stat-card {
    background: var(--glass-bg-strong);
    backdrop-filter: saturate(var(--glass-saturate)) blur(16px);
    -webkit-backdrop-filter: saturate(var(--glass-saturate)) blur(16px);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}

[data-theme="dark"] .stat-card::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.stat-card.clickable:active {
    transform: scale(0.97);
    transition: transform 0.1s;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -1px;
    line-height: 1.1;
}

.stat-value.online { color: var(--success); }
.stat-value.offline { color: var(--danger); }

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============ SEARCH INPUT ============ */
.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}

.btn-primary:hover {
    background: #0066d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,122,255,0.35);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(255,69,58,0.3);
}

.btn-danger:hover {
    background: #e63e33;
    box-shadow: 0 4px 14px rgba(255,69,58,0.35);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

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

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* ============ CARDS - Liquid Glass ============ */
.card {
    background: var(--glass-bg-strong);
    backdrop-filter: saturate(var(--glass-saturate)) blur(16px);
    -webkit-backdrop-filter: saturate(var(--glass-saturate)) blur(16px);
    border-radius: var(--radius);
    margin-bottom: 12px;
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.network-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background var(--transition);
}

.network-card .card-header:hover {
    background: var(--bg-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--border);
    font-weight: 600;
}

.card-body {
    padding: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-badge {
    background: var(--accent-light);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.chevron {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: var(--text-tertiary);
}

/* ============ EXPAND CONTENT ============ */
.expand-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.expand-content.expanded {
    max-height: 5000px;
}

/* ============ ALLOCATION ITEMS ============ */
.allocation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-top: 0.5px solid var(--border);
    transition: background var(--transition);
}

.allocation-item:hover {
    background: var(--bg-hover);
}

.allocation-item .alloc-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
    border-radius: 6px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* ============ STATUS DOT ============ */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all var(--transition);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(48,209,88,0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 4px rgba(255,69,58,0.3);
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 4px rgba(48,209,88,0.4); }
    50% { box-shadow: 0 0 12px rgba(48,209,88,0.6); }
}

/* ============ HOST CHIPS ============ */
.host-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 20px 14px;
}

.host-chip {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', monospace;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.host-chip.online {
    background: var(--success-light);
    color: var(--success);
    border: 0.5px solid rgba(48,209,88,0.2);
}

.host-chip.offline {
    background: var(--danger-light);
    color: var(--danger);
    border: 0.5px solid rgba(255,69,58,0.2);
}

.host-chip:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow);
}

.host-chip:active {
    transform: scale(0.95);
}

/* Ping Graph Host Chips */
.ping-host-chip {
    font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', monospace;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.ping-host-chip.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============ PING TIME FILTER BUTTONS ============ */
.ping-time-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 0.5px solid var(--border);
    background: var(--glass-bg-strong);
    color: var(--text-primary);
    transition: all var(--transition);
}

.ping-time-btn:hover {
    background: var(--bg-tertiary);
}

.ping-time-btn.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}

/* ============ PREFIX AVAILABILITY ============ */
.prefix-avail-section {
    padding: 14px 20px;
    border-top: 0.5px solid var(--border);
    background: linear-gradient(to bottom, var(--bg-tertiary), transparent);
}

.prefix-avail-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prefix-avail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.prefix-avail-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 12px;
    border: 0.5px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
}

.prefix-avail-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.prefix-avail-badge .size {
    font-weight: 700;
    color: var(--text-primary);
}

.prefix-avail-badge .count {
    color: var(--accent);
    font-weight: 700;
}

.prefix-avail-badge.zero .count {
    color: var(--text-tertiary);
}

/* ============ MODAL - Liquid Glass ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active .modal {
    display: block;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg-strong);
    backdrop-filter: saturate(200%) blur(40px);
    -webkit-backdrop-filter: saturate(200%) blur(40px);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    border: 0.5px solid var(--glass-border);
    box-shadow: 0 24px 80px rgba(0,0,0,0.15), 0 0 1px rgba(0,0,0,0.1);
}

[data-theme="dark"] .modal {
    background: rgba(38,38,40,0.92);
    border: 0.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.1);
}

.modal.active {
    display: block;
}

.modal.modal-lg {
    max-width: 620px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 0.5px solid var(--border);
    justify-content: flex-end;
}

.modal-info {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 18px;
}

.form-group label,
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group select,
.form-group textarea,
.input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.input-mini {
    width: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    text-align: center;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    font-weight: 600;
}

.input-mini:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.input-sm {
    padding: 8px 12px;
    font-size: 13px;
}

/* ============ PREFIX SELECTOR ============ */
.prefix-selector {
    margin: 18px 0;
}

.prefix-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prefix-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
}

.prefix-btn small {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

.prefix-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.prefix-btn.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}

.prefix-btn.selected small {
    color: rgba(255,255,255,0.8);
}

/* ============ AVAILABLE PREFIXES ============ */
.available-prefixes {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.prefix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.prefix-option {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', monospace;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition);
    color: var(--text-primary);
}

.prefix-option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.prefix-option.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,122,255,0.25);
}

.prefix-loading,
.prefix-error,
.prefix-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.prefix-error { color: var(--danger); }

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ SETTINGS PAGE ============ */
.settings-container {
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.section-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    padding: 28px 20px 8px 20px;
}

.settings-group {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    margin: 0 16px 16px;
    overflow: hidden;
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 0.5px solid var(--border);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-form-section {
    padding: 20px;
    border-top: 0.5px solid var(--border);
}

/* ============ USER MANAGEMENT ============ */
.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 0.5px solid var(--border);
    gap: 12px;
    transition: background var(--transition);
}

.user-row:last-child { border-bottom: none; }
.user-row:hover { background: var(--bg-hover); }

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,122,255,0.25);
}

.user-details { min-width: 0; }

.user-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ============ iOS TOGGLE ============ */
.toggle {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 31px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

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

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

input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary);
}

/* ============ LOGIN ============ */
.glass {
    background: var(--glass-bg-strong);
    backdrop-filter: saturate(200%) blur(40px);
    -webkit-backdrop-filter: saturate(200%) blur(40px);
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--glass-border);
    box-shadow: 0 24px 80px rgba(0,0,0,0.12);
}

[data-theme="dark"] .glass {
    background: rgba(38,38,40,0.92);
    border: 0.5px solid rgba(255,255,255,0.1);
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--accent); }

.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-light);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ============ ALERTS ============ */
.alert {
    padding: 14px 18px;
    margin: 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 0.5px solid rgba(48,209,88,0.2);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 0.5px solid rgba(255,69,58,0.2);
}

/* ============ HISTORY PAGE ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-secondary);
    margin: 2px 0 0;
    font-size: 13px;
}

.page-nav {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-sm);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition);
    border: 0.5px solid var(--border);
}

.back-btn:hover {
    background: var(--accent-light);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.stats-row .stat-card {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.stat-icon.icon-accent { background: linear-gradient(135deg, var(--accent), #5856d6); }
.stat-icon.icon-success { background: linear-gradient(135deg, var(--success), #28b94a); }
.stat-icon.icon-danger { background: linear-gradient(135deg, var(--danger), #d63c32); }
.stat-icon.icon-warning { background: linear-gradient(135deg, var(--warning), #e88d09); }
.stat-icon.icon-secondary { background: linear-gradient(135deg, var(--secondary), #4845b0); }

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

.stat-info .stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.stat-info .stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Filter Row */
.filter-row {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.filter-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    transition: all var(--transition);
    font-weight: 500;
}

.filter-btn:hover { background: var(--bg-hover); }

.filter-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 6px rgba(0,122,255,0.25);
}

.filter-select {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    min-width: 150px;
}

/* History Card */
.history-card {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    margin: 0 1rem 2rem;
    overflow: hidden;
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

.history-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 0.5px solid var(--border);
    font-weight: 700;
    color: var(--text-primary);
}

.event-count {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.history-list {
    max-height: 70vh;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 0.5px solid var(--border);
    gap: 1rem;
    transition: background var(--transition);
}

.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--bg-hover); }

.history-item.event-up { border-left: 3px solid var(--success); }
.history-item.event-down { border-left: 3px solid var(--danger); }

.event-status { flex-shrink: 0; }

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-up { background: var(--success-light); color: var(--success); }
.badge-down { background: var(--danger-light); color: var(--danger); }

.event-details { flex: 1; min-width: 0; }

.event-ip {
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.event-device { color: var(--secondary); font-weight: 500; }
.event-client { color: var(--text-secondary); }
.event-note { font-style: italic; }

.event-time {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.event-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-delete-event {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-xs);
    font-size: 14px;
    opacity: 0;
    transition: all var(--transition);
}

.history-item:hover .btn-delete-event { opacity: 0.6; }
.btn-delete-event:hover { opacity: 1 !important; background: var(--danger-light); color: var(--danger); }

/* ============ DEVICE PAGE ============ */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
}

.device-card {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    overflow: hidden;
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
    border-left: 4px solid var(--text-tertiary);
    transition: all var(--transition);
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.device-card.device-type-router { border-left-color: var(--success); }
.device-card.device-type-server { border-left-color: var(--secondary); }
.device-card.device-type-switch { border-left-color: var(--warning); }

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

.device-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.device-type-router .device-icon-wrapper { background: var(--success-light); color: var(--success); }
.device-type-server .device-icon-wrapper { background: rgba(88,86,214,0.12); color: var(--secondary); }
.device-type-switch .device-icon-wrapper { background: var(--warning-light); color: var(--warning); }

.device-actions { display: flex; gap: 0.5rem; }

.device-body { padding: 1rem 1.25rem; }

.device-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.device-type-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-router { background: var(--success-light); color: var(--success); }
.badge-server { background: rgba(88,86,214,0.12); color: var(--secondary); }
.badge-switch { background: var(--warning-light); color: var(--warning); }

.device-location, .device-ip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.device-ip a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.device-description {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.device-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 0.5px solid var(--border);
    background: var(--bg-primary);
}

.device-stat {
    padding: 0.75rem;
    text-align: center;
    border-right: 0.5px solid var(--border);
    transition: background var(--transition);
}

.device-stat:last-child { border-right: none; }

.device-stat .stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.device-stat .stat-txt {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.device-stat.online .stat-num { color: var(--success); }
.device-stat.offline .stat-num { color: var(--danger); }

.device-stat.clickable {
    cursor: pointer;
}

.device-stat.clickable:hover {
    background: var(--bg-hover);
}

/* Type Selector */
.type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.type-option input { display: none; }

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
    background: var(--bg-card);
}

.type-card span {
    font-size: 0.8rem;
    font-weight: 600;
}

.type-option input:checked + .type-card {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============ ROUTING ============ */
.routing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.routing-option input { display: none; }

.routing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    background: var(--bg-card);
}

.routing-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.routing-option input:checked + .routing-card {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.routing-icon { font-size: 24px; margin-bottom: 8px; }
.routing-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.routing-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ============ AUTOCOMPLETE ============ */
.autocomplete-wrapper { position: relative; }

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 0.5px solid var(--glass-border);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1002;
    display: none;
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}

.suggestion-item {
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 0.5px solid var(--border);
    transition: background var(--transition);
    color: var(--text-primary);
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: var(--accent-light);
}

.suggestion-item strong { color: var(--accent); }

/* ============ SELECT WITH ADD ============ */
.select-with-add {
    display: flex;
    gap: 8px;
    align-items: center;
}

.select-with-add select { flex: 1; }

.select-with-add .btn {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 14px;
}

/* ============ PREFIX SEARCH & PAGINATION ============ */
.prefix-search-box { margin-bottom: 12px; }

.prefix-search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
}

.prefix-search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.prefix-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 0.5px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.prefix-info { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.prefix-nav { display: flex; gap: 8px; }

/* ============ SUMMARY TABLE ============ */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.summary-table th {
    background: var(--bg-tertiary);
    padding: 12px 10px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.summary-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.summary-table th.sortable:hover { background: var(--bg-hover); }
.sort-icon { font-size: 10px; margin-left: 4px; opacity: 0.4; }

.summary-table td {
    padding: 10px;
    border-bottom: 0.5px solid var(--border);
}

.summary-table tr {
    transition: background var(--transition);
}

.summary-table tr:hover { background: var(--bg-hover); }
.summary-row.offline { opacity: 0.75; }

.status-badge.online { background: var(--success-light); color: var(--success); }
.status-badge.offline { background: var(--danger-light); color: var(--danger); }

.host-count {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.host-count.all-online { background: var(--success-light); color: var(--success); }
.host-count.all-offline { background: var(--danger-light); color: var(--danger); }
.host-count.partial { background: var(--warning-light); color: var(--warning); }

.pagination-wrapper { flex-wrap: wrap; gap: 8px; }

/* ============ EMPTY STATE ============ */
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin-top: 12px;
    color: var(--text-primary);
    font-weight: 700;
}

.empty-state p {
    margin: 8px 0;
    font-size: 14px;
}

/* ============ TEXT UTILITIES ============ */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-tertiary); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }

.confirm-text {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ============ HISTORY MINI (Dashboard) ============ */
.history-mini a {
    padding: 8px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-sm);
    border: 0.5px solid var(--glass-border);
}

/* ============ DROPDOWN ============ */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--glass-bg-strong);
    backdrop-filter: saturate(200%) blur(40px);
    -webkit-backdrop-filter: saturate(200%) blur(40px);
    border-radius: var(--radius-sm);
    border: 0.5px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition);
}

.dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* ============ FORM CONTROL (legacy compat) ============ */
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
    }

    .stat-value { font-size: 26px; }
}

@media (max-width: 600px) {
    .modal {
        width: 95%;
        padding: 20px;
        border-radius: var(--radius);
    }

    .prefix-buttons { gap: 6px; }
    .prefix-btn { padding: 8px 10px; font-size: 13px; }
    .prefix-grid { grid-template-columns: repeat(2, 1fr); }
    .routing-options { grid-template-columns: 1fr; }

    .summary-table { font-size: 12px; }
    .summary-table th, .summary-table td { padding: 8px 4px; }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .stat-card { padding: 14px 10px; }
    .stat-value { font-size: 24px; }

    .user-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-actions { width: 100%; justify-content: flex-end; }

    .prefix-pagination { flex-direction: column; align-items: stretch; }
    .prefix-nav { justify-content: center; }

    .page-header { flex-direction: column; align-items: flex-start; }

    .device-grid { grid-template-columns: 1fr; }
    .type-selector { grid-template-columns: 1fr; }
    .device-stats { grid-template-columns: repeat(2, 1fr); }
    .device-stat { border-bottom: 0.5px solid var(--border); }
    .device-stat:nth-child(2) { border-right: none; }

    .filter-row { flex-direction: column; }
    .history-item { flex-wrap: wrap; }
    .event-time { width: 100%; text-align: left; margin-top: 0.5rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }

    .navbar-content { padding: 10px 12px; gap: 8px; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============ SELECTION ============ */
::selection {
    background: var(--accent-light);
    color: var(--accent);
}

/* ============ FOCUS ============ */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ============ ANIMATION UTILITIES ============ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.3s ease-out both;
}
