:root {
  --ink: #181129;
  --muted: #6f6681;
  --line: #e8e2f0;
  --soft: #f7f5fa;
  --paper: #ffffff;
  --purple: #5822cb;
  --purple-dark: #3d139d;
  --pink: #ef1687;
  --cyan: #08b5bf;
  --green: #82c900;
  --yellow: #ffc31f;
  --amber: #e49b00;
  --red: #c53d4f;
  --shadow: 0 16px 40px rgba(42, 24, 78, 0.1);
  --font-display: "Montserrat", Arial, sans-serif;
  --font-body: "Poppins", Arial, sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
  background: #f4f1f8;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background-color: #f7f4fa; background-image: linear-gradient(rgba(88,34,203,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(8,181,191,0.045) 1px, transparent 1px); background-size: 36px 36px; }
button, input, select, textarea { font-family: var(--font-body); font-size: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { text-decoration: none; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--purple); font-family: var(--font-display); font-size: 0.7rem; font-weight: 800; margin: 0 0 4px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, th, .btn, .nav-item, .badge { font-family: var(--font-display); }
h1 { font-size: 1.65rem; line-height: 1.15; margin-bottom: 0; }
h2 { font-size: 1.25rem; margin-bottom: 0; }
h3 { font-size: 1rem; margin-bottom: 5px; }

.brand-mark { display: flex; align-items: center; font-family: var(--font-display); font-size: 1.65rem; font-weight: 900; line-height: 1; }
.brand-mark.large { font-size: 5rem; }
.brand-mark span:nth-child(1) { color: #5422c5; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(4) { color: #ed1681; }
.brand-mark span:nth-child(3) { color: #06aebb; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--paper); }
.login-brand { display: flex; flex-direction: column; justify-content: center; align-items: center; background: #f4effd; border-right: 1px solid #e6dcf7; border-top: 7px solid var(--cyan); position: relative; overflow: hidden; }
.login-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#dcd0f2 1px, transparent 1px), linear-gradient(90deg, #dcd0f2 1px, transparent 1px); background-size: 44px 44px; opacity: 0.4; }
.login-brand > * { position: relative; }
.login-brand p { color: var(--purple-dark); font-size: 1.2rem; font-weight: 700; margin: 12px 0 0; }
.login-panel { width: min(420px, calc(100vw - 40px)); margin: auto; }
.login-panel h1 { font-family: var(--font-display); font-size: 2.25rem; font-weight: 800; margin-bottom: 10px; }
.login-panel > .muted { margin-bottom: 30px; }
.mobile-logo { display: none; margin-bottom: 32px; }
label { color: #4f4660; display: grid; gap: 7px; font-size: 0.82rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #dcd4e8; border-radius: 6px; background: #fff; color: var(--ink); padding: 11px 12px; outline: 0; }
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(88, 34, 203, 0.12); }
.login-panel label + label { margin-top: 16px; }
.login-panel .wide { margin-top: 22px; }
.form-error { color: var(--red); min-height: 20px; margin: 10px 0 0; font-size: 0.83rem; }
.local-note { display: flex; align-items: center; gap: 7px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; font-size: 0.78rem; }
.local-note img { width: 15px; height: 15px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; z-index: 20; display: flex; flex-direction: column; color: white; background: #25123f; border-right: 1px solid #422563; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar .brand-mark { background: #fff; padding: 8px 10px; border-radius: 6px; }
.sidebar nav { padding: 18px 12px; display: grid; gap: 4px; }
.nav-item { width: 100%; height: 43px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 6px; padding: 0 12px; color: #cfc4e2; background: transparent; font-size: 0.9rem; font-weight: 650; text-align: left; }
.nav-item img { width: 19px; height: 19px; filter: invert(88%) sepia(12%) saturate(413%) hue-rotate(222deg); }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { color: white; background: var(--purple); box-shadow: inset 4px 0 0 var(--green); }
.nav-item.active img { filter: brightness(0) invert(1); }
.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 9px; }
.user-chip { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; }
.user-chip > span { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; background: var(--pink); border-radius: 50%; font-size: 0.74rem; font-weight: 800; }
.user-chip div { min-width: 0; display: grid; }
.user-chip strong, .user-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 0.78rem; }
.user-chip small { color: #a99dbd; font-size: 0.68rem; }
.sidebar .icon-btn { filter: brightness(0) invert(1); }

.main { grid-column: 2; min-width: 0; }
.topbar { min-height: 76px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(255,255,255,0.97); border-bottom: 1px solid var(--line); box-shadow: inset 0 -3px 0 var(--cyan); backdrop-filter: blur(8px); }
.topbar > div:first-of-type { min-width: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.today { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.view-root { padding: 24px 28px 42px; max-width: 1560px; margin: 0 auto; }

.btn, .icon-btn { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; }
.btn { min-height: 40px; border-radius: 6px; padding: 0 15px; font-size: 0.8rem; }
.btn img { width: 17px; height: 17px; }
.btn.primary { color: #fff; background: var(--purple); }
.btn.primary img { filter: brightness(0) invert(1); }
.btn.primary:hover { background: var(--purple-dark); }
.btn.pink { color: #fff; background: var(--pink); }
.btn.ghost { color: var(--purple); background: white; border: 1px solid #cdbde9; }
.btn.danger { color: var(--red); background: #fff; border: 1px solid #efc8ce; }
.btn.wide { width: 100%; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 0.76rem; }
.icon-btn { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 6px; background: transparent; }
.icon-btn:hover { background: rgba(88,34,203,0.08); }
.icon-btn img { width: 19px; height: 19px; }
.icon-btn.small { width: 32px; height: 32px; flex-basis: 32px; }
.icon-btn.small img { width: 16px; height: 16px; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 15px; }
.section-heading p { margin: 4px 0 0; font-size: 0.83rem; }
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric { min-height: 112px; padding: 16px; background: white; border: 1px solid var(--line); border-top: 3px solid var(--purple); border-radius: 7px; }
.metric:nth-child(2) { border-top-color: var(--pink); }
.metric:nth-child(3) { border-top-color: var(--yellow); }
.metric:nth-child(4) { border-top-color: var(--cyan); }
.metric:nth-child(5) { border-top-color: var(--green); }
.metric-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.metric-head img { width: 18px; height: 18px; opacity: 0.7; }
.metric strong { display: block; margin-top: 11px; font-size: 1.55rem; }
.metric small { color: var(--muted); font-size: 0.7rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr); gap: 16px; }
.panel { background: rgba(255,255,255,0.98); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 8px 22px rgba(48,25,82,0.045); }
.panel-head { min-height: 64px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-head p { margin: 3px 0 0; font-size: 0.76rem; }
.panel-body { padding: 17px; }
.panel + .panel { margin-top: 16px; }
.chart-wrap { height: 250px; position: relative; }
.chart-wrap canvas { width: 100%; height: 100%; }
.status-list { display: grid; gap: 12px; }
.status-row { display: grid; grid-template-columns: 95px 1fr 32px; align-items: center; gap: 10px; font-size: 0.8rem; }
.status-bar { height: 8px; background: #eeeaf4; border-radius: 4px; overflow: hidden; }
.status-bar span { display: block; height: 100%; background: var(--purple); border-radius: inherit; }
.status-row:nth-child(2) .status-bar span { background: var(--cyan); }
.status-row:nth-child(3) .status-bar span { background: #8d829e; }
.quick-list { display: grid; gap: 8px; }
.quick-item { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.date-tile { width: 44px; text-align: center; color: var(--purple); background: #f1eafd; border-radius: 5px; padding: 5px 3px; }
.date-tile strong { display: block; font-size: 1.05rem; }
.date-tile small { font-size: 0.6rem; text-transform: uppercase; }
.quick-item p { margin: 0; font-size: 0.78rem; }
.quick-item strong { font-size: 0.84rem; }

.toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.reservation-scope-bar { min-height: 66px; margin-bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); }
.reservation-scope-bar > p { max-width: 560px; margin: 0 0 12px; color: var(--muted); font-size: .72rem; text-align: right; }
.reservation-scope-tabs { display: flex; align-items: flex-end; gap: 4px; }
.reservation-scope-tab { min-width: 170px; min-height: 58px; padding: 9px 14px 11px; display: flex; align-items: center; gap: 10px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; text-align: left; cursor: pointer; }
.reservation-scope-tab:hover { color: var(--purple); background: #faf8fc; }
.reservation-scope-tab.active { color: var(--purple); border-bottom-color: var(--pink); }
.reservation-scope-tab img { width: 20px; height: 20px; opacity: .72; }
.reservation-scope-tab span { display: grid; gap: 2px; }
.reservation-scope-tab strong { font-size: .8rem; }
.reservation-scope-tab small { color: var(--muted); font-size: .62rem; font-weight: 500; }
.filter-row { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.filter-row label { min-width: 130px; font-size: 0.7rem; }
.search-field { position: relative; min-width: 240px; }
.search-field img { position: absolute; left: 11px; top: 11px; width: 17px; height: 17px; opacity: 0.55; }
.search-field input { padding-left: 36px; }
.table-wrap { width: 100%; overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th { height: 43px; padding: 8px 12px; color: #5c506e; background: #f7f4fb; border-bottom: 2px solid #d9ccef; font-size: 0.65rem; text-align: left; text-transform: uppercase; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 0.8rem; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fdfcff; }
.cell-main { display: block; font-weight: 700; }
.cell-sub { display: block; color: var(--muted); font-size: 0.7rem; margin-top: 3px; }
.actions-cell { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty img { width: 34px; height: 34px; opacity: 0.45; margin: 0 auto 10px; }

.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 12px; font-size: 0.69rem; font-weight: 800; white-space: nowrap; }
.badge.pending { color: #8c6200; background: #fff2c6; }
.badge.confirmed { color: #08717b; background: #d8f6f7; }
.badge.blocked { color: #5e536e; background: #eeeaf2; }
.badge.cancelled { color: #a42437; background: #fbe1e5; }
.badge.income { color: #467b00; background: #e9f8d4; }
.badge.expense { color: #a42437; background: #fbe1e5; }
.payment { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 750; }
.payment img { width: 14px; height: 14px; }
.payment.yes { color: #4c8300; }
.payment.no { color: #986b00; }

.agenda-nav { display: flex; align-items: center; gap: 7px; }
.week-label { min-width: 190px; text-align: center; font-size: 0.82rem; font-weight: 750; }
.agenda-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.agenda-day { min-width: 150px; background: white; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.agenda-day.today-day { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(88,34,203,0.09); }
.agenda-day-head { min-height: 56px; padding: 10px; border-bottom: 1px solid var(--line); }
.agenda-day-head span { display: block; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; }
.agenda-day-head strong { display: block; margin-top: 3px; font-size: 0.85rem; }
.slot { margin: 8px; min-height: 112px; padding: 10px; display: flex; flex-direction: column; gap: 5px; border: 1px solid #d9d0e5; border-left: 4px solid var(--green); border-radius: 6px; background: #fff; text-align: left; }
.slot.pending { border-left-color: var(--amber); background: #fffdf5; }
.slot.confirmed { border-left-color: var(--cyan); background: #f7feff; }
.slot.blocked { border-left-color: #8c8299; background: #f7f5f8; }
.slot.cancelled { border-left-color: var(--red); opacity: 0.7; }
.slot .slot-time { color: var(--muted); font-size: 0.67rem; }
.slot .slot-title { font-size: 0.79rem; font-weight: 800; }
.slot .slot-detail { color: var(--muted); font-size: 0.68rem; }
.slot .slot-rule-detail { padding:4px 5px;color:#7b3f4f;background:#fff0f3;border-radius:3px;font-size:.61rem;font-weight:700; }
.slot.available:hover { border-color: var(--green); background: #fbfff6; }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 12px; }
.service-provider { background: white; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.service-provider header { padding: 15px; border-top: 4px solid var(--pink); border-bottom: 1px solid var(--line); }
.service-provider:nth-child(3n+2) header { border-top-color: var(--cyan); }
.service-provider:nth-child(3n) header { border-top-color: var(--green); }
.service-provider:nth-child(4n) header { border-top-color: var(--yellow); }
.service-provider header span { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.service-provider header small { display: inline-block; margin-top: 5px; color: #4f8200; font-size: 0.65rem; font-weight: 750; }
.package-list { padding: 6px 15px 12px; }
.package-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.package-row:last-child { border: 0; }
.package-row p { color: var(--muted); margin: 4px 0 0; font-size: 0.7rem; }
.package-row strong:last-child { color: var(--purple); white-space: nowrap; font-size: 0.8rem; }

.staff-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.staff-metric { min-height: 92px; padding: 15px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: center; gap: 3px 12px; background: white; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 7px; }
.staff-metric.warning { border-left-color: var(--yellow); }
.staff-metric span, .staff-metric small { color: var(--muted); font-size: .68rem; }
.staff-metric strong { grid-row: span 2; font-size: 1.45rem; }
.staff-week-panel { margin-bottom: 22px; }
.staff-table-wrap { width: 100%; overflow-x: auto; }
.staff-schedule-table { min-width: 780px; }
.staff-schedule-table thead th span { display: block; margin-top: 2px; color: var(--muted); font-family: var(--font-body); font-size: .59rem; font-weight: 500; text-transform: none; }
.staff-schedule-table tbody th { width: 118px; padding: 11px 14px; background: #fbf9fd; text-transform: none; }
.staff-schedule-table tbody th strong, .staff-schedule-table tbody th span { display: block; }
.staff-schedule-table tbody th span { margin-top: 2px; color: var(--muted); font-family: var(--font-body); font-size: .61rem; }
.staff-slot { min-width: 180px; background: white; }
.staff-slot.covered { background: #fbfefd; }
.staff-slot.uncovered { background: #fffaf0; }
.staff-slot.not-offered { color: #aaa2b0; background: #f7f5f8; }
.staff-assignee { display: inline-flex; align-items: center; gap: 7px; margin: 2px 7px 2px 0; font-weight: 750; }
.staff-assignee i { width: 27px; height: 27px; display: grid; place-items: center; color: white; background: var(--purple); border-radius: 50%; font-size: .61rem; font-style: normal; }
.staff-unassigned { color: #986b00; font-size: .7rem; font-weight: 750; }
.staff-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.staff-section-title h2 { font-size: 1.08rem; }
.staff-section-title span { color: var(--muted); font-size: .68rem; }
.staff-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 12px; }
.staff-card { min-height: 200px; padding: 15px; background: white; border: 1px solid var(--line); border-top: 4px solid var(--pink); border-radius: 7px; }
.staff-card:nth-child(3n+2) { border-top-color: var(--cyan); }
.staff-card:nth-child(3n) { border-top-color: var(--green); }
.staff-card.inactive { opacity: .62; border-top-color: #aaa2b0; }
.staff-card header { display: grid; grid-template-columns: 42px minmax(0,1fr) 34px; align-items: center; gap: 10px; }
.staff-card header h3, .staff-card header p { margin: 0; }
.staff-card header h3 { font-size: .95rem; }
.staff-card header p { margin-top: 2px; color: var(--muted); font-size: .67rem; }
.staff-avatar { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--purple); border-radius: 50%; font-family: var(--font-display); font-size: .72rem; font-weight: 800; }
.staff-card-meta { margin: 14px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.staff-card-meta strong { color: var(--muted); font-size: .65rem; }
.staff-shift-list { display: flex; flex-wrap: wrap; gap: 5px; }
.staff-shift-list > span { padding: 5px 7px; color: #4e4260; background: #f4effa; border-radius: 4px; font-size: .61rem; font-weight: 700; }
.staff-notes { margin: 11px 0 0; padding-top: 9px; color: var(--muted); border-top: 1px solid var(--line); font-size: .66rem; }
.staff-schedule-editor { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.staff-schedule-editor > div:first-child strong, .staff-schedule-editor > div:first-child small { display: block; }
.staff-schedule-editor > div:first-child strong { font-family: var(--font-display); font-size: .8rem; }
.staff-schedule-editor > div:first-child small { margin-top: 3px; color: var(--muted); font-size: .66rem; }
.staff-schedule-head, .staff-schedule-row { display: grid; grid-template-columns: minmax(100px,1.2fr) repeat(3,minmax(76px,1fr)); align-items: center; gap: 6px; }
.staff-schedule-head { margin-top: 12px; padding: 0 6px; color: var(--muted); font-size: .59rem; text-align: center; text-transform: uppercase; }
.staff-schedule-head span:first-child { text-align: left; }
.staff-schedule-row { min-height: 45px; padding: 5px 6px; border-top: 1px solid var(--line); }
.staff-schedule-row > strong { font-size: .69rem; }
.staff-schedule-check { min-height: 32px; padding: 5px; display: flex; align-items: center; justify-content: center; gap: 5px; background: #f7f3fb; border: 1px solid var(--line); border-radius: 5px; font-size: .61rem; cursor: pointer; }
.staff-schedule-check input { width: 15px; height: 15px; accent-color: var(--purple); }
.staff-schedule-check.disabled { color: #aca5b2; background: #f5f4f6; cursor: default; }

.finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.summary-box { padding: 16px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.summary-box span { color: var(--muted); font-size: 0.72rem; }
.summary-box strong { display: block; margin-top: 7px; font-size: 1.4rem; }
.summary-box strong small, .summary-box > small { color: var(--muted); font-size: .67rem; font-weight: 500; }
.summary-box > small { display: block; margin-top: 5px; }
.summary-box.in strong { color: #4d8400; }
.summary-box.out strong { color: var(--red); }
.finance-toolbar { min-height: 62px; display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.finance-toolbar > p { margin: 0; }
.period-picker { display: flex; align-items: center; gap: 7px; font-size: .68rem; }
.period-picker input { width: 145px; padding: 8px; }
.finance-section-label { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 0 0 11px; }
.finance-section-label > div > span { color: var(--purple); font-size: .66rem; font-weight: 800; }
.finance-section-label h2 { margin-top: 3px; font-size: 1.32rem; }
.finance-section-label > small { color: var(--muted); font-size: .7rem; }
.event-finance-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.event-progress-panel { margin: 0 0 14px; padding: 13px 16px; background: #f6fbfb; border: 1px solid #cdebed; border-left: 4px solid var(--cyan); border-radius: 7px; }
.event-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .76rem; }
.event-progress-copy span { color: var(--purple); font-weight: 800; }
.event-progress-track { height: 8px; margin: 9px 0 7px; overflow: hidden; background: #dcecee; border-radius: 4px; }
.event-progress-track i { display: block; height: 100%; background: var(--cyan); border-radius: inherit; }
.event-progress-panel p { margin: 0; color: var(--muted); font-size: .68rem; }
.event-projection { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 18px; margin: 0 0 14px; padding: 14px 16px; color: white; background: var(--purple); border-radius: 7px; }
.event-projection span { font-size: .63rem; font-weight: 800; }
.event-projection strong { grid-row: span 2; font-size: .87rem; }
.event-projection small { color: #ded3f6; font-size: .66rem; }
.finance-events-table table { min-width: 980px; }
.cash-section-label { margin-top: 28px; }
.cash-finance-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.finance-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 16px; margin-top: 20px; }
.finance-detail-grid > * { min-width: 0; }
.subsection-head { min-height: 52px; margin-bottom: 9px; }
.subsection-head h3 { margin: 0 0 3px; font-size: 1rem; }
.subsection-head p { margin: 0; font-size: .7rem; }
.expense-panel { min-width: 0; }
.expense-categories { display: grid; gap: 14px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.expense-category > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: .72rem; }
.expense-category > div strong { color: var(--ink); }
.expense-category > span { display: block; height: 7px; overflow: hidden; background: #f1edf5; border-radius: 4px; }
.expense-category > span i { display: block; height: 100%; background: var(--pink); border-radius: inherit; }
.entry-source { display: inline-flex; padding: 3px 7px; border-radius: 10px; font-size: .62rem; font-weight: 750; white-space: nowrap; }
.entry-source.payment { color: #08717b; background: #d8f6f7; }
.entry-source.manual { color: var(--purple); background: #eee7fa; }
.amount-pending { color: var(--red); }
.amount-ok { color: #4d8400; }
.empty-table { padding: 25px 10px; color: var(--muted); text-align: center; }
.modal-intro { margin: 0 0 16px; padding: 11px 12px; color: #51445f; background: #f7f2fd; border-left: 4px solid var(--purple); border-radius: 5px; font-size: .75rem; line-height: 1.5; }
.operating-cost-totals { display: flex; align-items: center; justify-content: space-around; gap: 12px; padding: 11px; background: #f6f1fd; border: 1px solid var(--line); border-radius: 6px; font-size: .72rem; }
.operating-cost-totals strong { color: var(--purple); }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.settings-form .full { grid-column: 1 / -1; }
.isolation-panel { padding: 18px; background: #f1fbfc; border: 1px solid #bce9ec; border-radius: 7px; }
.isolation-panel img { width: 26px; height: 26px; margin-bottom: 12px; }
.isolation-panel p { color: #46666b; font-size: 0.79rem; line-height: 1.55; margin-bottom: 0; }

.modal { width: min(700px, calc(100vw - 28px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(25, 15, 43, 0.58); }
.modal-shell > header, .modal-shell > footer { padding: 16px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-shell > header { border-bottom: 1px solid var(--line); }
.modal-shell > footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { max-height: calc(100vh - 190px); overflow-y: auto; padding: 18px 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section-title { min-height: 52px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; background: #f7f2fd; border-left: 4px solid var(--purple); border-radius: 5px; }
.form-section-title > span { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; color: white; background: var(--purple); border-radius: 50%; font-family: var(--font-display); font-size: 0.72rem; font-weight: 800; }
.form-section-title strong, .form-section-title small { display: block; }
.form-section-title strong { color: var(--ink); font-family: var(--font-display); font-size: 0.78rem; }
.form-section-title small { margin-top: 2px; color: var(--muted); font-size: 0.67rem; font-weight: 400; }
.field-hint { color: var(--muted); font-size: 0.67rem; font-weight: 400; }
.checkbox { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--purple); }
.reservation-services-note { padding: 12px; background: #f6f1fd; border: 1px solid #d9ccec; border-radius: 6px; }
.reservation-services-note > strong { display: block; margin-bottom: 7px; color: var(--purple); font-size: 0.75rem; }
.reservation-services-note > div { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #ded5e9; font-size: 0.72rem; }
.payment-overview, .payment-modal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; background: #f7f3fb; border: 1px solid var(--line); border-radius: 7px; }
.payment-overview > div, .payment-modal-summary > div { display: grid; gap: 4px; }
.payment-overview span, .payment-modal-summary span { color: var(--muted); font-size: .68rem; }
.payment-overview strong, .payment-modal-summary strong { font-size: 1rem; }
.payment-overview .btn { align-self: center; justify-self: end; }
.payment-history { margin: 14px 0 18px; border-top: 1px solid var(--line); }
.payment-history-row { min-height: 62px; display: grid; grid-template-columns: minmax(0,1fr) auto 36px; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.payment-history-row > div { display: grid; gap: 2px; }
.payment-history-row span, .payment-history-row small { color: var(--muted); font-size: .67rem; }
.payment-history-row.voided { opacity: .58; text-decoration: line-through; }
.settings-stack { display: grid; gap: 18px; }
.rule-list { display: grid; }
.rule-row { min-height: 72px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.rule-row:first-child { border-top: 0; }
.rule-row p { margin: 3px 0 0; color: var(--muted); font-size: .7rem; }
.rule-kind { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; }
.rule-kind img { width: 19px; height: 19px; }
.rule-kind.block { background: #fff0f3; }
.rule-kind.open { background: #eff9df; }
.activity-list { display: grid; }
.activity-row { min-height: 68px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }
.activity-row p { margin: 3px 0 0; color: var(--muted); font-size: .7rem; }
.activity-row > span:last-child { color: var(--purple); font-size: .72rem; font-weight: 750; }
.activity-icon { width: 36px; height: 36px; display: grid; place-items: center; background: #f2ecfb; border-radius: 7px; }
.activity-icon img { width: 18px; height: 18px; }

.segmented { display: grid; grid-template-columns: repeat(2, 38px); height: 38px; padding: 2px; background: #eee8f5; border: 1px solid var(--line); border-radius: 6px; }
.segmented button { display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.segmented button.active { background: white; box-shadow: 0 1px 4px rgba(38,21,63,.13); }
.segmented img { width: 17px; height: 17px; }
.month-toolbar { min-height: 54px; margin-bottom: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.month-toolbar > strong { min-width: 180px; text-align: center; text-transform: capitalize; }
.calendar-legend { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .67rem; }
.calendar-legend i { width: 9px; height: 9px; border-radius: 2px; }.calendar-legend i.pending{background:#f3be38}.calendar-legend i.confirmed{background:var(--cyan)}.calendar-legend i.blocked{background:#8a8392}
.month-calendar { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 7px; }
.month-weekdays, .month-days { display: grid; grid-template-columns: repeat(7,minmax(100px,1fr)); }
.month-weekdays span { padding: 10px; color: var(--muted); background:#f7f3fb; border-right:1px solid var(--line); text-align:center; font-size:.68rem; font-weight:750; }
.month-day { min-height: 116px; padding: 7px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.month-day > span { width: 26px; height: 26px; display:grid; place-items:center; font-size:.72rem; font-weight:750; }
.month-day.today > span { color:white; background:var(--purple); border-radius:50%; }.month-day.outside{background:#faf9fb;color:#aaa3af}
.month-event { width:100%; min-height:27px; margin-top:4px; padding:5px 6px; overflow:hidden; border:0; border-left:4px solid; border-radius:4px; text-align:left; text-overflow:ellipsis; white-space:nowrap; font-size:.65rem; cursor:pointer; }
.month-event.pending{background:#fff6dc;border-color:#e8aa1e}.month-event.confirmed{background:#e2f7f6;border-color:var(--cyan)}.month-event.blocked{background:#efedf1;border-color:#817a89}.month-event.cancelled{background:#fff0f1;border-color:var(--red);opacity:.65}.month-event.available{background:#f2f9e8;border-color:var(--lime)}.month-event.open-exception{background:#e7f8fa;border-color:var(--cyan)}.month-event.filtered{background:#f4f2f6;border-color:#aaa3af;color:#6b6472;cursor:default}
.operation-sheet { display:grid; gap:16px; }
.operation-actions { display:flex; justify-content:flex-end; gap:8px; }
.operation-indicators { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.operation-indicator { min-height:74px; padding:11px; display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:9px; border:1px solid var(--line); border-left:4px solid #a39ca9; border-radius:7px; background:#fff; }
.operation-indicator img { width:20px; height:20px; padding:7px; box-sizing:content-box; border-radius:6px; background:#f2edf7; }
.operation-indicator span,.operation-indicator strong { display:block; }.operation-indicator span{color:var(--muted);font-size:.62rem}.operation-indicator strong{margin-top:3px;font-size:.72rem;line-height:1.25}
.operation-indicator.ok { border-left-color:var(--lime); }.operation-indicator.warning { border-left-color:#e8aa1e; }.operation-indicator.danger { border-left-color:var(--red); }.operation-indicator.info { border-left-color:var(--cyan); }
.operation-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:7px; overflow:hidden; }
.operation-summary>div { min-height:82px; padding:13px; display:grid; align-content:start; gap:4px; border-left:1px solid var(--line); }.operation-summary>div:first-child{border-left:0}
.operation-summary span,.operation-summary small{color:var(--muted);font-size:.64rem}.operation-summary strong{font-size:.75rem;line-height:1.35;overflow-wrap:anywhere}
.operation-profit,.operation-section { padding:15px; border:1px solid var(--line); border-radius:7px; background:#fff; }
.operation-profit { border-top:4px solid var(--cyan); background:#f8fcfc; }
.operation-section-head { display:flex; align-items:start; justify-content:space-between; gap:12px; }.operation-section-head h3{margin:0;font-size:1rem}.operation-section-head p{margin:3px 0 0;color:var(--muted);font-size:.67rem}.operation-section-head>div>span{color:var(--purple);font-size:.62rem;font-weight:800}
.operation-section-head>strong{font-size:1.35rem}.amount-ok{color:#3f7d15}.amount-pending{color:#a04a22}
.profit-grid { margin-top:12px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }.profit-grid>div{padding:10px;background:#fff;border:1px solid var(--line);border-radius:6px}.profit-grid span,.profit-grid small{display:block;color:var(--muted);font-size:.62rem}.profit-grid strong{display:block;margin:4px 0;font-size:.85rem}
.operation-list { margin-top:10px; border-top:1px solid var(--line); }.operation-row{min-height:58px;padding:9px 2px;display:grid;grid-template-columns:minmax(0,1fr) minmax(130px,auto);align-items:center;gap:12px;border-bottom:1px solid var(--line)}.operation-row>div:first-child{display:grid;gap:3px}.operation-row span{color:var(--muted);font-size:.64rem}.operation-row select{min-width:145px;padding:7px;font-size:.68rem}.operation-row.muted-row{opacity:.55}.operation-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px}
.operation-service-editor{display:grid;grid-template-columns:95px 95px 125px 34px;align-items:end;gap:6px}.operation-service-editor label{display:grid;gap:3px;color:var(--muted);font-size:.58rem}.operation-service-editor input,.operation-service-editor select{width:100%;min-width:0;padding:7px;font-size:.68rem}
.operation-task{min-height:56px;padding:8px 2px;display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:8px;border-bottom:1px solid var(--line);cursor:pointer}.operation-task span{display:grid;gap:3px}.operation-task small{color:var(--muted);font-size:.64rem}.operation-task.done strong{text-decoration:line-through}.operation-task.cancelled{opacity:.5}
.operation-add{margin-top:12px;padding:11px;display:flex;gap:8px;align-items:end;background:#f7f3fb;border-radius:6px}.operation-add>*{min-width:0}.operation-add select,.operation-add input{flex:1}.operation-add-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto}
.family-profile-head { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:18px; }.family-profile-head>div{padding:12px;background:#f7f3fb;border-radius:6px}.family-profile-head span,.family-history-row span{display:block;color:var(--muted);font-size:.68rem}.family-profile-head strong{display:block;margin-top:4px}
.family-history{border-top:1px solid var(--line)}.family-history-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:15px;padding:12px 2px;border-bottom:1px solid var(--line)}.family-history-row>div:last-child{text-align:right}
.service-provider header>div { display:flex; align-items:center; justify-content:space-between; gap:8px; }.service-provider header>div .icon-btn{flex:0 0 auto}
.package-row>div:last-child { display:flex; align-items:center; gap:7px; }.package-row small{display:block;margin-top:5px;color:var(--muted);font-size:.62rem}.package-thumb{width:42px;height:42px;float:left;margin:0 9px 5px 0;object-fit:cover;border-radius:5px}
.reservation-services-note select { width:auto; min-width:130px; padding:6px 8px; font-size:.68rem; }.reservation-services-note small{color:var(--muted)}
.export-month { display:flex; align-items:center; gap:7px; font-size:.68rem; }.export-month input{width:145px;padding:8px}

.toast-stack { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { width: min(350px, calc(100vw - 36px)); padding: 12px 14px; color: white; background: #25183b; border-radius: 6px; box-shadow: var(--shadow); font-size: 0.82rem; animation: toast-in .2s ease; }
.toast.error { background: #9c2637; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.sidebar-scrim, .mobile-only { display: none; }

@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .service-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .finance-detail-grid { grid-template-columns: 1fr; }
  .event-finance-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today { display: none; }
  .operation-indicators { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .profit-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .staff-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .main { grid-column: auto; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 15; background: rgba(24,17,41,0.45); }
  .sidebar.open + .sidebar-scrim { display: block; }
  .mobile-only { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .view-root { padding: 18px 16px 34px; }
  .dashboard-grid, .settings-layout { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .mobile-logo { display: flex; }
  .month-calendar { overflow-x:auto; }.month-weekdays,.month-days{min-width:780px}
}
@media (max-width: 680px) {
  .topbar { min-height: 66px; }
  .operation-indicators,.operation-summary,.profit-grid { grid-template-columns:1fr 1fr; }
  .operation-summary>div { border-left:0; border-top:1px solid var(--line); }.operation-summary>div:first-child{border-top:0}
  .operation-add-grid { grid-template-columns:1fr; }
  .operation-row { grid-template-columns:1fr; }.operation-row select{width:100%}
  .operation-service-editor { grid-template-columns:1fr 1fr; }.operation-service-editor select{min-width:0}
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 1.25rem; }
  .topbar-actions .btn { width: 40px; padding: 0; }
  .topbar-actions .btn span { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 102px; padding: 13px; }
  .metric strong { font-size: 1.25rem; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filter-row, .search-field { width: 100%; }
  .reservation-scope-bar { align-items: stretch; flex-direction: column; gap: 0; }
  .reservation-scope-bar > p { margin: 0 0 12px; text-align: left; }
  .reservation-scope-tabs { width: 100%; }
  .reservation-scope-tab { min-width: 0; flex: 1; }
  .filter-row label { flex: 1 1 130px; }
  .service-grid, .finance-summary, .settings-form, .form-grid { grid-template-columns: 1fr; }
  .staff-metrics, .staff-grid { grid-template-columns: 1fr; }
  .finance-toolbar, .finance-section-label { align-items: flex-start; flex-direction: column; }
  .finance-toolbar .section-actions { width: 100%; }
  .period-picker { flex: 1 1 145px; }
  .period-picker input { width: 100%; }
  .event-finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-projection { grid-template-columns: 1fr; }
  .event-projection strong { grid-row: auto; margin: 4px 0; }
  .operating-cost-totals { align-items: flex-start; flex-direction: column; }
  .settings-form .full, .form-grid .full { grid-column: auto; }
  .quick-item { grid-template-columns: 40px minmax(0,1fr); }
  .quick-item > .badge { grid-column: 2; justify-self: start; }
  .payment-overview, .payment-modal-summary { grid-template-columns: 1fr; }
  .payment-overview .btn { justify-self: stretch; }
  .staff-schedule-head, .staff-schedule-row { grid-template-columns: minmax(84px,1.1fr) repeat(3,minmax(60px,1fr)); }
  .staff-schedule-check span { display: none; }
  .rule-row { grid-template-columns: 40px minmax(0,1fr); }
  .rule-row > .badge, .rule-row > .btn { grid-column: 2; justify-self: start; }
  .week-label { min-width: 145px; }
  .month-toolbar { flex-wrap:wrap; }.calendar-legend{width:100%;margin-left:0}.family-profile-head{grid-template-columns:1fr}.family-history-row{grid-template-columns:1fr}.family-history-row>div:last-child{text-align:left}
}
@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
  .event-finance-summary { grid-template-columns: 1fr; }
  .topbar { gap: 7px; }
  .view-root { padding-left: 11px; padding-right: 11px; }
}
