/* PERWEB Partner Portal - Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-primary: #060b18;
    --bg-secondary: #0a1020;
    --bg-card: #0f1829;
    --bg-card-hover: #141e32;
    --accent: #00d4ff;
    --accent-dim: rgba(0, 212, 255, 0.15);
    --accent-border: rgba(0, 212, 255, 0.3);
    --accent-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --accent2: #ff6b35;
    --accent2-dim: rgba(255, 107, 53, 0.15);
    --text-primary: #f0f4ff;
    --text-secondary: #7a8da8;
    --text-muted: #4a5568;
    --border: rgba(255,255,255,0.06);
    --border-accent: rgba(0, 212, 255, 0.25);
    --success: #10b981;
    --success-dim: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.15);
    --error: #ef4444;
    --error-dim: rgba(239, 68, 68, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-accent: 0 4px 24px rgba(0, 212, 255, 0.15);
    --font: 'Exo 2', sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --sidebar-width: 260px;
    --header-height: 64px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── GRID BACKGROUND ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ─── TYPOGRAPHY ─── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font); font-weight: 700; line-height: 1.2; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { line-height: 1.6; }

/* ─── LAYOUT ─── */
.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ─── SIDEBAR ─── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-mark {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), #0099cc);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 14px; color: #000; flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 800; line-height: 1.2; }
.logo-text span { display: block; font-size: 10px; font-weight: 400; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section { margin-bottom: 24px; }
.nav-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-muted); padding: 0 8px 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: all 0.2s; margin-bottom: 2px; cursor: pointer;
}
.nav-item:hover { background: var(--accent-dim); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--accent-dim); color: var(--accent); border-left: 3px solid var(--accent); }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-badge {
    margin-left: auto; background: var(--accent); color: #000;
    font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-card);
}
.sidebar-user .avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), #0099cc);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #000; flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 11px; color: var(--text-secondary); }
.sidebar-user .logout-btn {
    color: var(--text-muted); font-size: 16px; padding: 4px;
    border: none; background: none; cursor: pointer; transition: color 0.2s;
}
.sidebar-user .logout-btn:hover { color: var(--error); }

/* ─── MAIN CONTENT ─── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 18px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-badge {
    background: var(--accent-dim); border: 1px solid var(--accent-border);
    color: var(--accent); padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600; font-family: var(--mono);
}

.content-area { padding: 28px 24px; flex: 1; }

/* ─── CARDS ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 700; }

/* ─── STATS GRID ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: var(--accent);
}
.stat-card:hover { border-color: var(--accent-border); transform: translateY(-2px); box-shadow: var(--shadow-accent); }
.stat-icon { font-size: 28px; margin-bottom: 12px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--accent); font-family: var(--mono); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    background: var(--bg-secondary); padding: 12px 16px;
    text-align: left; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody td { padding: 12px 16px; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ─── BADGES ─── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-active   { background: var(--success-dim); color: var(--success); }
.badge-pending  { background: var(--warning-dim); color: var(--warning); }
.badge-suspended{ background: var(--error-dim); color: var(--error); }
.badge-paid     { background: var(--success-dim); color: var(--success); }
.badge-unpaid   { background: var(--warning-dim); color: var(--warning); }
.badge-confirmed{ background: var(--accent-dim); color: var(--accent); }
.badge-cpanel   { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge-wordpress{ background: rgba(16,185,129,0.15); color: #34d399; }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 14px; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.2s; white-space: nowrap;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0099cc);
    color: #000;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: var(--accent-glow); color: #000; text-decoration: none; }
.btn-secondary {
    background: transparent; border: 1px solid var(--border-accent);
    color: var(--accent);
}
.btn-secondary:hover { background: var(--accent-dim); text-decoration: none; }
.btn-danger {
    background: var(--error-dim); border: 1px solid rgba(239,68,68,0.3);
    color: var(--error);
}
.btn-danger:hover { background: var(--error); color: #fff; text-decoration: none; }
.btn-success {
    background: var(--success-dim); border: 1px solid rgba(16,185,129,0.3);
    color: var(--success);
}
.btn-success:hover { background: var(--success); color: #fff; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 14px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: var(--font); font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--error); margin-top: 4px; }

/* ─── FLASH MESSAGES ─── */
.flash {
    padding: 12px 18px; border-radius: var(--radius-sm);
    margin-bottom: 20px; font-size: 14px; font-weight: 500;
    animation: slideDown 0.3s ease;
}
.flash-success { background: var(--success-dim); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.flash-error   { background: var(--error-dim); border: 1px solid rgba(239,68,68,0.3); color: var(--error); }
.flash-info    { background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--accent); }
.flash-warning { background: var(--warning-dim); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }

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

/* ─── AUTH PAGES ─── */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px; position: relative; z-index: 1;
}
.auth-glow {
    position: fixed;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,255,0.08) 0%, transparent 70%);
    top: -200px; left: -200px; pointer-events: none;
}
.auth-glow-2 {
    position: fixed;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,107,53,0.06) 0%, transparent 70%);
    bottom: -100px; right: -100px; pointer-events: none;
}
.auth-box {
    width: 100%; max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 16px; padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-logo {
    text-align: center; margin-bottom: 32px;
}
.auth-logo .brand { font-size: 26px; font-weight: 900; color: var(--accent); letter-spacing: -0.5px; }
.auth-logo .sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }

/* ─── PARTNER ID BADGE ─── */
.partner-id-box {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.partner-id-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.partner-id-value { font-size: 22px; font-weight: 800; color: var(--accent); font-family: var(--mono); }

/* ─── PENDING NOTICE ─── */
.pending-notice {
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(255,107,53,0.1));
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius);
    padding: 20px; margin-bottom: 24px;
}
.pending-notice h3 { color: var(--warning); margin-bottom: 8px; }
.pending-notice p { font-size: 14px; color: var(--text-secondary); }

/* ─── COMMISSION BOOST ─── */
.boost-banner {
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(255,107,53,0.1));
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 24px;
    display: flex; align-items: center; gap: 12px;
}
.boost-banner .boost-icon { font-size: 28px; }
.boost-banner .boost-text h4 { font-size: 14px; font-weight: 700; color: var(--accent); }
.boost-banner .boost-text p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ─── MODAL ─── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); z-index: 1000;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card); border: 1px solid var(--border-accent);
    border-radius: 16px; padding: 32px; width: 100%; max-width: 520px;
    animation: scaleIn 0.2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.modal-close:hover { color: var(--text-primary); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

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

/* ─── SEARCH BAR ─── */
.search-bar {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input {
    width: 100%; padding: 9px 14px 9px 36px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: var(--font); font-size: 14px;
}
.search-input:focus { outline: none; border-color: var(--accent); }

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

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .mobile-menu-btn { display: flex !important; }
}

.mobile-menu-btn {
    display: none;
    align-items: center; justify-content: center;
    width: 36px; height: 36px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; font-size: 18px; color: var(--text-primary);
}

/* ─── MISC UTILS ─── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-mono { font-family: var(--mono); }
.small { font-size: 12px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tab {
    padding: 7px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.filter-tab:hover, .filter-tab.active {
    background: var(--accent-dim); border-color: var(--accent-border);
    color: var(--accent);
}

/* Welcome steps */
.steps-list { list-style: none; }
.steps-list li {
    display: flex; gap: 16px; padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.steps-list li:last-child { border-bottom: none; }
.step-num {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-dim); border: 2px solid var(--accent-border);
    color: var(--accent); font-weight: 800; font-size: 13px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-content h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.step-content p { font-size: 13px; color: var(--text-secondary); }
