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

:root {
    --bg: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.75);
    --fg: #1a202c;
    --fg-muted: #64748b;
    --fg-dim: #94a3b8;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --accent-dark: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --gold: #d97706;
    --gold-light: #f59e0b;
    --success: #059669;
    --error: #dc2626;
    --border: rgba(100, 116, 139, 0.18);
    --border-light: rgba(100, 116, 139, 0.08);
    --gradient-1: linear-gradient(135deg, #2563eb, #7c3aed);
    --gradient-2: linear-gradient(135deg, #f0f4f8, #e2e8f0);
    --gradient-gold: linear-gradient(135deg, #f59e0b, #d97706);
    --input-bg: #f8fafc;
    --input-bg-hover: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
.bg-animated {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124,58,237,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(245,158,11,0.03) 0%, transparent 50%);
}

.floating-orb {
    position: absolute; border-radius: 50%; filter: blur(80px); animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: rgba(37,99,235,0.06); top: -100px; right: -100px; }
.orb-2 { width: 300px; height: 300px; background: rgba(124,58,237,0.05); bottom: -50px; left: -50px; animation-delay: -10s; }
.orb-3 { width: 200px; height: 200px; background: rgba(245,158,11,0.04); top: 50%; left: 50%; animation-delay: -5s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Header */
.main-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo-group { display: flex; align-items: center; gap: 14px; }
.logo-icon {
    width: 46px; height: 46px; border-radius: 14px;
    background: var(--gradient-1); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.logo-icon svg { width: 24px; height: 24px; color: white; }
.logo-text h1 { font-size: 18px; font-weight: 800; background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-text p { font-size: 11px; color: var(--fg-muted); font-weight: 500; letter-spacing: 0.5px; }

/* Tabs */
.nav-tabs { display: flex; gap: 4px; background: rgba(241,245,249,0.9); padding: 4px; border-radius: 14px; border: 1px solid var(--border); }
.tab-btn {
    padding: 10px 22px; font-weight: 600; font-size: 13px; color: var(--fg-muted);
    background: transparent; border: none; border-radius: 10px; cursor: pointer;
    font-family: inherit; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--fg); background: rgba(37,99,235,0.06); }
.tab-btn.active { color: white; background: var(--gradient-1); box-shadow: 0 4px 15px var(--accent-glow); }
.tab-btn svg { width: 16px; height: 16px; }

/* Main */
.main-content { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }

/* Glass Card */
.glass-card {
    background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.glass-card-elevated { box-shadow: 0 8px 40px rgba(0,0,0,0.08); }

/* Form Card Top Bar */
.form-card { position: relative; overflow: hidden; }
.form-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-1); }

/* Section Header */
.section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.section-icon {
    width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    background: var(--gradient-1); box-shadow: 0 4px 20px var(--accent-glow);
}
.section-icon svg { width: 24px; height: 24px; color: white; }
.section-title { font-size: 22px; font-weight: 800; color: var(--fg); }
.section-subtitle { font-size: 13px; color: var(--fg-muted); margin-top: 2px; }

/* Form */
.form-grid { display: grid; gap: 20px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.input-group { position: relative; }
.input-label { display: block; font-size: 12px; font-weight: 700; color: var(--fg-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.input-required { color: var(--error); margin-left: 2px; }

.input-field {
    width: 100%; background: var(--input-bg); border: 2px solid var(--border);
    border-radius: 12px; padding: 14px 16px; font-family: inherit; font-size: 14px;
    color: var(--fg); transition: all 0.3s ease;
}
.input-field:hover { border-color: rgba(37,99,235,0.3); background: var(--input-bg-hover); }
.input-field:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-glow); }
.input-field::placeholder { color: var(--fg-dim); }
select.input-field {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 44px;
}

/* Separator */
.form-separator { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: inherit; font-weight: 700; font-size: 14px; border-radius: 12px;
    cursor: pointer; transition: all 0.3s ease; border: none; text-decoration: none;
}
.btn-primary {
    background: var(--gradient-1); color: white; padding: 14px 28px;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: #fff; color: var(--fg-muted); padding: 14px 24px; border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(37,99,235,0.04); }

.btn-danger { background: rgba(220,38,38,0.08); color: var(--error); padding: 10px 18px; border: 1px solid rgba(220,38,38,0.15); }
.btn-danger:hover { background: var(--error); color: white; }

.btn-gold { background: var(--gradient-gold); color: #fff; padding: 14px 28px; box-shadow: 0 4px 20px rgba(245,158,11,0.25); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(245,158,11,0.35); }

.btn-icon {
    width: 38px; height: 38px; padding: 0; background: #fff;
    border: 1px solid var(--border); color: var(--fg-muted); border-radius: 10px;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

.btn-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 28px; border-top: 1px solid var(--border); }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-glass); backdrop-filter: blur(20px); border: 1px solid var(--border);
    border-radius: 16px; padding: 24px; text-align: center; transition: all 0.3s ease;
    position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-1); }
.stat-card:nth-child(2)::before { background: var(--gradient-gold); }
.stat-card:nth-child(3)::before { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.stat-card:nth-child(4)::before { background: linear-gradient(135deg, #db2777, #e11d48); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.1); }
.stat-number {
    font-family: 'JetBrains Mono', monospace; font-size: 36px; font-weight: 700;
    background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-card:nth-child(2) .stat-number { background: var(--gradient-gold); -webkit-background-clip: text; background-clip: text; }
.stat-card:nth-child(3) .stat-number { background: linear-gradient(135deg, #2563eb, #06b6d4); -webkit-background-clip: text; background-clip: text; }
.stat-card:nth-child(4) .stat-number { background: linear-gradient(135deg, #db2777, #e11d48); -webkit-background-clip: text; background-clip: text; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 8px; }

/* Table */
.table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; }
.data-table th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9); padding: 14px 16px; text-align: left;
    font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--fg); border-bottom: 2px solid var(--border);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr { transition: background 0.2s ease; }
.data-table tbody tr:hover { background: rgba(37,99,235,0.04); }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-male { background: rgba(37,99,235,0.1); color: #2563eb; }
.badge-female { background: rgba(219,39,119,0.1); color: #db2777; }

/* Search */
.search-wrapper { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fg-dim); width: 18px; height: 18px; }
.search-input {
    width: 100%; max-width: 280px; padding: 11px 16px 11px 42px;
    border: 1px solid var(--border); border-radius: 12px; font-family: inherit; font-size: 13px;
    background: #fff; color: var(--fg); transition: all 0.3s ease;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

/* Mobile Cards */
.mobile-card {
    background: var(--bg-glass); border: 1px solid var(--border); border-radius: 14px;
    padding: 20px; margin-bottom: 12px;
}
.mobile-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light); }
.mobile-card-row { display: flex; justify-content: space-between; padding: 6px 0; }
.mobile-card-label { font-size: 11px; font-weight: 700; color: var(--fg-dim); text-transform: uppercase; }
.mobile-card-value { font-weight: 600; font-size: 13px; color: var(--fg); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-content {
    background: #fff; border: 1px solid var(--border); border-radius: 20px;
    max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15); animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9); border-radius: 20px 20px 0 0;
}
.modal-body { padding: 24px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.detail-label { font-size: 12px; font-weight: 600; color: var(--fg-dim); }
.detail-value { font-weight: 600; font-size: 13px; color: var(--fg); text-align: right; max-width: 60%; }

/* Toast */
.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 1000;
    transform: translateY(120px); opacity: 0; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-container.show { transform: translateY(0); opacity: 1; }
.toast-box {
    background: #fff; border: 1px solid var(--accent); border-radius: 14px;
    padding: 16px 24px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 10px 40px rgba(37,99,235,0.15);
}
.toast-box.error { border-color: var(--error); }
.toast-box.error .toast-icon { color: var(--error); }
.toast-icon { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.toast-msg { font-weight: 600; font-size: 14px; color: var(--fg); }

/* Password */
.pw-wrapper { position: relative; }
.pw-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--fg-dim); cursor: pointer; padding: 4px; }
.pw-toggle:hover { color: var(--accent); }

/* Login Card */
.login-card { max-width: 420px; margin: 60px auto; }
.login-icon {
    width: 80px; height: 80px; border-radius: 24px; background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 24px;
    box-shadow: 0 8px 30px var(--accent-glow);
}
.login-icon svg { width: 40px; height: 40px; color: white; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 24px; color: var(--fg-dim); }
.empty-icon { width: 80px; height: 80px; margin: 0 auto 20px; color: var(--fg-dim); opacity: 0.5; }

/* Loading Spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px 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); } }

/* Animations */
.fade-up { animation: fadeUp 0.5s ease forwards; opacity: 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.stagger-1 { animation-delay: 0.1s; } .stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; } .stagger-4 { animation-delay: 0.4s; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Hidden */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .header-inner { height: 64px; }
    .logo-text h1 { font-size: 15px; }
    .nav-tabs { gap: 2px; padding: 3px; }
    .tab-btn { padding: 8px 14px; font-size: 12px; }
    .tab-btn span.tab-text { display: none; }
    .main-content { padding: 20px 16px 40px; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-number { font-size: 28px; }
    .btn-actions { flex-direction: column; }
    .btn-actions .btn { width: 100%; }
    .search-input { max-width: 100%; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .logo-text p { display: none; }
}
