@font-face {
  font-family: "UKIJ Tuz Tom";
  src: url("./assets/UKIJTuT.ttf?v=20260713-8") format("truetype"), local("UKIJ Tuz Tom");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "UKIJ Tuz Tom", Arial, sans-serif;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --line: #e5ebee;
  --line-strong: #d8e2e5;
  --ink: #1c2b33;
  --muted: #7b8a92;
  --muted-2: #a7b2b7;
  --primary: #08a8a4;
  --primary-dark: #078783;
  --primary-soft: #e7f8f7;
  --blue: #3985f7;
  --blue-soft: #eaf2ff;
  --orange: #f59e42;
  --orange-soft: #fff4e8;
  --red: #e85e68;
  --red-soft: #fff0f1;
  --green: #2fa96f;
  --green-soft: #eaf8f1;
  --purple: #8d6cdf;
  --shadow: 0 8px 28px rgba(22, 42, 52, .06);
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); direction: rtl; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.datetime-ltr { display: inline-block; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-family: Arial, var(--font); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 0 0 auto; z-index: 30; width: var(--sidebar); height: 100vh;
  padding: 0 16px 18px; background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { height: 76px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.brand-mark { position: relative; width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; color: white; background: linear-gradient(145deg, #08b8b2 0%, #078783 100%); box-shadow: 0 10px 22px rgba(8,168,164,.28), inset 0 1px 0 rgba(255,255,255,.22); }
.brand-mark::before { content: ""; position: absolute; inset: -18px -12px auto auto; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.18); }
.brand-mark::after { content: ""; position: absolute; inset: auto auto 6px 7px; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.48); box-shadow: 9px -19px 0 rgba(255,255,255,.2); }
.brand-mark svg { position: relative; z-index: 1; width: 25px; height: 25px; stroke-width: 2.1; }
.brand strong { display: block; font-size: 22px; line-height: 1.05; color: #142d33; }
.brand span { display: block; margin-top: 4px; direction: ltr; text-align: right; color: var(--primary); font: 600 9px/1 Arial, sans-serif; letter-spacing: 2.4px; }
.nav-label { display: block; padding: 8px 12px; font-size: 11px; color: var(--muted-2); }
.section-label { margin-top: 13px; }
.main-nav { flex: 1; }
.nav-item { position: relative; width: 100%; min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 6px; color: #5e6c73; background: transparent; text-align: right; transition: .2s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item span:nth-child(2) { flex: 1; }
.nav-item:hover { color: var(--primary-dark); background: #f3fbfa; }
.nav-item.active { color: var(--primary-dark); background: var(--primary-soft); font-weight: 700; }
.nav-item.active::after { content: ""; position: absolute; right: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--primary); }
.nav-count { min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; font: 600 11px/1 Arial, sans-serif; color: var(--primary-dark); background: rgba(8,168,164,.12); }
.alert-count { color: var(--red); background: var(--red-soft); }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.nav-count[hidden], .notification-badge[hidden] { display: none; }
.sidebar-footer { padding-top: 14px; border-top: 1px solid var(--line); }

.main-area { min-height: 100vh; margin-right: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; height: 76px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-start, .topbar-actions { display: flex; align-items: center; }
.topbar-start { gap: 13px; }
.page-heading h1 { margin: 0; font-size: 20px; line-height: 1.3; }
.page-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { gap: 10px; }
.icon-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: #607078; background: white; }
.icon-button:hover { color: var(--primary-dark); background: var(--primary-soft); border-color: #c6ece9; }
.menu-button { display: none; }
.notification-button { position: relative; }
.notification-dot { position: absolute; left: 8px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); border: 1px solid white; }
.notification-badge { position: absolute; left: -5px; top: -6px; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 11px; color: var(--red); background: var(--red-soft); border: 2px solid white; font: 700 10px/1 Arial, var(--font); }
.profile { margin-right: 4px; padding-right: 12px; display: flex; align-items: center; gap: 9px; border-right: 1px solid var(--line); }
.profile-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: #263d43; }
.profile strong, .profile span { display: block; }
.profile strong { font-size: 12px; }
.profile div span { margin-top: 2px; font-size: 10px; color: var(--muted); }
.profile svg { width: 14px; color: var(--muted); }

.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px 28px 45px; }
.view { animation: viewIn .28s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hero-banner { position: relative; min-height: 145px; padding: 25px 28px; overflow: hidden; display: flex; align-items: center; border: 1px solid #ccecea; border-radius: 7px; background: linear-gradient(115deg, #e8f8f7, #f8fcfc 66%, #edf9f8); }
.hero-banner::before, .hero-banner::after { content: ""; position: absolute; border: 1px solid rgba(8,168,164,.16); transform: rotate(-12deg); }
.hero-banner::before { width: 270px; height: 120px; left: -25px; top: 12px; }
.hero-banner::after { width: 190px; height: 190px; left: 65px; bottom: -135px; border-radius: 50%; }
.hero-art { position: absolute; inset: 0 auto 0 0; width: 34%; opacity: .9; }
.hero-art .box-a, .hero-art .box-b, .hero-art .box-c { position: absolute; display: block; transform: rotate(30deg) skew(-5deg); border-radius: 6px; }
.hero-art .box-a { left: 75px; top: 30px; width: 72px; height: 72px; background: rgba(8,168,164,.12); }
.hero-art .box-b { left: 120px; top: 55px; width: 58px; height: 58px; background: rgba(57,133,247,.09); }
.hero-art .box-c { left: 35px; top: 78px; width: 45px; height: 45px; background: rgba(245,158,66,.12); }
.hero-content { position: relative; z-index: 1; max-width: 700px; }
.eyebrow { margin-bottom: 8px; display: flex; align-items: center; gap: 7px; color: var(--primary-dark); font-size: 12px; font-weight: 700; }
.eyebrow::before { content: ""; width: 19px; height: 2px; background: var(--primary); }
.hero-content h2 { margin: 0; font-size: 22px; line-height: 1.55; }
.hero-content p { margin: 6px 0 15px; color: #597077; font-size: 13px; }
.button { min-height: 38px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: white; font-weight: 700; }
.button svg { width: 17px; height: 17px; }
.button:hover { border-color: #a8deda; color: var(--primary-dark); }
.button.primary { color: white; border-color: var(--primary); background: var(--primary); box-shadow: 0 6px 13px rgba(8,168,164,.18); }
.button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.button.soft { color: var(--primary-dark); border-color: transparent; background: var(--primary-soft); box-shadow: none; }
.button.danger { color: white; border-color: var(--red); background: var(--red); box-shadow: 0 6px 13px rgba(232,94,104,.18); }
.button.danger:hover { border-color: #d54d57; background: #d54d57; }
.button.danger-soft { color: var(--red); border-color: transparent; background: var(--red-soft); }

.stats-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.stat-card { min-height: 124px; padding: 18px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 3px 12px rgba(22,42,52,.025); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #627178; font-size: 12px; }
.stat-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 6px; }
.stat-icon svg { width: 18px; }
.stat-icon.teal { color: var(--primary-dark); background: var(--primary-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-value { margin-top: 11px; display: flex; align-items: baseline; gap: 5px; direction: rtl; }
.stat-value strong { font: 700 25px/1 Arial, var(--font); letter-spacing: 0; }
.stat-value span { color: var(--muted); font-size: 11px; }
.stat-note { margin-top: auto; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.stat-note .up { color: var(--green); }
.stat-note .warn { color: var(--red); }
.stat-note svg { width: 13px; height: 13px; }

.dashboard-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 18px; align-items: start; }
.dashboard-main, .dashboard-side { display: grid; gap: 18px; }
.mobile-quick-panel { display: none; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 3px 12px rgba(22,42,52,.025); overflow: hidden; }
.panel-header { min-height: 63px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-title h3 { margin: 0; font-size: 16px; }
.panel-title p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-actions { display: flex; align-items: center; gap: 8px; }
.text-button { padding: 4px 0; display: flex; align-items: center; gap: 4px; border: 0; color: var(--primary-dark); background: transparent; font-weight: 700; }
.text-button svg { width: 15px; }
.panel-body { padding: 18px 20px; }
.chart-wrap { min-height: 258px; display: grid; grid-template-columns: 1fr 190px; gap: 24px; direction: ltr; }
.chart-area { position: relative; min-width: 0; padding: 8px 0 25px; }
.chart-area svg { width: 100%; height: 205px; overflow: visible; }
.chart-grid line { stroke: #e7edef; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-fill { fill: url(#areaGradient); stroke: none; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-point { fill: white; stroke: var(--primary); stroke-width: 3; }
.chart-labels { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; color: var(--muted); font: 10px/1 Arial, sans-serif; }
.chart-summary { direction: rtl; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); padding-right: 20px; }
.chart-summary span { color: var(--muted); font-size: 11px; }
.chart-summary strong { margin: 6px 0; font: 700 26px/1 Arial, var(--font); }
.chart-summary small { color: var(--green); }
.mini-bars { height: 52px; margin-top: 20px; display: flex; align-items: end; gap: 5px; direction: ltr; }
.mini-bars i { flex: 1; min-width: 5px; border-radius: 2px 2px 0 0; background: #d5efed; }
.mini-bars i.active { background: var(--primary); }

.activity-list { display: grid; }
.activity-row { min-height: 74px; padding: 13px 0; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; }
.activity-icon svg { width: 17px; }
.activity-icon.sale { color: var(--primary-dark); background: var(--primary-soft); }
.activity-icon.redeem { color: var(--purple); background: #f2edff; }
.activity-icon.customer { color: var(--blue); background: var(--blue-soft); }
.activity-info { min-width: 0; flex: 1; }
.activity-info strong { display: block; font-size: 12px; }
.activity-info span { margin-top: 4px; display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-value { text-align: left; }
.activity-value strong, .activity-value span { display: block; direction: ltr; }
.activity-value strong { font: 700 12px/1 Arial, sans-serif; }
.activity-value span { margin-top: 5px; color: var(--muted); font-size: 9px; }

.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.quick-action { min-height: 96px; padding: 15px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; border: 1px solid transparent; border-radius: 8px; color: var(--ink); text-align: right; box-shadow: inset 0 0 0 1px rgba(255,255,255,.52); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.quick-action:nth-child(1) { color: #087a76; background: linear-gradient(135deg, #e1f8f6, #f4fffe); border-color: #bdecea; }
.quick-action:nth-child(2) { color: #2869d8; background: linear-gradient(135deg, #e6f0ff, #f7fbff); border-color: #c7dcff; }
.quick-action:nth-child(3) { color: #7a55d8; background: linear-gradient(135deg, #f0eaff, #fbf8ff); border-color: #ddd0ff; }
.quick-action:nth-child(4) { color: #bd6c19; background: linear-gradient(135deg, #fff0df, #fffaf4); border-color: #ffdfb9; }
.quick-action:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(22,42,52,.10); }
.quick-action svg { width: 28px; height: 28px; color: currentColor; }
.quick-action span { color: #182b33; font-size: 15px; font-weight: 800; line-height: 1.35; }
.reminder-item { padding: 15px 0; display: flex; gap: 11px; border-bottom: 1px solid var(--line); }
.reminder-item:last-child { border-bottom: 0; }
.reminder-line { width: 3px; min-height: 50px; flex: 0 0 auto; border-radius: 2px; }
.reminder-line.danger { background: var(--red); }
.reminder-line.warning { background: var(--orange); }
.reminder-line.birthday { background: var(--blue); }
.reminder-content { min-width: 0; flex: 1; }
.reminder-content strong { display: block; font-size: 12px; }
.reminder-content p { margin: 4px 0 7px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.reminder-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag { min-height: 21px; padding: 2px 8px; display: inline-flex; align-items: center; border-radius: 3px; font-size: 9px; white-space: nowrap; }
.tag.danger { color: var(--red); background: var(--red-soft); }
.tag.warning { color: #c87824; background: var(--orange-soft); }
.tag.success { color: var(--green); background: var(--green-soft); }
.tag.info { color: var(--blue); background: var(--blue-soft); }
.tag.neutral { color: var(--muted); background: #eef2f3; }
.reminder-meta time { color: var(--muted); font: 10px/1 Arial, var(--font); }

.view-toolbar { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading { margin: 0; font-size: 20px; line-height: 1.35; }
.section-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.muted-count { color: var(--muted); font: 11px/1 Arial, var(--font); }
.compact-select { height: 33px; min-height: 33px; padding-top: 0; padding-bottom: 0; font-size: 10px; }
.toolbar-group { display: flex; align-items: center; gap: 9px; }
.toolbar-search { width: 270px; height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; }
.toolbar-search svg { width: 17px; color: var(--muted); }
.toolbar-search input { width: 100%; border: 0; outline: 0; background: transparent; }
.select { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: white; outline: 0; }
.table-panel { overflow: visible; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th { height: 46px; padding: 0 18px; color: #66767d; background: var(--surface-soft); font-size: 12px; text-align: right; white-space: nowrap; }
td { height: 70px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
tbody tr:hover { background: #fbfdfd; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.cell-main, .cell-sub { display: block; }
.cell-main { color: var(--ink); font-size: 13px; font-weight: 700; }
.cell-sub { margin-top: 5px; color: var(--muted); font-size: 10.5px; direction: ltr; text-align: right; }
.num { font-family: Arial, var(--font); direction: ltr; display: inline-block; }
.points { color: var(--primary-dark); font-weight: 700; }
td .tag { font-size: 10.5px; }
.row-action { min-width: 32px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 4px; color: var(--muted); background: transparent; }
.row-action:hover { color: var(--primary-dark); background: var(--primary-soft); }
.row-action svg { width: 16px; }
.row-actions { display: flex; align-items: center; gap: 3px; }
.danger-action:hover { color: var(--red); background: var(--red-soft); }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state svg { width: 42px; height: 42px; color: var(--muted-2); }
.empty-state h3 { margin: 12px 0 5px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 12px; }
.pagination-bar { min-height: 58px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); background: white; flex-wrap: wrap; }
.pagination-info { color: var(--muted); font-size: 11px; }
.pagination-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination-button { min-width: 34px; height: 32px; padding: 0 10px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: white; font-size: 11px; }
.pagination-button.wide { min-width: 66px; }
.pagination-button:hover:not(:disabled), .pagination-button.active { color: var(--primary-dark); border-color: #bde7e4; background: var(--primary-soft); }
.pagination-button.active { font-weight: 800; }
.pagination-button:disabled { cursor: not-allowed; opacity: .45; }
.pagination-gap { min-width: 20px; display: inline-grid; place-items: center; color: var(--muted); font: 700 12px/1 Arial, var(--font); }

.reward-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.reward-card { position: relative; min-height: 190px; padding: 19px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: white; }
.reward-card::after { content: ""; position: absolute; left: -34px; top: -34px; width: 100px; height: 100px; border-radius: 50%; background: var(--primary-soft); }
.reward-card.orange::after { background: var(--orange-soft); }
.reward-card.blue::after { background: var(--blue-soft); }
.reward-card-icon { position: relative; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; color: var(--primary-dark); background: var(--primary-soft); }
.reward-card.orange .reward-card-icon { color: #bd6c19; background: var(--orange-soft); }
.reward-card.blue .reward-card-icon { color: var(--blue); background: var(--blue-soft); }
.reward-card h3 { margin: 14px 0 4px; font-size: 15px; }
.reward-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.reward-card-footer { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.reward-cost { font: 700 17px/1 Arial, var(--font); color: var(--primary-dark); }

.progress-cell { width: 150px; }
.progress-meta { margin-bottom: 5px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.progress { height: 5px; overflow: hidden; border-radius: 3px; background: #edf1f2; }
.progress span { height: 100%; display: block; border-radius: inherit; background: var(--primary); }
.progress.warning span { background: var(--orange); }
.progress.danger span { background: var(--red); }

.reminder-board { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.reminder-card { min-height: 150px; padding: 19px; display: flex; gap: 14px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.reminder-card-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; }
.reminder-card-icon.danger { color: var(--red); background: var(--red-soft); }
.reminder-card-icon.warning { color: #c87824; background: var(--orange-soft); }
.reminder-card-icon.info { color: var(--blue); background: var(--blue-soft); }
.reminder-card-icon.success { color: var(--green); background: var(--green-soft); }
.reminder-card-body { min-width: 0; flex: 1; }
.reminder-card-body h3 { margin: 0 0 6px; font-size: 14px; }
.reminder-card-body p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.reminder-card-footer { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.settings-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; align-items: start; }
.settings-section { padding: 22px; }
.settings-section h3 { margin: 0 0 4px; font-size: 16px; }
.settings-section > p { margin: 0 0 22px; color: var(--muted); font-size: 11px; }
.setting-row { min-height: 66px; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.setting-row strong, .setting-row span { display: block; }
.setting-row strong { font-size: 12px; }
.setting-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.toggle { position: relative; width: 42px; height: 23px; flex: 0 0 auto; border: 0; border-radius: 13px; background: #cbd4d7; }
.toggle::after { content: ""; position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: .2s; }
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(-19px); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; display: none; place-items: center; background: rgba(21,37,44,.45); backdrop-filter: blur(3px); }
.modal-backdrop.open { display: grid; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: hidden; border-radius: 8px; background: white; box-shadow: 0 25px 80px rgba(15,30,36,.25); animation: modalIn .22s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 2px 0 0; font-size: 18px; }
.modal-eyebrow { color: var(--primary-dark); font-size: 10px; }
.modal-body { max-height: calc(100vh - 145px); padding: 20px 21px; overflow-y: auto; }
.modal-backdrop[data-modal-type="confirm"] .modal { width: min(440px, calc(100vw - 40px)); overflow: visible; }
.modal-backdrop[data-modal-type="confirm"] .modal-header { display: none; }
.modal-backdrop[data-modal-type="confirm"] .modal-body { padding: 26px 24px 24px; overflow: visible; }
.modal-backdrop[data-modal-type="confirm"] .modal-footer { display: none; }
.confirm-dialog { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.confirm-icon { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; }
.confirm-icon svg { width: 30px; height: 30px; }
.confirm-dialog.danger .confirm-icon { color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px rgba(232,94,104,.12); }
.confirm-dialog.success .confirm-icon { color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px rgba(47,169,111,.12); }
.confirm-dialog.warning .confirm-icon { color: #c87824; background: var(--orange-soft); box-shadow: inset 0 0 0 1px rgba(245,158,66,.12); }
.confirm-copy { width: 100%; display: grid; gap: 6px; }
.confirm-message { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.8; }
.confirm-actions { width: 100%; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.confirm-actions .button { min-width: 116px; }
.confirm-actions .button:not(.danger) { color: var(--ink); border-color: var(--line-strong); background: var(--surface-soft); box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1/-1; }
.form-field label { color: #53656d; font-size: 11px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: white; outline: none; }
.form-field small { color: var(--muted); font-size: 11px; }
.form-field .manual-date { text-align: right; letter-spacing: .4px; unicode-bidi: plaintext; }
.form-field textarea { min-height: 75px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,168,164,.08); }
.sale-customer-search { position: relative; display: grid; gap: 0; }
.sale-customer-search > input[type="search"] { width: 100%; }
.sale-customer-search > input[type="search"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,168,164,.08); }
.sale-customer-options { position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; left: 0; max-height: 230px; padding: 6px; display: none; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 6px; background: white; box-shadow: 0 12px 28px rgba(22,42,52,.14); }
.sale-customer-options.open { display: grid; gap: 4px; }
.customer-option { width: 100%; min-height: 48px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 4px; color: var(--ink); background: transparent; text-align: right; cursor: pointer; }
.customer-option:hover, .customer-option:focus-visible { background: var(--primary-soft); outline: none; }
.customer-option span:last-child { min-width: 0; display: grid; gap: 3px; }
.customer-option strong { font-size: 12px; }
.customer-option small { color: var(--muted); font-size: 10px; }
.customer-empty { padding: 14px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.customer-preview { margin-top: 9px; min-height: 72px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line-strong); border-radius: 5px; background: #f8fbfb; direction: rtl; }
.customer-preview-main { min-width: 0; display: grid; gap: 6px; }
.customer-preview strong { min-width: 0; font-size: 18px; line-height: 1.2; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-preview small { min-width: 0; color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.customer-preview-points { min-width: 120px; display: grid; justify-items: end; gap: 6px; color: var(--primary-dark); }
.customer-preview-points span { color: var(--muted); font-size: 11px; font-weight: 700; }
.customer-preview-points b { font: 800 22px/1 Arial, var(--font); }
.customer-preview.empty strong, .customer-preview.empty small, .customer-preview.empty .customer-preview-points, .customer-preview.empty .customer-preview-points span { color: var(--muted); }
.sale-amount-field label { color: var(--red); }
.sale-amount-field input { color: var(--red); border-color: #f1c0c3; background: #fff7f7; }
.sale-amount-field input::placeholder { color: #d89398; }
.sale-amount-field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(244,92,104,.12); }
.redeem-points-field label { color: var(--red); }
.redeem-points-field input { color: var(--red); border-color: #f1c0c3; background: #fff7f7; }
.redeem-points-field input::placeholder { color: #d89398; }
.redeem-points-field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(244,92,104,.12); }
.points-preview { padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #ccecea; border-radius: 5px; color: var(--primary-dark); background: var(--primary-soft); }
.points-preview strong { font: 700 18px/1 Arial, var(--font); }
.points-preview strong.negative { color: var(--red); }
.sale-points-preview { margin-top: 2px; }
.modal-footer { margin-top: 19px; padding-top: 16px; display: flex; justify-content: center; gap: 9px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.button:disabled { cursor: wait; opacity: .65; }
.button.busy::after { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.receipt-detail { display: grid; gap: 16px; }
.receipt-head { padding: 14px; display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; border-radius: 6px; background: var(--surface-soft); }
.receipt-head div { display: grid; gap: 4px; }
.receipt-head span, .receipt-head small { color: var(--muted); font-size: 10px; }
.receipt-head strong { font-size: 13px; }
.receipt-lines { display: grid; }
.receipt-lines > div { min-height: 45px; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.receipt-lines small { color: var(--muted); }
.receipt-total { padding: 14px 16px; display: grid; gap: 10px; border-radius: 6px; background: #f7fafb; }
.receipt-total > div { display: flex; align-items: center; justify-content: space-between; }
.receipt-total strong { font-size: 17px; }
.system-state { min-height: calc(100vh - 150px); padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.system-state h2 { margin: 14px 0 6px; color: var(--ink); font-size: 19px; }
.system-state p { margin: 0 0 18px; font-size: 12px; }
.system-state small { margin-top: 13px; }
.system-state > svg { width: 42px; height: 42px; color: var(--red); }
.loader { width: 34px; height: 34px; border: 3px solid #d9efed; border-left-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 200; left: 50%; top: 24px; bottom: auto; transform: translateX(-50%); display: grid; gap: 10px; justify-items: center; }
.toast { width: min(360px, calc(100vw - 32px)); padding: 13px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid #cce7d9; border-radius: 6px; color: #246d4b; background: #f2fbf6; box-shadow: var(--shadow); animation: toastIn .25s ease; }
.toast svg { flex: 0 0 auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mobile-nav, .mobile-overlay { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar: 224px; }
  .content, .topbar { padding-left: 20px; padding-right: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chart-wrap { grid-template-columns: 1fr 165px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 860px) {
  :root { --sidebar: 260px; }
  .sidebar { transform: translateX(105%); box-shadow: -15px 0 50px rgba(18,33,40,.2); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .menu-button { display: grid; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 29; background: rgba(19,34,41,.38); }
  .mobile-overlay.open { display: block; }
  .main-area { margin-right: 0; }
  .profile div, .profile > svg { display: none; }
  .profile { padding-right: 8px; }
  .reward-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reminder-board { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { padding-bottom: 65px; }
  .topbar { height: 64px; padding: 0 14px; }
  .page-heading h1 { font-size: 16px; }
  .page-heading p, .profile { display: none; }
  .content { padding: 14px 12px 30px; }
  .hero-banner { min-height: 178px; padding: 20px; align-items: flex-start; }
  .hero-content { max-width: 100%; }
  .hero-content h2 { font-size: 18px; }
  .hero-content p { padding-left: 55px; }
  .hero-art { width: 50%; opacity: .55; }
  .hero-art .box-a { left: 15px; top: 84px; }
  .hero-art .box-b { left: 55px; top: 108px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .stat-card { min-height: 117px; padding: 13px; }
  .stat-top { align-items: flex-start; font-size: 10px; }
  .stat-icon { width: 30px; height: 30px; }
  .stat-value strong { font-size: 20px; }
  .mobile-quick-panel { display: block; margin-top: 12px; }
  .desktop-quick-panel { display: none; }
  .stats-grid { margin-top: 12px; }
  .dashboard-grid { gap: 12px; }
  .dashboard-main, .dashboard-side { gap: 12px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .panel-header { padding: 13px 15px; }
  .panel-body { padding: 14px 15px; }
  .chart-wrap { min-height: 320px; grid-template-columns: 1fr; gap: 10px; }
  .chart-summary { padding: 14px 0 0; display: grid; grid-template-columns: 1fr auto; align-items: center; border-right: 0; border-top: 1px solid var(--line); }
  .mini-bars { grid-column: 1/-1; margin-top: 10px; }
  .view-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { width: 100%; }
  .toolbar-group .button { flex: 1; }
  .toolbar-search { width: 100%; }
  .pagination-bar { justify-content: center; text-align: center; }
  .pagination-actions { justify-content: center; }
  .reward-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .receipt-head { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 25; height: 65px; padding: 5px 10px calc(5px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; justify-content: space-around; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
  .mobile-nav button { min-width: 48px; height: 51px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; color: var(--muted); background: transparent; font-size: 9px; }
  .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav button.active { color: var(--primary-dark); }
  .mobile-nav .mobile-add { position: relative; top: -12px; color: var(--primary-dark); }
  .mobile-nav .mobile-add svg { width: 39px; height: 39px; padding: 10px; border-radius: 50%; color: white; background: var(--primary); box-shadow: 0 5px 15px rgba(8,168,164,.3); }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: calc(100vh - 20px); border-radius: 9px 9px 0 0; }
  .toast-region { left: 50%; top: 12px; bottom: auto; transform: translateX(-50%); }
}

@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 105px; }
  .hero-content p { padding-left: 0; }
  .hero-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
