:root {
    --sidebar-w: 240px;
    --brand: #0b3d91;
}

body { background: #f4f6fa; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--brand), #072a66);
    color: #fff;
    padding: 1.25rem 1rem;
    position: sticky; top: 0; height: 100vh;
    flex-shrink: 0;
}
.sidebar .brand { color: #fff; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.sidebar .brand i { margin-right: .4rem; }
.sidebar .nav-link { color: rgba(255,255,255,.75); border-radius: .5rem; padding: .55rem .75rem; margin-bottom: .15rem; }
.sidebar .nav-link i { margin-right: .5rem; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.18); }
.sidebar .nav-section { color: rgba(255,255,255,.45); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; margin: 1rem .75rem .35rem; }
.sidebar .user-box { border-top: 1px solid rgba(255,255,255,.15); padding-top: 1rem; font-size: .9rem; }
.content { flex: 1; padding: 2rem; min-width: 0; }

@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .content { padding: 1rem; }
}

/* ---------- Cards ---------- */
.card { border: 1px solid #e6e9f0; border-radius: .75rem; }
.card-header { border-bottom: 1px solid #eef0f5; }
.stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: .6rem;
    display: grid; place-items: center; font-size: 1.2rem; margin-bottom: .75rem;
}
.stat-card .stat-label { color: #6c757d; font-size: .85rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }

/* ---------- Bar chart ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 220px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; }
.bar-col:hover .bar { opacity: 1; }
.bar-value { font-size: .65rem; color: #6c757d; margin-bottom: 2px; white-space: nowrap; }
.bar-label { font-size: .7rem; color: #6c757d; margin-top: 4px; }

/* ---------- Auth ---------- */
.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 1rem;
    background: radial-gradient(circle at top, #1a56c4, var(--brand) 45%, #061f4d);
}
.auth-card { width: 100%; max-width: 420px; border: 0; }
.auth-logo {
    width: 56px; height: 56px; margin: 0 auto; border-radius: 1rem;
    background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.6rem;
}
.auth-logo-img { display: block; width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; background: #fff; }

/* ---------- Live indicator ---------- */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #adb5bd; margin-right: 4px; vertical-align: middle; }
.live-dot.on { background: #198754; animation: live-pulse 1.6s infinite; }
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(25,135,84,.5); }
    70% { box-shadow: 0 0 0 7px rgba(25,135,84,0); }
    100% { box-shadow: 0 0 0 0 rgba(25,135,84,0); }
}

/* ---------- Priority picker ---------- */
.priority-option { display: block; padding: .45rem .6rem; border: 1px solid #e6e9f0; border-radius: .5rem; cursor: pointer; }
.priority-option:has(input:checked) { border-color: var(--brand); background: #f1f5ff; }
.priority-urgent:has(input:checked) { border-color: #dc3545; background: #fff1f2; }

.template-picker { background: #f1f5ff; border: 1px dashed #b8c8ee; }
.template-card { overflow: hidden; }
.template-thumb {
    width: 100%; height: 170px; border: 0; border-bottom: 1px solid #eef0f5;
    pointer-events: none; background: #fff;
}

.email-preview { width: 100%; height: 420px; border: 1px solid #e6e9f0; border-radius: .5rem; background: #fff; }
