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

:root {
  --bg:           #F9F6F1;
  --card:         #FFFFFF;
  --fg:           #1A1A1A;
  --muted:        #6B6B6B;
  --accent:       #E57415;
  --accent-hover: #C05F0A;
  --green:        #1A3606;
  --green-mid:    #2A5209;
  --green-light:  #3D7510;
  --border:       #E2D9CC;
  --soft-bg:      #F9F6F1;
  --error:        #cf222e;
  --success:      #1A3606;
}

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #F0EBE3; }
::-webkit-scrollbar-thumb { background: #C8B89A; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #E57415; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  max-width: 100%;
  margin: 0;
  padding: 0 0 60px;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--green);
  border-bottom: 3px solid var(--accent);
  padding: 0 20px;
  height: 54px;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 span { color: #fff; }

h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
}

h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

main {
  padding: 20px;
}

#agent-info {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 8px;
}

.state-panel {
  padding: 4px 0;
}

.hidden { display: none !important; }
.error { color: var(--error); margin-top: 8px; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }

/* ── Buttons ── */
button {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:hover:not(:disabled) { background: var(--accent-hover); }

button.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
}
button.secondary:hover:not(:disabled) {
  background: var(--card);
  color: var(--fg);
}

/* ── Inputs ── */
input[type="email"],
input[type="password"],
input[type="datetime-local"],
textarea {
  display: block;
  width: 100%;
  padding: 9px 11px;
  margin: 6px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--card);
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }

/* ── Auth panel ── */
#email-signin-form button { width: 100%; }
.separator {
  text-align: center;
  color: var(--muted);
  margin: 12px 0;
  font-size: 12px;
}
#google-signin-btn { width: 100%; background: var(--green); }
#google-signin-btn:hover:not(:disabled) { background: var(--green-mid); }

pre {
  background: var(--soft-bg);
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border);
}

/* ── Volgende lead knop ── */
#call-next-btn {
  font-size: 16px;
  padding: 16px 32px;
  margin-top: 12px;
  background: var(--green);
  border: 1px solid var(--green-light);
  width: 100%;
}
#call-next-btn:hover:not(:disabled) { background: var(--green-mid); }

#sdk-status {
  color: var(--muted);
  font-size: 13px;
}

/* ── Active call ── */
#lead-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

#call-status {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 13px;
}

.script-section,
.disposition-section {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 10px;
  margin: 14px 0;
}

#script-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}

.disposition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.disposition-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: background 0.1s;
}
.disposition-grid label:hover { background: var(--soft-bg); }

.callback-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}

.call-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

#hangup-btn {
  background: var(--error);
  flex-shrink: 0;
}
#hangup-btn:hover:not(:disabled) { background: #a40e26; }
#save-next-btn { flex: 1; }

/* ── Lead card (active call) ── */
.lead-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.lead-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.lead-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ── Routing note ── */
.routing-note {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid #e0c97a;
  background: #fffbe6;
  border-radius: 10px;
  font-size: 13px;
}

.routing-note h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #7a5c00;
  text-transform: none;
  letter-spacing: 0;
}

.routing-note-subtitle {
  margin: 0 0 10px;
  font-size: 12px;
  color: #a07800;
}

.routing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.routing-table th {
  text-align: left;
  padding: 4px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #7a5c00;
  border-bottom: 1px solid #e0c97a;
}

.routing-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0e4a0;
}

.routing-table tr:last-child td { border-bottom: none; }
.route-forward td:first-child { font-weight: 500; }
.route-confirm td { color: #7a5c00; font-style: italic; }
.route-remove td:first-child { color: var(--muted); }
