:root {
  --primary: #0F172A;
  --accent: #14B8A6;
  --accent-dark: #0D9488;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
  --danger: #EF4444;
  --success: #10B981;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.04);
  --shadow-lg: 0 8px 32px rgba(15,23,42,.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: #fff; gap: 16px;
}
.boot-spin {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #14B8A6;
  border-radius: 50%;
  animation: sp 1s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ── Layout ── */
.app {
  min-height: 100vh;
  padding-bottom: 80px;
}
.app-header {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(15,23,42,.15);
}
.app-header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.app-header h1 .emoji { font-size: 1.2rem; margin-right: 6px; }
.app-header .out {
  background: rgba(255,255,255,.1);
  border: 0;
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
}
.app-header .out:hover { background: rgba(255,255,255,.18); }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #14B8A6 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  padding: 36px 32px;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-card .logo {
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 4px;
}
.login-card h2 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.login-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
  margin: 0 0 26px;
}
.login-card label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.login-card input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
.btn-primary {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  background: linear-gradient(135deg, #14B8A6, #0D9488);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
  font-family: inherit;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(20,184,166,.35); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: wait; }
.notice {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .88rem;
  margin-top: 16px;
  text-align: center;
}
.notice.err {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.foot {
  text-align: center;
  margin-top: 22px;
  font-size: .78rem;
  color: var(--muted);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: #fff;
  padding: 4px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: sticky;
  top: 64px;
  z-index: 40;
}
.tabs button {
  flex: 1;
  padding: 11px 8px;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: .88rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 9px;
  font-family: inherit;
  transition: all .15s;
}
.tabs button.active {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: #fff;
}
.tabs button i { margin-right: 5px; }

/* ── Profile ── */
.card {
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  transition: border .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
.field .hint {
  font-size: .76rem;
  color: var(--muted);
  margin-top: 4px;
}

.avatar-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.avatar {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14B8A6, #0D9488);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.8rem; font-weight: 700;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.avatar-info {
  flex: 1;
  min-width: 0;
}
.avatar-info .name {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.avatar-info .em {
  color: var(--muted);
  font-size: .85rem;
  margin: 0;
  word-break: break-all;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f1f5f9;
  border-radius: 10px;
  margin: 4px 0 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-row.active { background: #d1fae5; }
.toggle-text {
  flex: 1;
  font-size: .9rem;
  line-height: 1.35;
}
.toggle-text strong { display: block; font-weight: 700; }
.toggle-text small { color: var(--muted); font-size: .78rem; }
.toggle {
  width: 44px; height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle.on { background: var(--success); }
.toggle.on::after { transform: translateX(20px); }

.input-prefix {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border .15s, box-shadow .15s;
}
.input-prefix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
.input-prefix .pre {
  background: #f1f5f9;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  border-right: 1px solid var(--border);
}
.input-prefix input {
  border: 0;
  flex: 1;
  padding: 11px 14px;
  font-size: .95rem;
  font-family: inherit;
  background: transparent;
}
.input-prefix input:focus { outline: 0; }

.save-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  z-index: 60;
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.save-bar .btn-primary {
  max-width: 320px;
  margin-top: 0;
}

/* ── Bookings ── */
.bk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bk-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: center;
}
.bk-thumb {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: #f1f5f9;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.bk-body { flex: 1; min-width: 0; }
.bk-body h4 {
  margin: 0 0 2px;
  font-size: .95rem;
  font-weight: 700;
}
.bk-body .meta {
  color: var(--muted);
  font-size: .8rem;
  margin: 2px 0 0;
}
.bk-status {
  font-size: .72rem;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.bk-status.confirmed { background: #d1fae5; color: #065f46; }
.bk-status.pending { background: #fef3c7; color: #92400e; }
.bk-status.cancelled { background: #fee2e2; color: #991b1b; }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty .ico { font-size: 2.6rem; margin-bottom: 12px; opacity: .4; }
.empty p { margin: 0; }
.empty a { color: var(--accent-dark); font-weight: 600; }

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(15,23,42,.25);
  animation: toastIn .25s;
}
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 700px) {
  .container { padding: 32px 24px; }
  .save-bar { padding: 14px 20px; }
}
