:root {
  --rose: #b76e79;
  --rose-dark: #7f4b4f;
  --rose-soft: #f5d8d3;
  --gold: #c99a6b;
  --beige: #f7eee8;
  --cream: #fffaf6;
  --ink: #2b2024;
  --muted: #8c7775;
  --line: rgba(127, 75, 79, 0.14);
  --panel: rgba(255, 255, 255, 0.82);
  --shadow: 0 24px 60px rgba(95, 55, 58, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(245, 216, 211, 0.65), transparent 28rem),
    linear-gradient(135deg, #fffaf6 0%, #f7eee8 52%, #fff 100%);
}
body.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 15%, rgba(216, 30, 117, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 88%, rgba(201, 154, 107, 0.18), transparent 24rem),
    linear-gradient(135deg, #fff 0%, #fff3f8 42%, #f8edf1 100%);
}
.login-shell {
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  overflow: hidden;
  border: 1px solid rgba(184, 30, 117, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 30px 80px rgba(85, 33, 58, 0.18);
}
.login-showcase {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 640px;
  padding: 36px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(184, 30, 117, 0.92), rgba(105, 20, 78, 0.94)),
    url("assets/cleanup.jpg") center/cover;
  color: #fff;
}
.login-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,0.16), transparent 35%, rgba(0,0,0,0.12));
}
.login-brand-mark, .screen-stack, .showcase-copy { position: relative; z-index: 1; }
.login-brand-mark { display: flex; align-items: center; gap: 14px; }
.login-brand-mark img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(255,255,255,0.84);
  box-shadow: 0 18px 40px rgba(51, 14, 38, 0.25);
}
.login-brand-mark span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.login-brand-mark strong { font-size: 18px; letter-spacing: 0; }
.screen-stack {
  height: 390px;
  margin: 22px 0;
}
.screen-card {
  position: absolute;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 24px 60px rgba(42, 10, 31, 0.28);
}
.dashboard-shot {
  left: 0;
  top: 24px;
  width: min(560px, 86%);
  height: 292px;
  padding: 18px;
}
.calendar-shot {
  right: 4px;
  top: 164px;
  width: 270px;
  height: 188px;
  padding: 16px;
}
.invoice-shot {
  left: 42px;
  bottom: 0;
  width: 210px;
  height: 176px;
  padding: 18px;
}
.shot-toolbar { display: flex; gap: 8px; margin-bottom: 18px; }
.shot-toolbar span {
  width: 44px;
  height: 8px;
  border-radius: 99px;
  background: #ead3dd;
}
.shot-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.shot-kpis i {
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff2f7, #f0c7d9);
}
.shot-chart {
  height: 150px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 13px;
  padding-top: 12px;
}
.shot-chart b {
  display: block;
  height: var(--h);
  min-height: 34px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #d81e75, #f0a2c6);
}
.shot-title {
  width: 118px;
  height: 12px;
  border-radius: 99px;
  background: #d81e75;
  margin-bottom: 16px;
}
.shot-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.shot-calendar span {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #f6d7e5;
}
.shot-calendar .busy { background: #d81e75; }
.receipt-logo {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d81e75, #8b1b61);
}
.invoice-shot p {
  height: 9px;
  margin: 0 0 10px;
  border-radius: 99px;
  background: #efd4df;
}
.invoice-shot p:nth-of-type(2) { width: 74%; }
.invoice-shot p:nth-of-type(3) { width: 58%; }
.invoice-shot strong {
  display: block;
  width: 82px;
  height: 15px;
  margin-top: 18px;
  border-radius: 99px;
  background: #251420;
}
.showcase-copy { max-width: 590px; }
.showcase-copy h1 {
  max-width: 620px;
  color: #fff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}
.showcase-copy p {
  max-width: 470px;
  color: rgba(255,255,255,0.82);
  font-size: 17px;
  line-height: 1.6;
}
.login-card {
  display: grid;
  align-content: center;
  padding: clamp(28px, 5vw, 52px);
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  text-align: center;
}
.login-logo {
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: block;
  border: 4px solid #fff;
  box-shadow: 0 16px 38px rgba(184, 30, 117, 0.2);
}
.login-card h2 {
  color: #8b1b61;
  font-size: clamp(25px, 3vw, 34px);
}
.login-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  text-align: left;
}
.login-form label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.login-form input { width: 100%; }
.login-error, .danger-text { min-height: 20px; color: #a8423a; font-weight: 700; }
.login-support {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}
.login-support a { text-decoration: none; }
.login-whats-new,
.login-mobile-support { display: none; }
.support-actions {
  display: grid;
  justify-content: center;
  gap: 9px;
}
.support-button {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  min-width: 180px;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  color: #8b1b61;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(85, 33, 58, 0.08);
}
.support-button b { text-decoration: none; }
.support-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.whatsapp-support { color: #168f48; }
.call-support { color: #8b1b61; }
.setup-message {
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--rose-dark);
  background: #fff7f3;
}
.setup-message.success { color: #176b4d; background: #eefaf3; border-color: rgba(23, 107, 77, 0.18); }
button, input, select { font: inherit; }
button, .button-link { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: rgba(255, 250, 246, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(183, 110, 121, 0.2);
}
.brand strong { display: block; font-family: Georgia, serif; font-size: 18px; line-height: 1.15; color: var(--rose-dark); }
.brand span, .role-card span, .kpi span, small, .panel p { color: var(--muted); }
nav { display: grid; gap: 8px; }
nav button, .ghost, .primary {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  transition: 180ms ease;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.file-action input { display: none; }
nav button {
  text-align: left;
  color: var(--rose-dark);
  background: transparent;
}
nav button:hover, nav button.active { background: #fff; border-color: var(--line); box-shadow: 0 10px 24px rgba(183, 110, 121, 0.08); }
.role-card {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff, #fff5f0);
}
.role-card strong { display: block; margin: 3px 0; }
main { padding: 24px; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(28px, 4vw, 44px); color: var(--rose-dark); }
h2 { font-size: 18px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
}
.search span { color: var(--muted); font-size: 12px; }
input, select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.86);
  padding: 0 12px;
  color: var(--ink);
}
.search input { border: 0; background: transparent; min-width: 210px; outline: 0; }
.menu-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 42px; height: 42px; }
.mobile-module-select { display: none; }
.view { display: none; animation: fadeUp 220ms ease both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi, .panel, .card, .settings-grid label, .report-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.kpi { padding: 18px; }
.kpi strong { display: block; margin: 10px 0 4px; font-size: clamp(23px, 3vw, 32px); color: var(--rose-dark); }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.panel { padding: 18px; min-width: 0; }
.panel.wide { grid-column: span 2; }
.panel-head, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.action-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ghost { background: #fff; color: var(--rose-dark); border-color: var(--line); }
.ghost.active, .ghost:hover { border-color: var(--gold); color: var(--rose-dark); }
.ghost.disabled { opacity: 0.55; pointer-events: auto; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
.primary { background: linear-gradient(135deg, var(--rose), var(--gold)); color: #fff; border: 0; box-shadow: 0 12px 26px rgba(183, 110, 121, 0.24); }
.danger {
  min-height: 42px;
  border: 1px solid rgba(168, 66, 58, 0.24);
  border-radius: 8px;
  padding: 0 14px;
  color: #a8423a;
  background: #fff2f0;
}
.danger:hover { border-color: #a8423a; }
.record-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.record-actions.inline { margin-top: 0; }
.record-actions button { min-height: 34px; padding: 0 10px; }
.bar-chart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 14px;
  padding: 18px 6px 4px;
}
.bar-chart span {
  position: relative;
  height: var(--h);
  min-height: 38px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #d9ae84, #b76e79);
}
.bar-chart b { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 12px; }
.donut {
  width: 170px;
  height: 170px;
  margin: 10px auto 16px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--ink);
  background: conic-gradient(#b83280 calc(var(--cash) * 1%), #0f7b8f 0);
  box-shadow: inset 0 0 0 34px #fffaf6, 0 16px 34px rgba(43, 32, 36, 0.12);
}
.donut strong { font-size: 30px; color: #24161a; }
.donut span { color: #5b454b; font-weight: 700; }
.legend, .payment-list, .staff-list, .branch-bars { display: grid; gap: 10px; }
.legend span { display: flex; align-items: center; gap: 8px; color: #493b3e; font-weight: 600; }
.legend b { color: #24161a; }
.legend i { width: 14px; height: 14px; border-radius: 99px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(43, 32, 36, 0.16); }
.cash { background: #b83280; }
.knet { background: #0f7b8f; }
.wamd { background: #d18b00; }
.pos-panel { margin-top: 14px; }
.pos-actions { justify-content: flex-start; flex-wrap: wrap; }
.pos-helper {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.pos-price-preview {
  align-self: end;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}
.pos-price-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.pos-price-preview strong {
  display: block;
  margin-top: 3px;
  color: var(--rose-dark);
}
.wide-field { grid-column: 1 / -1; }
.customer-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.customer-picker label { min-width: 0; }
.customer-picker button { white-space: nowrap; }
.icon-add {
  width: 42px;
  padding: 0;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}
.branch-row { display: grid; gap: 6px; }
.branch-row div { height: 10px; border-radius: 99px; background: #f3dfd7; overflow: hidden; }
.branch-row i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--rose), var(--gold)); }
.rank-list { display: grid; gap: 12px; padding-left: 22px; }
.rank-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.staff-item, .payment-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.total-row td { font-weight: 900; color: var(--rose-dark); background: #fff6f3; }
.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 99px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}
.Confirmed { background: #e8f6ef; color: #357a52; }
.Pending { background: #fff3d5; color: #9a6a12; }
.Completed { background: #f1e7ff; color: #7250a5; }
.Cancelled, .No-Show { background: #ffe3e1; color: #a8423a; }
.calendar-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.calendar-grid {
  display: grid;
  grid-template-columns: 86px 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.72);
}
.time-cell, .slot-cell { min-height: 76px; border-bottom: 1px solid var(--line); padding: 10px; }
.time-cell { color: var(--muted); background: #fff7f3; font-weight: 700; }
.slot-cell { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.appointment-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: min(360px, 100%);
  flex: 1 1 260px;
  padding: 10px 12px;
  border-left: 4px solid var(--rose);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 20px rgba(95,55,58,.08);
}
.appointment-chip:hover { outline: 2px solid rgba(201,154,107,.45); }
.appointment-chip small { color: var(--muted); }
.appointment-open {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.appointment-open strong,
.appointment-open small,
.appointment-open span { display: block; margin-top: 3px; }
.reminder-button { min-height: 32px; padding: 0 10px; }
.reminder-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  color: #8c7775;
  background: #f7eee8;
}
.appointment-items-wrap { margin: 12px 0; }
.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
}
.calendar-day-column {
  min-height: 360px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.74);
}
.calendar-day-column h3 { margin: 0; color: var(--rose-dark); font-size: 16px; }
.calendar-day-column p { margin: 4px 0 12px; color: var(--muted); }
.week-time { margin: 8px 0 4px; color: var(--gold); font-size: 12px; font-weight: 800; }
.empty-slot { display: block; padding: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }
.monthly-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
}
.month-cell {
  min-height: 118px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
}
.month-cell.muted { opacity: .48; }
.month-cell strong { color: var(--rose-dark); }
.month-cell small { display: block; min-height: 18px; color: var(--muted); }
.month-chip {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
  color: var(--rose-dark);
  text-align: left;
  font-size: 12px;
}
.cards-grid, .settings-grid, .report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.card { padding: 18px; }
.record-image {
  width: 100%;
  height: 100%;
  min-height: 138px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff6f3;
}
.media-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, .82fr);
  gap: 12px;
  align-items: stretch;
}
.record-copy { min-width: 0; }
.card h3 { margin: 0 0 8px; color: var(--rose-dark); }
.card p { color: var(--muted); }
.service-catalogue { display: grid; gap: 14px; }
.category {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  padding: 16px;
}
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.service {
  padding: 14px;
  border-radius: 8px;
  background: #fffaf7;
  border: 1px solid var(--line);
}
.service strong { display: block; color: var(--rose-dark); }
.service small { display: block; margin-top: 3px; }
.service span { display: block; margin-top: 8px; color: var(--gold); font-weight: 800; }
.panel-pad { background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 8px; }
.billing-layout, .payments-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.payments-layout { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr); align-items: start; }
.payment-side { position: sticky; top: 18px; }
.cash-box { display: grid; grid-template-columns: 1fr auto; gap: 14px; margin-top: 16px; }
.cash-box span { color: var(--muted); }
.payment-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
}
.payment-item.active {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(183, 110, 121, .12);
}
.payment-detail {
  margin-top: 0;
}
.payment-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(130px, .7fr));
  gap: 10px;
  margin: 0 0 14px;
}
.payment-filters label {
  display: grid;
  gap: 6px;
  color: var(--rose-dark);
  font-size: 13px;
  font-weight: 800;
}
.payment-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.payment-detail-head span {
  color: var(--muted);
  font-weight: 800;
}
.payment-actions { justify-content: flex-start; margin-top: 14px; }
.cash-closing-card {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}
.table-wrap.compact table { font-size: 13px; }
.table-wrap.compact th,
.table-wrap.compact td { padding: 8px; }
.settings-grid label {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: var(--rose-dark);
  font-weight: 700;
}
.settings-panel { margin-top: 14px; }
.superadmin-locked {
  opacity: 0.58;
  pointer-events: none;
}
.settings-grid textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255,255,255,0.86);
  resize: vertical;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.permission-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}
.permission-card h3 { margin: 0 0 10px; color: var(--rose-dark); }
.permission-card label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.report-tile {
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: var(--rose-dark);
  font-weight: 800;
  border-color: var(--line);
  background: var(--panel);
}
.report-tile:hover, .report-tile.active {
  border-color: var(--gold);
  background: #fffaf7;
  transform: translateY(-2px);
}
.report-detail { margin-top: 14px; }
.report-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}
.report-controls label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--rose-dark);
  font-weight: 800;
}
.report-badge {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  color: var(--rose-dark);
  background: #fff2ee;
  font-weight: 800;
}
.report-mini-chart {
  height: 150px;
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  overflow: hidden;
}
.report-mini-chart span {
  position: relative;
  height: var(--h);
  min-height: 34px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #d9ae84, #b76e79);
}
.report-mini-chart b {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  color: #fff;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-print-brand { display: none; }
.report-print-ledger { display: none; }
dialog {
  width: min(680px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 90px rgba(43,32,36,.28);
}
dialog::backdrop { background: rgba(43,32,36,.38); backdrop-filter: blur(5px); }
.invoice { padding: 24px; }
.appointment-form { padding: 24px; }
.close { float: right; width: 34px; height: 34px; border: 0; border-radius: 8px; background: #fff2ee; color: var(--rose-dark); font-size: 22px; }
.invoice-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.invoice-head img { width: 72px; height: 72px; object-fit: contain; border-radius: 16px; background: #fff; }
.arabic-brand { color: var(--rose); font-weight: 700; font-size: 15px; line-height: 1.4; }
.invoice-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
}
.invoice-meta span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
  padding: 8px 10px;
}
.invoice-service-name strong,
.invoice-service-name span {
  display: block;
}
.invoice-service-name span {
  margin-top: 3px;
  color: var(--rose);
  direction: rtl;
  font-size: 13px;
  font-weight: 700;
}
.appointment-detail-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.appointment-detail-box div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}
.appointment-detail-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.appointment-detail-box strong {
  display: block;
  margin-top: 4px;
  color: var(--rose-dark);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid label, .form-note {
  display: grid;
  gap: 7px;
  color: var(--rose-dark);
  font-weight: 800;
}
.form-grid input, .form-grid select, .form-note textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.86);
  color: var(--ink);
}
.form-note { margin-top: 12px; }
.form-note textarea { padding: 12px; resize: vertical; }
.package-picker {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf7;
}
.package-picker legend {
  padding: 0 6px;
  color: var(--rose-dark);
  font-weight: 800;
}
.package-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.check-row {
  display: grid !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.check-row input { width: 18px; height: 18px; }
.check-row span { display: grid; gap: 2px; }
.check-row small { color: var(--muted); font-weight: 500; }
.package-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 154, 107, 0.38);
  border-radius: 8px;
  background: #fff;
}
.package-total span {
  color: var(--muted);
  font-weight: 800;
}
.package-total strong {
  color: var(--rose-dark);
  font-size: 20px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1100px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { min-height: 520px; }
  .login-card { border-left: 0; border-top: 1px solid var(--line); }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 10; transform: translateX(-105%); transition: 220ms ease; width: min(300px, 90vw); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-grid; place-items: center; }
  .mobile-module-select { display: block; min-width: 170px; }
  .topbar { align-items: flex-start; }
  .kpi-grid, .dashboard-grid, .cards-grid, .settings-grid, .report-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  body.login-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
    padding: 18px 16px 14px;
    background:
      radial-gradient(circle at 50% 8%, rgba(255,255,255,0.12), transparent 17rem),
      linear-gradient(180deg, #9b1b64 0%, #8b1b61 58%, #731653 100%);
  }
  .login-whats-new {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.12);
  }
  .login-whats-new::before {
    content: "★";
    margin-right: 8px;
    color: #ffd36a;
  }
  .login-shell {
    width: 100%;
    min-height: 0;
    display: block;
    margin: auto 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .login-showcase { display: none; }
  .login-card {
    min-height: 0;
    padding: 28px 18px 26px;
    border: 0;
    border-radius: 22px;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 28px 70px rgba(37, 11, 29, 0.28);
  }
  .login-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
    box-shadow: 0 12px 24px rgba(139, 27, 97, 0.22);
  }
  .login-card h2 {
    font-size: 23px;
    line-height: 1.2;
  }
  .login-card > p:not(.eyebrow) {
    margin: 10px auto 18px;
    color: #4f454b;
  }
  .login-form { gap: 12px; margin-top: 0; }
  .login-form label {
    gap: 8px;
    color: #40363c;
    font-size: 14px;
  }
  .login-form input {
    min-height: 54px;
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
  }
  .login-form .primary {
    min-height: 50px;
    margin-top: 4px;
    background: linear-gradient(135deg, #c01672, #8b1b61);
  }
  .login-support {
    margin-top: 14px;
    gap: 0;
  }
  .login-support strong,
  .login-support .support-actions { display: none; }
.login-support .powered-by {
    color: #9b1b64;
    font-size: 12px;
    font-weight: 800;
  }
  .login-mobile-support {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding-top: 18px;
    margin-top: 18px;
    color: #fff;
    border-top: 1px solid rgba(255,255,255,0.24);
    text-align: center;
  }
  .login-mobile-support strong {
    font-size: 14px;
  }
  .login-mobile-support .support-button {
    min-height: 36px;
    min-width: 182px;
    color: #8b1b61;
    background: #fff;
    box-shadow: none;
  }
  .login-mobile-support .whatsapp-support { color: #168f48; }
  .login-mobile-support > span {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255,255,255,0.86);
  }
  main { padding: 16px; }
  body.login-body main { padding: 0; }
  .topbar, .section-head, .panel-head { align-items: stretch; flex-direction: column; }
  .action-row { justify-content: stretch; }
  .action-row button { flex: 1; }
  .top-actions, .search, .search input, .top-actions select { width: 100%; }
  .kpi-grid, .dashboard-grid, .cards-grid, .settings-grid, .report-grid, .service-grid, .billing-layout, .payments-layout { grid-template-columns: 1fr; }
  .payment-filters { grid-template-columns: 1fr; }
  .payment-side { position: static; }
  .permission-grid { grid-template-columns: 1fr; }
  .media-record { grid-template-columns: 1fr; }
  .record-image { height: auto; aspect-ratio: 16 / 9; min-height: 0; }
  .panel.wide { grid-column: auto; }
  .calendar-grid { grid-template-columns: 64px 1fr; }
  .weekly-calendar { grid-template-columns: repeat(7, minmax(220px, 1fr)); }
  .monthly-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .customer-picker { grid-template-columns: 1fr; }
  .wide-field { grid-column: auto; }
  .appointment-detail-box { grid-template-columns: 1fr; }
  .package-picker-list { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 9mm; }
  body[data-print-format="A5"] { zoom: 0.82; }
  body[data-print-format="Thermal 80mm"] .invoice,
  body[data-print-format="Thermal 80mm"] .report-detail {
    width: 78mm;
    max-width: 78mm;
    font-size: 10px;
  }
  body[data-print-format="DOT Matrix 8.5 inch"] .invoice,
  body[data-print-format="DOT Matrix 8.5 inch"] .report-detail {
    font-family: "Courier New", monospace;
    box-shadow: none;
  }
  @page { size: A4 portrait; margin: 8mm; }
  body {
    background: #fff;
    color: #111;
  }
  body[data-print-mode="receipt"] .app-shell,
  body[data-print-mode="receipt"] .toast,
  body[data-print-mode="receipt"] .no-print,
  body[data-print-mode="receipt"] dialog:not(#invoiceDialog) {
    display: none !important;
  }
  body[data-print-mode="receipt"] #invoiceDialog {
    display: block;
    position: static;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    page-break-inside: avoid;
  }
  body[data-print-mode="receipt"] #invoiceDialog::backdrop {
    display: none;
  }
  body[data-print-mode="receipt"] .invoice {
    padding: 0;
    font-size: 11px;
    line-height: 1.25;
    page-break-inside: avoid;
  }
  body[data-print-mode="receipt"] .invoice-head {
    gap: 8px;
    margin-bottom: 8px;
  }
  body[data-print-mode="receipt"] .invoice-head img {
    width: 46px;
    height: 46px;
    border-radius: 8px;
  }
  body[data-print-mode="receipt"] .invoice h2 {
    font-size: 16px;
  }
  body[data-print-mode="receipt"] .invoice p {
    margin: 2px 0;
  }
  body[data-print-mode="receipt"] .invoice-meta {
    gap: 6px;
    margin-bottom: 8px;
  }
  body[data-print-mode="receipt"] .invoice table {
    min-width: 0;
    font-size: 10.5px;
  }
  body[data-print-mode="receipt"] .invoice th,
  body[data-print-mode="receipt"] .invoice td {
    padding: 6px 7px;
  }
  body[data-print-mode="receipt"] .invoice th {
    font-size: 9px;
    letter-spacing: .03em;
  }
  body[data-print-mode="report"] .sidebar,
  body[data-print-mode="report"] .top-actions,
  body[data-print-mode="report"] .menu-toggle,
  body[data-print-mode="report"] dialog,
  body[data-print-mode="report"] .toast,
  body[data-print-mode="report"] button {
    display: none !important;
  }
  body[data-print-mode="report"] .app-shell {
    display: block;
  }
  body[data-print-mode="report"] main {
    padding: 0;
  }
  body[data-print-mode="report"] .view {
    display: none !important;
  }
  body[data-print-mode="report"] #reports {
    display: block !important;
  }
  body[data-print-mode="report"] #reports .section-head,
  body[data-print-mode="report"] .report-grid,
  body[data-print-mode="report"] .report-controls,
  body[data-print-mode="report"] .report-mini-chart,
  body[data-print-mode="report"] .report-detail > .table-wrap,
  body[data-print-mode="report"] .report-badge {
    display: none !important;
  }
  body[data-print-mode="report"] .report-print-ledger {
    display: block;
  }
  body[data-print-mode="report"] .report-detail {
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
  }
  body[data-print-mode="report"] .report-print-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e9d8d2;
  }
  body[data-print-mode="report"] .report-print-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
  }
  body[data-print-mode="report"] .report-print-brand h1 {
    margin: 0;
    font-size: 17px;
    font-family: Georgia, serif;
    color: #7d3f4c;
  }
  body[data-print-mode="report"] .report-print-brand p {
    margin: 2px 0 0;
    font-size: 10px;
    color: #5d5557;
  }
  body[data-print-mode="report"] .report-detail .panel-head {
    display: block;
    margin-bottom: 8px;
  }
  body[data-print-mode="report"] .report-detail h2 {
    font-size: 16px;
  }
  body[data-print-mode="report"] .report-detail p {
    margin: 3px 0 8px;
    font-size: 10px;
  }
  body[data-print-mode="report"] .report-print-ledger table {
    min-width: 0;
    font-size: 9.5px;
  }
  body[data-print-mode="report"] .report-print-ledger th,
  body[data-print-mode="report"] .report-print-ledger td {
    padding: 5px 6px;
  }
  body[data-print-mode="report"] .report-print-ledger th {
    font-size: 8px;
    letter-spacing: .03em;
  }
  body[data-print-mode="report"] .total-row td {
    font-weight: 900;
    background: #fff;
    color: #111;
  }
  body[data-print-mode="report"] .kpi,
  body[data-print-mode="report"] .panel,
  body[data-print-mode="report"] .report-tile,
  body[data-print-mode="report"] .report-detail {
    box-shadow: none;
    break-inside: avoid;
  }
}
