/* ============================================================
   VAKILIO PANEL DESIGN SYSTEM — iOS 26 LIGHT CRYSTAL
   White UI · Chamber Navy #10233A · Brass Gold #B9912F
   Mobile-first, works on all devices.
   ============================================================ */
:root {
    --navy: #10233A;
    --navy-deep: #0A1728;
    --gold: #B9912F;
    --goldlt: #D8B45C;
    --ivory: #F8F7F3;
    --text: #1E293B;
    --muted: #64748B;
    --green: #059669;
    --red: #DC2626;
    --blue: #2563EB;
    --amber: #B45309;
    --violet: #6D28D9;
    --glass: rgba(255, 255, 255, 0.62);
    --glass-strong: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.85);
    --shadow: 0 14px 34px -16px rgba(16, 35, 58, 0.22), 0 2px 8px rgba(16, 35, 58, 0.05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse 55% 40% at 8% 0%, rgba(216, 180, 92, 0.16), transparent 60%),
        radial-gradient(ellipse 50% 45% at 95% 12%, rgba(16, 35, 58, 0.07), transparent 62%),
        radial-gradient(ellipse 60% 40% at 40% 100%, rgba(216, 180, 92, 0.10), transparent 60%),
        linear-gradient(178deg, #FDFCF9 0%, var(--ivory) 55%, #F4F1E9 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-bottom: 92px;
}
@media (min-width: 1024px) { body { padding-bottom: 36px; } }

.font-display { font-family: 'Playfair Display', Georgia, serif; }
.gold-text { color: var(--gold); }
.muted { color: var(--muted); }

/* ---------- GLASS ---------- */
.glass {
    background: var(--glass);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.95);
}
@supports not (backdrop-filter: blur(1px)) { .glass { background: rgba(255,255,255,0.95); } }

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-weight: 700; font-size: 14px;
    border-radius: 14px; padding: 12px 18px;
    border: none; cursor: pointer; text-decoration: none;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-navy {
    background: linear-gradient(180deg, #1A3556, var(--navy) 60%, var(--navy-deep));
    color: #F8F5EE;
    border: 1px solid var(--navy-deep);
    box-shadow: 0 10px 22px -10px rgba(16, 35, 58, 0.55), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-navy:hover { filter: brightness(1.1); }
.btn-gold {
    background: linear-gradient(180deg, #C89F3C, var(--gold) 55%, #9C7A24);
    color: #FFFDF5;
    border: 1px solid #8A6C1F;
    box-shadow: 0 8px 18px -8px rgba(185, 145, 47, 0.6), inset 0 1px 0 rgba(255,248,224,0.5);
}
.btn-gold:hover { filter: brightness(1.06); }
.btn-glass {
    background: var(--glass-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--navy);
    border: 1px solid var(--glass-border);
    box-shadow: 0 6px 14px -8px rgba(16,35,58,0.2), inset 0 1px 0 rgba(255,255,255,0.95);
}

/* ---------- FORM CONTROLS ---------- */
input, select, textarea {
    font-family: inherit;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(16, 35, 58, 0.14);
    border-radius: 14px;
    color: var(--text);
    font-size: 14px;
    padding: 12px 14px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    background: #FFFFFF;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(185, 145, 47, 0.16);
}
select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px;
}
.field-lbl {
    font-size: 10.5px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--muted); margin-bottom: 6px; display: block;
}

/* ---------- TOPBAR (floating iOS pill) ---------- */
.topbar-wrap { position: sticky; top: 10px; z-index: 40; padding: 0 12px; }
.topbar {
    max-width: 1200px; margin: 0 auto;
    border-radius: 999px;
    padding: 10px 16px 10px 18px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16.5px; color: var(--navy); text-decoration: none; }
.brand i {
    color: var(--gold);
    background: rgba(216, 180, 92, 0.16);
    border: 1px solid rgba(185, 145, 47, 0.35);
    padding: 8px; border-radius: 12px; font-size: 14px;
}
.brand small { font-size: 9px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); display: block; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 18px 14px; }
@media (min-width: 768px) { .wrap { padding: 26px 24px; } }
.wrap-narrow { max-width: 520px; }

.section-title {
    font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.18em;
    color: var(--muted); margin: 24px 2px 12px;
    display: flex; align-items: center; gap: 8px;
}
.section-title i { color: var(--gold); }

/* ---------- AUTH CARD ---------- */
.auth-wrap { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 20px 14px; }
.auth-card {
    width: 100%; max-width: 460px;
    border-radius: 26px;
    padding: 30px 26px;
    position: relative; overflow: hidden;
}
.auth-card::before {
    content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.6), transparent);
    border-radius: 26px 26px 50% 50%; pointer-events: none;
}
.auth-card > * { position: relative; }
.auth-seal {
    width: 66px; height: 66px; border-radius: 50%;
    background: linear-gradient(180deg, #1A3556, var(--navy));
    border: 2px solid var(--gold);
    display: flex; align-items: center; justify-content: center;
    color: var(--goldlt); font-size: 24px;
    margin: 0 auto 16px;
    box-shadow: 0 0 0 5px rgba(248,247,243,0.9), 0 0 0 6px rgba(185,145,47,0.5), 0 12px 26px -10px rgba(16,35,58,0.45);
}

/* ---------- STATS ---------- */
.stats-scroll { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stats-scroll { grid-template-columns: repeat(4, 1fr); } }
.stat { border-radius: 20px; padding: 16px; position: relative; overflow: hidden; }
.stat::before {
    content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 45%;
    background: linear-gradient(180deg, rgba(255,255,255,0.65), transparent);
    border-radius: 20px 20px 50% 50%; pointer-events: none;
}
.stat .ico {
    width: 36px; height: 36px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; margin-bottom: 10px;
    background: rgba(216,180,92,0.14); color: var(--gold);
    border: 1px solid rgba(185,145,47,0.22);
    position: relative;
}
.stat .num { font-size: 26px; font-weight: 800; line-height: 1.05; color: var(--navy); position: relative; }
.stat .lbl { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; position: relative; }

/* ---------- FILTER TABS ---------- */
.filters { position: sticky; top: 74px; z-index: 30; border-radius: 999px; margin-top: 10px; padding: 8px; }
.tab-row { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.tab-row::-webkit-scrollbar { display: none; }
.ftab {
    flex: 0 0 auto;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(16, 35, 58, 0.10);
    color: var(--muted);
    font-family: inherit; font-size: 12px; font-weight: 700;
    padding: 8px 15px; border-radius: 999px;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: all 0.15s ease;
}
.ftab.active {
    background: linear-gradient(180deg, #1A3556, var(--navy));
    color: var(--goldlt); border-color: var(--navy);
    box-shadow: 0 6px 14px -6px rgba(16,35,58,0.45);
}
.ftab:hover:not(.active) { border-color: rgba(185,145,47,0.45); color: var(--navy); }

/* ---------- CARDS GRID ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
@media (min-width: 720px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.lead-card {
    border-radius: 22px; padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative; overflow: hidden;
}
.lead-card::before {
    content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 38%;
    background: linear-gradient(180deg, rgba(255,255,255,0.55), transparent);
    border-radius: 22px 22px 50% 50%; pointer-events: none;
}
.lead-card > * { position: relative; }
.lead-card:hover { box-shadow: 0 20px 42px -16px rgba(16, 35, 58, 0.3), inset 0 1px 0 rgba(255,255,255,0.95); transform: translateY(-2px); }
.lead-card.pri-High   { border-left: 3px solid var(--red); }
.lead-card.pri-Medium { border-left: 3px solid var(--goldlt); }
.lead-card.pri-Low    { border-left: 3px solid rgba(16,35,58,0.12); }

.lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.lead-time { font-size: 11px; color: var(--muted); font-weight: 700; }
.lead-name { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 800; color: var(--navy); }
.lead-cat {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(216, 180, 92, 0.13);
    border: 1px solid rgba(185, 145, 47, 0.35);
    color: #6B531B;
    font-size: 11px; font-weight: 800;
    padding: 5px 12px; border-radius: 999px;
    width: fit-content;
}
.lead-msg {
    background: rgba(255, 255, 255, 0.6);
    border: 1px dashed rgba(16, 35, 58, 0.16);
    border-radius: 14px; padding: 12px;
    font-size: 12.5px; color: #475569; line-height: 1.55;
    white-space: pre-wrap; word-break: break-word;
    max-height: 88px; overflow: hidden;
    position: relative; cursor: pointer;
}
.lead-msg.expanded { max-height: none; }
.lead-msg .fade {
    position: absolute; left: 0; right: 0; bottom: 0; height: 32px;
    background: linear-gradient(transparent, rgba(255,255,255,0.92));
    border-radius: 0 0 14px 14px;
}
.lead-msg.expanded .fade { display: none; }
.lead-remarks { font-size: 12px; color: var(--muted); }
.lead-remarks b { color: var(--amber); }
.camp-line { font-size: 10.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.camp-line i { color: var(--gold); }

/* ---------- BADGES ---------- */
.badge {
    font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 5px 10px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid transparent;
}
.b-callback, .b-new { background: rgba(37, 99, 235, 0.10); color: var(--blue); border-color: rgba(37,99,235,0.22); }
.b-progress  { background: rgba(109, 40, 217, 0.09); color: var(--violet); border-color: rgba(109,40,217,0.2); }
.b-contacted { background: rgba(180, 83, 9, 0.10);   color: var(--amber);  border-color: rgba(180,83,9,0.22); }
.b-converted { background: rgba(5, 150, 105, 0.10);  color: var(--green);  border-color: rgba(5,150,105,0.24); }
.b-closed    { background: rgba(220, 38, 38, 0.08);  color: var(--red);    border-color: rgba(220,38,38,0.2); }
.b-paid      { background: rgba(5, 150, 105, 0.10);  color: var(--green);  border-color: rgba(5,150,105,0.24); }
.b-pending   { background: rgba(180, 83, 9, 0.08);   color: var(--amber);  border-color: rgba(180,83,9,0.2); }
.b-followup  { background: rgba(220, 38, 38, 0.10);  color: var(--red);    border-color: rgba(220,38,38,0.25); }
.b-approved  { background: rgba(5, 150, 105, 0.10);  color: var(--green);  border-color: rgba(5,150,105,0.24); }
.b-suspended { background: rgba(220, 38, 38, 0.08);  color: var(--red);    border-color: rgba(220,38,38,0.2); }
.b-gold      { background: rgba(216,180,92,0.14);    color: #6B531B;       border-color: rgba(185,145,47,0.35); }

/* ---------- ACTIONS ---------- */
.actions { display: flex; gap: 8px; align-items: stretch; }
.actions form { flex: 1; margin: 0; }
.actions select { padding: 10px 30px 10px 12px; font-size: 12.5px; font-weight: 700; border-radius: 12px; }
.act-btn {
    width: 42px; min-width: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; font-size: 15px;
    color: #fff; text-decoration: none;
    box-shadow: 0 6px 14px -6px rgba(16,35,58,0.35);
    transition: filter 0.15s ease, transform 0.15s ease;
}
.act-btn:active { transform: scale(0.94); }
.act-call { background: linear-gradient(180deg, #10B981, var(--green)); }
.act-wa   { background: linear-gradient(180deg, #22C55E, #16A34A); }
.act-edit { background: linear-gradient(180deg, #1A3556, var(--navy)); color: var(--goldlt); }
.act-btn:hover { filter: brightness(1.1); }
.sub-actions { display: flex; gap: 8px; }
.sub-actions form { margin: 0; flex: 1; }
.mini-btn {
    width: 100%;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(16, 35, 58, 0.12);
    color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 700;
    padding: 9px; border-radius: 12px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.15s ease; text-decoration: none;
}
.mini-btn:hover { color: var(--navy); border-color: rgba(185,145,47,0.45); }
.mini-btn.danger:hover { color: var(--red); border-color: rgba(220,38,38,0.4); }

/* ---------- MODAL (bottom sheet on mobile) ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(16, 35, 58, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 24px; } }
.modal-backdrop.open { display: flex; }
.modal-panel {
    width: 100%; max-width: 560px;
    max-height: 92vh; overflow-y: auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(26px) saturate(170%);
    -webkit-backdrop-filter: blur(26px) saturate(170%);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -18px 50px -14px rgba(16,35,58,0.4), inset 0 1px 0 rgba(255,255,255,1);
    padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
    animation: slideUp 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 640px) { .modal-panel { border-radius: 24px; padding: 26px; } }
@keyframes slideUp { from { transform: translateY(36px); opacity: 0.5; } to { transform: translateY(0); opacity: 1; } }
.modal-grab { width: 44px; height: 4.5px; background: rgba(16,35,58,0.18); border-radius: 99px; margin: 0 auto 16px; }
@media (min-width: 640px) { .modal-grab { display: none; } }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-chip { background: rgba(255,255,255,0.65); border: 1px solid rgba(16,35,58,0.1); border-radius: 14px; padding: 12px; }

/* ---------- KPI PILLS ---------- */
.kpi-row { display: flex; gap: 9px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.kpi-row::-webkit-scrollbar { display: none; }
.kpi { flex: 0 0 auto; border-radius: 999px; padding: 9px 16px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.kpi b { font-size: 14px; color: var(--navy); }

/* ---------- MOBILE DOCK ---------- */
.bottom-nav-wrap {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 0 12px calc(10px + env(safe-area-inset-bottom));
    pointer-events: none;
}
@media (min-width: 1024px) { .bottom-nav-wrap { display: none; } }
.bottom-nav { pointer-events: auto; max-width: 480px; margin: 0 auto; border-radius: 999px; display: flex; padding: 8px 6px; }
.bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--muted); font-size: 9.5px; font-weight: 800;
    text-decoration: none; padding: 5px 0;
    background: none; border: none; cursor: pointer; font-family: inherit;
    transition: color 0.15s ease;
}
.bn-item i { font-size: 16px; }
.bn-item.active, .bn-item:hover { color: var(--gold); }

.desk-actions { display: none; gap: 10px; }
@media (min-width: 1024px) { .desk-actions { display: flex; } }

/* ---------- ALERTS ---------- */
.alert { border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.alert-error   { background: rgba(254, 226, 226, 0.7); border: 1px solid rgba(220, 38, 38, 0.3);  color: #7F1D1D; }
.alert-success { background: rgba(220, 252, 231, 0.7); border: 1px solid rgba(5, 150, 105, 0.3);  color: #065F46; }
.alert-warn    { background: rgba(254, 243, 199, 0.75); border: 1px solid rgba(180, 83, 9, 0.3);  color: #78350F; }

.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; border-radius: 22px; }
