/* Dispatchy – Main Stylesheet */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d23;
    --brand-primary: #4f46e5;
    --brand-hover: #4338ca;
}

/* ── Layout ─────────────────────────────────────────────── */
body {
    min-height: 100vh;
    background: #f4f6fb;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg) !important;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.25s ease;
    z-index: 1000;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .dropdown span,
.sidebar.collapsed .fs-5.fw-bold,
.sidebar.collapsed hr + ul + hr + .dropdown > a > span {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.6rem;
}

.main-content {
    min-height: 100vh;
    width: 0; /* flex-grow overrides */
    overflow-x: hidden;
}

/* ── Sidebar Nav Pills ──────────────────────────────────── */
.sidebar .nav-link {
    color: #adb5bd;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--brand-primary);
    color: #fff !important;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-weight: 600;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card {
    border-radius: 16px;
    padding: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.25;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.bg-brand  { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.bg-teal   { background: linear-gradient(135deg, #0d9488, #059669); }
.bg-orange { background: linear-gradient(135deg, #f97316, #ef4444); }
.bg-blue   { background: linear-gradient(135deg, #3b82f6, #0ea5e9); }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

/* ── Tables ─────────────────────────────────────────────── */
.table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    background: #f9fafb;
}

.table td {
    vertical-align: middle;
}

/* ── Badge overrides ────────────────────────────────────── */
.badge-status-subscribed   { background: #d1fae5; color: #065f46; }
.badge-status-unsubscribed { background: #fee2e2; color: #991b1b; }
.badge-status-bounced      { background: #fef3c7; color: #92400e; }
.badge-status-draft        { background: #e5e7eb; color: #374151; }
.badge-status-sent         { background: #dbeafe; color: #1e40af; }
.badge-status-sending      { background: #fde68a; color: #78350f; }

/* ── Code Editor Area ────────────────────────────────────── */
#html_content {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    min-height: 350px;
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 8px;
    border: 1px solid #313244;
    resize: vertical;
}

/* ── Progress Bars ───────────────────────────────────────── */
.progress {
    height: 8px;
    border-radius: 99px;
    background: #e5e7eb;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main-content {
        width: 100% !important;
    }
}

/* ── Animations ──────────────────────────────────────────── */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* ── Login Page ──────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1d23 0%, #2d3048 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 20px !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35) !important;
}
