:root { color-scheme: light; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --ink: #202b41; --muted: #526078; --accent: #2455c7; --line: #e2e6ec; }
body { background: #f8fafc; margin: 0; color: var(--ink); }
main { margin: 48px auto; width: min(1160px, calc(100% - 48px)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 36px; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -.045em; line-height: 1.12; margin: 0 0 24px; text-wrap: balance; }
h2 { letter-spacing: -.025em; }
.users-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.users-toolbar h1 { margin: 0; }
.users-toolbar .button { margin-left: auto; }
.users-table tbody tr:hover, .users-table tbody tr:focus-within { background: #f0f5ff; }
.user-edit { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; }
.user-edit:hover { background: #eef2f7; }
.resource-actions-cell { width: 1%; }
.resource-actions { display: flex; align-items: center; gap: 8px; }
.resource-actions form { display: block; margin: 0; }
.resource-actions > a { flex-shrink: 0; }
.resource-delete { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: transparent; color: #a02020; }
.resource-delete:hover { background: #fcecec; color: #801919; }
p { line-height: 1.65; color: var(--muted); }
.rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.room { border: 1px solid #dae1e8; background: #fcfdff; border-radius: 10px; padding: 22px; min-height: 140px; }
.room h2 { margin: 0; font-size: 1.1rem; }
@media (max-width: 600px) { .rooms { grid-template-columns: 1fr; } }

.auth { max-width: 480px; margin: auto; box-shadow: 0 18px 55px #202b4108; }
form { display: grid; gap: 12px; }
input[type=email], .auth input[type=text] { padding: 12px; border: 1px solid #a7b3c5; border-radius: 8px; font: inherit; min-width: 0; }
button { padding: 12px 20px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 650; line-height: 1.4; cursor: pointer; }
button:hover { background: #183f9c; }
:focus-visible { outline: 3px solid #ad7800; outline-offset: 3px; }
[role=alert] { color: #a02020; }

nav { margin-bottom: 18px; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: #183f9c; }
select { padding: 12px; border: 1px solid #a7b3c5; border-radius: 8px; font: inherit; background: white; }
.button { display: inline-flex; justify-content: center; align-items: center; font-weight: 650; line-height: 1.4; padding: 12px 20px; border-radius: 8px; background: #2455c7; color: white; text-decoration: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid #e5e7eb; overflow-wrap: anywhere; }
@media (max-width: 600px) { .card { padding: 18px; } th, td { padding: 8px; } }

/* Daily calendar: two pixels per elapsed minute. */
* { box-sizing: border-box; }
main.calendar-page { width: 100%; margin: 0; }
.app-header { min-height: 82px; padding: 18px 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: white; border-bottom: 1px solid #e2e6ec; }
.brand { min-width: 0; overflow-wrap: anywhere; font-size: 26px; letter-spacing: -.06em; font-weight: 800; text-decoration: none; color: #202b41; }
.brand .brand-dot { color: var(--accent); }
.brand-context { display: block; margin-top: 4px; font-size: 14px; font-weight: 450; letter-spacing: normal; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 24px; min-width: 0; }
.header-nav { display: flex; align-items: center; gap: 4px; margin: 0; padding: 4px; border: 1px solid #e2e6ec; border-radius: 12px; background: #f8fafc; }
.header-nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; border-radius: 8px; color: #526078; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.header-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-nav-link:hover { background: #eaf0f8; color: #2455c7; }
.header-nav-link[aria-current="page"] { background: #2455c7; color: white; box-shadow: 0 1px 3px #19212b1a; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.has-navigation .account { padding-left: 24px; border-left: 1px solid #e2e6ec; }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: #eaf0fc; color: #2455c7; font-weight: 700; }
.account-name { max-width: 200px; overflow-wrap: anywhere; }
.account form { margin: 0; flex-shrink: 0; }
.account button { background: transparent; color: #526078; padding: 9px 12px; border: 1px solid #dce2eb; border-radius: 8px; }
.account button:hover { background: #eef2f7; color: #202b41; }
@media (max-width: 1100px) { .app-header { flex-wrap: wrap; } .header-actions { flex-wrap: wrap; gap: 16px; } }
@media (max-width: 700px) {
  .app-header { flex-direction: column; }
  .brand { font-size: 21px; }
  .header-actions { width: 100%; }
  .header-nav { width: 100%; }
  .header-nav-link { flex: 1; padding: 9px 8px; }
  .account { width: 100%; }
  .has-navigation .account { padding: 12px 0 0; border-left: 0; border-top: 1px solid #e2e6ec; }
  .account-name { max-width: none; flex: 1; }
}
.day-calendar { padding: 28px 32px; }
.calendar-toolbar, .calendar-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; letter-spacing: .14em; margin: 0 0 8px; font-weight: 750; color: var(--accent); }
.calendar-toolbar h1 { font-size: 28px; margin: 0; }
.control { border: 1px solid #d6dce6; border-radius: 7px; padding: 9px 14px; background: white; text-decoration: none; color: #36445c; }
.control:hover { background: #edf2fa; }
.date-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-form label { font-size: 13px; color: #56657a; }
.date-form input { font: inherit; padding: 8px; border: 1px solid #d6dce6; border-radius: 6px; background: white; }
.date-form button { padding: 9px 13px; }
.calendar-caption { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 12px; font-size: 12px; color: #64748b; }
.calendar-scroll { overflow: auto; max-height: calc(100dvh - 255px); min-height: 280px; border: 1px solid #dce2eb; border-radius: 14px; background: white; scroll-behavior: smooth; padding-bottom: 14px; }
.calendar-grid { min-width: calc(74px + var(--resource-count) * 240px); }
.resource-headers { display: grid; grid-template-columns: 74px repeat(var(--resource-count), minmax(0, 1fr)); position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid #dce2eb; }
.resource-headers h2 { margin: 0; padding: 21px 20px; border-left: 1px solid #dce2eb; font-size: 15px; font-weight: 650; }
.time-heading { padding: 23px 14px; font-size: 11px; color: #748197; }
.resource-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 10px; background: var(--resource-color, #5475c3); }
.timeline { position: relative; display: grid; grid-template-columns: 74px repeat(var(--resource-count), minmax(0, 1fr)); height: calc(var(--minutes) * 2px); }
.time-axis { position: relative; background: #fcfdff; }
.time-axis > span { position: absolute; right: 12px; font-size: 11px; color: #758198; transform: translateY(-50%); }
.time-axis > span:first-child { transform: none; }
.resource-column { position: relative; border-left: 1px solid #dce2eb; min-width: 0; }
.grid-line { position: absolute; width: 100%; border-top: 1px solid #f0f2f6; pointer-events: none; }
.grid-line.whole-hour { border-color: #dfe5ed; }
.booking { position: absolute; z-index: 1; padding: 2px 5px; min-width: 0; }
.booking-content { height: 100%; border: 1px solid #cbd9f6; border-left: 4px solid var(--resource-color, #5475c3); border-radius: 5px; background: color-mix(in srgb, var(--resource-color, #5475c3) 12%, white); padding: 7px 10px; display: flex; flex-direction: column; gap: 4px; overflow: auto; font-size: 12px; color: #28416a; overflow-wrap: anywhere; }
.booking strong { font-size: 14px; }
.booking:focus { z-index: 3; }
.now-line { position: absolute; left: 65px; right: 0; border-top: 2px solid #e45c62; z-index: 4; pointer-events: none; }
.now-line span { position: absolute; left: -43px; top: -10px; border-radius: 4px; background: #e45c62; color: white; padding: 2px 5px; font-size: 10px; }
@media (max-width: 700px) { .app-header { padding: 14px 16px; align-items: flex-start; } .day-calendar { padding: 20px 12px; } .calendar-controls { gap: 8px; } .date-form { width: 100%; } .calendar-caption span:last-child { display: none; } .calendar-scroll { max-height: 65dvh; } }

dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 18px 55px #202b4120; width: min(520px, 94vw); max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: #19212b88; }
dialog label { display: grid; gap: 5px; }
dialog input { padding: 10px; font: inherit; border: 1px solid #a7b3c5; border-radius: 8px; min-width: 0; }
dialog small { color: #a02020; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger { background: #a02020; }
.danger:hover { background: #801919; }
button:disabled { opacity: .6; cursor: wait; }
.booking, .resource-column { cursor: pointer; }

.view-switch { display: flex; margin: 0; gap: 4px; }
.view-switch [aria-current=page] { background: #2455c7; color: white; border-color: #2455c7; }
.month-scroll { overflow-x: auto; background: white; border: 1px solid #dce2eb; border-radius: 14px; }
.month-grid { table-layout: fixed; min-width: 840px; }
.month-grid th { font-size: 12px; color: #64748b; background: #f8fafc; }
.month-grid td { vertical-align: top; height: 150px; padding: 8px; border-right: 1px solid #e5e7eb; }
.month-grid td:last-child { border-right: 0; }
.month-grid tr:last-child td { border-bottom: 0; }
.month-date { display: inline-block; padding: 3px 7px; margin-bottom: 7px; font-size: 13px; font-weight: 650; text-decoration: none; border-radius: 5px; }
.outside-month { background: #f8fafc; }
.outside-month .month-date { color: #64748b; }
.is-today .month-date { background: #2455c7; color: white; }
.month-booking { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; padding: 6px 7px; border-radius: 5px; border-left: 3px solid var(--resource-color, #5475c3); background: color-mix(in srgb, var(--resource-color, #5475c3) 12%, white); color: #28416a; font-size: 11px; cursor: pointer; overflow-wrap: anywhere; }
.month-booking time { font-weight: 650; }
.month-booking:hover { filter: brightness(.96); }

.auth input[type=color] { width: 64px; height: 44px; padding: 4px; border: 1px solid #a7b3c5; border-radius: 8px; background: white; cursor: pointer; }

/* Compact language links belong to the header, alongside account controls. */
.app-language-switch { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 2px; margin: 0; padding: 0; font-size: 14px; }
.app-language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 44px; text-decoration: none; color: var(--muted); border-radius: 6px; }
.app-language-switch a:hover { background: #f0f4fb; color: var(--accent); }
.app-language-switch [aria-current="page"] { color: var(--accent); font-weight: 750; text-decoration: underline; text-underline-offset: 5px; }
.app-language-switch span { color: var(--muted); }
.auth-header { padding-inline: max(24px, calc((100vw - 1160px) / 2)); }
.auth-header + main { margin-top: 64px; }
.auth label { color: var(--ink); font-weight: 550; }
.auth input, .auth select { width: 100%; }
.auth input[type=color] { width: 64px; }
.auth button[type=submit] { min-height: 46px; }
.button:hover { background: #183f9c; color: #fff; }
@media (max-width: 700px) {
  .auth-header { flex-direction: row; align-items: center; }
  .auth-header + main { margin-top: 32px; }
  main { width: calc(100% - 32px); margin-top: 24px; }
  .account { flex-wrap: wrap; }
  .account-name { flex: 1; min-width: 0; }
  .account .app-language-switch { margin-left: auto; }
  .header-nav-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .calendar-scroll { scroll-behavior: auto; } }

.demo-banner {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: .75rem 1rem;
    background: #fff3cd;
    color: #493b16;
    border-bottom: 1px solid #e4cb7a;
    font-size: .9rem;
}
.demo-banner a { color: inherit; font-weight: 600; margin-inline-start: .75rem; }
