:root {
  --navy: #132238;
  --navy-soft: #20344f;
  --cream: #f5f2eb;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #778195;
  --line: #e8e6df;
  --orange: #e66a2c;
  --orange-dark: #ca5520;
  --green: #2a9d78;
  --blue: #4f7ed8;
  --shadow: 0 16px 40px rgba(25, 35, 52, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 30px 22px;
  color: white;
  background: var(--navy);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.sidebar-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: rgba(255,255,255,.1);
  font-size: 25px;
  line-height: 1;
  display: none;
  place-items: center;
}

.sidebar-close:hover { background: rgba(255,255,255,.18); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-mark {
  width: 58px;
  height: 45px;
  padding: 5px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: white;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; }
.brand span { margin-top: 2px; color: #9eabc0; font-size: 12px; }

.nav-list {
  display: grid;
  gap: 7px;
  margin-top: 22px;
  padding-right: 3px;
  overflow-y: auto;
}

.nav-section-label {
  margin: 12px 14px 2px;
  color: #718198;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 11px;
  color: #b7c2d2;
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: .2s ease;
  text-decoration: none;
}

.nav-item:hover, .nav-item.active {
  color: white;
  background: var(--navy-soft);
}

.nav-item.active { box-shadow: inset 3px 0 var(--orange); }
.nav-icon { width: 22px; font-weight: 800; text-align: center; }

.sidebar-card {
  margin-top: auto;
  padding: 17px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
}

.sidebar-card-label {
  color: #8dd9bf;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.sidebar-card strong { display: block; margin: 8px 0 4px; font-size: 13px; }
.sidebar-card p { margin: 0; color: #9eabc0; font-size: 11px; line-height: 1.5; }
.sidebar-logout {
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,180,140,.24);
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffc3a3;
  background: rgba(230,106,44,.08);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  transition: .2s ease;
}
.sidebar-logout-icon { font-size: 14px; line-height: 1; }
.sidebar-logout-text { min-width: 0; display: block; }
.sidebar-logout-text strong,
.sidebar-logout-text small { display: block; }
.sidebar-logout-text strong { margin: 0; color: inherit; font-size: 10px; }
.sidebar-logout-text small {
  max-width: 125px;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255,255,255,.62);
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-logout:hover {
  color: white;
  border-color: var(--orange);
  background: var(--orange);
  transform: translateY(-1px);
}
.sidebar-logout:hover .sidebar-logout-text small { color: rgba(255,255,255,.84); }

.main-content { margin-left: 248px; padding: 0 34px 44px; }

.topbar {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar h1 { margin: 4px 0 0; font-size: 27px; letter-spacing: -.03em; }
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-switcher { position: relative; }
.active-user-button {
  min-width: 170px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}
.active-user-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--navy);
  font-size: 11px;
  font-weight: 800;
}
.active-user-button strong, .active-user-button small { display: block; }
.active-user-button strong { max-width: 112px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.active-user-button small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.user-switcher-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 7px);
  right: 0;
  width: 250px;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
  display: none;
}
.user-switcher-menu.open { display: grid; gap: 4px; }
.user-switch-option {
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.user-switch-option:hover, .user-switch-option.active { background: #fff1e8; }
.user-switch-option strong, .user-switch-option span { display: block; }
.user-switch-option strong { font-size: 11px; }
.user-switch-option span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.role-hidden { display: none !important; }
.today-box { padding-right: 17px; border-right: 1px solid var(--line); text-align: right; }
.today-box span, .today-box strong { display: block; }
.today-box span { color: var(--muted); font-size: 11px; }
.today-box strong { margin-top: 3px; font-size: 13px; }

.primary-btn, .secondary-btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 750;
  transition: .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-btn { color: white; background: var(--orange); box-shadow: 0 8px 18px rgba(230,106,44,.2); }
.primary-btn:hover { background: var(--orange-dark); transform: translateY(-1px); }
.secondary-btn { color: var(--navy); background: #edf0f4; }
.secondary-btn:hover { background: #e2e7ec; }
.compact-btn { padding: 8px 12px; font-size: 10px; }
.wide { width: 100%; padding: 13px 18px; }
.text-btn { padding: 5px; border: 0; color: var(--orange); background: transparent; font-weight: 700; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }

.page { display: none; animation: appear .25s ease; }
.page.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }

.filter-bar {
  padding: 17px 20px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.filter-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.date-fields { display: flex; align-items: end; gap: 10px; }
.date-fields label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }

input, select, textarea {
  width: 100%;
  border: 1px solid #dfe2e6;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: white;
  transition: .2s ease;
}

input, select { height: 42px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(230,106,44,.1); }
.date-fields input { display: block; width: 148px; height: 38px; margin-top: 5px; }
.compact-input { width: 150px; height: 36px; }
.date-picker-input {
  cursor: pointer;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--orange) 50%),
    linear-gradient(135deg, var(--orange) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 17px,
    calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.calendar-popover {
  position: fixed;
  z-index: 120;
  width: 310px;
  padding: 15px;
  border: 1px solid rgba(19, 34, 56, .1);
  border-radius: 16px;
  background: white;
  box-shadow: 0 22px 55px rgba(19, 34, 56, .2);
  display: none;
}
.calendar-popover.open { display: block; animation: calendarOpen .18s ease; }
@keyframes calendarOpen { from { opacity: 0; transform: translateY(-5px); } }
.calendar-header {
  padding: 2px 2px 13px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
}
.calendar-header strong { color: var(--navy); text-align: center; font-size: 14px; text-transform: capitalize; }
.calendar-nav {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: white;
  background: var(--navy);
  font-size: 22px;
  line-height: 1;
}
.calendar-nav:hover { background: var(--navy-soft); }
.calendar-weekdays, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekdays { margin-bottom: 6px; }
.calendar-weekdays span {
  padding: 5px 0;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.calendar-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}
.calendar-day:hover { color: var(--orange); background: #fff0e7; }
.calendar-day.other-month { color: #bdc3cd; }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--orange); }
.calendar-day.selected {
  color: white;
  background: var(--orange);
  box-shadow: 0 6px 14px rgba(230, 106, 44, .25);
}
.calendar-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.calendar-footer .secondary-btn { padding: 8px 12px; font-size: 10px; }
.calendar-footer button:disabled { opacity: .35; cursor: not-allowed; }

.stats-grid {
  margin: 20px 0;
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  min-height: 126px;
  padding: 21px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card div { min-width: 0; }
.stat-card span, .stat-card strong, .stat-card small { display: block; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-card strong { margin: 8px 0 5px; font-size: 22px; letter-spacing: -.03em; }
.stat-card small { color: #9ba3b1; font-size: 10px; }

.accent-card {
  display: block;
  color: white;
  background: linear-gradient(135deg, var(--orange), #f08a3f);
}

.accent-card .stat-label, .accent-card small { color: rgba(255,255,255,.78); }
.accent-card strong { margin-top: 13px; font-size: 29px; }

.stat-icon {
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  display: grid !important;
  place-items: center;
  font-weight: 850;
}
.stat-icon.green { color: var(--green); background: #e8f7f1; }
.stat-icon.orange { color: var(--orange); background: #fff0e7; }
.stat-icon.blue { color: var(--blue); background: #ebf1fd; }

.dashboard-grid, .split-layout, .management-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.split-layout { grid-template-columns: .8fr 1.4fr; }
.management-grid { grid-template-columns: 360px 1fr; }

.panel {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.02em; }

.section-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 { margin: 5px 0 0; }
.muted { color: var(--muted); }
.quick-actions, .action-row, .slip-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
}
.stack-form { display: grid; gap: 15px; }
.stack-form label, .filter-bar label {
  display: grid;
  gap: 6px;
  color: #5e6777;
  font-size: 11px;
  font-weight: 700;
}
.check-label { grid-template-columns: 20px 1fr; align-items: center; }
.check-label input { width: 18px; height: 18px; }
.status-pill {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--green);
  background: #e8f7f1;
  font-size: 10px;
  font-weight: 800;
}
.stat-primary { display: block; color: white; background: linear-gradient(135deg, var(--orange), #f08a3f); }
.stat-primary small, .stat-primary span { color: rgba(255,255,255,.8); }
.welcome-card {
  margin-bottom: 20px;
  padding: 22px;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.welcome-avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--orange);
  font-size: 18px;
  font-weight: 850;
}
.welcome-card .eyebrow { color: rgba(255,255,255,.62); }
.welcome-card h2 { margin: 5px 0; font-size: 20px; }
.welcome-card p:last-child { margin: 0; color: rgba(255,255,255,.75); font-size: 11px; }
.cell-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.table-actions form { display: inline-block; margin: 0 0 0 5px; }
.small-btn {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--navy);
  background: #edf0f4;
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}
.danger-btn { color: #b93b3b; background: #fff0f0; }
.empty-state { padding: 35px; color: var(--muted); text-align: center; }
.alert {
  margin: 0 0 18px;
  padding: 13px 16px;
  border-radius: 10px;
  color: #176448;
  background: #e8f7f1;
  font-size: 12px;
  font-weight: 650;
}
.alert-error { color: #a63737; background: #fff0f0; }
.logout-link, .quick-input-btn { white-space: nowrap; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.login-page {
  min-height: 100vh;
  padding: 30px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(230,106,44,.15), transparent 30%),
    var(--cream);
}
.login-card {
  width: min(430px, 100%);
  padding: 38px;
  border-radius: 22px;
  background: white;
  box-shadow: 0 24px 70px rgba(19,34,56,.13);
}
.login-logo {
  width: 190px;
  height: 90px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  object-position: center;
}
.login-card h1 { margin: 8px 0; font-size: 29px; }
.login-card > .muted { margin: 0 0 24px; line-height: 1.6; }
.login-help { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

.slip-page { max-width: 620px; margin: 0 auto; }
.slip-toolbar { justify-content: space-between; margin-bottom: 16px; }
.slip-toolbar .slip-actions { margin-top: 0; }
.slip-sheet {
  padding: 35px;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
}
.slip-sheet .slip-header { text-align: center; }
.slip-sheet .slip-header p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.slip-sheet .slip-header span { color: var(--muted); font-size: 11px; }
.slip-table { white-space: normal; }
.slip-table td:last-child { text-align: right; font-weight: 750; }
.slip-table th:last-child { text-align: right; }
.slip-note { padding: 12px; border-radius: 9px; color: var(--muted); background: #f7f7f5; font-size: 11px; }
.slip-footer { margin-top: 25px; color: var(--muted); text-align: center; font-size: 9px; }

.bar-chart {
  height: 190px;
  padding-top: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 10px;
}

.bar-item { height: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 8px; }
.bar-value { color: var(--muted); font-size: 10px; }
.bar { width: min(32px, 65%); min-height: 3px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #f2a36e, var(--orange)); }
.bar-day { color: var(--muted); font-size: 10px; padding-bottom: 8px; }

.ranking-list { display: grid; gap: 13px; }
.ranking-item { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 10px; }
.rank-number { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; color: var(--orange); background: #fff0e8; font-size: 11px; font-weight: 850; }
.rank-info strong, .rank-info span { display: block; }
.rank-info strong { font-size: 12px; }
.rank-info span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.rank-pay { font-size: 12px; }
.table-link { color: var(--ink); text-decoration: none; }
.table-link:hover { color: var(--orange); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
th { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:hover { background: #fbfaf7; }
tbody tr:last-child td { border-bottom: 0; }
.table-subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
tfoot td { padding-top: 17px; border-bottom: 0; font-weight: 850; }
.money { color: var(--navy); font-weight: 800; }
.qty-badge, .count-badge { display: inline-block; border-radius: 20px; color: var(--green); background: #e8f7f1; font-size: 10px; font-weight: 750; }
.qty-badge { padding: 5px 9px; }
.count-badge { padding: 7px 11px; }
.empty-row td { padding: 35px; color: var(--muted); text-align: center; }
.delete-btn, .edit-btn {
  border: 0;
  border-radius: 7px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: .2s ease;
}
.delete-btn { color: #d65b5b; background: #fff0f0; }
.edit-btn { color: var(--blue); background: #edf3ff; }
.edit-btn:hover { color: white; background: var(--blue); transform: translateY(-1px); }
.delete-btn:hover { color: white; background: #d65b5b; transform: translateY(-1px); }
.card-actions { display: flex; align-items: center; gap: 6px; }
.user-use-btn { padding: 6px 9px; font-size: 10px; }
.form-actions { display: flex; gap: 9px; }
.form-actions .wide { flex: 1; }
.hidden { display: none !important; }

.form-panel form { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; color: #5e6777; font-size: 11px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.pay-mode-switch {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f4f5f7;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.user-role-options { grid-template-columns: repeat(3, 1fr); }
.pay-mode-switch button {
  padding: 10px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}
.pay-mode-switch button.active {
  color: white;
  background: var(--navy);
  box-shadow: 0 5px 12px rgba(19, 34, 56, .18);
}
.tailor-combobox { position: relative; }
.tailor-combobox input[type="search"] { padding-right: 34px; }
.tailor-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  box-shadow: 0 14px 30px rgba(19, 34, 56, .14);
  display: none;
}
.tailor-suggestions.open { display: block; }
.tailor-option {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tailor-option:hover, .tailor-option:focus { background: #fff3eb; outline: none; }
.tailor-option .avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 10px;
}
.tailor-option strong, .tailor-option span { display: block; }
.tailor-option strong { font-size: 11px; }
.tailor-option span { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.tailor-empty { padding: 15px 10px; color: var(--muted); text-align: center; font-size: 10px; }
.tailor-empty[hidden], .tailor-option[hidden] { display: none; }
.searchable-combobox::after {
  content: "\2304";
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--orange);
  font-size: 14px;
  pointer-events: none;
}
.searchable-combobox input { padding-right: 34px; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; }
.money-input input { padding-left: 34px; }
.calculation-box { padding: 15px; border-radius: 11px; background: #f8f6f1; display: flex; justify-content: space-between; align-items: center; }
.calculation-box span { color: var(--muted); font-size: 11px; }
.calculation-box strong { color: var(--orange); font-size: 20px; }
.small-form form { display: grid; gap: 15px; }
.list-search { margin: -6px 0 15px; }
.list-search .search-box input { width: 100%; }
.card-actions form { margin: 0; }

.card-list, .rate-list { display: grid; gap: 10px; }
.person-card, .rate-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.person-main { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: white; background: var(--navy-soft); font-size: 12px; font-weight: 850; }
.person-card strong, .person-card span, .rate-card strong, .rate-card span { display: block; }
.person-card strong, .rate-card strong { font-size: 12px; }
.person-card span, .rate-card span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.rate-card .money { font-size: 14px; }

.print-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.recap-panel { margin-top: 20px; }
.print-title > strong { color: var(--muted); font-size: 11px; }
.recap-heading-actions { display: flex; align-items: center; gap: 14px; }
.recap-heading-actions > strong { color: var(--muted); font-size: 11px; }
.search-box {
  position: relative;
  display: block;
}
.search-box span {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.search-box input {
  width: 220px;
  height: 38px;
  padding-left: 34px;
}

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 100;
  padding: 13px 18px;
  border-radius: 10px;
  color: white;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 30px;
  display: none;
  place-items: center;
  background: rgba(13,25,40,.6);
}
.modal.open { display: grid; }
.modal-card { position: relative; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 35px; border-radius: 18px; background: white; }
.modal-close { position: absolute; right: 17px; top: 12px; border: 0; color: var(--muted); background: transparent; font-size: 27px; }
.slip-header { padding-bottom: 20px; border-bottom: 2px solid var(--navy); text-align: center; }
.slip-logo { width: 150px; height: 70px; margin: 0 auto 12px; object-fit: contain; }
.slip-header h2 { margin: 4px 0; font-size: 22px; }
.slip-meta { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slip-meta span, .slip-meta strong { display: block; }
.slip-meta span { color: var(--muted); font-size: 10px; }
.slip-meta strong { margin-top: 4px; font-size: 12px; }
.slip-total { margin: 18px 0; padding: 16px; border-radius: 10px; background: #f7f4ed; display: flex; justify-content: space-between; }
.slip-total strong { color: var(--orange); font-size: 20px; }
.slip-actions { display: flex; gap: 10px; margin-top: 18px; }
.slip-actions .wide { flex: 1; }
.share-btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  color: white;
  background: var(--navy);
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(19, 34, 56, .2);
}
.share-btn:hover { background: var(--navy-soft); transform: translateY(-1px); }
.share-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.signature { margin: 40px 0 25px auto; width: 180px; text-align: center; }
.signature-line { margin-top: 55px; border-top: 1px solid var(--ink); padding-top: 5px; font-size: 10px; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .split-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); transition: .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .main-content { margin-left: 0; padding: 0 18px 30px; }
  .mobile-menu { display: block; }
  .topbar { min-height: 90px; }
  .today-box { display: none; }
  .user-switcher { position: fixed; right: 14px; bottom: 14px; z-index: 50; filter: drop-shadow(0 10px 20px rgba(19,34,56,.16)); }
  .topbar .primary-btn { display: none; }
  .filter-bar, .date-fields { align-items: stretch; flex-direction: column; }
  .date-fields input { width: 100%; }
  .management-grid { grid-template-columns: 1fr; }
  .print-title, .recap-heading-actions { align-items: stretch; flex-direction: column; }
  .search-box input { width: 100%; }
  .topbar-actions .active-user-button { display: none; }
  .logout-link { padding: 9px 11px; }
  .quick-input-btn { display: none; }
  .welcome-card { align-items: flex-start; }
  .recap-panel { margin-top: 16px; }
  .person-card, .rate-card { align-items: flex-start; }
  .card-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .panel { padding: 17px; }
  .topbar h1 { font-size: 22px; }
  .slip-actions { flex-direction: column; }
  .welcome-avatar { flex-basis: 44px; width: 44px; height: 44px; }
  .welcome-card h2 { font-size: 17px; }
  .person-main { min-width: 0; }
  .person-main > div { min-width: 0; }
  .person-card { flex-direction: column; }
  .person-card .card-actions { width: 100%; justify-content: flex-end; }
  .rate-card { flex-direction: column; }
  .rate-card .card-actions { width: 100%; justify-content: flex-end; }
}

@media print {
  body { background: white; }
  .sidebar, .topbar, .filter-bar, .no-print, body > :not(.app-shell):not(.modal) { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .page { display: none !important; }
  .page.active { display: block !important; }
  .recap-panel { display: block !important; margin: 0; box-shadow: none; padding: 0; }
  .modal.open { position: static; display: block; padding: 0; background: white; }
  .modal.open .modal-card { width: 100%; max-height: none; overflow: visible; box-shadow: none; }
  .slip-page { display: block !important; max-width: none; }
  .slip-sheet { display: block !important; width: 100%; box-shadow: none; padding: 0; }
}
