/* ============================================
   SET Ministry Donor Finder CRM
   Professional SaaS Design System
   ============================================ */

:root {
    --primary: #1a5e2a;
    --primary-hover: #156d2a;
    --primary-light: #e8f5e9;
    --primary-dark: #0d3518;
    --gold: #b8960c;
    --gold-light: #fef3c7;
    --accent: #2563eb;
    --accent-light: #eff6ff;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --info: #0891b2;
    --info-light: #ecfeff;
    --pink: #db2777;
    --pink-light: #fdf2f8;
    --teal: #0d9488;
    --teal-light: #f0fdfa;

    --gray-25: #fcfcfd;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-150: #eef0f2;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --white: #ffffff;
    --sidebar-w: 250px;
    --topbar-h: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 150ms;
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.6;
    font-size: 13.5px;
    overflow-x: hidden;
}

/* ============ LAYOUT ============ */

.app { display: flex; min-height: 100vh; }

/* ============ SIDEBAR ============ */

.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--gray-150);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.25s var(--ease);
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(26,94,42,0.15);
}

.logo-text {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 400;
    margin-top: -2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all var(--duration) var(--ease);
    margin-bottom: 2px;
    position: relative;
}

.nav-link:hover {
    background: var(--gray-50);
    color: var(--gray-700);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-link i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.nav-link.active i { opacity: 1; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
}

.ministry-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--duration);
}

.ministry-link:hover { opacity: 0.8; }
.ministry-link i { font-size: 11px; }

.ministry-location {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ============ MAIN ============ */

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============ TOPBAR ============ */

.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-150);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.95);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px;
}

.topbar h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.topbar-sub {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: -2px;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.search-wrap {
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    gap: 8px;
    transition: all var(--duration) var(--ease);
}

.search-wrap:focus-within {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26,94,42,0.1);
}

.search-wrap i { color: var(--gray-400); font-size: 14px; }

.search-wrap input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--gray-700);
    width: 220px;
}

.search-wrap input::placeholder { color: var(--gray-400); }

/* ============ CONTENT ============ */

.content {
    padding: 24px 28px;
    flex: 1;
    max-width: 1400px;
}

.page { display: none; }
.page.active { display: block; }

/* ============ WELCOME ============ */

.welcome {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 32px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--white);
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-text h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.welcome-text p { opacity: 0.85; font-size: 14px; margin-bottom: 18px; }

.welcome-btns { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }

.welcome-art {
    font-size: 90px;
    opacity: 0.1;
    position: relative;
}

/* ============ BUTTONS ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: var(--shadow-sm); }

.btn-outline {
    background: var(--white);
    color: var(--gray-600);
    border-color: var(--gray-200);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-ghost { background: none; color: var(--gray-500); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-700); }

.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-lg { padding: 11px 24px; font-size: 14px; }

/* ============ STATS ============ */

.stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-150);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
    transform: translateY(-1px);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.green { background: var(--primary-light); color: var(--primary); }
.stat-icon.blue { background: var(--accent-light); color: var(--accent); }
.stat-icon.gold { background: var(--gold-light); color: var(--gold); }
.stat-icon.pink { background: var(--pink-light); color: var(--pink); }
.stat-icon.teal { background: var(--teal-light); color: var(--teal); }
.stat-icon.green-dark { background: var(--success-light); color: var(--success); }

.stat-body strong {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-body span {
    font-size: 11.5px;
    color: var(--gray-400);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ============ CARDS ============ */

.card {
    background: var(--white);
    border: 1px solid var(--gray-150);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--duration) var(--ease);
}

.card:hover { box-shadow: var(--shadow-sm); }

.card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-25);
}

.card-head h3 {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
}

.card-head h3 i { color: var(--primary); font-size: 16px; }

.card-body { padding: 20px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-center { display: flex; justify-content: center; align-items: center; min-height: 240px; }

/* ============ PIPELINE ============ */

.pipeline { margin-bottom: 16px; }

.pipe-stage {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.pipe-bar {
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    min-width: 110px;
    transition: width 0.6s var(--ease);
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0.2px;
}

.pipe-bar-done { background: var(--gold); color: var(--gray-800); }

.pipe-count {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-700);
    min-width: 28px;
}

.conversion-rate {
    background: var(--gray-50);
    border: 1px solid var(--gray-150);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    margin-top: 12px;
}

.conv-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.conv-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -1px;
}

.conv-sub { font-size: 11px; color: var(--gray-400); }

/* ============ TABLE ============ */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-25);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    vertical-align: middle;
}

.table tbody tr { transition: background var(--duration) var(--ease); }
.table tbody tr:hover td { background: var(--gray-25); }
.table tbody tr:last-child td { border-bottom: none; }

.th-check { width: 44px; }

.donor-name { font-weight: 600; color: var(--gray-800); }
.donor-email { color: var(--gray-400); font-size: 12px; }

.table-footer {
    padding: 12px 16px;
    font-size: 12px;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-25);
}

/* ============ TAGS / BADGES ============ */

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.tag.status-new { background: var(--accent-light); color: var(--accent); }
.tag.status-contacted { background: var(--gold-light); color: var(--gold); }
.tag.status-responded { background: var(--success-light); color: var(--success); }
.tag.status-donated { background: var(--pink-light); color: var(--pink); }
.tag.status-inactive { background: var(--gray-100); color: var(--gray-400); }

.tag-default { background: var(--primary-light); color: var(--primary); }

/* ============ TOOLBAR ============ */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    gap: 8px;
    transition: all var(--duration) var(--ease);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,94,42,0.1);
}

.search-box i { color: var(--gray-400); font-size: 14px; }

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    width: 280px;
    color: var(--gray-700);
}

.select-input {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    background: var(--white);
    color: var(--gray-600);
    outline: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.select-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,94,42,0.1); }

/* ============ BULK BAR ============ */

.bulk-bar {
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    animation: slideDown 0.2s var(--ease);
}

.bulk-bar .btn { color: var(--white); border-color: rgba(255,255,255,0.25); }
.bulk-bar .btn-outline { background: rgba(255,255,255,0.12); }
.bulk-bar .btn-danger { background: var(--danger); }

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

/* ============ EMPTY STATE ============ */

.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}

.empty i { font-size: 44px; margin-bottom: 12px; display: block; opacity: 0.4; }
.empty p { font-size: 14px; margin-bottom: 14px; font-weight: 500; }

/* ============ ACTIONS GRID ============ */

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.actions-grid-wide { grid-template-columns: repeat(4, 1fr); }

.action-card {
    background: var(--gray-25);
    border: 1px solid var(--gray-150);
    border-radius: var(--radius-sm);
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: inherit;
}

.action-card:hover {
    background: var(--primary-light);
    border-color: rgba(26,94,42,0.2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.action-card:active { transform: translateY(0); }

.action-card i {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
    opacity: 0.7;
}

.action-card:hover i { opacity: 1; }

.action-card strong {
    display: block;
    font-size: 12.5px;
    color: var(--gray-700);
    margin-bottom: 2px;
    font-weight: 600;
}

.action-card small { font-size: 11px; color: var(--gray-400); }

/* ============ COMPOSE ============ */

.compose-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.compose-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.compose-tab:hover { color: var(--gray-700); }

.compose-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.compose-form .form-group { margin-bottom: 12px; }
.compose-form textarea { resize: vertical; min-height: 80px; }

/* ============ WIZARD ============ */

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}

.w-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 500;
}

.w-step.active { color: var(--primary); }

.w-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gray-150);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all var(--duration) var(--ease);
}

.w-step.active .w-num { background: var(--primary); color: var(--white); }
.w-step.done .w-num { background: var(--success); color: var(--white); }
.w-step.done { color: var(--success); }

.w-line { width: 60px; height: 2px; background: var(--gray-200); margin: 0 16px; }

.w-panel { display: none; }
.w-panel.active { display: block; animation: fadeIn 0.2s var(--ease); }

/* ============ TEMPLATES ============ */

.template-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.template-card {
    border: 2px solid var(--gray-150);
    border-radius: var(--radius);
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    background: var(--white);
}

.template-card:hover { border-color: var(--primary); background: var(--primary-light); }

.template-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26,94,42,0.12);
}

.template-card i { font-size: 30px; color: var(--primary); margin-bottom: 10px; display: block; opacity: 0.7; }
.template-card.selected i { opacity: 1; }

.template-card h4 { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.template-card p { font-size: 11px; color: var(--gray-400); line-height: 1.4; }

/* ============ RECIPIENTS ============ */

.recipient-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.recipient-row input[type="checkbox"] { accent-color: var(--primary); }
.recipient-name { font-weight: 600; min-width: 160px; }
.recipient-email { color: var(--gray-400); flex: 1; }
.recipient-status { font-size: 12px; }

/* ============ SUMMARY ============ */

.summary-box {
    background: var(--gray-25);
    border: 1px solid var(--gray-150);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.sum-row:last-child { border-bottom: none; }
.sum-row span { color: var(--gray-400); }

/* ============ NEWSLETTERS ============ */

.nl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.nl-card {
    background: var(--white);
    border: 1px solid var(--gray-150);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--duration) var(--ease);
}

.nl-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.nl-card-head {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.nl-card-head h4 { font-size: 14px; font-weight: 600; }
.nl-card-head small { opacity: 0.8; font-size: 11px; }
.nl-card-body p { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; }
.nl-card-actions { display: flex; gap: 8px; }

/* ============ SETTINGS ============ */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--gray-700);
    outline: none;
    transition: all var(--duration) var(--ease);
    background: var(--white);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,94,42,0.1);
}

.form-group input::placeholder, .form-group textarea::placeholder { color: var(--gray-300); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.mt-3 { margin-top: 16px; }
.muted { color: var(--gray-400); font-size: 13px; }

.check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.check-label input { accent-color: var(--primary); }

/* ============ PROGRESS ============ */

.progress-bar-wrap {
    background: var(--gray-150);
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s var(--ease);
    width: 0%;
}

/* ============ LOG BOX ============ */

.log-box {
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-50);
    border: 1px solid var(--gray-150);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    line-height: 1.6;
}

.log-box p { margin-bottom: 2px; }

/* ============ DROP ZONE ============ */

.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 44px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone i { font-size: 40px; color: var(--gray-300); margin-bottom: 10px; display: block; }
.drop-zone p { color: var(--gray-400); font-size: 13px; }

/* ============ MODAL ============ */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s var(--ease);
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.2s var(--ease);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-150);
}

.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); }

.modal-body { padding: 22px; }

.modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--gray-150);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--gray-25);
}

/* ============ SLIDE PANEL ============ */

.panel-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    z-index: 150;
}

.slide-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 440px;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    z-index: 160;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.25s var(--ease);
}

@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-150);
}

.panel-header h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.panel-body { flex: 1; overflow-y: auto; padding: 22px; }

.detail-field { margin-bottom: 18px; }

.detail-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.detail-value { font-size: 14px; color: var(--gray-700); }

.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.note-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.note-item small { color: var(--gray-400); display: block; margin-top: 4px; font-size: 11px; }

.note-add { display: flex; gap: 8px; margin-top: 12px; }

.note-add input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    transition: border-color var(--duration);
}

.note-add input:focus { border-color: var(--primary); }

/* ============ TOAST ============ */

.toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--gray-800);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.25s var(--ease);
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

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

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ============ COMMAND PALETTE ============ */

.cmd-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 250;
    display: flex;
    justify-content: center;
    padding-top: 18vh;
    animation: fadeIn 0.1s var(--ease);
}

.cmd-box {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: scaleIn 0.15s var(--ease);
}

.cmd-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-150);
}

.cmd-input-wrap i { color: var(--gray-400); }

.cmd-input-wrap input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    flex: 1;
    color: var(--gray-700);
}

.cmd-list { max-height: 320px; overflow-y: auto; padding: 6px; }

.cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.cmd-item:hover { background: var(--primary-light); color: var(--primary); }
.cmd-item i { font-size: 15px; width: 20px; text-align: center; }

/* ============ BAR LIST ============ */

.bar-list { margin-top: 8px; }

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.bar-label {
    font-size: 12px;
    color: var(--gray-600);
    min-width: 90px;
    text-align: right;
    font-weight: 500;
}

.bar-track {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.6s var(--ease);
}

.bar-count { font-size: 12px; color: var(--gray-400); min-width: 28px; font-weight: 600; }

/* ============ UTILITIES ============ */

.hidden { display: none !important; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ============ RESPONSIVE ============ */

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

@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: 90;
    }

    .sidebar-overlay.hidden { pointer-events: none; }

    .main { margin-left: 0; }
    .menu-btn { display: block; }
    .content { padding: 16px; }
    .stats { grid-template-columns: 1fr 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left, .toolbar-right { flex-wrap: wrap; }
    .search-box input { width: 100%; }
    .template-grid { grid-template-columns: 1fr 1fr; }
    .welcome { flex-direction: column; text-align: center; }
    .welcome-btns { justify-content: center; }
    .welcome-art { display: none; }
    .slide-panel { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: 1fr; }
    .actions-grid, .actions-grid-wide { grid-template-columns: 1fr; }
}

/* ============ SCROLLBAR ============ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

/* ============ DISCOVER TABS ============ */

.discover-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
}

.discover-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-400);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.discover-tab:hover {
    color: var(--gray-600);
}

.discover-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.discover-tab i { font-size: 16px; }

/* ============ STATE GRID ============ */

.state-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
    padding: 4px 0;
}

.state-grid .check-label {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.state-grid .check-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.state-grid .check-label:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}

/* ============ RESULTS GRID ============ */

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.result-church-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s;
}

.result-church-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(26,94,42,0.08);
}

.result-church-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
    line-height: 1.3;
}

.result-church-card .church-meta {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.result-church-card .church-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-church-card .church-meta i {
    color: var(--gray-400);
}

.result-church-card .church-contact {
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-church-card .church-contact a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.result-church-card .church-contact a:hover {
    text-decoration: underline;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
