/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #222633;
  --bg-input: #252833;
  --border: #2d3040;
  --text: #e8e9ed;
  --text-dim: #8b8fa3;
  --text-muted: #5c6078;
  --accent: #4d8eff;
  --accent-hover: #3a7aff;
  --green: #22c55e;
  --green-bg: #0d3320;
  --yellow: #eab308;
  --yellow-bg: #332d0d;
  --red: #ef4444;
  --red-bg: #331111;
  --blue: #3b82f6;
  --blue-bg: #0d1d33;
  --purple: #a855f7;
  --purple-bg: #1f0d33;
  --gray: #6b7280;
  --gray-bg: #1f2130;
  --dark-gray: #374151;
  --dark-gray-bg: #171a24;
  --orange: #f97316;
  --orange-bg: #331a0d;
  --cyan: #06b6d4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.login-logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--accent);
  margin-bottom: 4px;
}
.login-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}
.login-btn:hover { background: var(--accent-hover); }
.login-btn:active { transform: scale(0.98); }
.login-error {
  text-align: center;
  color: var(--red);
  font-size: 0.85rem;
  padding: 8px;
  background: var(--red-bg);
  border-radius: var(--radius-sm);
}

/* ===== Header ===== */
#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
#header h1 { font-size: 1.1rem; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.staff-select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  max-width: 130px;
}
.clock { font-size: 0.85rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.current-user {
  font-size: 0.8rem;
  color: var(--cyan);
  font-weight: 600;
  background: rgba(6,182,212,0.1);
  padding: 3px 10px;
  border-radius: 12px;
}
.logout-btn {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.logout-btn:hover { background: var(--red); color: #fff; }

/* ===== Tabs ===== */
#tabNav {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 50px;
  z-index: 99;
}
.tab-btn {
  flex: 1;
  padding: 12px 4px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== Notification ===== */
.notification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}
.notif-close { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; padding: 0 4px; }

/* ===== Callback Reminders ===== */
.callback-reminders {
  background: var(--purple-bg);
  border: 1px solid var(--purple);
  border-radius: var(--radius-sm);
  margin: 8px 12px;
  padding: 10px 14px;
}
.reminder-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 0.9rem; color: var(--purple); margin-bottom: 6px;
}
.btn-sm {
  background: var(--purple); color: #fff; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: 0.75rem; cursor: pointer;
}
.reminder-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(168,85,247,0.2);
  font-size: 0.85rem;
}
.reminder-item:last-child { border-bottom: none; }
.reminder-call-btn {
  background: var(--green); color: #fff; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: 0.75rem; cursor: pointer;
}

/* ===== Tab Content ===== */
.tab-content { display: none; padding: 12px; }
.tab-content.active { display: block; }

/* ===== Search Bar ===== */
.search-bar-container {
  margin-bottom: 10px;
}
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-input {
  flex: 1;
  min-width: 0;
}
.search-btn-action {
  padding: 10px 14px !important;
  white-space: nowrap;
  font-size: 0.85rem !important;
}
.search-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-item:last-child { border-bottom: none; }
.search-result-name { font-weight: 600; }
.search-result-phone { color: var(--accent); margin-left: 8px; }
.search-result-area { color: var(--text-muted); margin-left: 8px; font-size: 0.8rem; }
.search-result-list { color: var(--cyan); margin-left: 8px; font-size: 0.75rem; }
.search-result-count {
  padding: 10px 14px;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}

/* ===== Callback Tag ===== */
.callback-tag-bar {
  margin-bottom: 10px;
}
.callback-tag-btn {
  font-size: 0.8rem !important;
  padding: 6px 12px !important;
}
.callback-tag-badge {
  background: var(--orange);
  color: #000;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.mark-callback-btn {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.mark-callback-btn:hover { background: var(--orange); color: #000; }
.mark-callback-btn.tagged { background: var(--orange); color: #000; }

/* ===== List Filter ===== */
.list-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.filter-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.list-filter-select {
  flex: 1;
  max-width: 250px;
}

/* ===== List Badge ===== */
.list-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--purple);
  color: #fff;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state .sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

/* ===== Progress Bar ===== */
.progress-bar-container { margin-bottom: 12px; }
.progress-info {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: var(--text-dim); margin-bottom: 6px;
}
.progress-track {
  height: 6px; background: var(--bg-input);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px; transition: width 0.4s ease;
  width: 0%;
}

/* ===== AI Call Time Panel ===== */
.ai-call-time {
  background: var(--blue-bg);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Auto Re-schedule Info ===== */
.auto-reschedule-info {
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--orange);
}

/* ===== Priority Badge ===== */
.priority-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--cyan);
  color: #000;
}

/* ===== Call Script Panel ===== */
.call-script-panel {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
  border-left: 3px solid var(--cyan);
}
.script-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 6px;
}
.script-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-line;
}

/* ===== Lead Card ===== */
.lead-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.lead-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; gap: 6px; flex-wrap: wrap;
}
.attempt-badge {
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.attempt-badge.retry { background: var(--yellow); color: #000; }
.lead-id { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }
.lead-name {
  font-size: 1.25rem; font-weight: 700;
  margin-bottom: 12px; line-height: 1.3;
}
.lead-details { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lead-detail {
  display: flex; align-items: center; gap: 10px; font-size: 0.9rem;
}
.lead-detail .label {
  color: var(--text-muted); min-width: 40px; font-size: 0.8rem;
}
.lead-detail .value { font-weight: 500; }
.phone-number { color: var(--accent); font-size: 1.05rem; letter-spacing: 0.5px; }

/* ===== Call Button ===== */
.call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}
.call-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(34,197,94,0.2);
}
.call-icon { font-size: 1.3rem; }

/* ===== Previous Notes ===== */
.previous-notes {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.note-entry {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.note-entry:last-child { border-bottom: none; }
.note-date { color: var(--text-muted); font-size: 0.75rem; }
.note-result {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 0.75rem; font-weight: 600; margin-left: 6px;
}
.note-memo { color: var(--text-dim); margin-top: 4px; }

/* ===== Section Title ===== */
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  margin-top: 4px;
}

/* ===== Result Buttons ===== */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.result-btn {
  padding: 14px 8px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  color: #fff;
}
.result-btn:active { transform: scale(0.95); }
.result-btn.selected { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.2); }

.result-rusu { background: var(--yellow); color: #000; }
.result-deta { background: var(--green); }
.result-gacha { background: var(--red); }
.result-fuzai { background: var(--gray); }
.result-futsu { background: var(--dark-gray); }

.sub-mikomi { background: var(--green); }
.sub-kyohi { background: var(--red); }
.sub-kentou { background: var(--yellow); color: #000; }
.sub-shiryou { background: var(--blue); }
.sub-orikaeshi { background: var(--purple); }

/* ===== Sub Options ===== */
.sub-options { animation: slideDown 0.25s ease; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Callback Section ===== */
.callback-section {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--purple);
  animation: slideDown 0.25s ease;
}
.callback-inputs { display: flex; gap: 8px; }
.callback-inputs .input-field { flex: 1; }

/* ===== Memo ===== */
.memo-section { margin-bottom: 12px; }
.memo-textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}
.memo-textarea:focus { border-color: var(--accent); outline: none; }

/* ===== Input Field ===== */
.input-field {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}
.input-field:focus { border-color: var(--accent); outline: none; }
.input-sm { width: 80px; }

/* ===== Save & Next ===== */
.save-next-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.save-next-btn:disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: not-allowed;
}
.save-next-btn:not(:disabled):active {
  background: var(--accent-hover);
  transform: scale(0.98);
}

/* ===== Nav Buttons ===== */
.nav-buttons {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.nav-btn {
  flex: 1; padding: 10px;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; cursor: pointer; transition: var(--transition);
}
.nav-btn:active { background: var(--bg-card-hover); }

/* ===== DASHBOARD ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stats-grid-2 { grid-template-columns: 1fr 1fr; }
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  border: 1px solid var(--border);
}
.stat-value {
  font-size: 1.8rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
.stat-green .stat-value { color: var(--green); }
.stat-blue .stat-value { color: var(--blue); }
.stat-red .stat-value { color: var(--red); }

.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.chart-title {
  font-size: 0.9rem; font-weight: 600;
  margin-bottom: 12px; color: var(--text-dim);
}
.chart-row { display: flex; gap: 10px; margin-bottom: 12px; }
.chart-half { flex: 1; min-width: 0; }

/* ===== Staff Performance ===== */
.staff-performance-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.perf-table { font-size: 0.8rem; }
.perf-header {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: 0.75rem;
}
.perf-row {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  align-items: center;
}
.perf-row:last-child { border-bottom: none; }

/* ===== Leaderboard ===== */
.leaderboard {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.leaderboard-table { font-size: 0.85rem; }
.lb-header {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: 0.8rem;
}
.lb-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  align-items: center;
}
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-weight: 700; }
.lb-name { font-weight: 500; }

/* ===== AI Panel ===== */
.ai-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.ai-suggestion {
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  border-left: 3px solid var(--accent);
}
.ai-suggestion:last-child { margin-bottom: 0; }
.ai-suggestion.ai-highlight {
  border-left-color: var(--cyan);
  background: rgba(6,182,212,0.08);
}
.ai-suggestion.ai-warning {
  border-left-color: var(--orange);
  background: var(--orange-bg);
}
.ai-suggestion.ai-success {
  border-left-color: var(--green);
  background: var(--green-bg);
}

/* ===== ANALYTICS ===== */
.analytics-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.analysis-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 400px;
}
.analysis-table th {
  background: var(--bg-input);
  color: var(--text-dim);
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.analysis-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.analysis-table tr:last-child td { border-bottom: none; }
.analysis-table .rate-high { color: var(--green); font-weight: 600; }
.analysis-table .rate-mid { color: var(--yellow); font-weight: 600; }
.analysis-table .rate-low { color: var(--red); font-weight: 600; }

/* ===== ADMIN ===== */
.admin-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.admin-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.admin-desc { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 12px; }
.import-area { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.import-list-select { display: flex; align-items: center; gap: 8px; width: 100%; }
.import-list-select .input-field { flex: 1; max-width: 250px; }
.import-result {
  margin-top: 10px; padding: 10px;
  background: var(--green-bg); border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--green);
}
.import-result.error { background: var(--red-bg); color: var(--red); }
.file-name { font-size: 0.8rem; color: var(--text-dim); }

.admin-btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.admin-btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-warning { background: var(--yellow); color: #000; }

/* ===== Lead Stats Admin ===== */
.lead-stats-admin {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text-dim);
  margin-bottom: 12px;
}
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Staff ===== */
.staff-form { display: flex; gap: 8px; margin-bottom: 12px; }
.staff-form .input-field { flex: 1; }
.staff-list { }
.staff-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.staff-item:last-child { border-bottom: none; }
.staff-delete {
  background: none; border: none; color: var(--red);
  font-size: 0.85rem; cursor: pointer; padding: 4px 8px;
}

/* ===== User Management ===== */
.user-form { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.user-form .input-field { flex: 1; min-width: 100px; }

/* ===== Assignment ===== */
.assignment-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.assign-range { display: flex; align-items: center; gap: 8px; }
.assign-range .input-field { flex: 1; }
.assign-sep { color: var(--text-muted); }
.assignment-list { font-size: 0.85rem; }
.assignment-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.assign-remove {
  background: none; border: none; color: var(--red);
  cursor: pointer; font-size: 0.8rem; padding: 2px 6px;
}

/* ===== Settings ===== */
.settings-grid { display: flex; flex-direction: column; gap: 12px; }
.setting-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.9rem;
}

/* Toggle Switch */
.toggle { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-input); border-radius: 26px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: #fff;
}

/* ===== Export ===== */
.export-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== Hidden ===== */
.hidden { display: none !important; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ===== List Item in Admin ===== */
.list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item-name { font-weight: 500; }
.list-item-count { font-size: 0.8rem; color: var(--text-muted); margin-left: 8px; }
.list-item-actions { display: flex; gap: 6px; }
.list-rename-btn {
  background: none; border: none; color: var(--accent);
  font-size: 0.8rem; cursor: pointer; padding: 4px 8px;
}
.list-delete-btn {
  background: none; border: none; color: var(--red);
  font-size: 0.8rem; cursor: pointer; padding: 4px 8px;
}

/* ===== Desktop ===== */
@media (min-width: 768px) {
  .tab-content { max-width: 720px; margin: 0 auto; padding: 20px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .lead-card { padding: 24px; }
  .lead-name { font-size: 1.5rem; }
  .call-btn { font-size: 1.3rem; padding: 18px; }
  .result-btn { padding: 16px; font-size: 1.05rem; }
  .save-next-btn { font-size: 1.15rem; padding: 18px; }
  .chart-row { flex-direction: row; }
  .tab-btn { font-size: 0.95rem; }
}

@media (max-width: 767px) {
  .chart-row { flex-direction: column; }
  .chart-half { width: 100%; }
}






/* ===== Clean PC 2-Column Layout ===== */
@media (min-width: 1024px) {
    #callTab {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .call-card {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 12px;
    }
}
