/* ═══════════════════════════════════════════════════════════════
   LeadDish — Component Styles
   Layout is handled by Tailwind inline in main.php
═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
    --c-border:   #e2e8f0;
    --c-border2:  #f0f4f8;
    --c-text:     #0f172a;
    --c-muted:    #64748b;
    --c-indigo:   #4f46e5;
    --c-indigo-h: #4338ca;
    --sh-xs: 0 1px 2px rgba(15,23,42,.05);
    --sh-sm: 0 1px 4px rgba(15,23,42,.07);
    --sh-md: 0 4px 14px rgba(15,23,42,.08);
    --sh-lg: 0 10px 28px rgba(15,23,42,.10);
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: var(--sh-xs);
    overflow: hidden;
    min-width: 0;
}
.card-header {
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 800; color: var(--c-text); }

/* ── Stat cards ────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 22px;
}
.stat-card {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 14px; padding: 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--sh-xs); overflow: hidden; min-width: 0;
    transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--sh-sm); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.stat-icon.indigo  { background:#e0e7ff; color:#4f46e5; }
.stat-icon.emerald { background:#dcfce7; color:#16a34a; }
.stat-icon.amber   { background:#fef3c7; color:#d97706; }
.stat-icon.purple  { background:#f3e8ff; color:#9333ea; }
.stat-icon.blue    { background:#e0f2fe; color:#0284c7; }
.stat-info { min-width: 0; }
.stat-value { font-size: 21px; font-weight: 800; color: var(--c-text); line-height: 1.2; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--c-muted); margin-top: 2px; }

/* ── Tables ────────────────────────────────────────────── */
.table-responsive {
    width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px; text-align: left; white-space: nowrap;
}
.data-table th {
    padding: 11px 16px; background: #f8fafc;
    color: var(--c-muted); font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 1px solid var(--c-border);
}
.data-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--c-border2);
    color: var(--c-text); font-weight: 500;
}
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #f8fafc; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.badge-active   { background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; }
.badge-inactive { background:#f1f5f9; color:#64748b; border:1px solid #e2e8f0; }
.badge-new      { background:#e0f2fe; color:#0284c7; border:1px solid #bae6fd; }
.badge-won      { background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; }
.badge-lost     { background:#fff1f2; color:#e11d48; border:1px solid #fecdd3; }
.user-role-badge { display:inline-block; padding:2px 8px; border-radius:20px; font-size:10px; font-weight:800; text-transform:uppercase; }
.role-superadmin { background:#f3e8ff; color:#9333ea; border:1px solid #e9d5ff; }
.role-staff      { background:#e0e7ff; color:#4f46e5; border:1px solid #c7d2fe; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: 10px;
    font-size: 12.5px; font-weight: 700;
    cursor: pointer; border: none; font-family: var(--font);
    transition: all .15s; text-decoration: none;
    white-space: nowrap; flex-shrink: 0;
}
.btn-primary { background: var(--c-indigo); color: #fff; box-shadow: 0 3px 10px rgba(79,70,229,.3); }
.btn-primary:hover { background: var(--c-indigo-h); color:#fff; }
.btn-secondary { background: #fff; color: var(--c-text); border: 1px solid var(--c-border); }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background:#fff1f2; color:#e11d48; border:1px solid #fecdd3; }
.btn-danger:hover { background:#fecdd3; color:#be123c; }
.btn-sm { padding:5px 12px; font-size:11.5px; border-radius:8px; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
    color: var(--c-text);
}
.form-control {
    width: 100%; padding: 10px 13px;
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 10px; color: var(--c-text);
    font-family: var(--font); font-size: 13px; font-weight: 500;
    outline: none; transition: border-color .15s, box-shadow .15s; max-width: 100%;
}
.form-control:focus { border-color: var(--c-indigo); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Alerts ────────────────────────────────────────────── */
.alert {
    padding: 11px 15px; border-radius: 11px; margin-bottom: 18px;
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 8px; width: 100%;
}
.alert-success { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0; }
.alert-error   { background:#fff1f2; color:#be123c; border:1px solid #fecdd3; }
.alert-info    { background:#eff6ff; color:#1d4ed8; border:1px solid #bfdbfe; }

/* ── Modals ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.4); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
    opacity: 0; visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-container {
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 18px; width: 100%; max-width: 520px;
    max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px;
    box-shadow: var(--sh-lg);
    transform: translateY(8px) scale(.98); transition: transform .2s;
}
.modal-overlay.active .modal-container { transform: translateY(0) scale(1); }
.modal-header {
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:18px; padding-bottom:14px; border-bottom:1px solid var(--c-border2);
}
.modal-title { font-size:15px; font-weight:800; color:var(--c-text); }
.modal-close {
    background:#f1f5f9; border:none; border-radius:8px;
    width:28px; height:28px; color:var(--c-muted); font-size:16px;
    cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.modal-close:hover { background:#e2e8f0; }

/* ── Auth ──────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh; width: 100%;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(79,70,229,.08), transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(124,58,237,.06), transparent 50%),
        #f1f5f9;
}
.auth-card {
    width: 100%; max-width: 400px; padding: 34px;
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 18px; box-shadow: var(--sh-lg);
}
.auth-logo   { text-align:center; margin-bottom:22px; }
.auth-title  { font-size:18px; font-weight:800; color:var(--c-text); margin-top:10px; }
.auth-subtitle { font-size:12.5px; color:var(--c-muted); margin-top:3px; }
.logo-badge {
    width:40px; height:40px; border-radius:11px;
    background: linear-gradient(135deg,#4f46e5,#7c3aed);
    display:flex; align-items:center; justify-content:center;
    font-weight:900; font-size:15px; color:#fff;
    box-shadow: 0 6px 16px rgba(79,70,229,.3); margin:0 auto;
}

/* ── Print ─────────────────────────────────────────────── */
@media print {
    #ld-sidebar, #ld-topbar, .no-print { display: none !important; }
    #ld-main { margin-left: 0 !important; }
    body { background: #fff !important; }
}
