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

:root {
    --sidebar-bg: #0f172a;
    --sidebar-width: 260px;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #eff6ff;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f1f5f9;
    --sidebar-active-bg: rgba(59,130,246,.15);
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); margin: 0; }

/* ─── SIDEBAR ─── */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    z-index: 100; overflow-y: auto;
}
.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo a { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.sidebar-logo .logo-mark {
    width: 36px; height: 36px; background: var(--accent);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 15px;
}
.sidebar-logo .logo-text { color: white; font-weight: 700; font-size: 16px; line-height: 1.2; }
.sidebar-logo .logo-sub { color: var(--sidebar-text); font-size: 11px; font-weight: 400; }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section-title {
    font-size: 10px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: var(--sidebar-text);
    padding: 8px 8px 4px; margin-top: 12px;
}
.nav-item { display: block; text-decoration: none; }
.nav-item a, a.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 8px;
    color: var(--sidebar-text); font-size: 14px; font-weight: 500;
    text-decoration: none; transition: all .15s;
}
.nav-item a:hover, a.nav-item:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255,255,255,.06);
}
.nav-item a.active, a.nav-item.active {
    color: var(--accent);
    background: var(--sidebar-active-bg);
}
.nav-item a svg, a.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 8px;
}
.sidebar-user .avatar {
    width: 34px; height: 34px; background: var(--accent);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { color: white; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { color: var(--sidebar-text); font-size: 11px; }
.sidebar-user .logout-btn {
    color: var(--sidebar-text); text-decoration: none;
    display: flex; align-items: center;
    padding: 4px; border-radius: 4px; transition: color .15s;
}
.sidebar-user .logout-btn:hover { color: var(--danger); }

/* ─── MAIN CONTENT ─── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0;
}
.page-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    display: flex; align-items: center; justify-content: space-between;
}
.page-title { font-size: 20px; font-weight: 700; margin: 0; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

.content-area { padding: 28px 32px; }

/* ─── CARDS ─── */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.stat-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px;
    display: flex; align-items: flex-start; gap: 16px;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue   { background: #eff6ff; color: var(--accent); }
.stat-icon.green  { background: #f0fdf4; color: var(--success); }
.stat-icon.orange { background: #fffbeb; color: var(--warning); }
.stat-icon.red    { background: #fef2f2; color: var(--danger); }
.stat-icon.purple { background: #faf5ff; color: #8b5cf6; }
.stat-icon.teal   { background: #f0fdfa; color: #14b8a6; }

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 22px; font-weight: 700; margin: 4px 0 0; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
table.data-table th {
    background: #f8fafc; color: var(--text-muted);
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    padding: 10px 14px; text-align: left;
    border-bottom: 1px solid var(--border);
}
table.data-table td {
    padding: 12px 14px; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #fafbfc; }

/* ─── STATUS BADGES ─── */
.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-new        { background: #eff6ff; color: #3b82f6; }
.badge-processing { background: #fffbeb; color: #d97706; }
.badge-completed  { background: #f0fdf4; color: #16a34a; }
.badge-rejected   { background: #fef2f2; color: #dc2626; }
.badge-cancelled  { background: #f8fafc; color: #64748b; }
.badge-banned     { background: #1a0a0a; color: #ff4444; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-control, .form-select {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: 'Inter', sans-serif;
    color: var(--text); background: white; transition: border .15s;
    outline: none;
}
.form-control:focus, .form-select:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; font-size: 14px;
    font-weight: 500; text-decoration: none; border: none; cursor: pointer;
    transition: all .15s; font-family: 'Inter', sans-serif;
}
.btn-primary   { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-success   { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; color: white; }
.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover  { background: #dc2626; color: white; }
.btn-outline   { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: #f8fafc; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn svg       { width: 16px; height: 16px; }

/* ─── ALERTS ─── */
.alert {
    padding: 12px 16px; border-radius: 8px;
    font-size: 14px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { 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; }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: .3; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.empty-state p  { font-size: 14px; margin-top: 4px; }

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-box {
    background: white; border-radius: 12px;
    width: 100%; max-width: 520px;
    padding: 28px; position: relative;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.modal-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 4px;
}

/* ─── UTP BANNER ─── */
.utp-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-radius: 12px; padding: 20px 24px;
    color: white; display: flex; align-items: center; gap: 20px;
    margin-bottom: 24px;
}
.utp-banner .utp-icon { font-size: 32px; flex-shrink: 0; }
.utp-banner h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.utp-banner p  { font-size: 13px; opacity: .75; margin: 0; }
.utp-tag {
    background: rgba(59,130,246,.25); color: #93c5fd;
    font-size: 12px; font-weight: 600; padding: 4px 10px;
    border-radius: 20px; display: inline-block; margin-top: 8px;
}

/* ─── FILTER BAR ─── */
.filter-bar {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap;
}
.filter-bar .form-control,
.filter-bar .form-select { width: auto; }

/* ─── PAGINATION (simple) ─── */
.pagination { display: flex; gap: 4px; margin-top: 16px; }
.page-link {
    padding: 6px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 13px; text-decoration: none;
    color: var(--text); background: white;
}
.page-link.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-link:hover:not(.active) { background: #f8fafc; }

/* ─── GRID ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 16px; }

/* ─── CASHBACK FORMULA ─── */
.formula-box {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    border-radius: 10px; padding: 18px 22px; color: white;
    text-align: center;
}
.formula-box .formula-text { font-size: 18px; font-weight: 700; }
.formula-box .formula-sub  { font-size: 12px; opacity: .7; margin-top: 4px; }

/* ─── MOBILE HEADER ─── */
.mobile-header {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; height: 56px;
    background: var(--sidebar-bg);
    align-items: center; justify-content: space-between;
    padding: 0 16px; z-index: 102;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.mobile-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mobile-logo .mark { width: 32px; height: 32px; background: var(--accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 13px; }
.mobile-logo span { color: white; font-weight: 700; font-size: 15px; }
.hamburger {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; gap: 5px; padding: 6px;
}
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: #94a3b8; border-radius: 2px;
    transition: all .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 100;
}
.sidebar-overlay.open { display: block; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        z-index: 101;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding-top: 56px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .page-header { padding: 16px; flex-wrap: wrap; gap: 12px; }
    .page-header .btn { font-size: 13px; padding: 7px 12px; }
    .filter-bar form { width: 100%; }
    .filter-bar .form-control,
    .filter-bar .form-select { width: 100%; }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table.data-table { min-width: 600px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 18px !important; }
    .utp-banner { flex-direction: column; gap: 10px; padding: 16px; }
    .formula-box { padding: 14px 16px; }
    .modal-box { padding: 20px; }
    details summary { font-size: 14px; }
}

/* ─── MISC ─── */
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.fw-600 { font-weight: 600; }
.mb-0   { margin-bottom: 0; }
.gap-8  { display: flex; gap: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
