:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #182230;
  --muted: #667085;
  --border: #e4e7ec;
  --primary: #155eef;
  --primary-dark: #004eeb;
  --sidebar: #101828;
  --sidebar-muted: #98a2b3;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: #175cd3; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--primary); font-size: 16px; }
.user-box { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.user-box form { margin: 0; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar { background: var(--sidebar); padding: 22px 14px; }
.sidebar a { display: block; color: #eaecf0; padding: 9px 12px; border-radius: 7px; margin-bottom: 3px; font-size: 14px; }
.sidebar a:hover { background: #1d2939; text-decoration: none; }
.nav-caption { color: var(--sidebar-muted); text-transform: uppercase; font-size: 10px; letter-spacing: .12em; padding: 15px 12px 7px; }
.nav-caption:first-child { padding-top: 3px; }
.content { padding: 30px; min-width: 0; }
.auth-content { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 50% 0%, #eef4ff, var(--bg) 45%); }
.auth-card { width: min(420px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.login-brand { margin-bottom: 30px; }
h1 { font-size: 28px; line-height: 1.2; margin: 4px 0 7px; letter-spacing: -.025em; }
h2 { font-size: 17px; margin: 0 0 18px; }
p { margin: 0; color: var(--muted); line-height: 1.55; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.back { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.metric { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; box-shadow: var(--shadow); }
.metric span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.metric strong { font-size: 28px; }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.detail-layout { align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 20px; }
.two-col > .panel + .panel, .client-grid > .panel + .panel, .booking-layout > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 14px; }
.panel-head h2 { margin-bottom: 3px; }
.table-wrap { overflow: auto; margin: -4px; padding: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); padding: 11px 10px; white-space: nowrap; }
td { padding: 13px 10px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d0d5dd; border-radius: 7px; min-height: 38px; padding: 8px 13px; color: #344054; background: #fff; font-weight: 600; font-size: 13px; text-decoration: none; }
.button:hover { background: #f9fafb; text-decoration: none; }
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.danger { color: var(--danger); border-color: #fecdca; background: #fff; }
.button.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.link-button { border: 0; background: none; color: #175cd3; padding: 0; font-size: inherit; }
.danger-text { color: var(--danger); }
.stack-form { display: grid; gap: 16px; }
.stack-form label:not(.check), .mini-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: #344054; }
input, select, textarea { width: 100%; border: 1px solid #d0d5dd; background: #fff; color: var(--text); border-radius: 7px; padding: 9px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #84adff; box-shadow: 0 0 0 3px #eef4ff; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 13px; }
legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13px; }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form { display: flex; gap: 10px; max-width: 450px; }
.inline-form select { flex: 1; }
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 13px; border: 1px solid; }
.flash-success { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.flash-error { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.badge { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.badge.large { padding: 6px 11px; font-size: 12px; }
.booking-pending { background: #fffaeb; color: #b54708; }
.booking-approved { background: #ecfdf3; color: #067647; }
.booking-rejected, .booking-cancelled { background: #fef3f2; color: #b42318; }
.status-reserved { background: #eaf2ff; color: #175cd3; }
.status-progress { background: #fff4e5; color: #b54708; }
.status-completed { background: #ecfdf3; color: #067647; }
.status-invoiced { background: #f4f3ff; color: #5925dc; }
.status-paid { background: #e6f9ee; color: #05603a; }
.status-cancelled { background: #f2f4f7; color: #667085; }
.project-list { margin: -8px 0; }
.project-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid #f0f2f5; color: var(--text); }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { text-decoration: none; }
.project-row > div { display: grid; gap: 4px; }
.project-row > div:last-child { justify-items: end; }
.project-row span, .project-row small { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 5px; margin-bottom: 14px; }
.tabs a { padding: 7px 11px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.tabs a.active { color: #175cd3; background: #eef4ff; font-weight: 600; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 15px 18px; margin: 0; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 550; }
.preserve { white-space: pre-wrap; line-height: 1.5; }
.muted { color: var(--muted); font-size: 13px; }
.resource-options { display: grid; gap: 8px; }
.resource-option { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.resource-option input { width: auto; }
.resource-option > span:first-of-type { display: grid; gap: 3px; flex: 1; }
.resource-option small { color: var(--muted); }
.resource-option.disabled { background: #f9fafb; opacity: .7; }
.availability { font-size: 11px; font-weight: 700; }
.availability.ok { color: var(--success); }
.availability.no { color: var(--danger); }
.button-row { display: flex; gap: 9px; margin-top: 4px; }
.resource-cards { display: grid; gap: 9px; }
.resource-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; border-bottom: 1px solid #f0f2f5; padding: 5px 0 13px; }
.resource-card:last-child { border-bottom: 0; }
.resource-card > div { display: grid; gap: 3px; }
.resource-card small { color: var(--muted); }
.skill-row { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.skill-row span { background: #f2f4f7; color: #475467; padding: 3px 6px; border-radius: 5px; font-size: 10px; }
details { font-size: 12px; color: var(--muted); }
summary { cursor: pointer; }
.mini-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; width: min(360px, 100%); }
.mini-form input:nth-of-type(4) { grid-column: 1 / -1; }
.planner-actions { display: flex; gap: 7px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 11px; color: var(--muted); margin: -8px 0 15px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; padding: 0; }
.planner { display: grid; grid-template-columns: 190px minmax(850px, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: auto; background: #fff; box-shadow: var(--shadow); }
.planner-header { position: sticky; top: 0; z-index: 9; background: #f9fafb; font-size: 12px; font-weight: 700; }
.resource-cell { min-height: 54px; padding: 10px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; position: sticky; left: 0; z-index: 6; }
.planner > .resource-cell:first-child { z-index: 12; background: #f9fafb; }
.resource-name { display: grid; align-content: center; gap: 3px; }
.resource-name small { color: var(--muted); font-size: 10px; line-height: 1.2; }
.timeline-header, .grid-days { display: grid; grid-template-columns: repeat(var(--planner-days), minmax(34px, 1fr)); }
.timeline-header { position: sticky; top: 0; z-index: 8; min-width: 850px; border-bottom: 1px solid var(--border); background: #f9fafb; }
.day-head { height: 54px; display: grid; place-items: center; align-content: center; gap: 2px; border-right: 1px solid #edf0f3; font-size: 10px; color: var(--muted); }
.day-head strong { color: #344054; font-size: 12px; }
.weekend { background: #f7f8fa !important; }
.timeline-row { position: relative; min-width: 850px; min-height: 54px; border-bottom: 1px solid var(--border); }
.grid-days { position: absolute; inset: 0; }
.day-cell { border-right: 1px solid #f0f2f5; }
.gantt-block { position: absolute; left: calc((var(--g-start) - 1) * (100% / var(--planner-days)) + 3px); width: calc(var(--g-span) * (100% / var(--planner-days)) - 6px); top: 8px; bottom: 8px; border-radius: 5px; padding: 5px 7px; overflow: hidden; display: grid; align-content: center; color: inherit; z-index: 4; border-left: 3px solid currentColor; }
.gantt-block:hover { text-decoration: none; filter: brightness(.98); }
.gantt-block strong { font-size: 10px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.gantt-block span { font-size: 9px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; opacity: .8; }
.client-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr); gap: 20px; align-items: start; }
.booking-cards { display: grid; gap: 9px; }
.booking-card { border: 1px solid var(--border); border-radius: 9px; padding: 14px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.booking-main { display: flex; gap: 12px; align-items: center; }
.service-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: #eef4ff; color: #175cd3; font-weight: 800; }
.booking-main > div { display: grid; gap: 4px; }
.booking-main span { color: var(--muted); font-size: 12px; }
.booking-actions { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.booking-actions form { margin: 0; }
.privacy-card { text-align: center; padding: 30px 24px; }
.privacy-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: #ecfdf3; color: #067647; font-weight: 800; }
.booking-layout { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(420px, 1.25fr); gap: 20px; align-items: start; }
.availability-key { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-bottom: 15px; }
.availability-key span { display: flex; align-items: center; gap: 5px; }
.availability-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.availability-dot.free { background: #abefc6; }
.availability-dot.mine { background: #84adff; }
.availability-dot.busy { background: #d0d5dd; }
.availability-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-label { text-align: center; font-size: 10px; color: var(--muted); padding-bottom: 4px; }
.calendar-day { min-height: 50px; border-radius: 6px; padding: 7px; border: 1px solid transparent; font-size: 11px; display: grid; align-content: space-between; }
.calendar-day strong { font-size: 12px; }
.calendar-day.available { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.calendar-day.mine { background: #eef4ff; border-color: #84adff; color: #175cd3; }
.calendar-day.unavailable { background: #f2f4f7; border-color: #e4e7ec; color: #98a2b3; }
.calendar-day.weekend-day { opacity: .75; }
.error-page { min-height: 60vh; display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; }
.error-page > strong { font-size: 70px; color: #d0d5dd; }
.error-page .button { margin-top: 10px; }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .client-grid, .booking-layout { grid-template-columns: 1fr; }
  .mini-form { width: 100%; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 15px; }
  .user-box > span { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; overflow-x: auto; padding: 8px; gap: 3px; }
  .sidebar a { white-space: nowrap; margin: 0; }
  .nav-caption { display: none; }
  .content { padding: 20px 14px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .booking-card { align-items: flex-start; flex-direction: column; }
  .booking-actions { width: 100%; }
  .planner-actions { flex-wrap: wrap; }
  .details { grid-template-columns: 1fr; gap: 5px; }
  .details dd { margin-bottom: 10px; }
  .availability-calendar { gap: 3px; }
  .calendar-day { min-height: 44px; padding: 5px; }
}

.project-editor { display: grid; grid-template-columns: minmax(0, .8fr) minmax(360px, 1.2fr); gap: 20px; align-items: start; }
.project-editor > .panel + .panel { margin-top: 0; }
.head-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 1050px) { .project-editor { grid-template-columns: 1fr; } }

.timeoff-dot { background: #98a2b3; }
.timeoff-block { background: repeating-linear-gradient(135deg, #eaecf0 0, #eaecf0 6px, #f2f4f7 6px, #f2f4f7 12px); color: #667085; border-left-color: #98a2b3; }

/* Terms of Use / Privacy */
.legal-shell { max-width: 980px; margin: 0 auto; }
.legal-head { align-items: flex-end; }
.legal-document { padding: 30px 34px; }
.legal-document > p { margin: 0 0 14px; }
.legal-document h2 { margin: 30px 0 10px; padding-top: 4px; font-size: 18px; }
.legal-document ul { color: var(--muted); line-height: 1.6; margin: 8px 0 16px; padding-left: 24px; }
.legal-document li { margin: 5px 0; }
.notice-card { margin-bottom: 18px; border: 1px solid #fedf89; background: #fffaeb; border-radius: 10px; padding: 15px 18px; }
.notice-card strong { display: block; color: #93370d; margin-bottom: 4px; }
.notice-card p { color: #b54708; font-size: 13px; }
.acceptance-card { margin-top: 20px; display: grid; gap: 16px; position: sticky; bottom: 12px; border-color: #84adff; box-shadow: 0 8px 24px rgba(16,24,40,.12); }
.legal-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 650; line-height: 1.45; }
.legal-check input { width: auto; margin-top: 3px; }
.acceptance-card .button { width: max-content; }
.acceptance-summary { margin-top: 20px; display: grid; gap: 16px; }
.hash-value { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.public-legal-link { margin-top: 16px; font-size: 12px; text-align: center; }
.public-legal-link a { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
@media (max-width: 760px) {
  .legal-document { padding: 20px 17px; }
  .acceptance-card { position: static; }
  .legal-head { align-items: flex-start; }
}
.auth-content .legal-shell { width: min(980px, calc(100vw - 32px)); margin: 24px auto; }
