:root {
  --blue-900: #0c3f83;
  --blue-800: #0f4fa4;
  --blue-700: #1769d2;
  --blue-600: #2379e8;
  --blue-100: #dcecff;
  --blue-50: #eef6ff;
  --ink: #162235;
  --muted: #6f7f93;
  --line: #dfe8f2;
  --surface: #ffffff;
  --canvas: #f4f8fc;
  --filled: #f1f6fb;
  --success: #16865c;
  --success-bg: #e6f7ef;
  --warning: #b86b00;
  --warning-bg: #fff3d9;
  --danger: #c53b45;
  --danger-bg: #ffeaec;
  --purple: #7357c8;
  --shadow: 0 10px 30px rgba(31, 76, 128, .10);
  --shadow-soft: 0 4px 18px rgba(31, 76, 128, .08);
  --radius: 18px;
  --sidebar: 268px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100%; margin: 0; color: var(--ink); background: var(--canvas);
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }

.boot-screen {
  min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: var(--blue-800); background: radial-gradient(circle at 50% 25%, #fff 0, var(--blue-50) 48%, var(--canvas) 100%);
  font-size: 20px;
}
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--blue-100); border-top-color: var(--blue-700);
  border-radius: 50%; animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--blue-600), var(--blue-900)); box-shadow: 0 8px 18px rgba(23, 105, 210, .26);
  color: white; flex: 0 0 auto;
}
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark--large { width: 74px; height: 74px; border-radius: 23px; }
.brand-mark--large svg { width: 44px; height: 44px; }

/* Login */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .85fr) minmax(480px, 1.15fr);
  background: #fff;
}
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 7vw; }
.login-box { width: min(430px, 100%); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 48px; }
.login-brand h1 { margin: 0; font-size: 25px; letter-spacing: -.5px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); }
.login-box h2 { font-size: 32px; line-height: 1.15; letter-spacing: -1px; margin: 0 0 10px; }
.login-box > p { color: var(--muted); margin: 0 0 30px; }
.login-visual {
  position: relative; overflow: hidden; margin: 18px; border-radius: 30px;
  background: linear-gradient(145deg, #0e4b9c, #1a75df 60%, #5aa4ef); color: #fff;
  display: grid; align-items: end; padding: 58px;
}
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.login-visual::before { width: 460px; height: 460px; right: -170px; top: -160px; }
.login-visual::after { width: 330px; height: 330px; left: -110px; bottom: -120px; }
.visual-content { position: relative; z-index: 1; max-width: 560px; }
.visual-content .big-icon { width: 118px; height: 118px; border-radius: 32px; background: rgba(255,255,255,.16); display: grid; place-items: center; margin-bottom: 34px; backdrop-filter: blur(8px); }
.visual-content .big-icon svg { width: 68px; height: 68px; fill: none; stroke: white; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.visual-content h2 { font-size: clamp(34px, 4vw, 58px); line-height: 1.05; letter-spacing: -2px; margin: 0 0 18px; }
.visual-content p { font-size: 18px; line-height: 1.65; opacity: .9; margin: 0; }
.login-note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--blue-50); border-radius: 14px; color: var(--blue-900); margin-top: 20px; font-size: 13px; }
.login-note svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40; display: flex; flex-direction: column;
  padding: 22px 16px 16px; background: #fff; border-right: 1px solid var(--line);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; }
.sidebar-brand strong { display: block; font-size: 20px; letter-spacing: -.5px; }
.sidebar-brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding: 4px 0 16px; }
.nav-section { padding: 16px 12px 7px; color: #97a4b4; font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.nav-link {
  appearance: none; border: 0; width: 100%; display: flex; align-items: center; gap: 12px;
  color: #4e6075; background: transparent; padding: 11px 13px; border-radius: 12px; text-align: left; font-weight: 650;
  transition: .18s ease;
}
.nav-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { background: var(--blue-50); color: var(--blue-800); }
.nav-link.active { background: var(--blue-700); color: #fff; box-shadow: 0 7px 18px rgba(23,105,210,.22); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--blue-100); color: var(--blue-800); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.user-card .user-info { min-width: 0; flex: 1; }
.user-card strong, .user-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card strong { font-size: 13px; }
.user-card span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.icon-btn {
  border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--blue-50); color: var(--blue-800); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.main-wrap { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  height: 72px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; background: rgba(244,248,252,.88); border-bottom: 1px solid rgba(223,232,242,.75); backdrop-filter: blur(14px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mobile-menu { display: none; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.topbar-date { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.topbar-date svg { width: 18px; height: 18px; fill: none; stroke: var(--blue-700); stroke-width: 2; }
.main-content { padding: 28px 30px 44px; max-width: 1700px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; letter-spacing: -.8px; margin: 0 0 5px; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Buttons */
.btn {
  border: 0; min-height: 42px; padding: 10px 16px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 750; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--blue-700); color: #fff; box-shadow: 0 7px 16px rgba(23,105,210,.2); }
.btn-primary:hover { background: var(--blue-800); }
.btn-secondary { background: var(--blue-50); color: var(--blue-800); }
.btn-secondary:hover { background: var(--blue-100); }
.btn-white { background: #fff; color: var(--ink); box-shadow: var(--shadow-soft); }
.btn-ghost { background: transparent; color: var(--blue-700); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-sm { min-height: 34px; padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.btn-icon { width: 42px; padding: 0; }

/* Inputs */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.field { min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-full { grid-column: 1 / -1; }
.field > label { display: flex; justify-content: space-between; gap: 8px; color: #435369; font-size: 12px; font-weight: 750; margin: 0 0 7px 2px; }
.field .hint { font-weight: 500; color: var(--muted); }
.control {
  width: 100%; min-height: 48px; border: 1px solid transparent; border-radius: 13px; padding: 11px 13px;
  color: var(--ink); background: var(--filled); outline: none; transition: .16s ease;
}
.control:hover { background: #eaf2fa; }
.control:focus { background: #fff; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(35,121,232,.12); }
textarea.control { resize: vertical; min-height: 94px; }
select.control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #75859a 50%), linear-gradient(135deg, #75859a 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input-wrap { position: relative; }
.input-wrap .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap .input-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.input-wrap .control { padding-left: 42px; }
.date-field { position: relative; cursor: pointer; }
.date-field .control { cursor: pointer; padding-right: 42px; }
.date-field::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); pointer-events: none;
  background: center/18px 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231769d2' stroke-width='2'%3E%3Cpath stroke-linecap='round' d='M7 3v3m10-3v3M4 9h16M5 5h14a1 1 0 0 1 1 1v14H4V6a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E");
}
.date-field input::-webkit-calendar-picker-indicator { opacity: 0; width: 0; padding: 0; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue-700); }
.segmented { display: inline-flex; padding: 4px; gap: 3px; background: #eaf1f8; border-radius: 12px; }
.segmented button { border: 0; background: transparent; color: var(--muted); min-height: 34px; padding: 6px 12px; border-radius: 9px; font-weight: 700; }
.segmented button.active { background: #fff; color: var(--blue-800); box-shadow: 0 2px 8px rgba(31,76,128,.12); }

/* Cards and layouts */
.card { background: var(--surface); border: 1px solid rgba(223,232,242,.92); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.card-body { padding: 20px; }
.card-head { min-height: 60px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .field { min-width: 180px; }
.toolbar-spacer { flex: 1; }

.metric-card { padding: 18px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; }
.metric-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.metric-value { margin-top: 13px; font-size: 25px; letter-spacing: -.7px; font-weight: 850; }
.metric-note { color: var(--muted); font-size: 11px; margin-top: 2px; }
.metric-card.success .metric-icon { background: var(--success-bg); color: var(--success); }
.metric-card.warning .metric-icon { background: var(--warning-bg); color: var(--warning); }
.metric-card.danger .metric-icon { background: var(--danger-bg); color: var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { padding: 12px 14px; color: #8492a5; font-size: 10px; letter-spacing: .7px; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 14px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f9fbfd; }
.table-title { font-weight: 750; }
.table-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.action-btn { border: 0; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-800); }
.action-btn:hover { background: var(--blue-100); }
.action-btn.danger { background: var(--danger-bg); color: var(--danger); }
.action-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Status */
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-blue { color: var(--blue-700); background: var(--blue-50); }
.badge-green { color: var(--success); background: var(--success-bg); }
.badge-yellow { color: var(--warning); background: var(--warning-bg); }
.badge-red { color: var(--danger); background: var(--danger-bg); }
.badge-gray { color: #6d7b8d; background: #eef2f6; }
.badge-purple { color: var(--purple); background: #f0ecff; }
.status-select { border: 0; border-radius: 999px; padding: 7px 28px 7px 10px; font-size: 11px; font-weight: 800; background-color: var(--blue-50); color: var(--blue-800); outline: none; }

/* Calendar */
.calendar-card { padding: 18px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.calendar-title { font-size: 17px; font-weight: 850; text-transform: capitalize; }
.calendar-nav { display: flex; gap: 7px; }
.calendar-nav button { border: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--blue-50); color: var(--blue-800); display: grid; place-items: center; }
.calendar-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.calendar-weekdays div { text-align: center; color: #95a2b2; font-size: 10px; font-weight: 800; padding: 5px 0; }
.calendar-day {
  position: relative; border: 0; min-height: 62px; border-radius: 12px; background: #f7fafd; color: var(--ink); padding: 8px;
  display: flex; align-items: center; justify-content: center; font-weight: 750; transition: .15s ease;
}
.calendar-day:hover { background: var(--blue-100); color: var(--blue-900); }
.calendar-day.other { opacity: .38; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--blue-600); }
.calendar-day.selected { background: var(--blue-700); color: #fff; box-shadow: 0 7px 16px rgba(23,105,210,.22); }
.calendar-day .day-count { position: absolute; right: 6px; top: 6px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; font-size: 9px; color: var(--blue-800); background: var(--blue-100); }
.calendar-day.selected .day-count { color: var(--blue-900); background: #fff; }

/* Appointment / queue */
.queue-list { display: flex; flex-direction: column; gap: 10px; }
.queue-item { display: grid; grid-template-columns: 68px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: #f7fafd; }
.queue-time { font-size: 16px; font-weight: 850; color: var(--blue-800); text-align: center; }
.queue-main { min-width: 0; }
.queue-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-main span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-actions { display: flex; gap: 6px; align-items: center; }
.barber-list { display: flex; flex-direction: column; gap: 10px; }
.barber-status { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #f7fafd; }
.barber-status .avatar { background: #fff; box-shadow: 0 2px 8px rgba(31,76,128,.08); }
.barber-status-info { min-width: 0; flex: 1; }
.barber-status-info strong, .barber-status-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barber-status-info span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.green { background: #21b67a; box-shadow: 0 0 0 4px #def6eb; }
.dot.yellow { background: #e39a20; box-shadow: 0 0 0 4px #fff1d7; }
.dot.blue { background: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-100); }

/* Charts */
.bar-chart { height: 220px; display: flex; align-items: flex-end; gap: 10px; padding: 24px 4px 0; }
.bar-column { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-value { font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar-track { width: min(42px, 72%); height: 150px; display: flex; align-items: flex-end; background: #f1f5f9; border-radius: 10px; overflow: hidden; }
.bar-fill { width: 100%; min-height: 3px; background: linear-gradient(180deg, var(--blue-600), var(--blue-800)); border-radius: 10px 10px 0 0; transition: height .4s ease; }
.bar-label { color: var(--muted); font-size: 10px; text-transform: capitalize; }
.horizontal-bars { display: flex; flex-direction: column; gap: 13px; }
.hbar-row { display: grid; grid-template-columns: minmax(100px, .6fr) minmax(120px, 1.4fr) auto; gap: 12px; align-items: center; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.hbar-track { height: 9px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: inherit; background: var(--blue-600); }
.hbar-value { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* Service choices and cards */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; max-height: 320px; overflow-y: auto; padding: 2px; }
.choice-card { position: relative; display: block; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-inner { min-height: 82px; border: 2px solid transparent; border-radius: 14px; background: var(--filled); padding: 12px; transition: .15s ease; }
.choice-card:hover .choice-inner { background: var(--blue-50); }
.choice-card input:checked + .choice-inner { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(35,121,232,.09); }
.choice-inner strong { display: block; }
.choice-inner span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.choice-price { color: var(--blue-800) !important; font-weight: 800; }
.entity-card { padding: 18px; display: flex; flex-direction: column; gap: 15px; min-height: 190px; }
.entity-top { display: flex; align-items: flex-start; gap: 12px; }
.entity-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-700); flex: 0 0 auto; }
.entity-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; }
.entity-main { min-width: 0; flex: 1; }
.entity-main h3 { margin: 2px 0 3px; font-size: 15px; }
.entity-main p { color: var(--muted); margin: 0; font-size: 12px; }
.entity-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.mini-stat { padding: 10px; border-radius: 11px; background: #f7fafd; }
.mini-stat span { display: block; color: var(--muted); font-size: 10px; }
.mini-stat strong { display: block; margin-top: 3px; font-size: 13px; }
.entity-actions { margin-top: auto; display: flex; gap: 8px; }

/* Cashier */
.cashier-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(360px,.75fr); gap: 18px; align-items: start; }
.catalog-card { min-height: 620px; }
.catalog-toolbar { padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 18px; }
.catalog-item { border: 0; text-align: left; min-height: 126px; padding: 14px; border-radius: 15px; background: #f5f9fd; color: var(--ink); display: flex; flex-direction: column; transition: .15s ease; }
.catalog-item:hover { background: var(--blue-50); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.catalog-item .type { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.catalog-item strong { margin: 7px 0 3px; line-height: 1.3; }
.catalog-item .catalog-meta { color: var(--muted); font-size: 11px; }
.catalog-item .catalog-price { margin-top: auto; padding-top: 10px; color: var(--blue-800); font-weight: 850; }
.catalog-item.out { opacity: .5; pointer-events: none; }
.cart-card { position: sticky; top: 90px; }
.cart-body { padding: 16px; }
.cart-customer { padding: 13px; border-radius: 14px; background: var(--blue-50); margin-bottom: 14px; }
.cart-items { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 3px; }
.cart-item { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 11px; border-radius: 12px; background: #f6f9fc; }
.cart-item strong { display: block; font-size: 12px; }
.cart-item span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.qty-control { display: flex; align-items: center; gap: 7px; }
.qty-control button { width: 26px; height: 26px; border: 0; border-radius: 8px; background: #fff; color: var(--blue-800); font-weight: 850; }
.qty-control b { min-width: 18px; text-align: center; font-size: 12px; }
.cart-empty { padding: 32px 12px; text-align: center; color: var(--muted); }
.cart-empty svg { width: 42px; height: 42px; margin: 0 auto 10px; fill: none; stroke: #b3c0cf; stroke-width: 1.6; }
.cart-summary { margin-top: 14px; border-top: 1px dashed #d6e0ea; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.summary-row strong { color: var(--ink); }
.summary-row.total { font-size: 18px; font-weight: 850; color: var(--ink); padding-top: 7px; border-top: 1px solid var(--line); }
.summary-row.total strong { color: var(--blue-800); }

/* Empty and loading */
.empty-state { display: grid; place-items: center; text-align: center; min-height: 210px; padding: 30px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; fill: none; stroke: #b8c4d2; stroke-width: 1.6; margin-bottom: 12px; }
.empty-state strong { color: var(--ink); font-size: 14px; }
.empty-state p { margin: 5px 0 0; max-width: 340px; font-size: 12px; }
.loading-block { min-height: 260px; display: grid; place-items: center; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10,31,57,.46); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(620px, 100%); max-height: min(90vh, 920px); display: flex; flex-direction: column; background: #fff; border-radius: 22px;
  box-shadow: 0 24px 70px rgba(10,31,57,.28); animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(12px) scale(.985); opacity: 0; } }
.modal.modal-lg { width: min(850px, 100%); }
.modal.modal-xl { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { border: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--filled); color: var(--muted); display: grid; place-items: center; }
.modal-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: #fbfdff; border-radius: 0 0 22px 22px; }
.confirm-message { color: var(--muted); font-size: 14px; line-height: 1.7; }

/* Receipt */
.receipt { width: 100%; max-width: 430px; margin: 0 auto; color: #111; }
.receipt-head { text-align: center; padding-bottom: 16px; border-bottom: 1px dashed #999; }
.receipt-head h2 { margin: 7px 0 4px; }
.receipt-head p { margin: 2px 0; font-size: 12px; }
.receipt-meta { padding: 14px 0; border-bottom: 1px dashed #999; font-size: 12px; }
.receipt-meta div { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0; }
.receipt-items { padding: 12px 0; border-bottom: 1px dashed #999; }
.receipt-line { margin: 7px 0; }
.receipt-line > div { display: flex; justify-content: space-between; gap: 12px; }
.receipt-line small { color: #555; }
.receipt-total { padding: 12px 0; }
.receipt-total div { display: flex; justify-content: space-between; gap: 12px; margin: 5px 0; }
.receipt-total .grand { font-size: 17px; font-weight: 850; border-top: 1px solid #222; padding-top: 8px; }
.receipt-footer { text-align: center; padding-top: 12px; border-top: 1px dashed #999; font-size: 12px; }

/* Toast */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { min-width: 270px; max-width: min(420px, calc(100vw - 40px)); padding: 13px 15px; border-radius: 13px; box-shadow: 0 16px 40px rgba(10,31,57,.22); color: #fff; background: #263b55; display: flex; align-items: flex-start; gap: 10px; animation: toastIn .2s ease; pointer-events: auto; }
.toast.success { background: #137554; }
.toast.error { background: #b73540; }
.toast svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }

/* Booking link and settings */
.booking-link-box { display: flex; gap: 10px; align-items: center; padding: 14px; background: var(--blue-50); border-radius: 14px; }
.booking-link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue-900); }
.info-box { padding: 14px 16px; border-radius: 14px; background: var(--blue-50); color: var(--blue-900); font-size: 12px; line-height: 1.6; }
.alert-box { padding: 13px 15px; border-radius: 13px; background: var(--warning-bg); color: #895000; font-size: 12px; }

/* Mobile overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(10,31,57,.4); }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cashier-layout { grid-template-columns: minmax(0,1.2fr) minmax(340px,.8fr); }
  .form-grid--4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 980px) {
  :root { --sidebar: 252px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 18px 0 40px rgba(10,31,57,.16); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrap { margin-left: 0; }
  .mobile-menu { display: grid; }
  .grid-main-side, .cashier-layout { grid-template-columns: 1fr; }
  .cart-card { position: static; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 720px) {
  body { font-size: 13px; }
  .topbar { height: 64px; padding: 0 16px; }
  .topbar-date span { display: none; }
  .main-content { padding: 20px 14px 34px; }
  .page-head { flex-direction: column; margin-bottom: 18px; }
  .page-head h1 { font-size: 24px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .metrics-mobile-2 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .metric-card { min-height: 116px; padding: 14px; }
  .metric-value { font-size: 20px; }
  .form-grid, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; gap: 13px; }
  .field.span-2 { grid-column: span 1; }
  .toolbar { align-items: stretch; }
  .toolbar .field { min-width: 0; width: 100%; }
  .toolbar .btn { flex: 1; }
  .queue-item { grid-template-columns: 56px minmax(0,1fr); }
  .queue-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 9px; }
  .calendar-day { min-height: 49px; padding: 5px; border-radius: 10px; }
  .calendar-day .day-count { right: 3px; top: 3px; min-width: 15px; height: 15px; font-size: 8px; }
  .choice-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 12px; }
  .catalog-item { min-height: 116px; padding: 11px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal.modal-lg, .modal.modal-xl { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .modal-foot { border-radius: 0; }
  .modal-body { padding: 18px 15px; }
  .modal-head { padding: 16px; }
  .modal-foot { padding: 13px 15px; }
  .toast-root { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
  .login-panel { padding: 30px 20px; }
  .login-brand { margin-bottom: 40px; }
  .login-box h2 { font-size: 28px; }
  .hbar-row { grid-template-columns: 95px 1fr; }
  .hbar-value { grid-column: 2; }
}

@media (max-width: 430px) {
  .metrics-mobile-2 { grid-template-columns: 1fr 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
  .btn { padding-inline: 13px; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
}

@media print {
  body * { visibility: hidden !important; }
  .receipt-print, .receipt-print * { visibility: visible !important; }
  .receipt-print { position: absolute; inset: 0; width: 80mm; margin: 0 auto; padding: 8mm 4mm; }
  .modal-backdrop { background: #fff; padding: 0; }
  .modal-head, .modal-foot { display: none !important; }
  .modal { box-shadow: none; max-height: none; }
  .modal-body { overflow: visible; padding: 0; }
}
