/* PayPal-inspired palette */
:root {
  --pp-blue: #003087;
  --pp-blue-dark: #001c64;
  --pp-blue-light: #009cde;
  --pp-yellow: #ffc439;
  --pp-bg: #f5f7fa;
  --pp-surface: #ffffff;
  --pp-border: #d6dade;
  --pp-text: #2c2e2f;
  --pp-muted: #6c7378;
  --pp-success: #1f8754;
  --pp-danger: #b3261e;
  --pp-warn: #b65800;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 48, 135, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 48, 135, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--pp-bg);
  color: var(--pp-text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pp-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top nav ---------- */
.nav {
  background: var(--pp-surface);
  border-bottom: 1px solid var(--pp-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--pp-blue);
  font-size: 17px;
  letter-spacing: 0.2px;
}
.nav-brand .dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pp-blue) 0%, var(--pp-blue-light) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px;
}
.nav-right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--pp-muted); }
.nav-right .who { color: var(--pp-text); font-weight: 600; }

/* ---------- generic ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
h1 { font-size: 22px; margin: 0 0 4px; color: var(--pp-blue-dark); }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--pp-muted); font-size: 13px; }

.card {
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card + .card { margin-top: 18px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--pp-blue);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--pp-blue-dark); }
.btn-secondary {
  background: #fff;
  color: var(--pp-blue);
  border-color: var(--pp-blue);
}
.btn-secondary:hover:not(:disabled) { background: #eef3ff; }
.btn-ghost {
  background: transparent;
  color: var(--pp-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { color: var(--pp-text); }
.btn-danger {
  background: #fff;
  color: var(--pp-danger);
  border-color: var(--pp-danger);
}
.btn-danger:hover:not(:disabled) { background: #fdecec; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- form ---------- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--pp-text); }
.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus {
  border-color: var(--pp-blue);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.15);
}

/* ---------- login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 156, 222, 0.10), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(0, 48, 135, 0.10), transparent 60%),
    var(--pp-bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--pp-surface);
  border: 1px solid var(--pp-border);
  border-radius: 14px;
  padding: 28px 26px;
  box-shadow: var(--shadow-md);
}
.login-card .brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  color: var(--pp-blue);
  font-weight: 700;
  font-size: 17px;
}
.login-card .brand .dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pp-blue) 0%, var(--pp-blue-light) 100%);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.login-card h1 { font-size: 20px; margin: 4px 0 4px; color: var(--pp-blue-dark); }
.login-card p.intro { color: var(--pp-muted); font-size: 13px; margin: 0 0 18px; }
.login-card .btn-primary { width: 100%; padding: 12px; }
.login-card .footnote {
  margin-top: 14px;
  font-size: 12px;
  color: var(--pp-muted);
  text-align: center;
  line-height: 1.6;
}

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--pp-border);
  font-size: 14px;
  vertical-align: middle;
}
.table th {
  background: #fafbfc;
  color: var(--pp-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; white-space: nowrap; }

.phone-cell {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  color: var(--pp-text);
  font-size: 14px;
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge .dotmark { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.badge-free  { background: #eaf6ef; color: var(--pp-success); border-color: #c7e5d3; }
.badge-free .dotmark { background: var(--pp-success); }
.badge-busy  { background: #fdecec; color: var(--pp-danger);  border-color: #f4c8c4; }
.badge-busy .dotmark { background: var(--pp-danger); }
.badge-mine  { background: #eef3ff; color: var(--pp-blue);    border-color: #c3d3f7; }
.badge-mine .dotmark { background: var(--pp-blue); }

/* ---------- holding panel ---------- */
.holding {
  background: linear-gradient(135deg, var(--pp-blue) 0%, var(--pp-blue-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}
.holding .label { font-size: 12px; opacity: 0.8; letter-spacing: 0.4px; text-transform: uppercase; }
.holding .phone {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
}
.holding .timer {
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 700;
}
.holding .actions { display: flex; gap: 10px; }
.holding .btn-primary { background: #fff; color: var(--pp-blue); }
.holding .btn-primary:hover:not(:disabled) { background: #f0f4ff; }
.holding .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.holding .btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.holding .btn-danger { background: transparent; color: #fff; border-color: rgba(255,196,57,0.9); }
.holding .btn-danger:hover:not(:disabled) { background: rgba(255,196,57,0.15); }
.holding .btn:disabled { opacity: 0.45; }

.sms-box {
  margin-top: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 48px;
  max-height: 220px;
  overflow: auto;
}
.sms-empty { opacity: 0.7; font-style: italic; }

/* ---------- toast ---------- */
.toast-stack {
  position: fixed;
  top: 18px; right: 18px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 1000;
}
.toast {
  background: var(--pp-text);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  max-width: 360px;
}
.toast.error { background: var(--pp-danger); }
.toast.success { background: var(--pp-success); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .table th, .table td { padding: 10px 8px; font-size: 13px; }
  .holding { padding: 16px; }
  .holding .phone { font-size: 18px; }
  .holding .timer { font-size: 22px; }
  .nav { padding: 12px 16px; }
  .container { padding: 18px 14px 60px; }
}
