:root {
  --bg: #1c1c1e;
  --surface: rgba(0, 0, 0, 0.45);
  --gold: #d4a017;
  --gold-light: #ffb300;
  --text: #f0e6d3;
  --muted: #b8a88a;
  --border: rgba(184, 134, 11, 0.45);
  --danger: #e57373;
  --ok: #81c784;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: transparent;
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("../../assets/leather_background.png?v=3") center / cover no-repeat;
  filter: brightness(0.72) contrast(1.05);
}

a { color: var(--gold-light); }

.login-emblem {
  display: block;
  width: min(120px, 40vw);
  height: auto;
  margin: 0 auto 0.75rem;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 22px rgba(212, 160, 23, 0.2));
}

.portal-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.portal-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.portal-header h1 {
  font-size: 1.25rem;
  color: var(--gold-light);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.login-card {
  max-width: 420px;
  margin: 4rem auto;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  color: var(--text);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #111;
  font-weight: 600;
  cursor: pointer;
}

button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.tab.active {
  background: var(--gold);
  color: #111;
  font-weight: 700;
}

.list-item {
  cursor: pointer;
  transition: border-color 0.15s;
}

.list-item:hover { border-color: var(--gold-light); }

.muted { color: var(--muted); font-size: 0.85rem; }

.error { color: var(--danger); margin-top: 0.5rem; }

.badge {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  font-size: 0.75rem;
  font-weight: 700;
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0.75rem;
  min-height: 60vh;
}

@media (max-width: 800px) {
  .chat-layout { grid-template-columns: 1fr; }
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.bubble {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.sent {
  align-self: flex-end;
  background: rgba(212, 160, 23, 0.25);
  border: 1px solid var(--border);
}

.bubble.received {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.compose {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.compose textarea {
  margin-bottom: 0;
  min-height: 2.5rem;
  resize: vertical;
}

.hidden { display: none !important; }

.qr-banner {
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.qr-login-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1rem;
}

.qr-login-title {
  color: var(--gold-light);
}

.qr-login-hint {
  margin: 0.5rem 0 0.75rem;
}

.login-divider {
  text-align: center;
  margin-bottom: 0.75rem;
}

.login-note {
  margin-top: 1rem;
  white-space: pre-line;
}

.login-submit {
  width: 100%;
}

.back-link {
  margin-top: 1rem;
}

.qr-status {
  margin-top: 0.75rem;
  min-height: 2.5em;
  text-align: center;
}

.lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.lang-globe {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(28, 28, 30, 0.85);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.lang-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.25rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.5rem;
  border-radius: 12px;
  background: rgba(28, 28, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lang-panel[hidden] {
  display: none !important;
}

.lang-option {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.lang-option:hover,
.lang-option.active {
  background: rgba(212, 160, 23, 0.2);
  color: var(--gold-light);
}

.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.qr-canvas-wrap table {
  margin: 0 auto !important;
}

.qr-canvas-wrap img,
.qr-canvas-wrap canvas {
  display: block;
  margin: 0 auto;
}

.mail-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0.75rem;
  min-height: 50vh;
}

.mail-app { display: flex; flex-direction: column; gap: 0.75rem; }

.mail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.mail-toolbar-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.mail-toolbar select {
  min-width: 180px;
}

.mail-toolbar-status {
  margin-left: auto;
  font-size: 0.85rem;
}

.mail-compose label { display: block; margin-top: 0.5rem; }
.mail-compose input,
.mail-compose textarea { width: 100%; margin-top: 0.25rem; }

.mail-list-pane h3,
.mail-detail-pane h3 { margin-top: 0; }

.mail-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.mail-item-head strong {
  flex: 1;
  min-width: 0;
}

.mail-item-delete {
  padding: 0.15rem 0.45rem;
  min-width: 1.75rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.mail-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-light);
  flex-shrink: 0;
}

.mail-date { font-size: 0.75rem; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(212, 160, 23, 0.25);
  color: var(--gold-light);
  vertical-align: middle;
}

@media (max-width: 900px) {
  .mail-layout { grid-template-columns: 1fr; }
}

.mail-item.unread { border-color: var(--gold-light); }
.mail-item.active { background: rgba(212, 160, 23, 0.12); }
.mail-preview { margin-top: 0.35rem; }
.mail-body {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 0.75rem;
  font-family: inherit;
  color: var(--text);
}
.mail-thread { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.thread-meta { font-size: 0.75rem; margin-bottom: 0.25rem; }

.mail-folder-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.mail-folder-tab {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.mail-folder-tab.active {
  background: rgba(212, 160, 23, 0.18);
  color: var(--gold-light);
  border-color: var(--gold-light);
}

.mail-chat {
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.mail-chat-head { border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 0.5rem; }
.mail-chat-head h3 { margin: 0 0 0.15rem; }

.mail-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.15rem;
}

.mail-chat-reply {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.6rem;
}

.mail-chat-reply textarea { width: 100%; }

.admin-reg-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.admin-reg-meta { line-height: 1.5; margin-bottom: 0.75rem; }
.admin-section-title { margin: 0 0 0.75rem; font-size: 1rem; color: var(--text-muted); }

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
}

.admin-modal.hidden { display: none; }

.admin-modal-card {
  width: min(100%, 520px);
  max-height: 90vh;
  overflow: auto;
}

.admin-modal-card textarea {
  width: 100%;
  min-height: 110px;
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  resize: vertical;
}

.admin-alert-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 179, 0, 0.45);
  background: rgba(255, 179, 0, 0.12);
  color: #ffd95a;
  font-size: 0.95rem;
}

.admin-alert-banner.hidden { display: none; }

#admin-tabs .tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.tab-badge.hidden { display: none; }

#admin-tabs .tab.active .tab-badge {
  background: #1c1c1e;
  color: #ffb300;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-user-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-user-row:last-child { border-bottom: none; }

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.pending { background: rgba(255, 179, 0, 0.2); color: #ffb300; }
.status-pill.approved { background: rgba(129, 199, 132, 0.2); color: var(--ok); }
.status-pill.rejected { background: rgba(229, 115, 115, 0.2); color: var(--danger); }
.status-pill.deleted { background: rgba(158, 158, 158, 0.25); color: #bdbdbd; }

button.approve-btn {
  background: linear-gradient(180deg, #9ccc65, #689f38);
  border-color: rgba(129, 199, 132, 0.5);
}

.admin-support-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(720px, 96vw);
  height: 100vh;
  z-index: 200;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.5rem;
}

.admin-support-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.admin-support-head h2 { margin: 0; font-size: 1.1rem; }

.admin-support-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-support-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0.6rem;
  min-height: 0;
}

.admin-support-list-pane,
.admin-support-chat-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-support-list-pane h3 { margin: 0 0 0.4rem; font-size: 0.9rem; }

#admin-support-thread-list {
  overflow-y: auto;
  flex: 1;
}

.support-thread-item.unread { border-color: var(--gold-light); }
.support-thread-item.active { background: rgba(212, 160, 23, 0.12); }

.admin-support-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.admin-support-summary {
  font-size: 0.8rem;
  margin: 0.35rem 0 0;
  font-style: italic;
}

.admin-support-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.admin-support-reply {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-support-reply textarea { width: 100%; }

.bubble.system {
  align-self: center;
  max-width: 92%;
  background: rgba(255,255,255,0.04);
  font-size: 0.8rem;
  color: var(--muted);
}

#admin-support-chat-btn.active {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

@media (max-width: 700px) {
  .admin-support-layout { grid-template-columns: 1fr; }
  .admin-support-list-pane { max-height: 28vh; }
}

.client-row,
.bulletin-card-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.client-row-body { flex: 1; min-width: 0; }

.brand-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.brand-badge .brand-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.bulletin-list {
  display: grid;
  gap: 0.75rem;
}

.bulletin-card .bulletin-work {
  margin: 0.5rem 0;
  white-space: pre-wrap;
}

.bulletin-offer-btn {
  margin-top: 0.75rem;
}

.deal-bar {
  margin-bottom: 0.75rem;
  border: 1px solid var(--gold);
}

.deal-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.deal-done {
  color: var(--gold-light);
  font-weight: 600;
  margin: 0.5rem 0 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal.hidden { display: none; }

.modal-card {
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Calendar grid */
.portal-shell:has(#panel-calendar:not(.hidden)),
.portal-shell:has(#panel-ledger:not(.hidden)) {
  max-width: 1280px;
}

.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 1rem;
}

.portal-modal-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.portal-modal-card label {
  margin-top: 0.65rem;
}

.portal-modal-card input,
.portal-modal-card textarea {
  width: 100%;
  margin-bottom: 0.35rem;
}

.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1rem;
}

@media (max-width: 900px) {
  .cal-layout {
    grid-template-columns: 1fr;
  }
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.cal-nav {
  display: flex;
  gap: 0.35rem;
}

.cal-bay-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0 0.5rem;
}

.cal-bay-chip.is-active {
  outline: 2px solid var(--accent, #c9a227);
  font-weight: 700;
}

.cal-bay-single {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9rem;
}

.cal-range,
.cal-legend {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.cal-grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.cal-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(88px, 1fr));
  min-width: 720px;
}

.cal-hour-col,
.cal-day-col {
  display: flex;
  flex-direction: column;
}

.cal-day-head {
  min-height: 72px;
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(184, 134, 11, 0.2);
  text-align: center;
}

.cal-day-head.spacer {
  border-right: none;
}

.cal-day-col.is-today .cal-day-head,
.cal-day-head.is-today {
  background: rgba(212, 160, 23, 0.18);
}

.cal-weekday {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.cal-date {
  font-weight: 700;
  color: var(--gold-light);
}

.cal-today-label {
  font-size: 0.7rem;
  color: var(--gold);
  margin-top: 0.15rem;
}

.cal-day-busy {
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.cal-hour-label {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(184, 134, 11, 0.15);
}

.cal-cell {
  height: 44px;
  border: none;
  border-bottom: 1px solid rgba(184, 134, 11, 0.15);
  border-right: 1px solid rgba(184, 134, 11, 0.15);
  background: transparent;
  color: var(--text);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0.15rem;
  overflow: hidden;
}

.cal-cell.free:hover {
  background: rgba(212, 160, 23, 0.12);
}

.cal-cell.busy-pending {
  background: rgba(255, 179, 0, 0.22);
}

.cal-cell.busy-confirmed {
  background: rgba(129, 199, 132, 0.28);
}

.cal-cell.start {
  font-weight: 700;
}

.cal-cell.today-col {
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.25);
}

.cal-side-list {
  max-height: 70vh;
  overflow: auto;
}

.cal-list-item {
  cursor: pointer;
  text-align: left;
}

.cal-list-item:hover {
  border-color: var(--gold);
}

/* Client history */
.client-row-btn {
  display: flex;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.client-row-hint {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  color: var(--gold);
}

.hist-drawer {
  width: min(640px, 100%);
}

.hist-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.hist-head .hist-close {
  margin-left: auto;
}

.hist-drawer section {
  margin-bottom: 1rem;
}

.hist-drawer h4 {
  color: var(--gold-light);
  margin-bottom: 0.4rem;
}

.hist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hist-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.hist-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.hist-badge.done {
  color: var(--ok);
  border-color: rgba(129, 199, 132, 0.5);
}

.hist-badge.pending {
  color: var(--gold-light);
}

/* Ledger */
.ledger-banner {
  border-color: rgba(229, 115, 115, 0.55);
  color: #ffc9c9;
  line-height: 1.45;
  font-size: 0.92rem;
}

.ledger-totals-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ledger-total-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ledger-total-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ledger-total-chip strong {
  font-size: 1.15rem;
}

.ledger-total-profit {
  border-color: rgba(212, 160, 23, 0.65);
}

.ledger-total-profit strong {
  color: var(--gold-light);
}

.ledger-sync {
  margin-top: 0.25rem;
  color: var(--ok);
  font-size: 0.9rem;
}

.ledger-sync-offline {
  color: var(--danger);
}

.ledger-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
}

.ledger-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.ledger-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.ledger-more {
  margin-top: 0.35rem;
}

.ledger-more summary {
  cursor: pointer;
  color: var(--muted);
  list-style: none;
  user-select: none;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.ledger-more summary::-webkit-details-marker {
  display: none;
}

.ledger-more summary:hover {
  border-color: var(--border);
  color: var(--text);
}

.ledger-more-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.ledger-phone-note {
  margin: 0 0 0.75rem;
}

.ledger-months {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.ledger-month-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.ledger-month-tab.active {
  background: rgba(212, 160, 23, 0.25);
  border-color: var(--gold);
  color: var(--gold-light);
}

.ledger-table-wrap {
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.ledger-table th,
.ledger-table td {
  border-bottom: 1px solid rgba(184, 134, 11, 0.25);
  padding: 0.45rem 0.35rem;
  text-align: left;
  vertical-align: middle;
}

.ledger-table th {
  color: var(--muted);
  font-weight: 600;
}

.ledger-table td.num,
.ledger-table th:nth-child(n + 3):nth-child(-n + 6) {
  text-align: right;
}

.ledger-cell {
  cursor: text;
  min-width: 4rem;
}

.ledger-cell:hover {
  background: rgba(212, 160, 23, 0.08);
}

.ledger-cell-editing {
  padding: 0.15rem !important;
  background: rgba(0, 0, 0, 0.35);
}

.ledger-inline-input {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.45rem;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--gold);
  border-radius: 6px;
}

.ledger-row-actions {
  width: 2.25rem;
  text-align: center;
}

.ledger-delete-btn {
  padding: 0.2rem 0.45rem;
  min-width: 0;
  line-height: 1;
  font-size: 1.1rem;
}

.ledger-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 1200;
  max-width: min(90vw, 360px);
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.92);
  border: 1px solid rgba(129, 199, 132, 0.55);
  color: var(--text);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
  font-size: 0.95rem;
}

.ledger-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ledger-toast-error {
  border-color: rgba(229, 115, 115, 0.75);
  background: rgba(60, 18, 18, 0.94);
  color: #ffc9c9;
}

/* Shift hub */
.shift-hub {
  margin-bottom: 1rem;
}

.shift-title {
  color: var(--gold-light);
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.shift-sto-name {
  margin-bottom: 0.35rem;
}

.shift-sync {
  color: var(--ok);
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.shift-sync-offline {
  color: var(--danger);
}

.shift-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.shift-card {
  margin-bottom: 0;
  min-height: 6rem;
}

.shift-card-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.shift-card-value {
  font-size: 1.75rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.shift-card-profit .shift-card-value {
  color: var(--gold-light);
}

.shift-appt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.shift-appt-time {
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  margin-right: 0.35rem;
}

.shift-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
}

.shift-nav-btn {
  min-height: 3.25rem;
  font-size: 1rem;
  font-weight: 600;
}
