/* =============================================
   SYNERGI OUTREACH APP — STYLESHEET
   Brand: #060C3B (Synergi Navy)
   ============================================= */
:root {
    --brand:     #060C3B;
    --brand-mid: #0D1B6B;
    --brand-light:#1a2f8a;
    --blue:      #2563EB;
    --blue-light:#3B82F6;
    --blue-glow: rgba(37,99,235,0.15);
    --green:     #22c55e;
    --amber:     #f59e0b;
    --red:       #ef4444;
    --purple:    #8b5cf6;
    --orange:    #f97316;
    --bg:        #f0f2f8;
    --card:      #ffffff;
    --border:    #e2e8f0;
    --text:      #1e293b;
    --muted:     #64748b;
    --sidebar-w: 230px;
}

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

body {
    font-family: 'Segoe UI', -apple-system, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--brand);
    background-image: linear-gradient(180deg, #060C3B 0%, #0a1650 60%, #060C3B 100%);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
    padding: 20px 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.logo-text-wrap { display: flex; flex-direction: column; }
.logo-text { color: white; font-weight: 800; font-size: 16px; letter-spacing: -0.3px; line-height: 1; }
.logo-sub  { color: rgba(255,255,255,0.4); font-size: 10px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }

.nav-links {
    list-style: none;
    padding: 14px 10px;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.15s;
}

.nav-links li a:hover {
    color: white;
    background: rgba(255,255,255,0.07);
}

.nav-links li.active a {
    color: white;
    background: var(--blue);
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
    font-weight: 600;
}

.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    padding: 8px 18px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand-link {
    color: rgba(255,255,255,0.25);
    font-size: 10px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.15s;
}
.sidebar-brand-link:hover { color: rgba(255,255,255,0.5); }

.sidebar-user {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px; height: 32px;
    background: var(--blue);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { color: white; font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,0.4); font-size: 10px; display: block; text-transform: capitalize; }

.logout-btn { color: rgba(255,255,255,0.3); font-size: 17px; text-decoration: none; transition: color 0.15s; flex-shrink: 0; }
.logout-btn:hover { color: var(--red); }

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 28px 32px;
    max-width: calc(100vw - var(--sidebar-w));
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 { font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: -0.3px; }
.page-header p  { color: var(--muted); font-size: 13px; margin-top: 3px; }
.header-actions { display: flex; gap: 10px; }

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(6,12,59,0.05);
}

.card h2 { font-size: 15px; font-weight: 700; color: var(--brand); margin-bottom: 16px; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h2 { margin-bottom: 0; }
.card-link { font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 500; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    position: relative;
    box-shadow: 0 1px 4px rgba(6,12,59,0.05);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(6,12,59,0.1); }

.stat-card.stat-blue   { border-top: 3px solid var(--blue); }
.stat-card.stat-amber  { border-top: 3px solid var(--amber); }
.stat-card.stat-green  { border-top: 3px solid var(--green); }
.stat-card.stat-purple { border-top: 3px solid var(--purple); }
.stat-card.stat-orange { border-top: 3px solid var(--orange); }

.stat-icon  { font-size: 22px; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--brand); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 5px; font-weight: 500; }
.stat-cta   { display: block; margin-top: 8px; font-size: 11px; color: var(--blue); text-decoration: none; font-weight: 600; }

/* ── Two Column ── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary  { background: linear-gradient(135deg, var(--blue), #1d4ed8); color: white; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.4); }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: #cbd5e1; }
.btn-ghost    { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn-full     { width: 100%; justify-content: center; }
.btn-sm       { padding: 5px 12px; font-size: 12px; }

/* ── Forms ── */
.form-group   { margin-bottom: 16px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    font-family: inherit;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow);
}
textarea { resize: vertical; }
.input-disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid var(--border);
    background: #fafbfc;
}
.data-table th:first-child { border-radius: 8px 0 0 0; }
.data-table th:last-child  { border-radius: 0 8px 0 0; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8faff; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-new_prospect  { background: #eff6ff; color: #1d4ed8; }
.badge-email_drafted { background: #fef9c3; color: #854d0e; }
.badge-email_sent    { background: #fff7ed; color: #c2410c; }
.badge-replied       { background: #f0fdf4; color: #15803d; }
.badge-closed_won    { background: #f0fdf4; color: #15803d; }
.badge-closed_lost   { background: #fef2f2; color: #b91c1c; }
.badge-draft         { background: #fef9c3; color: #854d0e; }
.badge-approved      { background: #eff6ff; color: #1d4ed8; }
.badge-sent          { background: #f0fdf4; color: #15803d; }
.badge-admin         { background: #f5f3ff; color: #6d28d9; }
.badge-user          { background: #f0f9ff; color: #0369a1; }
.badge-active        { background: #f0fdf4; color: #15803d; }
.badge-inactive      { background: #fef2f2; color: #b91c1c; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 13px; font-weight: 500; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Filter tabs ── */
.filter-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; transition: all 0.15s; }
.tab:hover { background: white; color: var(--text); }
.tab.active { background: white; color: var(--brand); font-weight: 700; box-shadow: 0 1px 4px rgba(6,12,59,0.1); border: 1px solid var(--border); }

/* ── Search ── */
.search-form { display: flex; gap: 10px; margin-bottom: 16px; }
.search-form input { max-width: 360px; }

/* ── Activity list ── */
.activity-list { display: flex; flex-direction: column; }
.activity-item { padding: 10px 0; border-bottom: 1px solid #f8fafc; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.activity-item:last-child { border-bottom: none; }
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-detail { display: block; color: var(--muted); font-size: 12px; }
.activity-time { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* ── Draft list ── */
.draft-list { display: flex; flex-direction: column; }
.draft-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f8fafc; }
.draft-item:last-child { border-bottom: none; }
.draft-info strong { display: block; font-size: 13px; }
.draft-info span   { font-size: 12px; color: var(--muted); }

/* ── Action buttons ── */
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── URL links ── */
.url-link { color: var(--blue); text-decoration: none; font-size: 12px; }
.url-link:hover { text-decoration: underline; }

/* ── Text helpers ── */
.text-muted { color: var(--muted); font-size: 12px; }
.empty-state { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }
.empty-state a { color: var(--blue); }

/* ── Draft review ── */
.draft-review-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
@media (max-width: 1000px) { .draft-review-grid { grid-template-columns: 1fr; } }

.email-preview-container { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.preview-subject, .preview-to { padding: 9px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); font-size: 13px; }
.email-iframe { width: 100%; height: 700px; border: none; display: block; }

/* ── Auth page ── */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
    min-height: 100vh;
}

.auth-container { width: 100%; max-width: 420px; padding: 20px; }

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img { width: 56px; height: 56px; border-radius: 12px; margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }
.auth-logo h1 { color: white; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.auth-logo p  { color: rgba(255,255,255,0.5); font-size: 13px; margin-top: 4px; }

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
}
.auth-card h2 { font-size: 20px; font-weight: 800; color: var(--brand); margin-bottom: 24px; }

/* ── Overlay / Audit spinner ── */
.overlay { position: fixed; inset: 0; background: rgba(6,12,59,0.75); display: flex; align-items: center; justify-content: center; z-index: 999; backdrop-filter: blur(2px); }
.overlay.hidden { display: none; }
.overlay-box { background: white; border-radius: 18px; padding: 40px; max-width: 440px; width: 90%; text-align: center; box-shadow: 0 30px 80px rgba(6,12,59,0.3); }
.audit-spinner h3 { margin-bottom: 8px; font-size: 18px; font-weight: 700; color: var(--brand); }
.audit-spinner p  { color: var(--muted); margin-bottom: 24px; font-size: 13px; }

.spinner {
    width: 48px; height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.audit-steps { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.step { padding: 8px 14px; border-radius: 8px; font-size: 13px; color: var(--muted); background: var(--bg); transition: all 0.2s; }
.step.active { color: var(--blue); background: #eff6ff; font-weight: 600; border-left: 3px solid var(--blue); }
.step.done   { color: var(--green); background: #f0fdf4; }
.step.error  { color: var(--red); background: #fef2f2; }

/* ── Prospect form ── */
.prospect-form { max-width: 800px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px; max-width: 100vw; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; gap: 12px; }
}
