/* ═══════════════════════════════════════════════════════════
   Tejarat PWA — Base Stylesheet (هماهنگ با base.html)
   تم: Teal حرفه‌ای + accent گرم
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary:       #0F766E;
  --primary-2:     #115E59;
  --primary-dark:  #134E4A;
  --primary-light: rgba(15,118,110,0.11);
  --primary-mid:   rgba(15,118,110,0.20);
  --accent:        #B45309;
  --accent-light:  rgba(180,83,9,0.10);
  --green:         var(--primary);
  --green-2:       var(--primary-2);
  --green-light:   var(--primary-light);
  --green-mid:     var(--primary-mid);
  --amber:         var(--accent);
  --bg:            #E8F0EE;
  --bg-2:          #F4F8F7;
  --card:          rgba(255,255,255,0.92);
  --text:          #0F172A;
  --text2:         #475569;
  --text3:         #94A3B8;
  --red:           #DC2626;
  --blue:          #1D4ED8;
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --radius-full:   999px;
  --shadow-card:   0 6px 22px rgba(15,118,110,0.09);
  --transition:    0.2s cubic-bezier(0.4,0,0.2,1);

  /* Shared semantic aliases used by legacy and newer screens. */
  --bg-base:       var(--bg);
  --bg-deep:       #071410;
  --bg-card:       var(--card);
  --bg-card-2:     #FFFFFF;
  --bg-elevated:   #FFFFFF;
  --bg-input:      #F8FAFC;
  --text-primary:  var(--text);
  --text-secondary:var(--text2);
  --text-muted:    var(--text3);
  --text-gold:     #B45309;
  --gold-bright:   #D5A84A;
  --gold-mid:      rgba(213,168,74,0.45);
  --gold-border:   rgba(180,83,9,0.22);
  --gold-dim:      rgba(180,83,9,0.10);
  --gold-glow:     rgba(213,168,74,0.18);
  --green-bright:  #159A78;
  --green-dim:     rgba(21,154,120,0.10);
  --status-danger: #DC2626;
  --shadow-gold:   0 8px 24px rgba(180,83,9,0.12);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* بکگراند texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34,197,94,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(212,168,50,0.06) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Ccircle cx='30' cy='30' r='0.5' fill='rgba(212,168,50,0.08)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ─── App Layout ────────────────────────────────────────── */
.app-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px; /* فضا برای navbar */
}

.app-wrapper.no-nav {
  padding-bottom: 0;
}

/* ─── Top Header ────────────────────────────────────────── */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, rgba(7,20,16,0.97) 0%, rgba(7,20,16,0.85) 70%, transparent 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.header-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card-2));
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.icon-btn:hover, .icon-btn:active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--gold-border);
}

.badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--gold-bright);
  color: var(--bg-deep);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ─── User Avatar ───────────────────────────────────────── */
.user-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.avatar-img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gold-mid);
  object-fit: cover;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-online::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-bright);
  border: 2px solid var(--bg-deep);
}

.avatar-info {
  text-align: right;
}

.avatar-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.avatar-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Page Content ──────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 10px 18px 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: linear-gradient(145deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}

.card-gold {
  border-color: var(--gold-border);
  background: linear-gradient(145deg, rgba(212,168,50,0.08), var(--bg-card));
}

.card-green {
  border-color: rgba(74,222,128,0.2);
  background: linear-gradient(145deg, rgba(74,222,128,0.06), var(--bg-card));
}

.card-clickable {
  cursor: pointer;
  transition: var(--transition);
}

.card-clickable:hover, .card-clickable:active {
  border-color: var(--gold-border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

/* ─── Stats Row ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
}

.stat-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.2;
}

.stat-value.green { color: var(--green-bright); }
.stat-value.red   { color: var(--status-danger); }

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-change {
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
}
.stat-change.up   { color: var(--green-bright); }
.stat-change.down { color: var(--status-danger); }

/* ─── Menu List ─────────────────────────────────────────── */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(145deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.menu-item:hover, .menu-item:active {
  border-color: var(--gold-border);
  background: linear-gradient(145deg, rgba(212,168,50,0.06), var(--bg-card));
}

.menu-item-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.menu-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 3px;
}

.menu-text p {
  font-size: 11px;
  color: var(--text-muted);
}

.menu-arrow {
  color: var(--text-muted);
  font-size: 16px;
  transform: rotate(180deg);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  border-radius: var(--radius-md);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  padding: 0 20px;
  width: 100%;
}

.btn-gold {
  background: linear-gradient(135deg, #f0c040, #c8960c);
  color: var(--bg-deep);
  box-shadow: 0 4px 20px rgba(212,168,50,0.35);
}

.btn-gold:hover { filter: brightness(1.08); }
.btn-gold:active { transform: scale(0.98); }

.btn-green {
  background: linear-gradient(135deg, var(--green-mid), var(--green-dim));
  color: #fff;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold-border);
  color: var(--text-gold);
}

.btn-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}

.btn-sm {
  height: 38px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.btn-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ─── Form Elements ─────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  direction: rtl;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold-mid);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a6e58' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-textarea {
  resize: none;
  min-height: 90px;
}

/* ─── Tags / Badges ─────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.tag-gold    { background: rgba(212,168,50,0.15); color: var(--gold-bright); border: 1px solid rgba(212,168,50,0.25); }
.tag-green   { background: rgba(74,222,128,0.12); color: var(--green-bright); border: 1px solid rgba(74,222,128,0.2); }
.tag-red     { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.tag-blue    { background: rgba(59,130,246,0.12); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }
.tag-purple  { background: rgba(167,139,250,0.12); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.2); }
.tag-gray    { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); }

/* ─── Bottom Navbar ─────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 100%;
  max-width: 480px;
  z-index: 200;
  padding: 8px 18px 16px;
  background: linear-gradient(0deg, rgba(7,20,16,0.98) 60%, transparent 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
  padding: 8px 10px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  background: none;
  font-family: 'Vazirmatn', sans-serif;
  flex: 1;
}

.nav-item.active {
  background: var(--bg-elevated);
  color: var(--gold-bright);
  border: 1px solid var(--gold-border);
}

.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 600; }

/* ─── Bottom Action Bar ─────────────────────────────────── */
.bottom-bar {
  position: sticky;
  bottom: 70px;
  z-index: 50;
  padding: 10px 18px;
  background: linear-gradient(0deg, var(--bg-deep) 40%, transparent 100%);
}

/* ─── Divider ───────────────────────────────────────────── */
.divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 14px 0;
}

.divider-gold {
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}

/* ─── Section Header ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-action {
  font-size: 12px;
  color: var(--gold-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Search Bar ────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 13px;
  direction: rtl;
}

.search-bar input::placeholder { color: var(--text-muted); }

/* ─── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1;
  min-width: fit-content;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-align: center;
  border: none;
  background: none;
  font-family: 'Vazirmatn', sans-serif;
}

.tab.active {
  background: var(--bg-elevated);
  color: var(--gold-bright);
  border: 1px solid var(--gold-border);
}

/* ─── Filter Chips ──────────────────────────────────────── */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: 'Vazirmatn', sans-serif;
}

.chip.active {
  background: var(--gold-glow);
  border-color: var(--gold-border);
  color: var(--gold-bright);
}

/* ─── Order Card ────────────────────────────────────────── */
.order-card {
  background: linear-gradient(145deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.order-card:hover { border-color: var(--gold-border); }

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.order-id {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-bright);
}

.order-customer {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.order-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-bright);
}

/* ─── Product Card ──────────────────────────────────────── */
.product-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(145deg, var(--bg-card-2), var(--bg-card));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
}

.product-img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

.product-info { flex: 1; }

.product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.product-code {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.product-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.price-box {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  text-align: center;
}

.price-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.price-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-value.consumer { color: var(--green-bright); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: var(--bg-elevated);
  color: var(--gold-bright);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.qty-btn:hover { background: var(--gold-glow); }
.qty-value { font-size: 16px; font-weight: 700; min-width: 28px; text-align: center; }

/* ─── Toast ─────────────────────────────────────────────── */
#toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  transition: 0.3s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  box-shadow: var(--shadow-gold);
}

#toast.show { transform: translateX(-50%) translateY(0); }

/* ─── Modal / Sheet ─────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-end;
}

.overlay.open { display: flex; }

.sheet {
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-card-2), var(--bg-base));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--gold-border);
  padding: 20px 20px 32px;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Donut Chart ───────────────────────────────────────── */
.donut-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.donut-wrap svg { transform: rotate(-90deg); }

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-pct {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold-bright);
  line-height: 1;
}

.donut-lbl {
  font-size: 10px;
  color: var(--text-muted);
}

/* ─── Animations ────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) both;
}

.stagger > * {
  animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) both;
}

.stagger > *:nth-child(1) { animation-delay: 0.0s; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.15s; }
.stagger > *:nth-child(5) { animation-delay: 0.2s; }
.stagger > *:nth-child(6) { animation-delay: 0.25s; }
.stagger > *:nth-child(7) { animation-delay: 0.3s; }
.stagger > *:nth-child(8) { animation-delay: 0.35s; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 2px; }

/* ─── Utilities ─────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.text-gold { color: var(--gold-bright); }
.text-green { color: var(--green-bright); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 10px; }
.font-bold { font-weight: 700; }
.font-heavy { font-weight: 800; }
.w-full { width: 100%; }

/* ─── Media Queries ─────────────────────────────────────── */
@media (max-width: 360px) {
  .page-content { padding: 8px 14px 16px; }
  .top-header { padding: 12px 14px 10px; }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 481px) {
  body { background: #E6ECEA; }
  .app-wrapper {
    box-shadow: 0 18px 60px rgba(15,23,42,0.08);
    border-left: 1px solid rgba(15,118,110,0.08);
    border-right: 1px solid rgba(15,118,110,0.08);
  }
  .page-content {
    padding-inline: clamp(24px, 4vw, 56px);
  }
  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

@media (min-width: 900px) {
  .app-wrapper { min-height: 100vh; }
}

/* -------------------------------------------------------------------------
   Product-wide visual layer
   Keeps existing template markup and business behaviour intact while giving
   every screen the same rhythm, surfaces, controls and responsive rules.
------------------------------------------------------------------------- */
:where(button, input, select, textarea) { font: inherit; }
:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(21,154,120,.28);
  outline-offset: 2px;
}

.top-header, .app-header {
  background: rgba(255,255,255,.92) !important;
  color: var(--text) !important;
  border-bottom: 1px solid rgba(15,118,110,.10) !important;
  box-shadow: 0 4px 20px rgba(15,23,42,.05);
  backdrop-filter: blur(18px);
}
.top-header .page-title, .app-header .page-title,
.top-header .header-title, .app-header .header-title { color: var(--text) !important; }
.top-header .header-sub, .app-header .header-sub,
.top-header .text-muted, .app-header .text-muted { color: var(--text2) !important; }

.card, .panel, .surface, .table-card, .filter-card,
.settings-card, .report-card, .order-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,118,110,.10);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(15,23,42,.06);
}

:where(.btn, button, .btn-primary, .btn-secondary, .btn-outline, .action-btn) {
  border-radius: 12px;
  min-height: 42px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
:where(.btn, button, .btn-primary, .btn-secondary, .btn-outline, .action-btn):active {
  transform: translateY(1px) scale(.985);
}
.btn-primary, .button-primary, .action-primary {
  background: linear-gradient(135deg, #159A78, #0F766E) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 8px 18px rgba(15,118,110,.22);
}
.btn-primary:hover, .button-primary:hover, .action-primary:hover {
  box-shadow: 0 10px 24px rgba(15,118,110,.30);
}

:where(input[type="text"], input[type="number"], input[type="tel"],
input[type="password"], input[type="date"], input[type="search"],
select, textarea) {
  min-height: 44px;
  background: #F8FAFC;
  border: 1px solid #D8E3E0;
  border-radius: 12px;
  color: var(--text);
  padding: 9px 12px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
:where(input, select, textarea):focus {
  background: #fff;
  border-color: #159A78;
  box-shadow: 0 0 0 4px rgba(21,154,120,.10);
}

:where(table) { border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 14px; }
:where(th) { background: #F1F7F5; color: #31534D; font-weight: 800; }
:where(td, th) { border-bottom: 1px solid #E6EFEC; padding: 11px 12px; }
:where(tr:last-child td) { border-bottom: 0; }
:where(tbody tr:hover) { background: #F8FCFA; }

.empty-state, .no-data, .empty { color: var(--text2); background: rgba(255,255,255,.70); border-radius: var(--radius-lg); }
.badge, .tag, .status, .chip { border-radius: 999px; font-weight: 800; }

@media (max-width: 899px) {
  .page-content { padding-inline: 14px; }
  .top-header, .app-header { padding-inline: 14px !important; }
  :where(.table-wrap, .table-responsive) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (min-width: 900px) {
  .page-content { max-width: 1240px; width: 100%; margin-inline: auto; }
  .top-header, .app-header { padding-inline: clamp(24px, 4vw, 64px) !important; }
  :where(.stats-grid, .kpi-grid, .cards-grid, .summary-grid) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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