/* SUPER CALENDAR — 2026 Web Admin Cabinet (Spatial Porcelain Editorial) */
:root {
  --bg: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --ink: #0b1220;
  --ink-2: #334155;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.16);
  --primary: #1d4ed8;
  --primary-soft: rgba(29, 78, 216, 0.09);
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.11);
  --amber: #b45309;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 28px 64px -18px rgba(15, 23, 42, 0.22);
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }

.ambient-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(56% 42% at 10% 4%, rgba(191, 219, 254, 0.45), transparent 68%),
    radial-gradient(50% 42% at 92% 8%, rgba(209, 250, 229, 0.4), transparent 68%),
    linear-gradient(180deg, #f8fafd 0%, #f3f6fb 100%);
}

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

.app-loading { min-height: 100vh; display: grid; place-items: center; }
.loader-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 36px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.loader-card img { border-radius: 14px; }
.loader-text { font-weight: 800; color: var(--ink-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%); color: #fff; box-shadow: 0 8px 20px -8px rgba(29, 78, 216, 0.55); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: #f8fafc; border-color: rgba(29, 78, 216, 0.3); }
.btn-success { background: var(--emerald); color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.22); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; border-radius: 9px; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; border-radius: 8px; }

/* Language Switcher */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(15, 23, 42, 0.06); border: 1px solid var(--line); }
.lang-switch button {
  border: 0; background: transparent; padding: 4px 10px; border-radius: 999px;
  font-family: inherit; font-size: 0.75rem; font-weight: 800; color: var(--muted); cursor: pointer;
}
.lang-switch button.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1); }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-family: inherit; font-size: 0.9rem; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.date-input-wrap { position: relative; display: flex; align-items: center; }
.date-input-wrap .input { padding-right: 40px; cursor: pointer; }
.date-trigger {
  position: absolute; right: 6px; border: 0; background: var(--primary-soft); color: var(--primary);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center;
}

/* Auth Screen */
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.auth-topbar { width: min(460px, 100%); display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.auth-card {
  width: min(460px, 100%); padding: 32px 30px; border-radius: 26px;
  background: var(--surface); backdrop-filter: blur(18px); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-row img { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); }
.brand-title { font-weight: 800; font-size: 0.98rem; line-height: 1.15; }
.brand-sub { font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.auth-card h1 { margin: 4px 0 8px; font-size: 1.48rem; font-weight: 800; letter-spacing: -0.025em; }
.auth-lead { margin: 0 0 20px; font-size: 0.9rem; color: var(--ink-2); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 13px; background: rgba(15, 23, 42, 0.055); margin-bottom: 20px; }
.auth-tabs button {
  border: 0; background: transparent; padding: 9px 10px; border-radius: 10px;
  font-family: inherit; font-size: 0.83rem; font-weight: 700; color: var(--muted); cursor: pointer;
}
.auth-tabs button.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }
.otp-notice { padding: 12px 14px; border-radius: 12px; background: var(--emerald-soft); color: #065f46; font-size: 0.84rem; font-weight: 600; margin-bottom: 14px; }
.err-box { padding: 10px 13px; border-radius: 11px; background: var(--danger-soft); color: var(--danger); font-size: 0.84rem; font-weight: 700; margin-bottom: 14px; }
.auth-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.83rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

/* Main App Shell */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 20px 14px; background: rgba(255, 255, 255, 0.84); backdrop-filter: blur(18px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px;
}
.side-bot-pill {
  padding: 11px 12px; border-radius: 14px; background: #f8fafd; border: 1px solid var(--line);
  font-size: 0.8rem;
}
.side-bot-pill strong { display: block; font-size: 0.86rem; color: var(--ink); }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 12px; border: 0; background: transparent;
  font-family: inherit; font-size: 0.88rem; font-weight: 700; color: var(--ink-2);
  cursor: pointer; text-align: left; transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { background: rgba(15, 23, 42, 0.045); color: var(--ink); }
.nav-btn.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge { margin-left: auto; padding: 2px 7px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: var(--primary); color: #fff; }

.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; padding: 14px 26px;
  background: rgba(246, 248, 252, 0.84); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer; }
.page-title { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.content { padding: 24px 26px 48px; max-width: 1260px; width: 100%; }

/* Cards, Grids, Tables */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-title { margin: 0; font-size: 1.04rem; font-weight: 800; }
.kpi-card { padding: 18px 20px; margin-bottom: 0; }
.kpi-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.kpi-val { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.kpi-sub { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.pill-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pill-tab {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.pill-tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; padding: 10px 12px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(29, 78, 216, 0.02); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; }
.badge-green { background: var(--emerald-soft); color: #065f46; }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-gray { background: rgba(15, 23, 42, 0.07); color: var(--ink-2); }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 0.92rem; }

/* Toggle Switch */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: none; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: 0.2s;
}
.switch span::before {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  border-radius: 999px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: 0.2s;
}
.switch input:checked + span { background: var(--emerald); }
.switch input:checked + span::before { transform: translateX(20px); }

/* Days checkboxes */
.days-row { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip {
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: #fff; font-size: 0.82rem; font-weight: 700; cursor: pointer; user-select: none;
}
.day-chip.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Support split view */
.support-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; min-height: 460px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 540px; overflow-y: auto; }
.chat-item {
  padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; text-align: left; font-family: inherit;
}
.chat-item.is-active { border-color: var(--primary); background: var(--primary-soft); }
.chat-thread { display: flex; flex-direction: column; height: 540px; }
.chat-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 4px; }
.msg-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 0.88rem; line-height: 1.45; }
.msg-client { align-self: flex-start; background: #f1f5f9; color: var(--ink); }
.msg-admin { align-self: flex-end; background: var(--primary); color: #fff; }
.msg-time { display: block; font-size: 0.68rem; opacity: 0.72; margin-top: 4px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(11, 18, 32, 0.48);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px;
}
.modal-box {
  width: min(640px, 100%); max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px 26px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }

/* Custom Visual Calendar DatePicker (NEVER native input[type=date]!) */
.dp-popover {
  position: fixed; z-index: 400; width: 296px; padding: 14px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-month { font-size: 0.92rem; font-weight: 800; }
.dp-nav { border: 1px solid var(--line); background: #f8fafc; width: 30px; height: 30px; border-radius: 9px; cursor: pointer; font-weight: 800; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.dp-wd { font-size: 0.7rem; font-weight: 800; color: var(--muted); padding: 4px 0; }
.dp-day {
  border: 0; background: transparent; padding: 7px 0; border-radius: 9px;
  font-family: inherit; font-size: 0.82rem; font-weight: 700; color: var(--ink); cursor: pointer;
}
.dp-day:hover { background: var(--primary-soft); color: var(--primary); }
.dp-day.is-today { border: 1px solid var(--primary); }
.dp-day.is-selected { background: var(--primary); color: #fff; }
.dp-day.is-empty { pointer-events: none; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Toast */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 13px; background: var(--ink); color: #fff; font-size: 0.86rem; font-weight: 700; box-shadow: var(--shadow-lg); max-width: 340px; }
.toast.is-err { background: var(--danger); }
.toast.is-ok { background: #065f46; }

/* Unified Auth Badges, Passkey UI (inspired by unlock-lock.com reference) & Guided Onboarding */
.trial-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  background: var(--emerald-soft); color: #065f46; font-size: 0.77rem; font-weight: 800; margin-bottom: 12px;
}
.auth-subhint { margin: 8px 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.48; text-align: center; }
.auth-or {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 12px;
  color: var(--muted); font-size: 0.78rem; font-weight: 700;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line-strong); }

.pk-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px;
  padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #ffffff; color: var(--ink); font-family: inherit; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pk-btn:hover:not(:disabled) { background: #f8fafc; border-color: rgba(29, 78, 216, 0.35); transform: translateY(-1px); }
.pk-btn:disabled { opacity: 0.6; cursor: default; }
.pk-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.pk-msg { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 600; line-height: 1.45; }
.pk-msg:empty { display: none; }
.pk-msg.is-info { background: var(--primary-soft); color: var(--primary); }
.pk-msg.is-ok { background: var(--emerald-soft); color: #065f46; }
.pk-msg.is-err { background: var(--danger-soft); color: var(--danger); }

.pk-list { margin-top: 14px; border-top: 1px solid var(--line); }
.pk-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.pk-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary); display: grid; place-items: center;
}
.pk-main { flex: 1 1 180px; min-width: 0; }
.pk-name { font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.pk-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 4px; font-size: 0.76rem; color: var(--muted); align-items: center; }
.pk-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.pk-promo {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 18px;
  border-radius: 16px; background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
  border: 1px solid rgba(29, 78, 216, 0.16); border-left: 4px solid var(--primary);
  flex-wrap: wrap;
}
.pk-promo-ic {
  width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--primary);
  display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(29, 78, 216, 0.12);
}
.pk-promo-body { flex: 1 1 240px; min-width: 0; }
.pk-promo-title { font-size: 0.94rem; font-weight: 800; color: var(--ink); }
.pk-promo-desc { font-size: 0.82rem; color: var(--ink-2); margin-top: 2px; }

.flow-box {
  margin-top: 14px; padding: 16px; border-radius: 16px;
  background: #f8fafd; border: 1px solid rgba(29, 78, 216, 0.18);
}
.flow-status {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 700; margin-bottom: 12px;
  background: var(--primary-soft); color: var(--primary);
}
.flow-status.is-ready { background: var(--emerald-soft); color: #065f46; }
.flow-status.is-err { background: var(--danger-soft); color: var(--danger); }

.onb-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.onb-step {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px;
  border-radius: 16px; border: 1px solid var(--line); background: #fff;
}
.onb-step.is-done { background: #f4fdf8; border-color: rgba(5, 150, 105, 0.25); }
.onb-step.is-active { border-color: rgba(29, 78, 216, 0.35); box-shadow: 0 8px 24px -14px rgba(29, 78, 216, 0.35); }
.onb-num {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  font-size: 0.86rem; font-weight: 800; background: var(--primary-soft); color: var(--primary);
}
.onb-step.is-done .onb-num { background: var(--emerald); color: #fff; }
.onb-step h3 { margin: 0 0 6px; font-size: 0.98rem; font-weight: 800; }
.onb-step p { margin: 0; font-size: 0.86rem; color: var(--ink-2); line-height: 1.55; }
.nav-btn.is-locked { opacity: 0.5; }
.nav-btn.is-locked:hover { opacity: 0.72; }

.fmt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fmt-card {
  padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line-strong);
  background: #fff; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.fmt-card:hover { border-color: rgba(29, 78, 216, 0.35); }
.fmt-card.is-active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1); }
.fmt-card strong { display: block; font-size: 0.88rem; color: var(--ink); margin-bottom: 3px; }
.fmt-card span { display: block; font-size: 0.76rem; color: var(--muted); line-height: 1.38; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 150; transform: translateX(-105%); transition: transform 0.25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .support-grid, .fmt-grid { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}
