/* ==========================================
   Proxy V4 Dân Cư Xoay - Design System
   Brand: VPSTTT - Light/Dark Theme Support
   Default: Light Mode
   ========================================== */

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

/* ==========================================
   LIGHT MODE (Default)
   ========================================== */
:root {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --primary-glow: rgba(124, 58, 237, 0.2);

    --bg-dark: #f4f6f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f7ff;
    --bg-sidebar: #ffffff;
    --bg-input: #f1f5f9;
    --bg-modal: rgba(0, 0, 0, 0.4);

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.08);

    --border: #e2e8f0;
    --border-hover: rgba(124, 58, 237, 0.4);

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

    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.08);

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

/* ==========================================
   DARK MODE
   ========================================== */
[data-theme="dark"] {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #6d28d9;
    --primary-glow: rgba(124, 58, 237, 0.4);

    --bg-dark: #0a0a1a;
    --bg-card: #111128;
    --bg-card-hover: #16163a;
    --bg-sidebar: #0d0d24;
    --bg-input: #1a1a3e;
    --bg-modal: rgba(0, 0, 0, 0.7);

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

    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    --border: rgba(124, 58, 237, 0.15);
    --border-hover: rgba(124, 58, 237, 0.4);

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.2);
}

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

html { scroll-behavior: smooth; }

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

a { text-decoration: none; color: var(--primary-light); transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==========================================
   Theme Toggle Button
   ========================================== */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    transform: rotate(15deg);
}

/* ==========================================
   Login Page
   ========================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .login-wrapper {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 40%, #2d1b69 100%);
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

[data-theme="dark"] .login-wrapper::before {
    background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167,139,250,0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 420px;
    max-width: 95%;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 50px; margin-bottom: 12px; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.login-header-actions {
    position: absolute;
    top: 16px;
    right: 16px;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: 1px 0 3px rgba(0,0,0,0.03);
}

[data-theme="dark"] .sidebar { box-shadow: none; }

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header img { height: 36px; }

.sidebar-header .brand-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.sidebar-header .brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 12px 16px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.06);
    color: var(--text-primary);
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(124, 58, 237, 0.08);
}

.nav-item.active {
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary);
    border: 1px solid rgba(124, 58, 237, 0.15);
    font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
    background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(124,58,237,0.08));
    color: var(--primary-light);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.nav-item .icon { font-size: 18px; width: 24px; text-align: center; }

.nav-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

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

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; }

.top-header {
    padding: 16px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

[data-theme="dark"] .top-header {
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(10px);
}

.top-header h2 { font-size: 20px; font-weight: 700; }

.top-header-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 32px; }

/* ==========================================
   Cards
   ========================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

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

.card-header h3 { font-size: 16px; font-weight: 700; }
.card-body { padding: 24px; }

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

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

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.purple { background: rgba(124,58,237,0.1); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }

.stat-info h4 { font-size: 28px; font-weight: 800; line-height: 1.2; }
.stat-info p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

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

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

thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

[data-theme="dark"] thead th { background: rgba(124, 58, 237, 0.05); }

tbody td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(124, 58, 237, 0.03); }

/* ==========================================
   Status Badges
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-active { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22, 163, 74, 0.2); }
.badge-active::before { background: var(--success); box-shadow: 0 0 6px var(--success); }

.badge-paused { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217, 119, 6, 0.2); }
.badge-paused::before { background: var(--warning); }

.badge-empty { background: rgba(148, 163, 184, 0.08); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.2); }
.badge-empty::before { background: var(--text-muted); }

.badge-suspended { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.2); }
.badge-suspended::before { background: var(--danger); }

.badge-inactive { background: rgba(148, 163, 184, 0.08); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.2); }
.badge-inactive::before { background: var(--text-muted); }

.badge-rotating { background: var(--info-bg); color: var(--info); border: 1px solid rgba(37, 99, 235, 0.2); animation: pulse-badge 2s ease-in-out infinite; }
.badge-rotating::before { background: var(--info); animation: pulse-dot 1s ease-in-out infinite; }

@keyframes pulse-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.4); } }

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover { box-shadow: 0 6px 25px var(--primary-glow); transform: translateY(-1px); }

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

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

.btn-success { background: linear-gradient(135deg, #16a34a, #15803d); color: white; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; }
.btn-warning { background: linear-gradient(135deg, #d97706, #b45309); color: white; }

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-icon {
    width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); font-size: 16px;
}

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

/* ==========================================
   Forms
   ========================================== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 540px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); }

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

.modal-header h3 { font-size: 18px; font-weight: 700; }

.modal-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

.modal-close:hover { background: var(--danger); color: white; border-color: var(--danger); }

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

/* ==========================================
   Toast
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 420px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.toast-success::before { background: var(--success); }
.toast-error::before { background: var(--danger); }
.toast-warning::before { background: var(--warning); }
.toast-info::before { background: var(--info); }

.toast .icon { font-size: 20px; flex-shrink: 0; }
.toast-success .icon { color: var(--success); }
.toast-error .icon { color: var(--danger); }
.toast-warning .icon { color: var(--warning); }
.toast-info .icon { color: var(--info); }

.toast .message { font-size: 14px; flex: 1; }
.toast .close-toast { cursor: pointer; color: var(--text-muted); font-size: 16px; padding: 4px; transition: var(--transition); }
.toast .close-toast:hover { color: var(--text-primary); }
.toast-exit { animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

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

/* ==========================================
   Toolbar
   ========================================== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar .search-box { position: relative; flex: 1; min-width: 200px; max-width: 400px; }

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

.toolbar .search-box input:focus { border-color: var(--primary); }

.toolbar .search-box .search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 14px;
}

.toolbar .filter-select {
    padding: 10px 36px 10px 14px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-family: inherit; font-size: 14px; outline: none; cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    transition: var(--transition);
}

.toolbar .filter-select:focus { border-color: var(--primary); }

/* ==========================================
   IP Display & Token
   ========================================== */
.ip-display {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    background: rgba(124, 58, 237, 0.06);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--primary);
    border: 1px solid rgba(124, 58, 237, 0.12);
    display: inline-block;
}

.ip-display.rotating {
    animation: pulse-badge 1.5s ease-in-out infinite;
    color: var(--info);
    background: var(--info-bg);
    border-color: rgba(37, 99, 235, 0.2);
}

.token-display {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    background: rgba(124, 58, 237, 0.04);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
    word-break: break-all;
    max-width: 180px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.token-display:hover {
    max-width: none;
    white-space: normal;
    background: rgba(124, 58, 237, 0.08);
}

/* ==========================================
   Empty State & Loading
   ========================================== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h4 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 400px; margin: 0 auto; }

.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

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

/* Confirm Dialog */
.confirm-dialog { text-align: center; padding: 20px 0; }
.confirm-dialog .icon { font-size: 48px; margin-bottom: 16px; }
.confirm-dialog h4 { font-size: 18px; margin-bottom: 8px; }
.confirm-dialog p { font-size: 14px; color: var(--text-secondary); max-width: 360px; margin: 0 auto; }

/* ==========================================
   API Docs
   ========================================== */
.api-endpoint {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
}

.api-method { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; margin-right: 10px; }
.api-method.get { background: rgba(22,163,74,0.1); color: var(--success); }
.api-method.post { background: rgba(37,99,235,0.1); color: var(--info); }

.api-url { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 13px; color: var(--text-primary); }
.api-desc { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }

.code-block {
    background: #1e1e2e;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #a78bfa;
    overflow-x: auto;
    margin-top: 12px;
    white-space: pre;
    line-height: 1.8;
}

/* ==========================================
   Landing Page
   ========================================== */
.landing-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #f8f7ff 0%, #ede9fe 50%, #ddd6fe 100%);
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
}

[data-theme="dark"] .landing-hero {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 40%, #2d1b69 100%);
}

.landing-hero::before {
    content: '';
    position: absolute;
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(124,58,237,0.06) 0%, transparent 70%);
    top: -300px; right: -300px;
    animation: float 10s ease-in-out infinite;
}

[data-theme="dark"] .landing-hero::before {
    background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
}

.landing-content { position: relative; z-index: 1; max-width: 700px; }
.landing-content img { height: 60px; margin-bottom: 24px; }

.landing-content h1 {
    font-size: 42px; font-weight: 800; margin-bottom: 16px; line-height: 1.3;
    background: linear-gradient(135deg, #1e293b, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .landing-content h1 {
    background: linear-gradient(135deg, #f1f5f9, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-content p { font-size: 18px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.7; }

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 48px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.feature-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.feature-card .icon { font-size: 32px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 0; }

/* ==========================================
   Activity Log
   ========================================== */
.log-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.log-type-badge.admin { background: rgba(124,58,237,0.08); color: var(--primary); }
.log-type-badge.user { background: var(--info-bg); color: var(--info); }
.log-type-badge.system { background: var(--success-bg); color: var(--success); }
.log-type-badge.api { background: var(--warning-bg); color: var(--warning); }

/* ==========================================
   Mobile
   ========================================== */
.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px; right: 20px;
    width: 50px; height: 50px;
    background: var(--primary);
    border: none; border-radius: 50%;
    color: white; font-size: 22px;
    cursor: pointer; z-index: 200;
    box-shadow: 0 4px 20px var(--primary-glow);
    align-items: center; justify-content: center;
}

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

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: flex; }
    .page-content { padding: 20px 16px; }
    .top-header { padding: 14px 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar .search-box { max-width: none; }
    .landing-content h1 { font-size: 28px; }
    .landing-content p { font-size: 15px; }
    .landing-features { grid-template-columns: 1fr; }
    table { font-size: 13px; }
    thead th, tbody td { padding: 10px 12px; }
}
