/* ================================================
   DLS WhatsApp Campaign Manager - Admin CSS
   ================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0a0f1e;
    --sidebar-text: #a8b3cf;
    --sidebar-active: #25d366;
    --sidebar-hover-bg: rgba(255,255,255,0.06);
    --topbar-height: 60px;
    --primary: #25d366;
    --primary-dark: #1da851;
    --secondary: #128C7E;
    --accent: #34b7f1;
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #25d366;
    --body-bg: #f0f2f7;
    --card-bg: #ffffff;
    --text-muted: #6c757d;
    --border: #e2e8f0;
    --shadow: 0 2px 12px rgba(0,0,0,0.07);
    --radius: 12px;
    --font: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--body-bg);
    color: #1a2332;
    font-size: 14px;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: width 0.25s ease, transform 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 20px 20px 16px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    white-space: nowrap;
}

.sidebar-nav {
    padding: 12px 0 24px;
}

.nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    padding: 16px 20px 6px;
    white-space: nowrap;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.18s;
    white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    color: var(--sidebar-active);
    background: rgba(37, 211, 102, 0.1);
    border-right: 3px solid var(--sidebar-active);
}

.sidebar-nav .nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

.top-navbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 999;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.page-content {
    padding: 24px;
}

/* ---- Sidebar collapsed ---- */
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .nav-link span { display: none; }
.sidebar.collapsed + .main-content { margin-left: 60px; }

/* ---- Stats Cards ---- */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.stat-card .stat-change { font-size: 12px; margin-top: 6px; }

/* ---- Cards ---- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ---- Tables ---- */
.table-responsive { border-radius: var(--radius); overflow: hidden; }
.table th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 2px solid var(--border) !important;
    padding: 12px 16px;
    white-space: nowrap;
}
.table td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge { font-weight: 600; padding: 4px 10px; border-radius: 6px; font-size: 11px; }

/* ---- Buttons ---- */
.btn-wa {
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 600;
}
.btn-wa:hover { background: var(--primary-dark); color: #fff; }

/* ---- Forms ---- */
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    padding: 8px 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,211,102,0.15);
    outline: none;
}

/* ---- Page Headers ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 { font-size: 22px; font-weight: 700; margin: 0; }
.page-header p { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

/* ---- Progress bars ---- */
.progress { border-radius: 50px; height: 8px; background: #e9ecef; }
.progress-bar { border-radius: 50px; background: var(--primary); }

/* ---- Status Badges ---- */
.status-queued    { background: #e9ecef; color: #495057; }
.status-sent      { background: #cff4fc; color: #0c5460; }
.status-delivered { background: #d1e7dd; color: #155724; }
.status-read      { background: #d4edda; color: #0f5132; }
.status-failed    { background: #f8d7da; color: #721c24; }
.status-running   { background: #fff3cd; color: #664d03; }
.status-scheduled { background: #cfe2ff; color: #084298; }
.status-draft     { background: #f8f9fa; color: #495057; }
.status-completed { background: #d1e7dd; color: #0f5132; }
.status-paused    { background: #fff3cd; color: #664d03; }
.status-active    { background: #d1e7dd; color: #0f5132; }
.status-inactive  { background: #f8d7da; color: #721c24; }

/* ---- Login Page ---- */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0f1e 0%, #128C7E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 48px; color: var(--primary); }
.login-logo h1 { font-size: 22px; font-weight: 700; margin-top: 8px; }
.login-logo p { color: var(--text-muted); font-size: 13px; }

/* ---- Wizard Steps ---- */
.wizard-step-indicator { display: flex; gap: 0; margin-bottom: 32px; }
.wizard-step {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    position: relative;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.wizard-step::after {
    content: '';
    position: absolute;
    top: 20px; right: -50%;
    width: 100%; height: 2px;
    background: var(--border);
    z-index: 0;
}
.wizard-step:last-child::after { display: none; }
.wizard-step .step-number {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 6px;
    font-size: 13px;
    font-weight: 700;
    position: relative; z-index: 1;
}
.wizard-step.active .step-number { background: var(--primary); color: #fff; }
.wizard-step.done .step-number { background: var(--secondary); color: #fff; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-content { padding: 16px; }
    .stat-card .stat-value { font-size: 22px; }
}

/* ---- Alerts ---- */
.alert { border-radius: 10px; font-size: 13.5px; border: none; }

/* ---- Toasts ---- */
.toast-container { z-index: 9999; }

/* ---- Loading spinner overlay ---- */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 9998;
}

/* ---- Code block (API guide) ---- */
pre.api-code {
    background: #1a2332;
    color: #a8ff78;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 12.5px;
    overflow-x: auto;
    line-height: 1.6;
}
