/* ========================================
   ZeroSrv - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    
    --bg-dark: #0a0a0a;
    --bg-dark-secondary: #101722;
    --bg-card: #141414;
    --bg-input: #1a1a1a;
    
    --border-dark: #2a2a2a;
    --border-light: #333;
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1a1;
    --text-muted: #666666;
    
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    
    --transition: 150ms ease;
}

/* ========================================
   SweetAlert2 Dark Theme
   ======================================== */
.swal2-popup.swal-dark-popup {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
    font-size: 0.9rem !important;
}

.swal2-input, .swal2-textarea {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-dark) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
}

.swal2-input:focus, .swal2-textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
}

.swal2-confirm.swal-dark-btn {
    background: var(--primary) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    padding: 10px 24px !important;
}

.swal2-confirm.swal-dark-btn:hover {
    background: var(--primary-hover) !important;
}

.swal2-cancel.swal-dark-btn-cancel {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-dark) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    padding: 10px 24px !important;
}

.swal2-cancel.swal-dark-btn-cancel:hover {
    background: var(--border-dark) !important;
}

.swal2-icon.swal2-warning {
    border-color: var(--warning) !important;
    color: var(--warning) !important;
}

.swal2-icon.swal2-error {
    border-color: var(--danger) !important;
}

.swal2-icon.swal2-success {
    border-color: var(--success) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--success) !important;
}

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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ========================================
   Layout
   ======================================== */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid var(--border-dark);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.logo:hover {
    color: var(--text-primary);
}

.logo-image {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.version-badge {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
}

/* Search */
.search-container {
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .search-container {
        display: flex;
        align-items: center;
    }
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--transition);
}

.search-input {
    width: 280px;
    height: 36px;
    padding: 0 48px 0 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition);
}

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

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

.search-input:focus + .search-icon,
.search-container:focus-within .search-icon {
    color: var(--primary);
}

.search-kbd {
    position: absolute;
    right: 12px;
    padding: 2px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    font-size: 10px;
    font-family: inherit;
    color: var(--text-muted);
}

/* Icon Button */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* User Avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border: 2px solid var(--border-dark);
    cursor: pointer;
    transition: border-color var(--transition);
}

.user-avatar:hover {
    border-color: var(--primary);
}

/* User Menu */
.user-menu-container {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.user-menu-trigger:hover {
    background: var(--bg-input);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.user-menu-trigger .user-avatar {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.user-menu-trigger .user-avatar .material-symbols-outlined {
    font-size: 18px;
    color: white;
}

.user-menu-trigger .user-name {
    font-size: 13px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-trigger .dropdown-arrow {
    font-size: 18px;
    color: var(--text-muted);
}

.user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s ease;
}

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

.user-menu-header {
    padding: 12px 16px;
}

.user-menu-email {
    font-size: 12px;
    color: var(--text-muted);
}

.user-menu-divider {
    height: 1px;
    background: var(--border-dark);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: all var(--transition);
}

.user-menu-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.user-menu-item .material-symbols-outlined {
    font-size: 18px;
}

.user-menu-item-danger {
    color: var(--danger);
}

.user-menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

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

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: var(--shadow-md);
}

/* Stats Card */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-icon {
    color: var(--primary);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Online Indicator */
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

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

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    height: 36px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

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

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    color: var(--text-primary);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* ========================================
   Forms
   ======================================== */

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition);
}

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

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

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: 24px;
    transition: all var(--transition);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition);
}

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

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

/* ========================================
   Tables
   ======================================== */

.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-dark);
}

.table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover td {
    background: var(--bg-input);
}

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

/* ========================================
   Badges
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

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

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

.badge-info {
    background: var(--primary-light);
    color: var(--primary);
}

/* ========================================
   Section Headers
   ======================================== */

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

.section-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ========================================
   Tabs
   ======================================== */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

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

/* ========================================
   Activity Timeline
   ======================================== */

.timeline {
    padding: 24px;
}

.timeline-item {
    position: relative;
    padding-left: 24px;
    padding-bottom: 24px;
    border-left: 1px solid var(--border-dark);
}

.timeline-item:last-child {
    padding-bottom: 0;
    border-left: none;
}

.timeline-dot {
    position: absolute;
    left: -5px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--bg-card);
}

.timeline-dot.success {
    background: var(--success);
}

.timeline-dot.warning {
    background: var(--warning);
}

.timeline-dot.danger {
    background: var(--danger);
}

.timeline-dot.muted {
    background: var(--text-muted);
}

.timeline-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-time {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Network Card
   ======================================== */

.network-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .network-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.network-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.network-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: var(--shadow-md);
}

.network-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.network-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--primary);
}

.network-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.network-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 11px;
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--text-muted);
}

.network-stats {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-dark);
}

.network-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.network-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.network-stat-value {
    font-size: 14px;
    font-weight: 600;
}

/* ========================================
   Utilities
   ======================================== */

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.text-muted {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-8 {
    margin-bottom: 32px;
}

/* ========================================
   Dashboard Layout
   ======================================== */

/* Controller Status Bar */
.controller-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
}

.controller-status-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.offline {
    background: var(--danger);
}

.status-text {
    font-size: 13px;
    font-weight: 500;
}

.status-divider {
    color: var(--border-dark);
}

.status-version,
.status-address,
.status-clock {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, monospace;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 350px 1fr;
    }
}

.networks-section {
    min-width: 0;
}

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

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    margin-bottom: 24px;
}

/* ========================================
   Network Detail Page
   ======================================== */

.breadcrumb {
    margin-bottom: 24px;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.network-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-dark);
}

.network-header-left {
    flex: 1;
}

.network-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.network-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
}

.network-title:hover {
    color: var(--primary);
}

.network-name-input {
    font-size: 24px;
    font-weight: 600;
    width: 300px;
}

.network-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.network-id-full {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--text-muted);
}

/* Members Table */
.member-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.member-id {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    color: var(--text-muted);
}

.ip-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 4px;
    background: var(--primary-light);
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    color: var(--primary);
}

.physical-ip,
.version-badge {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.join-command {
    display: block;
    padding: 12px 16px;
    margin-top: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--primary);
}

.search-input-sm {
    width: 200px;
    height: 36px;
}

/* Settings */
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-dark);
}

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

.setting-label {
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.form-input-sm {
    width: 120px;
    height: 36px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
}

.info-value {
    font-weight: 500;
}

/* Routes */
.routes-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.routes-list,
.pools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-item,
.pool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.route-target,
.pool-range {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

.route-via {
    font-size: 12px;
    color: var(--text-muted);
}

/* Flow Rules */
.flow-rules-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rules-editor {
    margin-bottom: 16px;
}

.rules-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--text-primary);
    resize: vertical;
}

.rules-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.rules-help {
    font-size: 13px;
}

.rules-help summary {
    cursor: pointer;
    color: var(--text-secondary);
}

.help-content {
    padding: 16px 0;
}

.help-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.help-content li {
    margin-bottom: 8px;
}

.help-content code {
    padding: 2px 6px;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 12px;
}

.help-link {
    color: var(--primary);
}

.compiled-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rule-type {
    text-transform: uppercase;
    font-size: 10px;
}

/* Modal */
.modal-overlay,
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 400px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 130px); /* Account for header and footer */
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-dark);
}

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

/* Permission Modal Styles */
.permission-category {
    margin-bottom: 20px;
}

.permission-category:last-child {
    margin-bottom: 0;
}

.permission-category-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-dark);
}

.permission-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

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

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.permission-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.permission-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.permission-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* System User Avatar */
.user-avatar-small.system-user {
    background: linear-gradient(135deg, var(--warning), #f97316);
}

/* ========================================
   Backup/Restore Styles
   ======================================== */
.backup-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.backup-info .info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
}

.backup-info .info-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.backup-info .info-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.backup-info .info-item.warning .material-symbols-outlined {
    color: var(--warning);
}

.backup-info .info-item.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.backup-info .info-item.success .material-symbols-outlined {
    color: var(--success);
}

.backup-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.backup-file-info .material-symbols-outlined {
    font-size: 20px;
    color: var(--primary);
}

.backup-preview {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
}

.backup-preview h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.network-list-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-dark);
}

.network-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.network-preview-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--primary);
}

.network-preview-item .network-name {
    flex: 1;
    color: var(--text-primary);
}

.network-preview-item .network-members {
    color: var(--text-muted);
    font-size: 12px;
}

.form-input-file {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.form-input-file:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.form-input-file::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    cursor: pointer;
}

.restore-summary {
    margin: 8px 0 0 20px;
    padding: 0;
    font-size: 13px;
}

.restore-summary li {
    margin: 4px 0;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

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

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #d97706;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-dark);
    background: var(--bg-input);
}

.card-footer.muted {
    font-size: 12px;
    color: var(--text-muted);
}

/* Badge styles */
.badge-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-dark);
}

.modal.modal-xl {
    max-width: 720px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Button sizes */
.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

/* Identity Info Styles */
.identity-info {
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
}

.identity-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.identity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.identity-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.identity-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.identity-value {
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.identity-value.truncate {
    max-width: 200px;
}

.identity-restore-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-dark);
}

.identity-restore-section .alert-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.identity-restore-section .alert-info .material-symbols-outlined {
    font-size: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.identity-restore-section .alert-info strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.identity-restore-section .alert-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.preview-value.text-success {
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-value.text-warning {
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   Blazor Error UI
   ======================================== */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 16px;
    background: var(--danger);
    color: white;
    text-align: center;
    z-index: 9999;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    margin-left: 16px;
    color: white;
    cursor: pointer;
}

/* ========================================
   Routes & IP Pools
   ======================================== */

.routes-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-header .card-title {
    margin: 0;
}

.pools-list,
.routes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pool-item,
.route-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
}

@media (min-width: 640px) {
    .pool-item,
    .route-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.pool-info,
.route-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.pool-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.pool-range code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

@media (max-width: 400px) {
    .pool-range code {
        font-size: 11px;
        padding: 3px 6px;
    }
}

.pool-separator {
    color: var(--text-muted);
}

.pool-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 13px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-item.available .stat-value {
    color: var(--success);
}

.stat-item.used .stat-value {
    color: var(--warning);
}

.pool-actions,
.route-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    align-self: flex-end;
}

@media (min-width: 640px) {
    .pool-actions,
    .route-actions {
        align-self: center;
    }
}

.route-target {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    word-break: break-all;
}

@media (max-width: 400px) {
    .route-target {
        font-size: 11px;
        padding: 3px 6px;
    }
}

.route-via {
    font-size: 13px;
    color: var(--text-secondary);
}

.route-via code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--text-primary);
}

.route-via.local {
    color: var(--text-muted);
    font-style: italic;
}

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

.empty-message .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.empty-message p {
    font-size: 14px;
}

.pool-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.pool-preview .material-symbols-outlined {
    font-size: 20px;
}

.pool-preview.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

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

.form-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--danger);
    margin-bottom: 1rem;
}

/* ============================================
   IP Pool Selector Component
   ============================================ */

.ip-pool-selector {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ip-pool-selector .section-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Presets Grid */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.preset-btn:hover {
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.03);
}

.preset-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.preset-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.preset-range {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.preset-count {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.preset-btn.selected .preset-name,
.preset-btn.selected .preset-range {
    color: var(--primary);
}

/* Random Section */
.random-controls {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.random-size {
    flex: 1;
}

.random-size label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.random-controls .btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.random-controls .btn .material-symbols-outlined {
    font-size: 18px;
}

/* Manual Section */
.manual-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Divider */
.ip-pool-selector hr {
    border: none;
    border-top: 1px solid var(--border-dark);
    margin: 0;
}


/* ============================================
   Dashboard Network Grid Styles
   ============================================ */

.network-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.network-name-cell .network-icon {
    font-size: 20px;
    color: var(--primary);
    opacity: 0.8;
}

.network-name-text {
    font-weight: 500;
    color: var(--text-primary);
}

.network-id-code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.member-count {
    font-weight: 500;
    color: var(--text-primary);
}

.online-count {
    font-weight: 600;
    color: var(--success);
}

/* Stat Card Updates */
.stat-icon {
    font-size: 20px !important;
    color: var(--text-muted);
}

/* ========================================
   Settings Form Styles
   ======================================== */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.setting-item-input {
    flex-wrap: wrap;
    gap: 12px;
}

.setting-item-input .form-input-sm {
    width: 100px;
    text-align: center;
}

/* Badge in card header */
.card-header .badge {
    margin-left: auto;
}

/* Responsive Settings */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
    }

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .setting-item .switch {
        align-self: flex-end;
    }

    .setting-item-input .form-input-sm {
        width: 100%;
    }

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

/* ========================================
   Alert Dropdown
   ======================================== */
.alert-dropdown {
    position: relative;
}

.alert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.alert-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.alert-btn.has-alerts {
    color: var(--warning);
}

.alert-btn .material-symbols-outlined {
    font-size: 22px;
}

.alert-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
}

.alert-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.alert-count {
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.alert-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    color: var(--text-muted);
}

.alert-empty .material-symbols-outlined {
    font-size: 40px;
    color: var(--success);
}

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

.alert-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-dark);
}

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

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

.alert-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 18px;
}

.alert-item.alert-warning .alert-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.alert-item.alert-error .alert-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.alert-item.alert-info .alert-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

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

.alert-title {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
}

.alert-message {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-network {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.alert-dropdown-footer {
    padding: 12px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-dark);
}

@media (max-width: 480px) {
    .alert-dropdown-menu {
        position: fixed;
        top: 60px;
        right: 8px;
        left: 8px;
        width: auto;
    }
}

/* ========================================
   Login Page
   ======================================== */
.empty-layout {
    min-height: 100vh;
    background: var(--bg-dark);
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    color: var(--primary);
}

.login-logo svg {
    width: 100%;
    height: 100%;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-error .material-symbols-outlined {
    font-size: 20px;
}

.login-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-md);
    color: var(--success);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-success .material-symbols-outlined {
    font-size: 20px;
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--text-primary);
}

.back-link .material-symbols-outlined {
    font-size: 16px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-check {
    display: flex;
    align-items: center;
}

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

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 15px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.validation-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

/* ========================================
   Settings Page Styles
   ======================================== */

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Tabs */
.tabs-container {
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-dark);
    width: fit-content;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-input);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab .material-symbols-outlined {
    font-size: 18px;
}

.tab-content {
    animation: fadeIn 0.2s ease;
}

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

/* Data Table */
.data-table {
    overflow-x: auto;
}

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

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-dark);
}

.data-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-dark);
}

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

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

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

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-small .material-symbols-outlined {
    font-size: 16px;
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon .material-symbols-outlined {
    font-size: 18px;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-ghost.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Card Footer */
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-dark);
    margin: 0 -20px -20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card-footer.muted {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-input);
}

/* Alert Component */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 16px;
}

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

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

.mb-3 {
    margin-bottom: 12px;
}

/* Small Spinner */
.spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}
