/* ============================================================
   ALPHA NOVAA CRM — style.css
   Theme: White / Red / Black
   Mobile-first, Android-app-like for telecallers
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

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

:root {
    --red:        #d0021b;
    --red-dark:   #a00115;
    --red-light:  #fff0f0;
    --navy:       #0f172a;
    --lightnavy:  #1e293b;
    --black:      #111111;
    --gray-900:   #1a1a1a;
    --gray-700:   #374151;
    --gray-500:   #6b7280;
    --gray-300:   #d1d5db;
    --gray-100:   #f3f4f6;
    --white:      #ffffff;
    --green:      #16a34a;
    --green-light:#dcfce7;
    --orange:     #ea580c;
    --orange-light:#fff7ed;
    --blue:       #1d4ed8;
    --blue-light: #eff6ff;
    --shadow:     0 2px 10px rgba(0,0,0,0.08);
    --shadow-lg:  0 8px 30px rgba(0,0,0,0.12);
    --radius:     10px;
    --radius-sm:  6px;
}

html { font-size: 15px; height: 100%; }
body {
    font-family: 'Nunito', sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100%;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 40px 35px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}
.login-box .logo-wrap { text-align: center; margin-bottom: 28px; }
.login-box .logo-wrap img { max-width: 180px; max-height: 70px; object-fit: contain; }
.login-box h2 { text-align: center; font-size: 20px; font-weight: 800; color: var(--black); margin-bottom: 6px; }
.login-box p.sub { text-align: center; color: var(--gray-500); font-size: 13px; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm); font-size: 15px; transition: border 0.2s;
    background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--red);
}
.btn-primary {
    display: block; width: 100%; padding: 14px; background: var(--red);
    color: var(--white); font-size: 16px; font-weight: 800;
    border: none; border-radius: var(--radius-sm); transition: background 0.2s;
}
.btn-primary:hover { background: var(--red-dark); }
.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-danger { background: var(--red-light); color: var(--red-dark); border: 1px solid #fca5a5; }
.alert-success { background: var(--green-light); color: #15803d; border: 1px solid #86efac; }
.alert-warning { background: var(--orange-light); color: var(--orange); border: 1px solid #fdba74; }

/* ============================================================
   ADMIN / MANAGER LAYOUT (Desktop-first)
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; overflow-x: hidden; }

/* ── SIDEBAR — narrow icon rail with hover flyouts ──────────── */
.sidebar {
    width: 58px;
    height: 100vh;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 200;
    overflow: visible;
    flex-shrink: 0;
}
.sidebar-logo {
    background: var(--white);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    height: 60px;
    flex-shrink: 0;
}
.sidebar-logo img { max-height: 34px; max-width: 34px; object-fit: contain; }

.sidebar-nav { flex: 1; padding: 8px 0; overflow: visible; }

/* ── Each nav group ── */
.nav-group {
    position: relative;
}
/* The icon button */
.nav-group-icon {
    width: 58px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.45);
    font-size: 18px;
    gap: 2px;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.nav-group-icon .nav-icon-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    line-height: 1;
}
.nav-group-icon:hover,
.nav-group:hover .nav-group-icon { background: rgba(255,255,255,0.07); color: white; }
.nav-group-icon:hover .nav-icon-label,
.nav-group:hover .nav-icon-label { color: rgba(255,255,255,0.7); }
.nav-group-icon.active { background: var(--red); color: white; }
.nav-group-icon.active .nav-icon-label { color: rgba(255,255,255,0.8); }

/* SLA badge on icon */
.nav-icon-badge {
    position: absolute;
    top: 5px; right: 8px;
    background: #dc2626;
    color: white;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 4px;
    line-height: 1.4;
}

/* ── Flyout panel ── */
.nav-flyout {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 58px;
    background: #1e293b;
    border-radius: 0 10px 10px 0;
    min-width: 180px;
    z-index: 9999;
    padding: 6px 0;
    box-shadow: 4px 4px 20px rgba(0,0,0,0.5);
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
}
.nav-flyout.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

.nav-flyout-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 6px 16px 4px;
}
.nav-flyout a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}
.nav-flyout a:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-flyout a.active { background: var(--red); color: white; }
.nav-flyout a .ficon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

/* old rules removed */

/* ── MAIN CONTENT shifts right by sidebar width ── */
.main-content {
    margin-left: 58px;
    flex: 1;
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
.sidebar-collapsed-layout .main-content { margin-left: 58px; }



.topbar {
    background: var(--navy);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0 16px 0 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
    gap: 12px;
}
.topbar-title { font-size: 16px; font-weight: 800; color: white; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-user { font-size: 13px; color: rgba(255,255,255,0.5); font-weight: 600; white-space: nowrap; display: none; }
.topbar-user strong { color: white; }
.topbar-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--red); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.topbar-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    font-size: 12px; font-weight: 700;
    padding: 6px 12px; border-radius: 20px;
    cursor: pointer; text-decoration: none; font-family: inherit;
    white-space: nowrap;
}
.topbar-btn:hover { background: rgba(255,255,255,0.14); color: white; }
.topbar-btn.danger { color: #fca5a5; border-color: rgba(252,165,165,0.3); background: rgba(220,38,38,0.12); }
.topbar-btn.danger:hover { background: rgba(220,38,38,0.2); }
.topbar-date { font-size: 11px; color: rgba(255,255,255,0.35); white-space: nowrap; }


.page-body {
    padding: 24px 28px;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
}

/* Cards / Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); border-top: 4px solid var(--gray-300); }
.stat-card.red    { border-color: var(--red); }
.stat-card.green  { border-color: var(--green); }
.stat-card.orange { border-color: var(--orange); }
.stat-card.blue   { border-color: var(--blue); }
.stat-card.black  { border-color: var(--black); }
.stat-card .val { font-size: 32px; font-weight: 800; color: var(--black); line-height: 1; }
.stat-card .lbl { font-size: 13px; color: var(--gray-500); margin-top: 6px; font-weight: 600; }

/* Tables */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 16px; font-weight: 800; color: var(--black); }
.card-body { padding: 0; }
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th { background: var(--gray-100); padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--gray-100); }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-green { background: var(--green-light); color: #15803d; }
.badge-red   { background: var(--red-light); color: var(--red-dark); }
.badge-orange{ background: var(--orange-light); color: var(--orange); }
.badge-blue  { background: var(--blue-light); color: var(--blue); }
.badge-gray  { background: var(--gray-100); color: var(--gray-500); }
.badge-black { background: var(--gray-900); color: white; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; border: none; transition: all 0.15s; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-red    { background: var(--red); color: white; }
.btn-red:hover { background: var(--red-dark); }
.btn-black  { background: var(--black); color: white; }
.btn-black:hover { background: var(--gray-700); }
.btn-green  { background: var(--green); color: white; }
.btn-green:hover { background: #15803d; }
.btn-outline{ background: white; border: 2px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--black); }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-row.single { grid-template-columns: 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* ============================================================
   TELECALLER APP LAYOUT (Mobile / Android App Style)
   ============================================================ */

/* App shell */
.tc-page {
    min-height: 100vh;
    background: var(--black);
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
}

/* App top bar */
.app-bar {
    background: var(--black);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.app-bar .app-logo img { height: 32px; object-fit: contain; }
.app-bar .app-title { font-size: 17px; font-weight: 800; color: white; }
.app-bar .app-right { display: flex; align-items: center; gap: 12px; }
.app-bar .app-user { font-size: 12px; color: rgba(255,255,255,0.5); }
.app-bar .btn-app-logout { background: rgba(255,255,255,0.06); border: none; color: rgba(255,255,255,0.6); padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* App body scrollable */
.app-body { flex: 1; background: var(--gray-100); overflow-y: auto; padding-bottom: 80px; }

/* App bottom nav */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--black);
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 200;
}
.app-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    font-weight: 700;
    border: none;
    background: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.15s;
}
.app-nav-item .nav-icon { font-size: 20px; margin-bottom: 3px; }
.app-nav-item.active { color: var(--red); }
.app-nav-item:hover { color: white; }

/* Dashboard home */
.tc-welcome {
    background: var(--black);
    padding: 20px 18px 28px;
    color: white;
}
.tc-welcome .greeting { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.tc-welcome .name { font-size: 22px; font-weight: 800; }
.tc-welcome .date-time { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 4px; }

.tc-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 18px;
    background: var(--black);
    padding-top: 0;
}
.tc-stat-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.tc-stat-box.highlight { background: var(--red); border-color: var(--red); }
.tc-stat-num { font-size: 30px; font-weight: 800; color: white; }
.tc-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 600; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.tc-stat-box.highlight .tc-stat-lbl { color: rgba(255,255,255,0.8); }

/* Action section */
.tc-section { padding: 18px; }
.tc-section-title { font-size: 12px; font-weight: 800; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

.tc-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 18px;
    background: var(--white);
    border: none;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    font-family: inherit;
}
.tc-action-btn .left { display: flex; align-items: center; gap: 12px; }
.tc-action-btn .icon-wrap { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.icon-wrap.red { background: var(--red-light); }
.icon-wrap.green { background: var(--green-light); }
.icon-wrap.orange { background: var(--orange-light); }
.icon-wrap.blue { background: var(--blue-light); }
.icon-wrap.black { background: var(--gray-100); }
.tc-action-btn .btn-label { font-size: 15px; font-weight: 700; color: var(--black); }
.tc-action-btn .btn-sub { font-size: 12px; color: var(--gray-500); margin-top: 1px; }
.tc-action-btn .arrow { font-size: 18px; color: var(--gray-300); }
.tc-action-btn .count-badge { background: var(--red); color: white; border-radius: 12px; padding: 2px 9px; font-size: 12px; font-weight: 800; }

/* List selector */
.list-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.list-card .lc-info .lc-name { font-size: 16px; font-weight: 700; }
.list-card .lc-info .lc-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.list-card .lc-stats { text-align: right; }
.list-card .lc-num { font-size: 20px; font-weight: 800; color: var(--red); }
.list-card .lc-lbl { font-size: 11px; color: var(--gray-500); }

/* Call screen */
.call-screen { background: var(--white); min-height: calc(100vh - 120px); }

.contact-header {
    background: var(--black);
    padding: 24px 18px 28px;
    color: white;
    text-align: center;
}
.contact-header .avatar-circle {
    width: 70px; height: 70px; border-radius: 50%;
    background: var(--red); display: flex; align-items: center;
    justify-content: center; font-size: 28px; font-weight: 800;
    margin: 0 auto 14px;
}
.contact-header .c-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.contact-header .c-phone { font-size: 16px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.contact-header .c-meta { font-size: 12px; color: rgba(255,255,255,0.4); }
.contact-header .c-attempt { display: inline-block; background: rgba(255,255,255,0.1); padding: 3px 12px; border-radius: 20px; font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 8px; }

.call-btn-wrap { padding: 18px; }
.call-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px;
    background: var(--green);
    color: white;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(22,163,74,0.3);
}
.alt-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 10px;
    border: none;
}

/* Disposition grid */
.disposition-section { padding: 0 18px; }
.disposition-section h4 { font-size: 12px; font-weight: 800; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.disposition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.disp-btn {
    padding: 13px 8px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    text-align: center;
    transition: all 0.15s;
}
.disp-btn:hover { border-color: var(--gray-300); }
.disp-btn.selected { background: var(--black); color: white; border-color: var(--black); }
.disp-btn[data-color="#f59e0b"].selected { background: #f59e0b; border-color: #f59e0b; }
.disp-btn[data-color="#f97316"].selected { background: #f97316; border-color: #f97316; }
.disp-btn[data-color="#3b82f6"].selected { background: #3b82f6; border-color: #3b82f6; }
.disp-btn[data-color="#10b981"].selected { background: #10b981; border-color: #10b981; }
.disp-btn[data-color="#06b6d4"].selected { background: #06b6d4; border-color: #06b6d4; }
.disp-btn[data-color="#ef4444"].selected { background: #ef4444; border-color: #ef4444; }
.disp-btn[data-color="#dc2626"].selected { background: #dc2626; border-color: #dc2626; }
.disp-btn[data-color="#16a34a"].selected { background: #16a34a; border-color: #16a34a; }

/* Notes textarea */
.notes-section { padding: 0 18px 18px; }
.notes-section textarea {
    width: 100%; padding: 12px; border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
    resize: none; height: 90px;
}
.notes-section textarea:focus { outline: none; border-color: var(--red); }

/* Script panel */
.script-panel {
    margin: 0 18px 18px;
    background: var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
}
.script-toggle {
    width: 100%; padding: 12px 16px; background: none; border: none;
    font-family: inherit; font-size: 14px; font-weight: 700; color: var(--gray-700);
    text-align: left; display: flex; justify-content: space-between; align-items: center;
}
.script-content { padding: 0 16px 14px; font-size: 13px; color: var(--gray-700); line-height: 1.7; display: none; }
.script-content.open { display: block; }

/* Fixed save bar */
.save-bar {
    position: fixed;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    padding: 12px 18px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 100;
}
.save-bar .save-btn {
    width: 100%; padding: 16px; background: var(--red); color: white;
    border: none; border-radius: var(--radius); font-size: 16px; font-weight: 800;
    font-family: inherit;
}
.save-bar .save-btn:disabled { background: var(--gray-300); }

/* Followup card */
.followup-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}
.followup-card .fc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.followup-card .fc-info .fc-name { font-size: 16px; font-weight: 700; }
.followup-card .fc-info .fc-meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.followup-card .fc-time { margin-left: auto; text-align: right; }
.followup-card .fc-time .time { font-size: 14px; font-weight: 700; }
.followup-card .fc-time .overdue { font-size: 11px; color: var(--red); font-weight: 700; }

/* Modal */
.modal-overlay {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 500;
    -webkit-align-items: flex-end; align-items: flex-end;
    -webkit-justify-content: center; justify-content: center;
}
.modal-overlay.open { display: -webkit-flex; display: flex; }
.modal-sheet {
    background: white; border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px;
    width: 100%; max-width: 480px;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-sheet h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.modal-sheet .modal-btn {
    width: 100%; padding: 15px; border-radius: var(--radius);
    font-size: 15px; font-weight: 800; border: none; margin-top: 10px; font-family: inherit;
}
.modal-btn.confirm { background: var(--red); color: white; }
.modal-btn.cancel  { background: var(--gray-100); color: var(--gray-700); }

/* WhatsApp buttons */
.wa-buttons { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 18px; }
.wa-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; background: #dcfce7; border-radius: var(--radius-sm);
    border: none; font-family: inherit; font-size: 14px; font-weight: 700; color: #15803d;
}
.wa-btn .wa-icon { font-size: 18px; }
.wa-btn:active { background: #bbf7d0; }

/* Admin/Manager nav page headings */
.page-heading { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-heading h2 { font-size: 22px; font-weight: 800; }

/* Search bar */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-bar input, .search-bar select {
    padding: 9px 14px; border: 2px solid var(--gray-300); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
}
.search-bar input:focus, .search-bar select:focus { outline: none; border-color: var(--red); }
.search-bar input.main { flex: 1; min-width: 200px; }

/* Progress bar */
.progress-bar-wrap { background: var(--gray-100); border-radius: 20px; height: 8px; overflow: hidden; margin-top: 4px; }
.progress-bar-fill { height: 100%; background: var(--red); border-radius: 20px; }

/* Empty state */
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-500); }
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ============================================================
   MOBILE RESPONSIVE — Hamburger sidebar for admin/manager
   ============================================================ */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
    display: flex;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    border-radius: 8px;
}
@media (min-width: 901px) {
    .hamburger-btn { display: none; }
}
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Sidebar overlay — dark backdrop on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* Mobile logout button in topbar */
.topbar-logout {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
}

@media (max-width: 900px) {
    /* Sidebar slides in from left as full-width panel */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 200 !important;
        width: 260px !important;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }
    /* When open — expand nav icons to full rows with text */
    .sidebar.open .nav-group-icon {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 20px;
        gap: 12px;
        font-size: 20px;
    }
    .sidebar.open .nav-icon-label {
        font-size: 14px;
        font-weight: 700;
        text-transform: none;
        letter-spacing: 0;
        color: rgba(255,255,255,0.75);
    }
    /* Show flyout links inline under each group when sidebar is open */
    .sidebar.open .nav-flyout {
        position: static;
        visibility: visible;
        opacity: 1;
        pointer-events: all;
        background: rgba(0,0,0,0.2);
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        min-width: 0;
    }
    .sidebar.open .nav-flyout a {
        padding: 10px 20px 10px 52px;
        font-size: 13px;
        color: rgba(255,255,255,0.6);
    }
    .sidebar.open .nav-flyout-title {
        padding: 6px 20px 2px 52px;
        font-size: 10px;
    }
    .sidebar.open .nav-group-icon.active .nav-icon-label {
        color: white;
    }
    /* Sidebar footer logout row */
    .sidebar.open .sidebar-footer .nav-group-icon {
        padding: 14px 20px;
    }
    .main-content { margin-left: 0; }

    /* Show hamburger and mobile logout */
    .hamburger-btn { display: flex; }
    .topbar-logout { display: flex; }

    /* Hide Change Password text on small screens — keep icon only */
    .pw-btn-text { display: none; }
}

@media (max-width: 700px) {
    .form-row { grid-template-columns: 1fr; }
    .form-row.three { grid-template-columns: 1fr 1fr; }
    .page-body { padding: 14px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-title { font-size: 15px; }
    .topbar-date { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* Tables scroll horizontally */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Cards full width */
    .card { border-radius: 10px; }

    /* Hide Change Password button on very small screens */
    #pwBtn { display: none; }
}


/* ============================================================
   THEMES — data-theme on <body>
   Default (midnight) needs no overrides — matches base styles
   All overrides use !important to beat inline styles
   ============================================================ */

/* ── OCEAN (dark navy + blue) ─────────────────────────────── */
body[data-theme="ocean"] .tc-page,
body[data-theme="ocean"] .app-bar,
body[data-theme="ocean"] .tc-welcome,
body[data-theme="ocean"] .tc-stats-row       { background: #0f2544 !important; }

body[data-theme="ocean"] .app-bar            { border-bottom-color: rgba(255,255,255,0.08) !important; }
body[data-theme="ocean"] .app-bar .app-title { color: #ffffff !important; }
body[data-theme="ocean"] .app-bar .app-user  { color: rgba(255,255,255,0.5) !important; }
body[data-theme="ocean"] .btn-app-logout     { background: rgba(255,255,255,0.08) !important; color: rgba(255,255,255,0.6) !important; }

body[data-theme="ocean"] .app-body           { background: #f0f4f8 !important; }

body[data-theme="ocean"] .tc-stat-box        { background: rgba(255,255,255,0.07) !important; border-color: rgba(255,255,255,0.10) !important; }
body[data-theme="ocean"] .tc-stat-box.highlight { background: #0ea5e9 !important; border-color: #0ea5e9 !important; }
body[data-theme="ocean"] .tc-stat-num        { color: #ffffff !important; }
body[data-theme="ocean"] .tc-stat-lbl        { color: rgba(255,255,255,0.5) !important; }
body[data-theme="ocean"] .tc-stat-box.highlight .tc-stat-lbl { color: rgba(255,255,255,0.85) !important; }

body[data-theme="ocean"] .app-bottom-nav     { background: #0f2544 !important; border-top-color: rgba(255,255,255,0.08) !important; }
body[data-theme="ocean"] .app-nav-item       { color: rgba(255,255,255,0.35) !important; }
body[data-theme="ocean"] .app-nav-item.active { color: #38bdf8 !important; }

body[data-theme="ocean"] .tc-section-title   { color: #64748b !important; }
body[data-theme="ocean"] .icon-wrap.red      { background: #e0f2fe !important; }
body[data-theme="ocean"] .icon-wrap.green    { background: #d1fae5 !important; }
body[data-theme="ocean"] .icon-wrap.orange   { background: #fef3c7 !important; }
body[data-theme="ocean"] .icon-wrap.blue     { background: #dbeafe !important; }
body[data-theme="ocean"] .tc-action-btn .btn-label { color: #0f2544 !important; }

body[data-theme="ocean"] .count-badge        { background: #0ea5e9 !important; }
body[data-theme="ocean"] #floatDialerBtn,
body[data-theme="ocean"] .dialer-float-btn   { background: #0ea5e9 !important; box-shadow: 0 4px 16px rgba(14,165,233,0.5) !important; }
body[data-theme="ocean"] .btn-primary        { background: #0ea5e9 !important; }
body[data-theme="ocean"] #callBtn            { background: #0ea5e9 !important; }
body[data-theme="ocean"] .disp-btn.selected  { background: #0ea5e9 !important; border-color: #0ea5e9 !important; }

body[data-theme="ocean"] .sidebar            { background: #0f2544 !important; }
body[data-theme="ocean"] .nav-item.active    { background: #0ea5e9 !important; }
body[data-theme="ocean"] .sidebar-user .avatar { background: #0ea5e9 !important; }
body[data-theme="ocean"] .btn-logout:hover   { color: #0ea5e9 !important; }


/* ── FOREST (deep green + emerald) ───────────────────────── */
body[data-theme="forest"] .tc-page,
body[data-theme="forest"] .app-bar,
body[data-theme="forest"] .tc-welcome,
body[data-theme="forest"] .tc-stats-row      { background: #1a3a2a !important; }

body[data-theme="forest"] .app-bar           { border-bottom-color: rgba(255,255,255,0.08) !important; }
body[data-theme="forest"] .app-bar .app-title { color: #ffffff !important; }
body[data-theme="forest"] .app-bar .app-user { color: rgba(255,255,255,0.5) !important; }
body[data-theme="forest"] .btn-app-logout    { background: rgba(255,255,255,0.08) !important; color: rgba(255,255,255,0.6) !important; }

body[data-theme="forest"] .app-body          { background: #f0f7f2 !important; }

body[data-theme="forest"] .tc-stat-box       { background: rgba(255,255,255,0.07) !important; border-color: rgba(255,255,255,0.10) !important; }
body[data-theme="forest"] .tc-stat-box.highlight { background: #16a34a !important; border-color: #16a34a !important; }
body[data-theme="forest"] .tc-stat-num       { color: #ffffff !important; }
body[data-theme="forest"] .tc-stat-lbl       { color: rgba(255,255,255,0.5) !important; }
body[data-theme="forest"] .tc-stat-box.highlight .tc-stat-lbl { color: rgba(255,255,255,0.85) !important; }

body[data-theme="forest"] .app-bottom-nav    { background: #1a3a2a !important; border-top-color: rgba(255,255,255,0.08) !important; }
body[data-theme="forest"] .app-nav-item      { color: rgba(255,255,255,0.35) !important; }
body[data-theme="forest"] .app-nav-item.active { color: #4ade80 !important; }

body[data-theme="forest"] .tc-section-title  { color: #6b7280 !important; }
body[data-theme="forest"] .icon-wrap.red     { background: #dcfce7 !important; }
body[data-theme="forest"] .icon-wrap.green   { background: #d1fae5 !important; }
body[data-theme="forest"] .icon-wrap.orange  { background: #fef3c7 !important; }
body[data-theme="forest"] .icon-wrap.blue    { background: #dbeafe !important; }
body[data-theme="forest"] .tc-action-btn .btn-label { color: #1a3a2a !important; }

body[data-theme="forest"] .count-badge       { background: #16a34a !important; }
body[data-theme="forest"] #floatDialerBtn,
body[data-theme="forest"] .dialer-float-btn  { background: #16a34a !important; box-shadow: 0 4px 16px rgba(22,163,74,0.5) !important; }
body[data-theme="forest"] .btn-primary       { background: #16a34a !important; }
body[data-theme="forest"] #callBtn           { background: #16a34a !important; }
body[data-theme="forest"] .disp-btn.selected { background: #16a34a !important; border-color: #16a34a !important; }

body[data-theme="forest"] .sidebar           { background: #1a3a2a !important; }
body[data-theme="forest"] .nav-item.active   { background: #16a34a !important; }
body[data-theme="forest"] .sidebar-user .avatar { background: #16a34a !important; }
body[data-theme="forest"] .btn-logout:hover  { color: #16a34a !important; }


/* ── LIGHT (white + red) ──────────────────────────────────── */
/* ── LIGHT THEME ─────────────────────────────────────────────── */
body[data-theme="light"] .tc-page            { background: #ffffff !important; }
body[data-theme="light"] .app-bar            { background: #ffffff !important; border-bottom: 1px solid rgba(0,0,0,0.08) !important; }
body[data-theme="light"] .app-bar .app-title { color: #111111 !important; }
body[data-theme="light"] .app-bar .app-user  { color: #6b7280 !important; }
body[data-theme="light"] .app-greeting       { color: #9ca3af !important; }
body[data-theme="light"] .app-fullname       { color: #111111 !important; }
body[data-theme="light"] .btn-app-logout     { background: #f3f4f6 !important; color: #6b7280 !important; }
body[data-theme="light"] .app-leads-btn      { background: #f3f4f6 !important; border-color: rgba(0,0,0,0.12) !important; color: #111111 !important; }
body[data-theme="light"] .app-menu-btn       { background: #f3f4f6 !important; border-color: rgba(0,0,0,0.12) !important; color: #374151 !important; }
body[data-theme="light"] .app-menu-panel     { background: #ffffff !important; border-color: rgba(0,0,0,0.12) !important; }
body[data-theme="light"] .app-menu-item      { color: #374151 !important; border-color: rgba(0,0,0,0.06) !important; }
body[data-theme="light"] .app-menu-item:hover { background: #f3f4f6 !important; }
body[data-theme="light"] .app-menu-logout    { color: #dc2626 !important; }

body[data-theme="light"] .app-body           { background: #f3f4f6 !important; }
body[data-theme="light"] .tc-welcome         { background: #ffffff !important; }
body[data-theme="light"] .tc-welcome .greeting { color: #9ca3af !important; }
body[data-theme="light"] .tc-welcome .name   { color: #111111 !important; }
body[data-theme="light"] .tc-welcome .date-time { color: #b0b8c1 !important; }

body[data-theme="light"] .tc-stats-row       { background: #ffffff !important; }
body[data-theme="light"] .tc-stat-box        { background: #f9fafb !important; border-color: rgba(0,0,0,0.07) !important; }
body[data-theme="light"] .tc-stat-box.highlight { background: #d0021b !important; border-color: #d0021b !important; }
body[data-theme="light"] .tc-stat-num        { color: #111111 !important; }
body[data-theme="light"] .tc-stat-lbl        { color: #6b7280 !important; }
body[data-theme="light"] .tc-stat-box.highlight .tc-stat-num { color: #ffffff !important; }
body[data-theme="light"] .tc-stat-box.highlight .tc-stat-lbl { color: rgba(255,255,255,0.85) !important; }

body[data-theme="light"] .app-bottom-nav     { background: #ffffff !important; border-top: 1px solid rgba(0,0,0,0.08) !important; }
body[data-theme="light"] .app-nav-item       { color: #9ca3af !important; }
body[data-theme="light"] .app-nav-item.active { color: #d0021b !important; }

body[data-theme="light"] .tc-section-title   { color: #9ca3af !important; }
body[data-theme="light"] .sidebar            { background: #1e293b !important; }


/* ── MIDNIGHT — default, no overrides needed ─────────────── */
body[data-theme="midnight"] { /* matches base styles */ }

/* ── Centuria theme ─────────────────────────────────────────────────────── */
body[data-theme="centuria"] .tc-page,
body[data-theme="centuria"] .app-bar,
body[data-theme="centuria"] .tc-welcome,
body[data-theme="centuria"] .tc-stats-row       { background: #4a1942 !important; }

body[data-theme="centuria"] .app-bar            { border-bottom-color: rgba(255,255,255,0.08) !important; }
body[data-theme="centuria"] .app-bar .app-title { color: #ffffff !important; }
body[data-theme="centuria"] .app-bar .app-user  { color: rgba(255,255,255,0.5) !important; }
body[data-theme="centuria"] .btn-app-logout     { background: rgba(255,255,255,0.08) !important; color: rgba(255,255,255,0.6) !important; }

body[data-theme="centuria"] .app-body           { background: #f5f0f5 !important; }

body[data-theme="centuria"] .tc-stat-box        { background: rgba(255,255,255,0.07) !important; border-color: rgba(255,255,255,0.10) !important; }
body[data-theme="centuria"] .tc-stat-box.highlight { background: #b8963e !important; border-color: #b8963e !important; }
body[data-theme="centuria"] .tc-stat-num        { color: #ffffff !important; }
body[data-theme="centuria"] .tc-stat-lbl        { color: rgba(255,255,255,0.5) !important; }

body[data-theme="centuria"] .app-bottom-nav     { background: #4a1942 !important; border-top-color: rgba(255,255,255,0.08) !important; }
body[data-theme="centuria"] .app-nav-item       { color: rgba(255,255,255,0.35) !important; }
body[data-theme="centuria"] .app-nav-item.active { color: #b8963e !important; }

body[data-theme="centuria"] .tc-section-title   { color: #7c3a74 !important; }

body[data-theme="centuria"] .count-badge        { background: #b8963e !important; }
body[data-theme="centuria"] .nav-group-icon     { color: rgba(255,255,255,0.75) !important; }
body[data-theme="centuria"] .nav-group-icon:hover { color: #ffffff !important; background: rgba(184,150,62,0.2) !important; }
body[data-theme="centuria"] .nav-label          { color: rgba(255,255,255,0.75) !important; }
body[data-theme="centuria"] .sidebar            { background: #4a1942 !important; border-right-color: rgba(255,255,255,0.08) !important; }
body[data-theme="centuria"] #floatDialerBtn,
body[data-theme="centuria"] .dialer-float-btn   { background: #b8963e !important; box-shadow: 0 4px 16px rgba(184,150,62,0.5) !important; }
body[data-theme="centuria"] .btn-primary        { background: #4a1942 !important; }
body[data-theme="centuria"] #callBtn            { background: #4a1942 !important; }
body[data-theme="centuria"] .app-leads-btn      { background: rgba(184,150,62,0.2) !important; border-color: rgba(184,150,62,0.4) !important; }


/* ── SETTINGS PAGE theme cards ───────────────────────────── */
.theme-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--white); border: 2px solid var(--gray-300);
    border-radius: 14px; padding: 16px 18px; cursor: pointer;
    transition: all 0.18s; margin-bottom: 12px;
}
.theme-card:hover        { border-color: var(--gray-500); transform: translateX(3px); }
.theme-card.active       { border-color: var(--red); background: var(--red-light); }
.theme-card .swatch      { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.theme-card .tc-name     { font-size: 15px; font-weight: 800; color: var(--black); }
.theme-card .tc-desc     { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.theme-card .tc-check    { margin-left: auto; font-size: 22px; opacity: 0; transition: opacity 0.18s; }
.theme-card.active .tc-check { opacity: 1; }

/* ── Centuria admin theme overrides ─────────────────────────────────────── */
body[data-theme="centuria"] .sidebar,
body[data-theme="centuria"] .nav-sidebar      { background: #4a1942 !important; }
body[data-theme="centuria"] .nav-group-icon.active { background: #b8963e !important; }
body[data-theme="centuria"] .nav-flyout a.active   { background: #b8963e !important; }
body[data-theme="centuria"] .top-bar           { background: #4a1942 !important; }
body[data-theme="centuria"] .btn-primary       { background: #4a1942 !important; }
body[data-theme="centuria"] .btn-primary:hover { background: #3a1232 !important; }
body[data-theme="centuria"] .stat-card.red     { border-color: #4a1942 !important; }
body[data-theme="centuria"] .card-header       { border-left-color: #4a1942 !important; }
