/* =====================================================================
   BookingHub — macOS-inspired UI · white background · windows & modals
   ===================================================================== */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f9;
  --surface-3: #f0f0f3;
  --text: #1d1d1f;
  --text-2: #3a3a3c;
  --muted: #86868b;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .14);

  --blue: #007aff;
  --blue-2: #0063d1;
  --blue-soft: rgba(0, 122, 255, .10);
  --green: #28a745;
  --green-soft: rgba(52, 199, 89, .13);
  --orange: #e8890c;
  --orange-soft: rgba(255, 159, 10, .14);
  --red: #e5372b;
  --red-soft: rgba(255, 59, 48, .10);
  --purple: #8e44d6;
  --purple-soft: rgba(175, 82, 222, .12);
  --grey-soft: rgba(142, 142, 147, .14);

  --light-red: #ff5f57;
  --light-yellow: #febc2e;
  --light-green: #28c840;

  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 14px;
  --shadow-window: 0 0 0 .5px rgba(0, 0, 0, .10), 0 24px 64px rgba(0, 0, 0, .10), 0 6px 18px rgba(0, 0, 0, .06);
  --shadow-modal: 0 0 0 .5px rgba(0, 0, 0, .14), 0 38px 90px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .12);
  --shadow-btn: 0 .5px 1.5px rgba(0, 0, 0, .12), inset 0 .5px 0 rgba(255, 255, 255, .6);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --menubar-h: 30px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }
.inline-form { display: inline; margin: 0; }
.link { color: var(--blue); font-weight: 500; }
.link:hover { text-decoration: underline; }
.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ---------------- Menu bar ---------------- */
.menubar {
  position: fixed; inset: 0 0 auto 0; height: var(--menubar-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 13px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--line);
}
.menubar-left, .menubar-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.menubar-item { color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.menubar-user { font-weight: 500; }
.app-glyph {
  width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center;
  background: linear-gradient(180deg, #3b9bff, var(--blue)); color: #fff;
}
.app-glyph .icon { width: 12px; height: 12px; stroke-width: 3; }
.menubar-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent;
  font: inherit; color: var(--text-2); padding: 3px 8px; border-radius: 5px; cursor: pointer;
}
.menubar-btn:hover { background: rgba(0, 0, 0, .06); }

/* ---------------- Desktop & windows ---------------- */
.desktop {
  min-height: 100vh;
  padding: calc(var(--menubar-h) + 26px) 28px 120px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(0, 122, 255, .045), transparent 60%),
    var(--bg);
}
.window {
  max-width: 1240px; margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  animation: window-in .35s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes window-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.titlebar {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 16px;
  background: linear-gradient(180deg, #fbfbfd, #f3f3f6);
  border-bottom: .5px solid var(--line-2);
}
.title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; pointer-events: none;
}
.titlebar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; position: relative; z-index: 1; }
.lights { display: flex; gap: 8px; }
.light {
  width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15);
}
.light.red { background: var(--light-red); }
.light.yellow { background: var(--light-yellow); }
.light.green { background: var(--light-green); }
button.light { cursor: pointer; }
button.light .icon { width: 8px; height: 8px; stroke-width: 3; color: rgba(80, 0, 0, .65); opacity: 0; }
.lights:hover button.light .icon, button.light:focus-visible .icon { opacity: 1; }

.window-body { padding: 24px 26px 28px; }
.window-status {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 18px; font-size: 12px; color: var(--muted);
  background: var(--surface-2); border-top: .5px solid var(--line);
}
.live-indicator { display: inline-flex; align-items: center; gap: 6px; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: var(--light-green); box-shadow: 0 0 0 3px rgba(40, 200, 64, .18); animation: pulse 2s infinite; }
.live-indicator.is-offline i { background: var(--muted); box-shadow: none; animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(40, 200, 64, 0); } }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: var(--radius-sm);
  font: 500 13.5px/1 var(--font); color: var(--text);
  background: #fff; border: .5px solid var(--line-2); box-shadow: var(--shadow-btn);
  cursor: pointer; white-space: nowrap; transition: background .15s, transform .05s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { background: #f6f6f8; }
.btn:active { transform: translateY(.5px); background: #ececef; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(0, 122, 255, .35); }
.btn-sm { height: 28px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; height: 38px; font-size: 14px; }
.btn-primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, #2a8cff, var(--blue));
  box-shadow: 0 .5px 1.5px rgba(0, 60, 150, .35), inset 0 .5px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { background: linear-gradient(180deg, #1c84ff, var(--blue-2)); }
.btn-primary:active { background: var(--blue-2); }
.btn-success { color: #fff; border-color: transparent; background: linear-gradient(180deg, #3dcc5c, #28b04a); }
.btn-success:hover { background: #24a043; }
.btn-danger { color: #fff; border-color: transparent; background: linear-gradient(180deg, #ff5a4f, var(--red)); }
.btn-danger:hover { background: #d42f24; }
.btn-danger-ghost { color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn.is-loading { opacity: .7; pointer-events: none; }
.btn .icon { width: 14px; height: 14px; }

/* ---------------- Forms ---------------- */
.form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search],
input[type=date], input[type=time], select, textarea {
  width: 100%; height: 34px; padding: 0 11px;
  font: 14px var(--font); color: var(--text);
  background: #fff; border: .5px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 1.5px rgba(0, 0, 0, .04);
  transition: box-shadow .15s, border-color .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; }
select {
  padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 122, 255, .25); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; margin: 4px 0; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.end-preview {
  height: 34px; display: flex; align-items: center; padding: 0 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-2); font-weight: 500;
}

/* ---------------- Notices, toasts ---------------- */
.notice { padding: 10px 12px; border-radius: 9px; font-size: 13.5px; margin-bottom: 14px; }
.notice-error { background: var(--red-soft); color: #b3261e; }
.notice-success { background: var(--green-soft); color: #1d7a34; }
.notice-info { background: var(--blue-soft); color: #0a58b5; }

.toast-stack { position: fixed; top: calc(var(--menubar-h) + 12px); right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  padding: 12px 14px 12px 38px; border-radius: 12px; font-size: 13.5px; position: relative;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 12px 32px rgba(0, 0, 0, .14);
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.toast::before { content: ""; position: absolute; left: 14px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); }
.toast-success::before { background: var(--light-green); }
.toast-error::before { background: var(--light-red); }
.toast-info::before { background: var(--blue); }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* ---------------- Stats ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: .5px solid var(--line); color: var(--text);
  transition: transform .15s, box-shadow .15s;
}
a.stat:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .06); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tone-orange .stat-value { color: var(--orange); }
.tone-red .stat-value { color: var(--red); }
.tone-green .stat-value { color: var(--green); }
.tone-blue .stat-value { color: var(--blue); }

/* ---------------- Sections, lists ---------------- */
.section { margin-bottom: 30px; }
.section:last-child { margin-bottom: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; font-weight: 650; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }

.list { list-style: none; margin: 0; padding: 0; border: .5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-bottom: .5px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-time { font-weight: 600; font-size: 13px; min-width: 70px; display: flex; flex-direction: column; }
.list-time span { font-weight: 400; color: var(--muted); font-size: 12px; }
.list-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 9px 0; border-bottom: .5px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--muted); }
.dot-pending { background: #ff9f0a; } .dot-confirmed { background: #34c759; } .dot-declined { background: #ff3b30; }
.dot-cancelled { background: #8e8e93; } .dot-completed { background: var(--blue); } .dot-neutral { background: #c7c7cc; }
.feed-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: .5px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  padding: 10px 14px; background: var(--surface-2); border-bottom: .5px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: .5px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafafc; }
.table-compact td { padding: 8px 14px; }
.table th.t-right { text-align: right; }
.cell-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
tr.is-muted td { opacity: .55; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #a1a1a6, #7c7c80);
}
.result-count { margin: 0 0 8px; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--orange-soft); color: #b86a00; }
.badge-confirmed { background: var(--green-soft); color: #1d7a34; }
.badge-declined { background: var(--red-soft); color: #c4281c; }
.badge-cancelled { background: var(--grey-soft); color: #636366; }
.badge-completed { background: var(--blue-soft); color: #0a5cc2; }

/* ---------------- Segmented control & filters ---------------- */
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-bottom: 14px;
  background: var(--surface-3); border-radius: 9px;
}
.segmented a {
  padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.segmented a:hover { color: var(--text); }
.segmented a.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .05); }
.segmented .count { font-size: 11px; color: var(--muted); font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.filters select { width: auto; min-width: 140px; height: 30px; font-size: 13px; }
.filters input[type=date] { width: auto; height: 30px; font-size: 13px; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 14px; height: 14px; }
.search input { height: 30px; padding-left: 31px; font-size: 13px; border-radius: 8px; background: var(--surface-2); }
.date-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.pager-info { font-size: 12.5px; color: var(--muted); }

/* ---------------- Cards (client & worker) ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.booking-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius);
  background: #fff; border: .5px solid var(--line-2); box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  position: relative; overflow: hidden;
}
.booking-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--muted); }
.booking-card.status-pending::before { background: #ff9f0a; }
.booking-card.status-confirmed::before { background: #34c759; }
.booking-card.status-declined::before { background: #ff3b30; }
.booking-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.booking-card h3 { font-size: 17px; font-weight: 650; }
.booking-card p { margin: 0; }
.booking-time { font-weight: 500; color: var(--text-2); }
.booking-worker { display: flex; align-items: center; gap: 6px; color: var(--text-2); margin-top: 4px !important; }
.booking-state { font-size: 12.5px; color: var(--muted); }
.booking-card footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--line); }
.booking-card footer form { margin: 0; }

/* ---------------- Empty states ---------------- */
.empty { text-align: center; padding: 34px 20px; border: .5px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.empty .icon { width: 30px; height: 30px; color: #c7c7cc; margin-bottom: 8px; }
.empty h3 { font-size: 14.5px; font-weight: 600; }
.empty p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---------------- Account ---------------- */
.account-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; }
.card { padding: 20px; border-radius: var(--radius); border: .5px solid var(--line-2); background: #fff; }
.card-title { font-size: 15px; font-weight: 650; margin-bottom: 14px; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 14px; }
.details dt { color: var(--muted); font-size: 13px; }
.details dd { margin: 0; font-weight: 500; }

/* ---------------- Modals ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(250, 250, 252, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s; }
.modal-window {
  position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); overflow: hidden;
  opacity: 0; transform: scale(.94) translateY(6px); transition: opacity .18s, transform .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-window.modal-sm { width: min(430px, 100%); }
.modal.is-open .modal-backdrop { opacity: 1; }
.modal.is-open .modal-window { opacity: 1; transform: none; }
.modal-window > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-body { padding: 20px 22px 8px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: var(--surface-2); border-top: .5px solid var(--line); }
.modal-open { overflow: hidden; }
.summary { margin: 0 0 14px; padding: 10px 12px; background: var(--surface-2); border-radius: 9px; font-size: 13px; font-weight: 500; }
.summary:empty { display: none; }
.alert-icon { width: 44px; height: 44px; margin: 4px auto 10px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #ffb340, #ff9500); }
.alert-icon .icon { width: 22px; height: 22px; }
.confirm-text { text-align: center; font-weight: 500; margin: 0 0 12px; }

.availability { margin: -2px 0 14px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.availability-title { width: 100%; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.chip { padding: 3px 9px; border-radius: 99px; background: #fff; border: .5px solid var(--line-2); font-size: 12px; }

/* ---------------- Dock ---------------- */
.dock {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: flex-end; gap: 6px; padding: 7px 9px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 20px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 12px 36px rgba(0, 0, 0, .12);
}
.dock-item { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 3px 5px; }
.dock-icon {
  position: relative; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15), inset 0 .5px 0 rgba(255, 255, 255, .35);
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.3);
}
.dock-icon .icon { width: 24px; height: 24px; stroke-width: 1.9; }
.dock-item:hover .dock-icon { transform: translateY(-6px) scale(1.12); }
.dock-item::after { content: ""; position: absolute; bottom: -1px; width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.dock-item.is-active::after { background: rgba(0, 0, 0, .55); }
.dock-label {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap;
  background: rgba(255, 255, 255, .95); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 4px 12px rgba(0, 0, 0, .1);
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.dock-item:hover .dock-label, .dock-item:focus-visible .dock-label { opacity: 1; }
.dock-badge {
  position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 1.5px #fff;
}
.tile-blue { background: linear-gradient(180deg, #4aa3ff, #0a6cff); }
.tile-red { background: linear-gradient(180deg, #ff6b61, #f0352a); }
.tile-green { background: linear-gradient(180deg, #4cd964, #22ad44); }
.tile-orange { background: linear-gradient(180deg, #ffb340, #ff8a00); }
.tile-purple { background: linear-gradient(180deg, #c57bff, #8e3ff0); }
.tile-grey { background: linear-gradient(180deg, #a8a8ad, #6e6e73); }

/* ---------------- Login ---------------- */
.login-desktop {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px;
  background:
    radial-gradient(900px 480px at 20% 0%, rgba(0, 122, 255, .07), transparent 60%),
    radial-gradient(800px 420px at 90% 100%, rgba(175, 82, 222, .06), transparent 60%),
    #fff;
}
.login-window { width: min(400px, 100%); margin: 0; }
.login-body { padding: 26px 30px 28px; text-align: center; }
.login-body .form { text-align: left; margin-top: 18px; }
.login-body h2 { font-size: 22px; font-weight: 700; }
.login-body > p { margin: 4px 0 0; }
.login-logo {
  width: 64px; height: 64px; margin: 2px auto 14px; border-radius: 16px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #4aa3ff, #0a6cff); box-shadow: 0 10px 24px rgba(0, 122, 255, .3), inset 0 .5px 0 rgba(255, 255, 255, .4);
}
.login-logo .icon { width: 32px; height: 32px; stroke-width: 2.6; }
.login-hint { font-size: 12px; color: var(--muted); margin: 16px 0 0; line-height: 1.6; }
.login-foot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .split, .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .menubar { padding: 0 10px; }
  .menubar-hide-sm { display: none !important; }
  .menubar-left, .menubar-right { gap: 10px; }
  .desktop { padding: calc(var(--menubar-h) + 12px) 8px 108px; }
  .window { border-radius: 12px; }
  .window-body { padding: 16px 14px 20px; }
  .titlebar { flex-wrap: wrap; }
  .title { position: static; transform: none; order: -1; }
  .lights { display: none; }
  .titlebar-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stats-3 .stat { padding: 10px 11px; }
  .stats-3 .stat-value { font-size: 21px; }
  .stats-3 .stat-label { font-size: 11.5px; line-height: 1.3; }
  .table { min-width: 620px; }
  .table td { white-space: nowrap; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .filters select, .search { max-width: none; flex: 1 1 100%; }
  .window-status { flex-direction: column; align-items: flex-start; gap: 4px; }
  .dock { bottom: 8px; padding: 6px 7px; border-radius: 18px; }
  .dock-icon { width: 42px; height: 42px; }
  .modal { padding: 0; place-items: end center; }
  .modal-window { width: 100% !important; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-window .lights { display: flex; }
  .modal-window .title { position: absolute; left: 50%; transform: translateX(-50%); }
  .toast-stack { left: 12px; right: 12px; max-width: none; }
}
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--text-2); }
.btn-group { display: inline-flex; align-items: center; border-radius: var(--radius-sm); box-shadow: var(--shadow-btn); background: #fff; border: .5px solid var(--line-2); overflow: hidden; }
.btn-group-label { display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; font-size: 12.5px; font-weight: 500; color: var(--muted); height: 28px; border-right: .5px solid var(--line); }
.btn-group .btn { border: 0; border-radius: 0; box-shadow: none; border-right: .5px solid var(--line); }
.btn-group .btn:last-child { border-right: 0; }

/* ── Selector de idioma (English | Español) ── */
.lang-switch { display: inline-flex; margin-bottom: 0; }
.segmented button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-2); padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .05); }
.login-lang { margin: 0 0 18px; }

/* ---------------- En curso, extensiones, zona del servicio, alertas ---------------- */
.tone-purple .stat-value { color: var(--purple); }
.badge-in_progress { background: var(--purple-soft); color: #7a2fc0; }
.booking-card.status-in_progress::before { background: var(--purple); }
.cell-note.note-live { color: #7a2fc0; font-weight: 500; }
.cell-note.note-warn { color: #b86a00; font-weight: 500; }
.cell-note.tz-note { display: flex; align-items: center; gap: 4px; }
.cell-note.tz-note .icon { width: 12px; height: 12px; flex: none; }
.row-warn td { background: rgba(255, 59, 48, .04); }
.availability-tz { width: 100%; margin-top: 2px; }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; border: .5px solid var(--line); }
.alert-info { background: var(--blue-soft); color: #0a4f9e; }
.alert-warning { background: var(--orange-soft); color: #8a4f00; }
.alert-success { background: var(--green-soft); color: #1d6b31; }
.alert-text { flex: 1; min-width: 0; }
.alert-meta { display: block; font-size: 11.5px; opacity: .7; margin-top: 2px; }
.alert-close { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px; border-radius: 6px; opacity: .6; line-height: 0; }
.alert-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.alert-close .icon { width: 15px; height: 15px; }
.alerts-all { align-self: flex-end; margin: 0; }
.alerts-all button { border: 0; background: none; cursor: pointer; font: inherit; color: var(--blue); }
.vpn-note { margin-top: 3px; font-size: 12px; font-weight: 500; color: #b3261e; }
.passkey-list { list-style: none; margin: 0 0 14px; padding: 0; border: .5px solid var(--line); border-radius: 10px; }
.passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.passkey-list li + li { border-top: .5px solid var(--line); }
.login-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12.5px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: .5px; background: var(--line-2); }
[data-passkey-error] { margin-top: 12px; }

/* =====================================================================
   Logo de la empresa
   ===================================================================== */
.t-center { text-align: center; }
.glyph-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; line-height: 0; }
.glyph-btn:hover .app-glyph { box-shadow: 0 0 0 2px var(--blue-soft), 0 0 0 3.5px var(--blue); }
.glyph-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .35); }
.app-glyph.has-logo, .login-logo.has-logo { background: transparent; box-shadow: none; overflow: hidden; }
.app-glyph.has-logo, .login-logo.has-logo { display: flex; align-items: center; justify-content: center; }
.app-glyph.has-logo { width: auto; height: 22px; border-radius: 4px; }
.app-glyph.has-logo img { height: 22px; width: auto; max-width: 80px; object-fit: contain; display: block; }
.login-logo.has-logo { width: auto; height: 84px; border-radius: 0; }
.login-logo.has-logo img { height: 84px; width: auto; max-width: 240px; object-fit: contain; display: block; }
.logo-preview { display: flex; justify-content: center; padding: 14px; margin-bottom: 6px; border-radius: 12px; background: var(--surface-2); }
.logo-preview .login-logo { margin: 0; }
.logo-remove { margin-right: auto; }
input[type=file] { font: 13px var(--font); color: var(--text-2); width: 100%; }
input[type=file]::file-selector-button {
  font: 500 13px var(--font); color: var(--text); margin-right: 10px; padding: 6px 12px; cursor: pointer;
  background: var(--btn-bg); border: .5px solid var(--line-2); border-radius: var(--radius-sm);
}

/* =====================================================================
   Botón de tema (☀️ / 🌙)
   ===================================================================== */
.theme-btn .icon { width: 15px; height: 15px; }
.theme-btn .icon:last-child { display: none; }                 /* sol oculto en modo claro */
[data-theme="dark"] .theme-btn .icon:first-child { display: none; }
[data-theme="dark"] .theme-btn .icon:last-child { display: inline-block; }
html.theme-anim, html.theme-anim * { transition: background-color .25s, border-color .25s, color .25s !important; }

/* =====================================================================
   DARK MODE — se activa con <html data-theme="dark">
   ===================================================================== */
:root { --btn-bg: #fff; }
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121214;
  --surface: #1c1c1f;
  --surface-2: #232327;
  --surface-3: #2c2c31;
  --text: #f2f2f7;
  --text-2: #d1d1d6;
  --muted: #98989f;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --btn-bg: #2c2c31;

  --blue: #0a84ff;
  --blue-2: #0071e3;
  --blue-soft: rgba(10, 132, 255, .18);
  --green: #32d74b;
  --green-soft: rgba(50, 215, 75, .16);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, .18);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, .16);
  --purple: #bf5af2;
  --purple-soft: rgba(191, 90, 242, .18);
  --grey-soft: rgba(142, 142, 147, .2);

  --shadow-window: 0 0 0 .5px rgba(255, 255, 255, .1), 0 24px 64px rgba(0, 0, 0, .55), 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-modal: 0 0 0 .5px rgba(255, 255, 255, .14), 0 38px 90px rgba(0, 0, 0, .7), 0 10px 30px rgba(0, 0, 0, .4);
  --shadow-btn: 0 .5px 1.5px rgba(0, 0, 0, .4), inset 0 .5px 0 rgba(255, 255, 255, .06);
}
[data-theme="dark"] .menubar { background: rgba(28, 28, 31, .78); }
[data-theme="dark"] .menubar-btn:hover,
[data-theme="dark"] .alert-close:hover { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .desktop { background: radial-gradient(1200px 500px at 50% -10%, rgba(10, 132, 255, .08), transparent 60%), var(--bg); }
[data-theme="dark"] .titlebar { background: linear-gradient(180deg, #2a2a2e, #232327); }
[data-theme="dark"] .btn,
[data-theme="dark"] .btn-group { background: var(--btn-bg); }
[data-theme="dark"] .btn:hover { background: #36363c; }
[data-theme="dark"] .btn:active { background: #3f3f46; }
[data-theme="dark"] .btn-primary { background: linear-gradient(180deg, #2b93ff, var(--blue)); }
[data-theme="dark"] .btn-primary:hover { background: linear-gradient(180deg, #1f8bff, var(--blue-2)); }
[data-theme="dark"] .btn-success { background: linear-gradient(180deg, #34c759, #248a3d); }
[data-theme="dark"] .btn-danger { background: linear-gradient(180deg, #ff5a4f, #d93a2f); }
[data-theme="dark"] .btn-danger-ghost { background: var(--btn-bg); color: var(--red); }
[data-theme="dark"] .btn-danger-ghost:hover { background: var(--red-soft); }
[data-theme="dark"] input[type=text], [data-theme="dark"] input[type=email], [data-theme="dark"] input[type=tel],
[data-theme="dark"] input[type=password], [data-theme="dark"] input[type=search], [data-theme="dark"] input[type=date],
[data-theme="dark"] input[type=time], [data-theme="dark"] select, [data-theme="dark"] textarea {
  background-color: #2a2a2e; box-shadow: inset 0 1px 1.5px rgba(0, 0, 0, .25);
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%23bbb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
[data-theme="dark"] .search input { background-color: var(--surface-2); }
[data-theme="dark"] .card,
[data-theme="dark"] .booking-card,
[data-theme="dark"] .modal-window,
[data-theme="dark"] .chip { background: var(--surface); }
[data-theme="dark"] .booking-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
[data-theme="dark"] .table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
[data-theme="dark"] .segmented a.is-active,
[data-theme="dark"] .segmented button.is-active { background: #48484e; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, .5); }
[data-theme="dark"] .toast { background: rgba(44, 44, 49, .9); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .1), 0 12px 32px rgba(0, 0, 0, .5); }
[data-theme="dark"] .dock { background: rgba(40, 40, 44, .72); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .12), 0 12px 36px rgba(0, 0, 0, .5); }
[data-theme="dark"] .dock-item.is-active::after { background: rgba(255, 255, 255, .7); }
[data-theme="dark"] .dock-label { background: rgba(44, 44, 49, .96); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .12), 0 4px 12px rgba(0, 0, 0, .4); }
[data-theme="dark"] .dock-badge { box-shadow: 0 0 0 1.5px var(--surface); }
[data-theme="dark"] .empty .icon { color: #545458; }
[data-theme="dark"] .login-desktop {
  background:
    radial-gradient(900px 480px at 20% 0%, rgba(10, 132, 255, .12), transparent 60%),
    radial-gradient(800px 420px at 90% 100%, rgba(191, 90, 242, .1), transparent 60%),
    var(--bg);
}
/* Textos de color sobre fondos suaves: más claros para que se lean en oscuro */
[data-theme="dark"] .notice-error, [data-theme="dark"] .vpn-note { color: #ff8a80; }
[data-theme="dark"] .notice-success { color: #6fe08a; }
[data-theme="dark"] .notice-info { color: #7ab8ff; }
[data-theme="dark"] .badge-pending, [data-theme="dark"] .cell-note.note-warn { color: #ffb84d; }
[data-theme="dark"] .badge-confirmed { color: #6fe08a; }
[data-theme="dark"] .badge-declined { color: #ff8a80; }
[data-theme="dark"] .badge-cancelled { color: #aeaeb2; }
[data-theme="dark"] .badge-completed { color: #7ab8ff; }
[data-theme="dark"] .badge-in_progress, [data-theme="dark"] .cell-note.note-live { color: #d79bff; }
[data-theme="dark"] .alert-info { color: #9cc9ff; }
[data-theme="dark"] .alert-warning { color: #ffc670; }
[data-theme="dark"] .alert-success { color: #84e69b; }
[data-theme="dark"] .row-warn td { background: rgba(255, 69, 58, .08); }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.85); }
