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

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

:root {
    --bg: #08080d;
    --bg-card: #111118;
    --bg-elevated: #181820;
    --bg-input: #0e0e15;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --accent: #4085f2;
    --accent-dim: #2d5fb8;
    --accent-glow: rgba(64,133,242,0.15);
    --green: #34d058;
    --green-bg: rgba(52,208,88,0.12);
    --red: #f85149;
    --red-bg: rgba(248,81,73,0.12);
    --yellow: #e3b341;
    --yellow-bg: rgba(227,179,65,0.12);
    --white: #e6e8ed;
    --gray1: #9da2ad;
    --gray2: #5c6170;
    --gray3: #363944;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #5a9df8; }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius); font-weight: 600;
    font-size: 14px; border: none; cursor: pointer; transition: all 0.25s;
    text-decoration: none; white-space: nowrap;
}
.btn-primary {
    background: var(--accent); color: #fff;
    box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover { background: #5093f6; transform: translateY(-1px); box-shadow: 0 0 30px var(--accent-glow); }
.btn-secondary {
    background: transparent; color: var(--white);
    border: 1px solid var(--border-hover);
}
.btn-secondary:hover { border-color: var(--gray2); background: rgba(255,255,255,0.03); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248,81,73,0.2); }
.btn-danger:hover { background: rgba(248,81,73,0.2); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: var(--bg-elevated); color: var(--gray1); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--white); border-color: var(--border-hover); }

/* ==================== INPUTS ==================== */
.input, select {
    width: 100%; padding: 12px 16px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--white); font-size: 14px; font-family: inherit;
    transition: all 0.2s; outline: none;
}
.input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--gray2); }
select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6170' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 36px;
}
select option { background: var(--bg-card); color: var(--white); }
label { display: block; font-size: 13px; color: var(--gray1); margin-bottom: 6px; font-weight: 500; }

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
}
.card-hover { transition: all 0.3s; }
.card-hover:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }

/* ==================== TABLES ==================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 14px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--gray2); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }
.mono { font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 13px; }

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-gray { background: rgba(255,255,255,0.06); color: var(--gray1); }

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
    animation: fadeIn 0.2s;
}
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 32px; width: 100%; max-width: 480px; animation: slideUp 0.3s; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h2 { font-size: 20px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--gray2); font-size: 28px; cursor: pointer;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: all 0.2s; }
.modal-close:hover { color: var(--white); background: rgba(255,255,255,0.06); }

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

/* ==================== LAYOUT ==================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .hide-mobile { display: none; }
}

/* ==================== LANDING PAGE ==================== */
.hero { padding: 100px 0 60px; text-align: center; }
.hero h1 { font-size: 56px; font-weight: 900; line-height: 1.1; margin-bottom: 20px; letter-spacing: -0.02em; }
.hero .gradient-text {
    background: linear-gradient(135deg, var(--accent), #a855f7);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 18px; color: var(--gray1); max-width: 540px; margin: 0 auto 40px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px; border-radius: 100px; font-size: 13px; font-weight: 500;
    background: rgba(52,208,88,0.08); border: 1px solid rgba(52,208,88,0.2);
    color: var(--green); margin-bottom: 32px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.stats { display: flex; justify-content: center; gap: 80px; padding: 60px 0; }
.stat-value { font-size: 48px; font-weight: 900;
    background: linear-gradient(180deg, #fff, var(--gray2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 13px; color: var(--gray2); margin-top: 4px; }

.section { padding: 80px 0; }
.section-title { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.section-sub { font-size: 16px; color: var(--gray1); margin-bottom: 48px; }

.feature-card { padding: 32px; }
.feature-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-glow), rgba(168,85,247,0.08));
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    margin-bottom: 20px;
}
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--gray1); font-size: 14px; line-height: 1.7; }

.product-card {
    background: linear-gradient(135deg, rgba(64,133,242,0.06), rgba(168,85,247,0.03));
    border: 1px solid rgba(64,133,242,0.15); border-radius: var(--radius-xl);
    padding: 40px; transition: all 0.3s;
}
.product-card:hover { border-color: rgba(64,133,242,0.35); transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(64,133,242,0.08); }
.product-card h3 { font-size: 28px; font-weight: 800; margin-bottom: 10px; }
.product-card p { color: var(--gray1); margin-bottom: 24px; line-height: 1.7; }
.product-features { list-style: none; margin-bottom: 32px; }
.product-features li { display: flex; align-items: center; gap: 12px; padding: 6px 0; color: var(--gray1); font-size: 14px; }
.product-features .check {
    width: 20px; height: 20px; border-radius: 50%; background: var(--green-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--green); flex-shrink: 0;
}

.footer { padding: 40px 0; border-top: 1px solid var(--border); text-align: center; color: var(--gray2); font-size: 13px; }
.footer a { color: var(--gray1); }

/* ==================== NAV ==================== */
.nav { padding: 16px 0; border-bottom: 1px solid var(--border); position: sticky; top: 0;
    background: rgba(8,8,13,0.85); backdrop-filter: blur(12px); z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-size: 20px; font-weight: 800; color: var(--white);
    display: flex; align-items: center; gap: 10px; }
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { padding: 8px 16px; border-radius: 8px; color: var(--gray1); font-size: 14px;
    font-weight: 500; transition: all 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--white); background: rgba(255,255,255,0.04); }

/* ==================== ADMIN PANEL ==================== */
.panel-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--bg-card); border-right: 1px solid var(--border);
    padding: 24px 16px; display: flex; flex-direction: column; position: fixed;
    top: 0; bottom: 0; left: 0; }
.sidebar-brand { font-size: 18px; font-weight: 800; padding: 0 8px 24px; border-bottom: 1px solid var(--border);
    margin-bottom: 24px; color: var(--white); }
.sidebar-brand span { color: var(--accent); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 10px; color: var(--gray1); font-size: 14px; font-weight: 500;
    transition: all 0.2s; text-decoration: none; }
.sidebar-link:hover { color: var(--white); background: rgba(255,255,255,0.04); }
.sidebar-link.active { color: var(--white); background: var(--accent-glow); }
.sidebar-link .icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); }

.panel-content { margin-left: 240px; padding: 32px; flex: 1; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.panel-header h1 { font-size: 24px; font-weight: 700; }

.stat-card { padding: 24px; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.stat-card .stat-number { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.stat-card .stat-desc { font-size: 13px; color: var(--gray2); }

/* ==================== LOGIN PAGE ==================== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-box { width: 100%; max-width: 400px; }
.login-box h1 { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.login-box .sub { text-align: center; color: var(--gray1); margin-bottom: 32px; font-size: 14px; }
.login-box .form-group { margin-bottom: 16px; }
.login-box .error { background: var(--red-bg); border: 1px solid rgba(248,81,73,0.2); color: var(--red);
    padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ==================== ALERT ==================== */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-success { background: var(--green-bg); border: 1px solid rgba(52,208,88,0.2); color: var(--green); }
.alert-error { background: var(--red-bg); border: 1px solid rgba(248,81,73,0.2); color: var(--red); }

/* ==================== GENERATED KEYS ==================== */
.key-item { display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-elevated); padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; }
.key-item code { font-size: 13px; }

/* ==================== SEARCH ==================== */
.search-input { max-width: 280px; }
