:root {
  --ink: #1a1208; --ink-muted: #5a4a3a; --ink-faint: #9a8a7a;
  --parchment: #f5f0e8; --parchment-dark: #ede8dc; --parchment-border: #d8d0c0;
  --rust: #8b3a1c; --rust-dark: #6b2a0e; --rust-light: #f0e0d8;
  --sage: #3a5a3a; --sage-light: #e0ece0; --gold: #c8962a; --gold-light: #f5e8c8;
  --surface: #ffffff; --shadow: 0 2px 12px rgba(26,18,8,.08);
  --shadow-lg: 0 8px 32px rgba(26,18,8,.12); --radius: 3px; --transition: .18s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Source Sans 3', sans-serif; background: var(--parchment); color: var(--ink); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

/* NAV */
.nav { background: var(--ink); color: var(--parchment); padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 60px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.nav-brand { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; color: var(--parchment); text-decoration: none; }
.nav-brand span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-link { color: rgba(245,240,232,.75); text-decoration: none; font-size: .875rem; font-weight: 500; padding: .5rem 1rem; border-radius: var(--radius); transition: var(--transition); background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-link:hover, .nav-link.active { color: var(--parchment); background: rgba(255,255,255,.1); }
.nav-company { font-size: .8rem; color: var(--gold); font-weight: 500; }
.nav-right { display: flex; align-items: center; gap: 1rem; }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.page { padding: 2.5rem 0; }
.page-header { margin-bottom: 2rem; }
.page-title { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.page-subtitle { color: var(--ink-muted); margin-top: .25rem; font-size: .95rem; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--parchment-border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; color: var(--ink); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--parchment-border); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--rust); }
.stat-number { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .8px; margin-top: 4px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* FORMS */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: .4rem; }
.form-label span { color: var(--rust); }
.form-control { width: 100%; padding: .65rem .875rem; font-family: 'Source Sans 3', sans-serif; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1.5px solid var(--parchment-border); border-radius: var(--radius); transition: var(--transition); appearance: none; }
.form-control:focus { outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(139,58,28,.1); }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a4a3a' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .875rem center; padding-right: 2.5rem; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .8rem; color: var(--ink-faint); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--rust); cursor: pointer; }
.form-check-label { font-size: .95rem; color: var(--ink); cursor: pointer; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.25rem; font-family: 'Source Sans 3', sans-serif; font-size: .9rem; font-weight: 600; border: none; border-radius: var(--radius); cursor: pointer; text-decoration: none; transition: var(--transition); letter-spacing: .3px; white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--parchment); }
.btn-primary:hover { background: var(--rust-dark); }
.btn-rust { background: var(--rust); color: white; }
.btn-rust:hover { background: var(--rust-dark); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--parchment-border); }
.btn-outline:hover { border-color: var(--ink); background: var(--parchment-dark); }
.btn-ghost { background: transparent; color: var(--ink-muted); padding: .4rem .75rem; font-size: .85rem; }
.btn-ghost:hover { background: var(--parchment-dark); color: var(--ink); }
.btn-danger { background: transparent; color: var(--rust); border: 1.5px solid var(--rust-light); font-size: .85rem; padding: .4rem .75rem; }
.btn-danger:hover { background: var(--rust); color: white; border-color: var(--rust); }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.w-full { width: 100%; justify-content: center; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th { background: var(--parchment-dark); color: var(--ink-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; padding: .75rem 1rem; text-align: left; border-bottom: 2px solid var(--parchment-border); }
tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--parchment-border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--parchment); }
.td-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* BADGES */
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: .75rem; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.badge-active { background: var(--sage-light); color: var(--sage); }
.badge-inactive { background: var(--parchment-dark); color: var(--ink-faint); }
.badge-owner { background: var(--gold-light); color: #7a5a10; }
.badge-member { background: var(--rust-light); color: var(--rust-dark); }

/* ALERTS */
.alert { padding: .875rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem; }
.alert-error { background: #fef2f0; border: 1px solid #f5c6bc; color: #7a2010; }
.alert-success { background: var(--sage-light); border: 1px solid #b0d0b0; color: var(--sage); }
.alert-info { background: var(--gold-light); border: 1px solid #dfc070; color: #6a4a10; }

/* AUTH */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--parchment); background-image: repeating-linear-gradient(0deg,transparent,transparent 39px,var(--parchment-border) 39px,var(--parchment-border) 40px); padding: 2rem; }
.auth-box { background: var(--surface); border: 1px solid var(--parchment-border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); }
.auth-logo { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; color: var(--ink); text-align: center; margin-bottom: .25rem; }
.auth-logo span { color: var(--rust); }
.auth-tagline { text-align: center; color: var(--ink-muted); font-size: .85rem; margin-bottom: 2rem; }
.auth-divider { border: none; border-top: 1px solid var(--parchment-border); margin: 1.5rem 0; }
.auth-footer-link { text-align: center; font-size: .875rem; color: var(--ink-muted); margin-top: 1.25rem; }
.auth-footer-link a { color: var(--rust); text-decoration: none; font-weight: 600; }

/* INVITE */
.invite-url-box { background: var(--parchment); border: 1.5px dashed var(--parchment-border); border-radius: var(--radius); padding: .75rem 1rem; font-size: .82rem; color: var(--ink-muted); word-break: break-all; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.invite-url-text { flex: 1; }

/* SESSION CARDS */
.session-card { background: var(--surface); border: 1px solid var(--parchment-border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: .75rem; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }
.session-date { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; color: var(--ink); }
.session-time { color: var(--ink); font-weight: 500; }
.session-break-tag { display: inline-block; padding: 1px 8px; background: var(--gold-light); color: var(--gold); border-radius: 10px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.material-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; background: var(--parchment); border: 1px solid var(--parchment-border); border-radius: 10px; font-size: .78rem; color: var(--ink-muted); margin: 2px; }

/* MATERIAL BUILDER */
.material-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 2fr auto; gap: .5rem; align-items: end; margin-bottom: .5rem; }
@media (max-width: 700px) { .material-row { grid-template-columns: 1fr 1fr; } }

/* SITE CARDS */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.site-card { background: var(--surface); border: 1px solid var(--parchment-border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); transition: var(--transition); text-decoration: none; color: inherit; display: block; }
.site-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--rust-light); }
.site-card-name { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-bottom: .25rem; }
.site-card-addr { font-size: .85rem; color: var(--ink-muted); }
.site-card-footer { margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; }

/* EVENT CALENDAR */
.calendar-page.container { max-width: 1440px; }
.calendar-page { --calendar-line: #ddd5c8; --calendar-subtle: #faf8f3; }
.calendar-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.calendar-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  line-height: 1;
  font-weight: 700;
  color: var(--ink);
}
.calendar-month-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.calendar-month-label {
  min-width: 210px;
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 600;
  text-transform: capitalize;
}
.calendar-icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255,255,255,.5);
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.calendar-icon-button:hover { background: var(--surface); border-color: var(--ink); transform: translateY(-1px); }
.calendar-icon-button svg,
.calendar-actions svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.calendar-actions { display: flex; justify-content: flex-end; gap: .75rem; }
.calendar-actions .btn { min-height: 44px; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 1rem; align-items: start; }
.calendar-surface,
.calendar-upcoming { background: var(--surface); border: 1px solid var(--calendar-line); box-shadow: var(--shadow); }
.calendar-surface { min-width: 0; overflow: hidden; }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--calendar-line); }
.calendar-weekdays > div {
  padding: .85rem .5rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.calendar-day {
  min-width: 0;
  min-height: 132px;
  padding: .7rem;
  border-right: 1px solid var(--calendar-line);
  border-bottom: 1px solid var(--calendar-line);
  background: var(--surface);
}
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day.is-outside { background: var(--calendar-subtle); color: var(--ink-faint); }
.calendar-day.is-today { background: #fffaf0; box-shadow: inset 0 0 0 1px rgba(200,150,42,.55); }
.calendar-day__header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .55rem; }
.calendar-day__number { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; }
.is-outside .calendar-day__number { color: var(--ink-faint); }
.is-today .calendar-day__number { color: #9a6500; }
.calendar-day__today {
  color: #8a5b00;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.calendar-day__mobile-date { display: none; }
.calendar-day__events { display: grid; gap: .35rem; }
.calendar-event {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: .35rem;
  align-items: start;
  min-width: 0;
  padding: .28rem .35rem;
  color: var(--ink);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background-color var(--transition), border-color var(--transition);
}
.calendar-event:hover,
.calendar-event:focus-visible { background: var(--parchment); border-left-color: currentColor; outline: none; }
.calendar-event__status-dot,
.calendar-legend__dot {
  width: 7px;
  height: 7px;
  margin-top: .35rem;
  border-radius: 50%;
  background: var(--event-color, var(--sage));
  flex: 0 0 auto;
}
.calendar-event__time { grid-column: 2; color: var(--ink-muted); font-size: .68rem; line-height: 1.15; }
.calendar-event__body { grid-column: 2; min-width: 0; display: grid; gap: .08rem; }
.calendar-event__title { overflow: hidden; color: var(--ink); font-size: .76rem; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event__location { display: flex; align-items: center; gap: .2rem; overflow: hidden; color: var(--ink-muted); font-size: .66rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event__location svg { width: 10px; height: 10px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.calendar-event__meta { grid-column: 3; grid-row: 1 / span 3; display: flex; align-items: center; gap: .35rem; }
.calendar-event__lock,
.calendar-legend__lock { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.calendar-event__mobile-status,
.calendar-event__mobile-end,
.calendar-event__chevron { display: none; }
.calendar-day__more { padding-left: .7rem; color: var(--rust); font-size: .68rem; font-weight: 700; }
.is-scheduled { --event-color: var(--sage); }
.is-completed { --event-color: #77756f; }
.is-postponed { --event-color: var(--gold); }
.is-canceled { --event-color: #b13716; }
.calendar-event.is-canceled .calendar-event__title { text-decoration: line-through; text-decoration-thickness: 1px; }
.calendar-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; padding: .8rem 1rem; color: var(--ink-muted); font-size: .72rem; }
.calendar-legend__item { display: inline-flex; align-items: center; gap: .35rem; }
.calendar-legend__dot { margin-top: 0; }
.calendar-upcoming { padding: 1.35rem 1rem; }
.calendar-upcoming h2 { margin: 0 0 1rem; font-family: 'Playfair Display', serif; font-size: 1.45rem; }
.calendar-upcoming__list { display: grid; }
.calendar-upcoming__event { display: grid; gap: .35rem; padding: .8rem .15rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--calendar-line); }
.calendar-upcoming__event:last-child { border-bottom: none; }
.calendar-upcoming__event:hover strong { color: var(--rust); }
.calendar-upcoming__event time { color: var(--ink-muted); font-size: .7rem; font-weight: 700; text-transform: capitalize; }
.calendar-upcoming__summary { display: grid; grid-template-columns: 7px 36px minmax(0, 1fr); gap: .35rem; align-items: start; font-size: .74rem; }
.calendar-upcoming__summary .calendar-event__status-dot { margin-top: .3rem; }
.calendar-upcoming__summary strong { overflow: hidden; font-size: .76rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; transition: color var(--transition); }
.calendar-upcoming__location { padding-left: 43px; overflow: hidden; color: var(--ink-muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.calendar-upcoming__empty { color: var(--ink-muted); font-size: .82rem; }
.calendar-mobile-empty { display: none; }

@media (max-width: 1180px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-upcoming { display: none; }
}

@media (max-width: 900px) {
  .calendar-header { grid-template-columns: 1fr auto; }
  .calendar-heading { grid-column: 1; }
  .calendar-month-nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .calendar-actions { grid-column: 2; grid-row: 1; }
}

@media (max-width: 820px) {
  .calendar-page { padding-top: 1.5rem; }
  .calendar-header { display: flex; flex-direction: column; align-items: stretch; gap: 1.1rem; }
  .calendar-title { font-size: 2.5rem; }
  .calendar-month-nav { justify-content: space-between; }
  .calendar-month-label { min-width: 0; font-size: 1.65rem; }
  .calendar-icon-button { width: 50px; height: 50px; background: var(--surface); }
  .calendar-actions { display: grid; grid-template-columns: 1fr 1.35fr; }
  .calendar-actions .btn { justify-content: center; min-height: 48px; }
  .calendar-weekdays { display: none; }
  .calendar-grid { display: block; }
  .calendar-day { display: block; min-height: 0; padding: 0; border-right: none; background: transparent; }
  .calendar-day.is-outside,
  .calendar-day.is-empty:not(.is-today) { display: none; }
  .calendar-day.is-today { box-shadow: inset 3px 0 0 var(--rust); }
  .calendar-day__header { display: none; }
  .calendar-day__mobile-date { display: block; padding: .8rem 1rem .55rem; font-size: .9rem; font-weight: 750; text-transform: capitalize; }
  .calendar-day.is-today .calendar-day__mobile-date::before { content: 'Today  '; color: var(--rust); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
  html[lang='de'] .calendar-day.is-today .calendar-day__mobile-date::before { content: 'Heute  '; }
  .calendar-day__events { display: block; }
  .calendar-event {
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: .8rem;
    align-items: center;
    min-height: 78px;
    padding: .9rem 1rem;
    border-top: 1px solid var(--calendar-line);
    border-left: 3px solid var(--event-color);
    background: var(--surface);
  }
  .calendar-event:hover,
  .calendar-event:focus-visible { background: var(--calendar-subtle); border-left-color: var(--event-color); }
  .calendar-event__status-dot { display: none; }
  .calendar-event__time { grid-column: 1; grid-row: 1; color: var(--ink); font-size: .95rem; font-weight: 700; }
  .calendar-event__mobile-end { display: block; margin-top: .08rem; color: var(--ink-muted); font-size: .74rem; font-weight: 500; }
  .calendar-event__body { grid-column: 2; grid-row: 1; gap: .22rem; }
  .calendar-event__title { font-size: .95rem; }
  .calendar-event__location { font-size: .78rem; }
  .calendar-event__location svg { width: 13px; height: 13px; }
  .calendar-event__meta { grid-column: 3; grid-row: 1; }
  .calendar-event__mobile-status { display: inline; color: var(--event-color); font-size: .72rem; font-weight: 650; }
  .calendar-event__lock { width: 16px; height: 16px; }
  .calendar-event__chevron { display: block; width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .calendar-day__more { padding: .65rem 1rem; background: var(--surface); border-top: 1px solid var(--calendar-line); font-size: .75rem; }
  .calendar-legend { display: none; }
  .calendar-mobile-empty { display: block; padding: 2rem 1rem; text-align: center; color: var(--ink-muted); }
}

@media (max-width: 520px) {
  .calendar-actions { grid-template-columns: 1fr; }
  .calendar-create-button { grid-row: 1; }
  .calendar-event { grid-template-columns: 54px minmax(0, 1fr) auto; gap: .65rem; padding: .85rem .75rem; }
  .calendar-event__mobile-status { display: none; }
}


:root {
  --si-text:         var(--ink);
  --si-text-muted:   var(--ink-muted);
  --si-accent:       var(--rust);
  --si-accent-dark:  var(--rust-dark);
  --si-border:       var(--parchment-border);
  --si-heading-font: 'Playfair Display', serif;
  --si-footer-bg:    var(--ink);
  --si-footer-text:  rgba(245, 240, 232, .6);
  --si-footer-link:  rgba(245, 240, 232, .75);
}

/* UTILITY */
.text-muted { color: var(--ink-muted); } .text-sm { font-size: .85rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.divider { border: none; border-top: 1px solid var(--parchment-border); margin: 1.5rem 0; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state-text { font-size: 1rem; margin-bottom: 1.25rem; }
.section-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--parchment-border); }

/* SITE FOOTER */
.site-footer { background: var(--si-footer-bg); color: var(--si-footer-text); font-size: .8rem; padding: 1.5rem 2rem; }
.site-footer a { color: var(--si-footer-link); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer__inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem 2rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }

/* LEGAL PAGES */
.legal-page { max-width: 720px; margin: 3rem auto; padding: 0 1rem; }
.legal-page h1 { font-family: var(--si-heading-font); font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--si-text); }
.legal-page h2 { font-size: 1.1rem; font-weight: 600; margin-top: 2rem; margin-bottom: .5rem; color: var(--si-accent); border-bottom: 1px solid var(--si-border); padding-bottom: .25rem; }
.legal-page h3 { font-size: 1rem; font-weight: 600; margin-top: 1rem; margin-bottom: .25rem; color: var(--si-text-muted); }
.legal-page p, .legal-page address, .legal-page li { color: var(--si-text-muted); font-size: .95rem; margin-bottom: .75rem; }
.legal-page ul { padding-left: 1.25rem; }
.legal-page .lead-text { font-size: 1.05rem; color: var(--si-text); }
.legal-page a { color: var(--si-accent); }
.legal-page a:hover { color: var(--si-accent-dark); }

/* ── FILTER GRID HELPERS ─────────────────────────────────────── */
/* Used by Sessions views instead of inline grid styles */
.filter-grid      { display: grid; grid-template-columns: 1fr 1fr 1fr auto;      gap: .75rem; align-items: end; }
.filter-grid-wide { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto;  gap: .75rem; align-items: end; }

/* ── HAMBURGER BUTTON ──────────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem .35rem;
  flex-shrink: 0;
  align-self: stretch;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--parchment);
  border-radius: 1px;
  transition: transform .18s ease, opacity .18s ease;
  transform-origin: center;
}
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── BREAKPOINT: tablet / small desktop ─────────────────────────── */
@media (max-width: 768px) {
  /* Nav: hamburger layout */
  .nav {
    padding: 0 1rem;
    flex-wrap: wrap;
    height: auto;
    min-height: 60px;
    justify-content: flex-start;
    gap: 0;
  }
  .nav-brand {
    flex: 1;
    height: 60px;
    display: flex;
    align-items: center;
  }
  .nav-toggle { display: flex; }
  .nav-right {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .25rem 0 .75rem;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .nav-right.open { display: flex; }
  .nav-company {
    padding: .65rem 1rem;
    font-size: .85rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  .nav-link {
    padding: .875rem 1rem;
    font-size: .95rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    width: 100%;
  }
}

/* ── BREAKPOINT: mobile ──────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Container */
  .container { padding: 0 .875rem; }
  .page { padding: 1.25rem 0; }

  /* Typography */
  .page-title { font-size: 1.4rem; }
  .page-header { margin-bottom: 1.25rem; }

  /* Cards */
  .card { padding: 1.1rem; }
  .stat-card { padding: 1rem 1.1rem; }
  .stat-number { font-size: 1.75rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Filter grids collapse to 1 column */
  .filter-grid,
  .filter-grid-wide { grid-template-columns: 1fr; }

  /* Tables */
  thead th { font-size: .7rem; padding: .6rem .75rem; }
  tbody td { font-size: .82rem; padding: .65rem .75rem; }

  /* Session card */
  .session-card { grid-template-columns: 1fr; }

  /* Sites grid: fewer minimum width so 2 up still fits */
  .sites-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

  /* Footer */
  .site-footer { padding: 1.25rem .875rem; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ── BREAKPOINT: small phone ─────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding: 0 .75rem; }

  /* Material row: single column on small phones */
  .material-row { grid-template-columns: 1fr; }

  /* Auth pages */
  .auth-wrap { padding: 1.25rem .75rem; align-items: flex-start; padding-top: 2rem; }
  .auth-box { padding: 1.5rem 1.1rem; }

  /* Minimum touch targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }

  /* Page header: stack title + action button vertically */
  .page-header-row { flex-direction: column; align-items: flex-start; }

  /* Stats: single column on very small phones */
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── BREAKPOINT: tiny (360 px and below) ────────────────────────── */
@media (max-width: 360px) {
  .page-title { font-size: 1.2rem; }
  .nav-brand { font-size: 1.05rem; }
}

/* ── Accessibility: reduced motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.profile-avatar {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.profile-avatar__preview {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #2563eb;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}
.profile-avatar__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 560px) {
  .profile-avatar { grid-template-columns: 1fr; }
}

/* MODERN APP SHELL */
:root {
  --ink: #17120d;
  --ink-muted: #62584e;
  --ink-faint: #9a9188;
  --parchment: #f7f4ee;
  --parchment-dark: #eee9df;
  --parchment-border: #ddd6ca;
  --rust: #a73b18;
  --rust-dark: #7e2b10;
  --rust-light: #f5e5de;
  --sage: #356047;
  --sage-light: #e4eee8;
  --gold: #bd8418;
  --gold-light: #f6ebcf;
  --surface-soft: rgba(255,255,255,.76);
  --shadow: 0 1px 2px rgba(23,18,13,.04), 0 8px 24px rgba(23,18,13,.06);
  --shadow-lg: 0 4px 10px rgba(23,18,13,.06), 0 24px 64px rgba(23,18,13,.12);
  --radius: 9px;
  --radius-sm: 6px;
  --transition: .2s cubic-bezier(.2,.7,.2,1);
}

html { scroll-behavior: smooth; }
body {
  background: var(--parchment);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(255,255,255,.95), transparent 38%),
    radial-gradient(circle at 90% 0%, rgba(167,59,24,.045), transparent 32%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--rust-light); color: var(--rust-dark); }
:where(a, button, input, select, textarea):focus-visible { outline: 3px solid rgba(167,59,24,.24); outline-offset: 2px; }

.nav {
  min-height: 68px;
  height: auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  background: rgba(23,18,13,.96);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 30px rgba(23,18,13,.16);
  backdrop-filter: blur(18px);
}
.nav-brand { font-size: 1.4rem; letter-spacing: -.025em; }
.nav-right { gap: .75rem; }
.nav-links { gap: .15rem; }
.nav-link {
  position: relative;
  padding: .65rem .8rem;
  border-radius: var(--radius-sm);
  color: rgba(247,244,238,.7);
  font-size: .86rem;
  font-weight: 600;
}
.nav-link:hover,
.nav-link.active { color: var(--parchment); background: rgba(255,255,255,.075); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: .8rem;
  right: .8rem;
  bottom: .25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}
.nav-project { display: grid; gap: .05rem; min-width: 0; padding-right: .35rem; }
.nav-project-label { color: rgba(247,244,238,.48); font-size: .6rem; font-weight: 700; letter-spacing: .09em; line-height: 1; text-transform: uppercase; }
.nav-project-name { max-width: 170px; overflow: hidden; color: var(--gold); font-size: .78rem; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.container { max-width: 1280px; padding-inline: clamp(1rem, 3vw, 2.5rem); }
.page { padding-block: clamp(2rem, 5vw, 3.75rem); animation: page-enter .38s ease both; }
.page-header { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.page-title { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.035em; line-height: 1.08; }
.page-subtitle { margin-top: .45rem; font-size: .98rem; }

.card {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-color: rgba(221,214,202,.9);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.card-title { margin-bottom: 1.15rem; font-size: 1.22rem; font-weight: 650; letter-spacing: -.015em; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-card { padding: 1.4rem 1.55rem; border-radius: var(--radius); transition: transform var(--transition), box-shadow var(--transition); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.form-label { margin-bottom: .45rem; font-size: .75rem; font-weight: 750; letter-spacing: .08em; }
.form-control {
  min-height: 46px;
  padding: .72rem .9rem;
  border-width: 1px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 2px rgba(23,18,13,.025);
}
.form-control:hover { border-color: #c7bcad; }
.form-control:focus { border-color: var(--rust); background: var(--surface); box-shadow: 0 0 0 4px rgba(167,59,24,.1); }

.btn {
  min-height: 44px;
  justify-content: center;
  padding: .68rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .01em;
  transition: transform var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn-rust { box-shadow: 0 7px 18px rgba(167,59,24,.18); }
.btn-rust:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(126,43,16,.22); }
.btn-outline { border-width: 1px; background: rgba(255,255,255,.55); }
.btn-outline:hover { transform: translateY(-1px); border-color: #b9ac9b; background: var(--surface); }
.btn-sm { min-height: 36px; padding: .42rem .78rem; font-size: .78rem; }

table { border-collapse: separate; border-spacing: 0; }
thead th { padding: .8rem 1rem; border-bottom-width: 1px; background: rgba(238,233,223,.72); font-size: .7rem; font-weight: 750; letter-spacing: .09em; }
tbody td { padding: .95rem 1rem; border-bottom-color: rgba(221,214,202,.8); vertical-align: middle; }
tbody tr { transition: background-color var(--transition); }
tbody tr:hover { background: rgba(247,244,238,.8); }

.alert { padding: 1rem 1.15rem; border-radius: var(--radius-sm); box-shadow: 0 4px 14px rgba(23,18,13,.04); }
.auth-wrap {
  background: var(--parchment);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.98), transparent 38%),
    radial-gradient(circle at 90% 16%, rgba(167,59,24,.08), transparent 28%),
    linear-gradient(rgba(221,214,202,.34) 1px, transparent 1px);
  background-size: auto, auto, 100% 48px;
}
.auth-box { max-width: 480px; padding: clamp(1.5rem, 5vw, 2.75rem); border-color: rgba(221,214,202,.9); border-radius: 14px; background: rgba(255,255,255,.9); backdrop-filter: blur(18px); }
.site-card { padding: 1.35rem; border-radius: var(--radius); background: var(--surface-soft); backdrop-filter: blur(10px); }
.site-card:hover { transform: translateY(-3px); border-color: #c8b6a9; }
.site-footer { padding: 1.75rem clamp(1rem, 3vw, 2.5rem); border-top: 1px solid rgba(255,255,255,.06); }

@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .nav { min-height: 64px; padding-inline: 1rem; }
  .nav-brand { height: 64px; }
  .nav-project { padding: .85rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-project-name { max-width: none; font-size: .9rem; }
  .nav-link.active::after { left: 1rem; right: auto; bottom: .4rem; width: 28px; }
}

@media (max-width: 640px) {
  .container { padding-inline: .875rem; }
  .page-title { font-size: 2rem; }
  .card { padding: 1.15rem; }
  .auth-box { border-radius: var(--radius); }
}

@media (display-mode: standalone) {
  .nav { padding-top: env(safe-area-inset-top); }
  .site-footer { padding-bottom: max(1.75rem, env(safe-area-inset-bottom)); }
}
