/* ============================================================
   Kuaishou API Admin - Main Stylesheet
   Modern admin dashboard with glassmorphism design
   ============================================================ */

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
    --primary: #1a1a2e;
    --primary-light: #2d2d44;
    --bg: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f1f3;
    --text: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8e8ea0;
    --border: #e5e5ea;
    --border-light: #f0f0f5;
    --accent: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #6366f1;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ============================================================
   Layout
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
}

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

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.sidebar-logo .logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

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

.sidebar-nav-section {
    margin-bottom: 8px;
}

.sidebar-nav-section .section-title {
    padding: 12px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.sidebar-nav-section .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    margin: 2px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav-section .nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.sidebar-nav-section .nav-link.active {
    background: var(--bg-secondary);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav-section .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav-section .nav-link .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.sidebar-nav-section .nav-link .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

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

.sidebar-footer .btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-footer .btn-logout:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

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

.sidebar-overlay.active {
    opacity: 1;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 20px 30px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ============================================================
   Header
   ============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

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

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

.header-breadcrumb a:hover {
    color: var(--accent);
}

.header-breadcrumb .separator {
    color: var(--border);
}

.header-breadcrumb .current {
    color: var(--text);
    font-weight: 500;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.header-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.header-user .username {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.header-user .user-arrow {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.header-user:hover .user-arrow {
    transform: rotate(180deg);
}

/* Hamburger menu button (mobile) */
.hamburger-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

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

.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger-btn span::before,
.hamburger-btn span::after {
    content: '';
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    position: absolute;
    transition: all 0.3s ease;
}

.hamburger-btn span::before {
    top: -6px;
}

.hamburger-btn span::after {
    top: 6px;
}

.hamburger-btn.active span {
    background: transparent;
}

.hamburger-btn.active span::before {
    top: 0;
    transform: rotate(45deg);
}

.hamburger-btn.active span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ============================================================
   Authentication Pages
   ============================================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 40px;
    animation: fadeInUp 0.5s ease;
}

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

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

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

.auth-header .auth-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

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

.form-group .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-group .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.form-group .input-wrapper input {
    padding-left: 40px;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8ea0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Captcha Row */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-row input {
    flex: 1;
}

.captcha-row .captcha-img {
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
}

.captcha-row .captcha-refresh {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.captcha-row .captcha-refresh:hover {
    background: var(--border);
    color: var(--text);
}

/* Verify Code Row */
.verify-code-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.verify-code-row input {
    flex: 1;
}

.verify-code-row .btn-send-code {
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.verify-code-row .btn-send-code:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.verify-code-row .btn-send-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    z-index: 1;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text);
}

/* Form Actions */
.form-actions {
    margin-top: 24px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--accent);
    font-weight: 500;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

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

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

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

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

.btn-pill {
    border-radius: 50px;
    padding: 12px 28px;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 12px;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

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

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   Landing Page
   ============================================================ */
.landing-page {
    min-height: 100vh;
    background: var(--bg);
}

.landing-hero {
    padding: 80px 20px 60px;
    text-align: center;
}

.landing-hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.landing-hero h1 .highlight {
    background: linear-gradient(135deg, var(--accent), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.landing-hero .hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-features {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.landing-features .section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.landing-features .section-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--accent);
}

.feature-card .feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

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

.feature-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================================
   Glass Cards
   ============================================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.glass-card-flat {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 20px;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    position: relative;
}

.alert .alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 16px;
    padding: 2px;
    transition: opacity 0.2s ease;
}

.alert .alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

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

.badge-success {
    background: #ecfdf5;
    color: #065f46;
}

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
}

.badge-warning {
    background: #fffbeb;
    color: #92400e;
}

.badge-info {
    background: #eff6ff;
    color: #1e40af;
}

.badge-primary {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ============================================================
   Tables
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg);
}

table thead {
    background: var(--bg-secondary);
}

table thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

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

table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

table tbody tr.clickable {
    cursor: pointer;
}

table .text-center {
    text-align: center;
}

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

table .actions {
    display: flex;
    gap: 8px;
}

table .actions .action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s ease;
}

table .actions .action-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

table .actions .action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Checkbox in table */
table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.pagination .page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 12px;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

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

.modal-header .modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

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

/* ============================================================
   Form Controls (Additional)
   ============================================================ */
/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

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

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .toggle-track {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--border);
    position: relative;
    transition: background 0.3s ease;
}

.toggle-switch .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.toggle-switch input:checked + .toggle-track {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(20px);
}

.toggle-switch .toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-card .stat-icon.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.stat-card .stat-icon.green {
    background: #ecfdf5;
    color: #10b981;
}

.stat-card .stat-icon.orange {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-card .stat-icon.red {
    background: #fef2f2;
    color: #ef4444;
}

.stat-card .stat-icon.purple {
    background: #f5f3ff;
    color: #8b5cf6;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 4px;
}

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

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

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

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

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

.tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-nav .tab-link {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.tab-nav .tab-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

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

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ============================================================
   Color Picker
   ============================================================ */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-group input[type="color"] {
    width: 42px;
    height: 42px;
    padding: 2px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: none;
    transition: border-color 0.2s ease;
}

.color-picker-group input[type="color"]:hover {
    border-color: var(--accent);
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker-group input[type="text"] {
    flex: 1;
}

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

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.page-header .page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   Search & Filter Bar
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.filter-bar .search-input {
    max-width: 300px;
}

.filter-bar select {
    max-width: 180px;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

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

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ============================================================
   Loading
   ============================================================ */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-accent { color: var(--accent); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.mr-2 { margin-right: 8px; }
.mr-4 { margin-right: 16px; }
.ml-2 { margin-left: 8px; }
.ml-4 { margin-left: 16px; }

.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.max-w-sm { max-width: 384px; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }

.rounded { border-radius: 10px; }
.rounded-lg { border-radius: 14px; }
.rounded-xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

.shadow { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation utility classes */
.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease;
}

.animate-fade-in-down {
    animation: fadeInDown 0.4s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

.animate-slide-in-left {
    animation: slideInLeft 0.3s ease;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease;
}

/* Transition utilities */
.transition {
    transition: all 0.2s ease;
}

.transition-transform {
    transition: transform 0.3s ease;
}

.transition-opacity {
    transition: opacity 0.3s ease;
}

/* ============================================================
   Responsive - Tablet (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
        padding: 16px 20px;
    }

    .sidebar-logo {
        padding: 20px 16px;
    }

    .sidebar-logo .logo-text {
        font-size: 16px;
    }

    .sidebar-nav-section .nav-link {
        padding: 10px 16px;
        margin: 2px 8px;
        font-size: 13px;
    }

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

    .landing-hero h1 {
        font-size: 36px;
    }

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

    .page-header h2 {
        font-size: 20px;
    }
}

/* ============================================================
   Responsive - Mobile (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 12px 16px;
    }

    .hamburger-btn {
        display: flex;
    }

    .header {
        padding: 10px 0;
        margin-bottom: 16px;
    }

    .header-user {
        gap: 6px;
    }

    .header-user .username {
        display: none;
    }

    .landing-hero h1 {
        font-size: 28px;
    }

    .landing-hero p {
        font-size: 15px;
    }

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

    .auth-card {
        padding: 28px 20px;
    }

    .auth-header h1 {
        font-size: 20px;
    }

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

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

    .page-header h2 {
        font-size: 18px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .search-input,
    .filter-bar select {
        max-width: 100%;
    }

    .modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    .table-container {
        border-radius: 12px;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }

    table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 16px;
        border-bottom: none;
        font-size: 13px;
    }

    table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
    }

    table tbody tr:nth-child(even) {
        background: transparent;
    }

    .pagination {
        gap: 4px;
    }

    .pagination .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .tab-nav {
        gap: 0;
    }

    .tab-nav .tab-link {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ============================================================
   Responsive - Small Mobile (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
    .main-content {
        padding: 10px 12px;
    }

    .landing-hero {
        padding: 60px 16px 40px;
    }

    .landing-hero h1 {
        font-size: 24px;
    }

    .landing-hero p {
        font-size: 14px;
    }

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

    .auth-card {
        padding: 24px 16px;
        border-radius: 14px;
    }

    .auth-header h1 {
        font-size: 18px;
    }

    .glass-card {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

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

    .modal {
        border-radius: 14px 14px 0 0;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .captcha-row {
        flex-wrap: wrap;
    }

    .verify-code-row {
        flex-wrap: wrap;
    }

    .btn-lg {
        padding: 12px 24px;
        font-size: 15px;
    }

    .page-header h2 {
        font-size: 16px;
    }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
    .sidebar,
    .sidebar-overlay,
    .hamburger-btn,
    .header {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .glass-card,
    .stat-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}