/* ADA Brand Colors */
:root{--brand:#B43205;--gold:#FFB511;--teal:#48D5D8}
.btn-primary{background:var(--brand)!important;border-color:var(--brand)!important}
.btn-primary:hover{background:#8a2803!important}
header{background:linear-gradient(135deg,#B43205,#B43205 40%,#48D5D8)!important}
.nav-item.active{color:var(--brand)!important;border-bottom-color:var(--brand)!important}
a{color:var(--brand)}
.badge.active{background:var(--teal)!important}
/* TeleCaller Manager - responsive styles */
:root {
  --primary: #003366;
  --primary-light: #1a4f8a;
  --accent: #e8a33d;
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #222831;
  --muted: #6b7280;
  --green: #1a7f37;
  --red: #c0392b;
  --border: #dde3ea;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 51, 102, .08);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.hidden { display: none !important; }
.view { min-height: 100vh; }

/* ── Login ── */
#view-login {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #003366 0%, #0b4d8c 60%, #1565b0 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 36px 28px;
  width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-logo { font-size: 48px; text-align: center; }
.login-card h1 { text-align: center; color: var(--primary); font-size: 24px; margin-top: 8px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; color: var(--primary); }
.login-card input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }

/* ── Layout ── */
.app-header {
  background: var(--primary); color: #fff; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 8px; }
.logo-sm { font-size: 22px; }
.app-title { font-weight: 700; font-size: 17px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.user-chip { font-size: 13px; background: rgba(255,255,255,.15); padding: 5px 10px; border-radius: 20px; }

.app-nav {
  display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 48px; z-index: 40; -webkit-overflow-scrolling: touch;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 14px; font-size: 11px; color: var(--muted); text-decoration: none;
  white-space: nowrap; border-bottom: 3px solid transparent; flex-shrink: 0;
}
.nav-item span { font-size: 11px; }
.nav-item.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }
.nav-item.active .nav-item { color: var(--primary); }

.app-main { max-width: 960px; margin: 0 auto; padding: 16px 14px 90px; }
.sec h2 { color: var(--primary); font-size: 20px; margin-bottom: 12px; }
.sec h3 { color: var(--primary); font-size: 16px; margin: 14px 0 8px; }

/* ── Cards ── */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 14px; border: 1px solid var(--border);
}
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--border); border-left: 4px solid var(--primary);
}
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 12px; color: var(--muted); }
.stat-card.green { border-left-color: var(--green); } .stat-card.green .num { color: var(--green); }
.stat-card.red { border-left-color: var(--red); } .stat-card.red .num { color: var(--red); }
.stat-card.amber { border-left-color: var(--accent); } .stat-card.amber .num { color: #b0781a; }

/* ── Forms ── */
.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.hint { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ── Buttons ── */
.btn {
  border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .05s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #e8eef6; color: var(--primary); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; font-weight: 500; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.table th {
  background: var(--primary); color: #fff; text-align: left; padding: 9px 10px;
  font-size: 12px; position: sticky; top: 0; white-space: nowrap;
}
.table td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.table tbody tr:nth-child(even) { background: #f8fafc; }
.table tbody tr:hover { background: #eef4fb; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.pending { background: #fff3cd; color: #856404; }
.badge.callback { background: #d1ecf1; color: #0c5460; }
.badge.completed { background: #d4edda; color: #155724; }
.badge.answered, .badge.interested { background: #d4edda; color: #155724; }
.badge.not_answered, .badge.wrong_number, .badge.switched_off, .badge.busy { background: #f8d7da; color: #721c24; }
.badge.in_progress { background: #e2e3e5; color: #383d41; }
.badge.pending_feedback { background: #fff3cd; color: #856404; }
.badge.role-admin { background: #cce5ff; color: #004085; }
.badge.role-manager { background: #e8d5ff; color: #5b2a86; }
.badge.role-telecaller { background: #d4edda; color: #155724; }
.badge.active { background: #d4edda; color: #155724; }
.badge.inactive { background: #f8d7da; color: #721c24; }

/* ── My calls / queue ── */
.lead-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.lead-card .lead-name { font-weight: 700; font-size: 15px; }
.lead-card .lead-phone { color: var(--primary); font-weight: 600; font-size: 16px; text-decoration: none; }
.lead-card .lead-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.ongoing-box { margin-bottom: 12px; }
.ongoing-card {
  background: linear-gradient(135deg, #fff8e1, #ffecb3); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.timer { font-size: 24px; font-weight: 800; color: #b0781a; font-variant-numeric: tabular-nums; }

/* ── Toolbar ── */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input, .toolbar select { padding: 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; }
.toolbar input[type="text"] { flex: 1; min-width: 160px; }
.toolbar input[type="date"] { min-width: 140px; }

/* ── Modal ── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 400px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 16px 50px rgba(0,0,0,.3);
}
.modal-card h3 { color: var(--primary); margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 12px 22px; border-radius: 30px;
  font-size: 14px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.3); text-align: center; max-width: 90vw;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

/* ── Result box ── */
.result-box { background: #eef6ee; border: 1px solid #b7dfb9; color: #155724; border-radius: 8px; padding: 12px; margin-bottom: 12px; font-size: 13.5px; }

.error-msg { color: var(--red); font-size: 13px; margin: 6px 0; min-height: 0; }

.empty-msg { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

/* ── Desktop layout ── */
@media (min-width: 900px) {
  .app-header { position: static; }
  .app-nav { position: static; justify-content: center; }
  .app-main { padding-bottom: 30px; }
}
