/* =========================================================
   CalBook — Design System v3 (monochrome dashboard)
   ========================================================= */

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

:root {
  --color-primary: #16171C;
  --color-primary-dark: #000000;
  --color-primary-light: #EEF0F2;
  --gradient-primary: linear-gradient(135deg, #24262C 0%, #000000 100%);
  --color-accent: #2563EB;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;

  --color-page-bg: #E5E5E7;
  --color-shell: #FFFFFF;
  --color-panel: #F3F3F5;
  --color-surface: #FFFFFF;
  --color-bg: #F3F3F5;
  --color-bg-alt: #FAFAFB;
  --color-border: #E9E9EC;
  --color-border-strong: #D8D8DD;
  --color-text: #16171C;
  --color-text-muted: #6C6D76;
  --color-text-subtle: #9A9BA5;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(20, 20, 25, 0.05);
  --shadow-sm: 0 2px 8px rgba(20, 20, 25, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 20, 25, 0.07);
  --shadow-lg: 0 24px 64px rgba(20, 20, 25, 0.16);
  --shadow-glow: 0 0 0 4px rgba(22, 23, 28, 0.08);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-width: 250px;
  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--color-page-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--color-text); text-decoration: underline; transition: color .15s var(--ease); }
a:hover { color: var(--color-text-muted); }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 800; letter-spacing: -0.02em; color: var(--color-text); }
p { margin: 0 0 12px; color: var(--color-text-muted); }
img { max-width: 100%; }
code { background: #EDEDF0; border: 1px solid var(--color-border); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; color: var(--color-text); }
::selection { background: #DADAF0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D3D3D8; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #B4B4BC; }

.icon { width: 18px; height: 18px; display: inline-block; vertical-align: -4px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.icon-lg { width: 26px; height: 26px; }

/* ---------------- Layout shells ---------------- */
.center-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--color-page-bg);
}

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  animation: rise .35s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.auth-logo { font-size: 23px; font-weight: 800; color: var(--color-text); margin-bottom: 4px; letter-spacing: -0.02em; }
.auth-sub { color: var(--color-text-muted); font-size: 14px; margin-bottom: 30px; }

/* App shell: one big rounded white card (matches the "floating panel" reference look),
   containing a plain white sidebar and a soft-gray content panel. */
body.app-body { background: var(--color-page-bg); padding: 22px; }
.app-shell {
  display: flex;
  max-width: 1480px;
  margin: 0 auto;
  min-height: calc(100vh - 44px);
  background: var(--color-shell);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-shell);
  padding: 26px 18px;
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sidebar-logo {
  font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--color-text);
  padding: 4px 10px 26px; display: flex; align-items: center; gap: 8px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 7px; border-radius: var(--radius-full);
  color: var(--color-text-muted); font-weight: 600; font-size: 13.5px;
  transition: all .15s var(--ease);
  text-decoration: none;
}
.nav-icon-circle {
  width: 30px; height: 30px; border-radius: 50%; background: var(--color-panel);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .15s var(--ease);
}
.nav-icon-circle .icon { width: 15px; height: 15px; vertical-align: middle; color: var(--color-text-muted); }
.sidebar nav a:hover { background: var(--color-panel); color: var(--color-text); }
.sidebar nav a.active { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.sidebar nav a.active .nav-icon-circle { background: #fff; }
.sidebar nav a.active .nav-icon-circle .icon { color: var(--color-primary); }
.sidebar-footer { padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--color-border); }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 6px 4px 14px; }
.sidebar-profile .avatar-circle {
  width: 38px; height: 38px; border-radius: 50%; background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  position: relative; flex-shrink: 0;
}
.sidebar-profile .name { font-size: 13.5px; font-weight: 700; color: var(--color-text); }
.sidebar-profile .email { font-size: 11.5px; color: var(--color-text-subtle); }

.main-content {
  flex: 1; min-width: 0;
  background: var(--color-panel);
  border-radius: var(--radius-lg);
  margin: 10px 10px 10px 0;
  padding: 30px 34px;
  overflow-y: auto;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { font-size: 25px; }
.topbar p { margin: 2px 0 0; font-size: 14px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card-desc { font-size: 13.5px; color: var(--color-text-muted); margin-bottom: 18px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-full);
  font-weight: 600; font-size: 13.5px; cursor: pointer;
  border: 1px solid transparent; transition: all .15s var(--ease);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.btn-secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-bg); border-color: var(--color-text-subtle); }
.btn-danger { background: #FEF2F2; color: var(--color-danger); }
.btn-danger:hover { background: #FEE2E2; }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- Forms ---------------- */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--color-text); }
.form-group { margin-bottom: 18px; }
.form-hint { font-size: 12px; color: var(--color-text-subtle); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=date], input[type=time], input[type=url], input[type=datetime-local],
select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; color: var(--color-text);
  background: var(--color-bg-alt);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--color-primary); background: #fff;
  box-shadow: var(--shadow-glow);
}
textarea { resize: vertical; min-height: 90px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { background: var(--color-bg); border: 1.5px solid var(--color-border); border-right: none; padding: 10px 12px; border-radius: var(--radius-md) 0 0 var(--radius-md); color: var(--color-text-muted); font-size: 13px; white-space: nowrap; }
.input-prefix input { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--color-text); }
.checkbox-row input { width: auto; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #D7D7DC; border-radius: 999px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-xs); }
.switch input:checked + .slider { background: var(--color-primary); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* ---------------- Alerts / badges ---------------- */
.alert { padding: 13px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF1F5; color: #292A31; border: 1px solid #DCDDE3; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 700; letter-spacing: .01em; }
.badge-green { background: var(--color-primary); color: #fff; }
.badge-gray { background: #EEEEF1; color: #5C5D66; }
.badge-red { background: #FDECEC; color: #B42318; }
.badge-blue { background: #EAF1FE; color: #1D4ED8; }
.badge-amber { background: #FEF3E2; color: #B45309; }

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-subtle); padding: 10px 14px; border-bottom: 1.5px solid var(--color-border); font-weight: 700; }
td { padding: 15px 14px; border-bottom: 1px solid var(--color-border); font-size: 13.5px; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--color-bg-alt); }

/* ---------------- Event type cards ---------------- */
.event-type-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 22px; background: #fff; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 10px; position: relative;
  border-top: 4px solid var(--color-primary);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.event-type-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.event-type-card .et-title { font-size: 16px; font-weight: 700; }
.event-type-card .et-meta { font-size: 12.5px; color: var(--color-text-muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.event-type-card .et-actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }

/* ---------------- Public profile / booking page ---------------- */
.booking-shell { max-width: 960px; margin: 0 auto; padding: 0 20px 60px; }
.cover-banner { height: 180px; margin: 0 -20px 0; background-size: cover; background-position: center; position: relative; }
.cover-banner::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.25) 100%); }
.booking-shell.has-cover { padding-top: 0; }
.host-header { display: flex; align-items: center; gap: 18px; margin: 0 0 32px; padding-top: 44px; }
.host-header.with-cover { margin-top: -46px; padding-top: 0; position: relative; }
.host-avatar { width: 68px; height: 68px; border-radius: 50%; background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 26px; box-shadow: var(--shadow-md); border: 3px solid #fff; }
.host-name { font-size: 23px; font-weight: 800; }
.host-bio { color: var(--color-text-muted); font-size: 14px; }

.promo-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--radius-md);
  color: #fff; font-weight: 600; font-size: 13.5px; margin-bottom: 18px;
}

.booking-panel {
  display: grid; grid-template-columns: 340px 1fr; gap: 0;
  background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid var(--color-border);
}
.booking-panel .info-col { padding: 34px; border-right: 1px solid var(--color-border); background: var(--color-bg-alt); }
.booking-panel .slots-col { padding: 34px; }
@media (max-width: 800px) {
  .booking-panel { grid-template-columns: 1fr; }
  .booking-panel .info-col { border-right: none; border-bottom: 1px solid var(--color-border); }
}

.event-color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; box-shadow: 0 0 0 3px rgba(0,0,0,.03); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar-grid .cal-dow { font-size: 10.5px; color: var(--color-text-subtle); font-weight: 700; padding-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.calendar-grid .cal-day { padding: 9px 0; border-radius: var(--radius-md); cursor: pointer; font-size: 13.5px; font-weight: 600; transition: all .12s var(--ease); }
.calendar-grid .cal-day:hover:not(.disabled) { background: var(--color-primary-light); }
.calendar-grid .cal-day.selected { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-sm); }
.calendar-grid .cal-day.disabled { color: var(--color-text-subtle); cursor: not-allowed; opacity: .35; }
.calendar-grid .cal-day.empty { visibility: hidden; }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-weight: 700; font-size: 14.5px; }
.month-nav button { background: #fff; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; padding: 5px 11px; transition: all .12s var(--ease); }
.month-nav button:hover { border-color: var(--color-primary); }

.slot-list { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.slot-btn {
  border: 1.5px solid var(--color-primary); color: var(--color-primary);
  background: #fff; border-radius: var(--radius-md); padding: 11px; font-weight: 700;
  cursor: pointer; text-align: center; transition: all .15s var(--ease);
}
.slot-btn:hover { background: var(--gradient-primary); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }

.tz-picker { font-size: 13px; color: var(--color-text-muted); margin-top: 18px; }

/* AI assistant widget */
.ai-widget { border: 1.5px solid var(--color-border-strong); background: var(--color-bg-alt); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 24px; }
.ai-widget h3 { font-size: 15px; margin-bottom: 10px; }
.ai-chat-log { max-height: 220px; overflow-y: auto; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-msg { padding: 9px 13px; border-radius: var(--radius-md); font-size: 13px; max-width: 85%; }
.ai-msg.user { background: #fff; align-self: flex-end; border: 1px solid var(--color-border); }
.ai-msg.assistant { background: #fff; align-self: flex-start; border: 1px solid var(--color-primary); box-shadow: var(--shadow-xs); }
.ai-input-row { display: flex; gap: 8px; }
.ai-input-row input { flex: 1; }

/* Reminder banner (dashboard) */
.reminder-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--gradient-primary); color: #fff; border-radius: var(--radius-lg);
  padding: 16px 22px; margin-bottom: 22px; box-shadow: var(--shadow-md);
  animation: rise .3s var(--ease);
}
.reminder-banner .rb-text { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.reminder-banner .btn-secondary { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.35); color: #fff; }
.reminder-banner .btn-secondary:hover { background: rgba(255,255,255,.25); }

/* Landing page */
.landing-nav { display:flex; justify-content:space-between; align-items:center; padding:22px 44px; }
.landing-hero { text-align: center; padding: 90px 20px 60px; }
.landing-hero .eyebrow { display:inline-block; background: var(--color-primary-light); color: var(--color-text); font-weight:700; font-size:12.5px; padding:6px 14px; border-radius:var(--radius-full); margin-bottom:20px; }
.landing-hero h1 { font-size: 50px; max-width: 800px; margin: 0 auto 18px; line-height:1.08; }
.landing-hero p { font-size: 18px; max-width: 600px; margin: 0 auto 32px; }
.landing-features { max-width: 1120px; margin: 0 auto; padding: 40px 20px 100px; }
.feature-card { padding: 26px; }
.feature-icon { width:46px; height:46px; border-radius: var(--radius-md); background: var(--gradient-primary); display:flex; align-items:center; justify-content:center; margin-bottom: 14px; color:#fff; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.empty-state .icon-wrap { width:56px; height:56px; border-radius:50%; background:var(--color-panel); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; font-size:22px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-xs); }
.stat-icon-circle {
  width: 42px; height: 42px; border-radius: 50%; background: var(--color-panel);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.stat-icon-circle .icon { color: var(--color-text); }
.stat-icon-circle.dark { background: var(--color-primary); }
.stat-icon-circle.dark .icon { color: #fff; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; letter-spacing:-0.02em; }
.stat-card .stat-label { font-size: 12px; color: var(--color-text-muted); font-weight:600; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,20,25,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
  animation: fadeIn .15s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 480px; width: 100%; padding: 28px; max-height: 88vh; overflow-y: auto;
  animation: rise .2s var(--ease);
}
.modal-box .modal-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; display:flex; justify-content:space-between; align-items:center; }
.modal-close { cursor: pointer; color: var(--color-text-subtle); background:none; border:none; font-size: 20px; line-height:1; }

/* ---------------- Code / snippet blocks ---------------- */
.code-block {
  background: #16171C; color: #E5E5E9; border-radius: var(--radius-md);
  padding: 16px 18px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px;
  overflow-x: auto; white-space: pre; position: relative; line-height:1.6;
}
.copy-btn { position: absolute; top: 10px; right: 10px; }

/* ---------------- Calendar view (FullCalendar overrides) ---------------- */
#calendar-view-wrap .fc { font-family: var(--font); }
#calendar-view-wrap .fc-toolbar-title { font-size: 18px; font-weight: 800; }
#calendar-view-wrap .fc-button-primary { background: var(--color-surface) !important; border-color: var(--color-border-strong) !important; color: var(--color-text) !important; box-shadow: none !important; text-transform: capitalize; font-weight:600; }
#calendar-view-wrap .fc-button-primary:hover { background: var(--color-bg) !important; }
#calendar-view-wrap .fc-button-active, #calendar-view-wrap .fc-button-primary:not(:disabled).fc-button-active { background: var(--color-primary) !important; border-color: transparent !important; color: #fff !important; }
#calendar-view-wrap .fc-daygrid-day.fc-day-today, #calendar-view-wrap .fc-timegrid-col.fc-day-today { background: var(--color-panel) !important; }
#calendar-view-wrap .fc-event { border-radius: 6px; border: none; padding: 1px 4px; font-size: 12px; cursor: pointer; }
#calendar-view-wrap .fc-theme-standard td, #calendar-view-wrap .fc-theme-standard th { border-color: var(--color-border); }
#calendar-view-wrap { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-xs); }

@media (max-width: 900px) {
  body.app-body { padding: 0; }
  .app-shell { border-radius: 0; flex-direction: column; min-height: 100vh; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 14px 16px; overflow-x: auto; }
  .sidebar nav { flex-direction: row; }
  .sidebar-logo, .sidebar-footer { display: none; }
  .main-content { margin: 0; border-radius: 0; padding: 18px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
}
