/* ============================================================================
 * pharmasys/styles.css — Zafar Rahkar Pharmacy System
 * Editorial cream + per-action colors design (v1).
 * ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,700;12..96,800&display=swap');

:root {
  --rx-paper:   #faf7f0;
  --rx-paper-2: #f4efe4;
  --rx-ink:     #0f1f1e;
  --rx-ink-muted: #6b6359;
  --rx-line:    rgba(15, 31, 30, 0.08);

  /* Identity — deep teal */
  --rx-teal-900: #0a3835;
  --rx-teal-700: #0f4c4a;
  --rx-teal-500: #14746f;
  --rx-teal-50:  #e0efee;

  /* Per-action saturated colors (six distinct families) */
  --rx-c1: #ea580c;  /* coral   — sell / dispense (most-used) */
  --rx-c2: #059669;  /* emerald — stock in */
  --rx-c3: #4f46e5;  /* indigo  — batches */
  --rx-c4: #7c3aed;  /* violet  — suppliers */
  --rx-c5: #d97706;  /* amber   — supplier ledger */
  --rx-c6: #db2777;  /* rose    — sales history */
  --rx-c7: #0891b2;  /* cyan    — medicines catalog */
  --rx-c8: #6b7280;  /* slate   — users / settings */

  --rx-radius-card: 18px;
  --rx-radius-tile: 20px;
  --rx-radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  color: var(--rx-ink);
  background: var(--rx-paper);
  min-height: 100vh;
}
body {
  background-image:
    radial-gradient(circle at 90% -10%, rgba(20, 116, 111, 0.10), transparent 55%),
    radial-gradient(circle at -5% 90%, rgba(217, 119, 6, 0.07), transparent 50%);
  background-attachment: fixed;
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.06  0 0 0 0 0.06  0 0 0 0 0.06  0 0 0 0.5 0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.55'/></svg>");
  opacity: 0.4;
  mix-blend-mode: multiply;
}

a { color: var(--rx-teal-700); text-decoration: none; }
a:hover { color: var(--rx-teal-900); }

/* ============================================================================
 * TOP NAV
 * ============================================================================ */
.rx-nav {
  position: relative; z-index: 5;
  background: linear-gradient(180deg, var(--rx-teal-900), var(--rx-teal-700));
  color: #f5efe1;
  border-radius: 0 0 24px 24px;
  padding: 14px 28px;
  box-shadow: 0 12px 30px -22px rgba(10,56,53,.55);
  margin-bottom: 22px;
}
.rx-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.rx-brand {
  display: flex; align-items: center; gap: 12px;
  color: #f5efe1; text-decoration: none;
}
.rx-brand__mark {
  width: 40px; height: 40px;
  background: linear-gradient(140deg, #fcd34d, #f59e0b);
  color: var(--rx-teal-900);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 14px -8px rgba(252, 211, 77, 0.6);
}
.rx-brand__txt {
  display: flex; flex-direction: column; line-height: 1.1;
}
.rx-brand__name {
  font-family: 'Bricolage Grotesque', 'Vazirmatn', sans-serif;
  font-weight: 800; letter-spacing: -0.01em;
  font-size: 18px;
}
.rx-brand__sub {
  font-size: 11px;
  color: rgba(245, 239, 225, 0.65);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.rx-nav__links {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.rx-nav__link {
  padding: 8px 14px;
  border-radius: var(--rx-radius-pill);
  font-size: 13px; font-weight: 500;
  color: rgba(245, 239, 225, 0.8);
  transition: background .2s, color .2s;
}
.rx-nav__link:hover, .rx-nav__link.is-active {
  background: rgba(245, 239, 225, 0.12);
  color: #fff;
}
.rx-nav__link i { margin-inline-end: 5px; }
.rx-nav__right {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: rgba(245, 239, 225, 0.85);
}
.rx-nav__user {
  display: flex; align-items: center; gap: 8px;
  background: rgba(245, 239, 225, 0.10);
  padding: 6px 12px;
  border-radius: var(--rx-radius-pill);
  border: 1px solid rgba(245, 239, 225, 0.16);
}
.rx-nav__user small { opacity: .7; }
.rx-btn-logout {
  padding: 6px 14px;
  border-radius: var(--rx-radius-pill);
  background: rgba(245, 239, 225, 0.08);
  border: 1px solid rgba(245, 239, 225, 0.18);
  color: #f5efe1;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.rx-btn-logout:hover { background: rgba(245, 239, 225, 0.18); color: #fff; transform: translateY(-1px); }

/* ============================================================================
 * PAGE CONTAINER
 * ============================================================================ */
.rx-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
  position: relative; z-index: 1;
}

/* ============================================================================
 * HERO
 * ============================================================================ */
.rx-hero {
  background: linear-gradient(135deg, var(--rx-teal-900) 0%, var(--rx-teal-700) 60%, #115e5b 100%);
  color: #f5efe1;
  border-radius: 24px;
  padding: 40px 36px 36px;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 24px 60px -25px rgba(10,56,53,.55), inset 0 1px 0 rgba(255,255,255,.08);
}
.rx-hero::before {
  content: ''; position: absolute; left: -120px; top: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(245,239,225,.08), transparent 70%);
  border-radius: 50%;
}
.rx-hero::after {
  content: ''; position: absolute; right: -80px; bottom: -100px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(217,119,6,.18), transparent 70%);
  border-radius: 50%;
}
.rx-hero__inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 24px;
}
.rx-hero__left { max-width: 720px; }
.rx-hero__eyebrow {
  font-family: 'Bricolage Grotesque', 'Vazirmatn', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.35em; text-transform: uppercase;
  color: rgba(245,239,225,.7);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.rx-hero__eyebrow::before { content: ''; width: 32px; height: 1px; background: rgba(245,239,225,.5); }
.rx-hero__title {
  font-family: 'Bricolage Grotesque', 'Vazirmatn', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.rx-hero__subtitle { font-size: 15px; color: rgba(245,239,225,.78); margin-bottom: 18px; }
.rx-hero__date {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(245,239,225,.12);
  border: 1px solid rgba(245,239,225,.18);
  border-radius: var(--rx-radius-pill);
  padding: 8px 18px;
  font-size: 14px; font-weight: 500;
  backdrop-filter: blur(8px);
}
.rx-hero__date i { color: #fcd34d; }
.rx-hero__right { position: relative; z-index: 1; font-family: 'Bricolage Grotesque', sans-serif; text-align: center; }
.rx-hero__big-num {
  font-size: clamp(72px, 9vw, 120px);
  font-weight: 800; line-height: .95; letter-spacing: -0.04em;
  color: #fcd34d;
  text-shadow: 0 6px 24px rgba(252,211,77,.3);
}
.rx-hero__big-label { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(245,239,225,.6); margin-top: 6px; }

/* ============================================================================
 * SECTION HEAD
 * ============================================================================ */
.rx-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 32px 0 18px; gap: 16px;
}
.rx-section-head h2 {
  font-family: 'Bricolage Grotesque', 'Vazirmatn', sans-serif;
  font-size: 22px; font-weight: 700; margin: 0;
  color: var(--rx-teal-900); letter-spacing: -0.01em;
}
.rx-section-head h2 small {
  font-family: 'Bricolage Grotesque', monospace;
  font-size: 11px; color: var(--rx-ink-muted);
  margin-inline-start: 12px; letter-spacing: .15em;
  text-transform: uppercase; font-weight: 500;
}
.rx-section-rule { flex: 1; height: 1px; background: linear-gradient(to left, var(--rx-line), transparent); }

/* ============================================================================
 * STAT CARDS
 * ============================================================================ */
.rx-stats { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rx-stat {
  display: block; background: #fff; border-radius: var(--rx-radius-card);
  padding: 22px 22px 20px; text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
  border: 1px solid var(--rx-line);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
  box-shadow: 0 1px 0 rgba(15,31,30,.02), 0 8px 24px -16px rgba(15,31,30,.15);
}
.rx-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(15,31,30,.02), 0 22px 40px -20px rgba(15,31,30,.25);
  border-color: rgba(15,31,30,.12);
}
.rx-stat__accent { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.rx-stat__icon {
  position: absolute; inset-inline-end: 18px; top: 18px;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.rx-stat__label { font-size: 12px; color: var(--rx-ink-muted); font-weight: 500; margin-bottom: 10px; }
.rx-stat__value {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 44px; font-weight: 800; line-height: 1;
  color: var(--rx-teal-900);
  letter-spacing: -0.03em; margin-bottom: 8px;
}
.rx-stat--alert .rx-stat__value { color: var(--accent); }
.rx-stat__foot {
  font-size: 11px; color: var(--rx-ink-muted);
  display: flex; align-items: center; gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--rx-line);
}
.rx-stat--total    { --accent: var(--rx-teal-500); }
.rx-stat--low      { --accent: #d97706; }
.rx-stat--expiring { --accent: #ca8a04; }
.rx-stat--expired  { --accent: #dc2626; }

/* ============================================================================
 * ACTION CARDS (saturated per-action color)
 * ============================================================================ */
.rx-actions { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.rx-action {
  --bg: var(--rx-c1);
  --bg-2: color-mix(in srgb, var(--bg) 78%, black);
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(140deg, var(--bg) 0%, var(--bg-2) 100%);
  color: #fff;
  border-radius: var(--rx-radius-tile);
  padding: 26px 24px 22px;
  text-decoration: none; min-height: 200px;
  overflow: hidden; isolation: isolate;
  box-shadow: 0 14px 32px -16px color-mix(in srgb, var(--bg) 70%, transparent);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s;
}
.rx-action::before {
  content: ''; position: absolute;
  inset-inline-end: -50px; top: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  z-index: -1; transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.rx-action::after {
  content: ''; position: absolute;
  inset-inline-start: -40px; bottom: -40px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(0,0,0,.10);
  z-index: -1; transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.rx-action:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: 0 22px 44px -16px color-mix(in srgb, var(--bg) 75%, transparent);
  color: #fff;
}
.rx-action:hover::before { transform: scale(1.25) translate(20px, -20px); }
.rx-action:hover::after  { transform: scale(1.25) translate(-12px, 16px); }
.rx-action__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.rx-action__num {
  font-family: 'Bricolage Grotesque', monospace;
  font-size: 13px; font-weight: 700; letter-spacing: .15em;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 12px; border-radius: var(--rx-radius-pill);
  backdrop-filter: blur(4px);
}
.rx-action__icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  backdrop-filter: blur(8px);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.rx-action:hover .rx-action__icon { transform: rotate(-6deg) scale(1.08); }
.rx-action__title { font-family: 'Vazirmatn', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }
.rx-action__desc { font-size: 13px; color: rgba(255,255,255,.82); line-height: 1.5; margin-bottom: 14px; }
.rx-action__cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.92);
  padding-top: 10px; border-top: 1px dashed rgba(255,255,255,.22);
}
.rx-action__cta i { transition: transform .3s; }
.rx-action:hover .rx-action__cta i { transform: translateX(-6px); }

.rx-action--sell      { --bg: var(--rx-c1); }
.rx-action--add       { --bg: var(--rx-c2); }
.rx-action--batches   { --bg: var(--rx-c3); }
.rx-action--supp      { --bg: var(--rx-c4); }
.rx-action--ledger    { --bg: var(--rx-c5); }
.rx-action--sales     { --bg: var(--rx-c6); }
.rx-action--medicines { --bg: var(--rx-c7); }
.rx-action--admin     { --bg: var(--rx-c8); }

/* ============================================================================
 * PAGE CARD (generic content surfaces)
 * ============================================================================ */
.rx-card {
  background: #fff;
  border-radius: var(--rx-radius-card);
  padding: 26px;
  border: 1px solid var(--rx-line);
  box-shadow: 0 1px 0 rgba(15,31,30,.02), 0 10px 24px -16px rgba(15,31,30,.12);
}
.rx-card + .rx-card { margin-top: 18px; }
.rx-card__head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.rx-card__title {
  font-family: 'Bricolage Grotesque', 'Vazirmatn', sans-serif;
  font-size: 18px; font-weight: 700; color: var(--rx-teal-900); margin: 0;
}

/* ============================================================================
 * FORMS
 * ============================================================================ */
.rx-field { display: flex; flex-direction: column; gap: 6px; }
.rx-field label { font-size: 12px; font-weight: 600; color: var(--rx-ink-muted); }
.rx-field label .req { color: #dc2626; }
.rx-input, .rx-select, .rx-textarea {
  font-family: inherit; font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--rx-line);
  border-radius: 10px;
  background: #fff;
  color: var(--rx-ink);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.rx-input:focus, .rx-select:focus, .rx-textarea:focus {
  outline: none;
  border-color: var(--rx-teal-500);
  box-shadow: 0 0 0 4px rgba(20, 116, 111, 0.12);
}
.rx-textarea { resize: vertical; min-height: 80px; }
.rx-grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rx-grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* Buttons */
.rx-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 18px;
  border: none; border-radius: 12px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.rx-btn--primary { background: var(--rx-teal-700); color: #fff; box-shadow: 0 8px 20px -10px rgba(15, 76, 74, 0.45); }
.rx-btn--primary:hover { background: var(--rx-teal-900); color: #fff; transform: translateY(-1px); }
.rx-btn--accent  { background: var(--rx-c1); color: #fff; }
.rx-btn--accent:hover { background: color-mix(in srgb, var(--rx-c1) 80%, black); transform: translateY(-1px); color: #fff; }
.rx-btn--ghost {
  background: #fff; color: var(--rx-teal-900);
  border: 1px solid var(--rx-line);
}
.rx-btn--ghost:hover { background: var(--rx-paper-2); }
.rx-btn--danger { background: #dc2626; color: #fff; }
.rx-btn--danger:hover { background: #991b1b; color: #fff; }
.rx-btn--sm { font-size: 12px; padding: 6px 12px; border-radius: 8px; }

/* Tables */
.rx-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--rx-line); background: #fff; }
.rx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rx-table th {
  text-align: start;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rx-ink-muted);
  padding: 12px 14px;
  background: var(--rx-paper-2);
  border-bottom: 1px solid var(--rx-line);
}
.rx-table td { padding: 11px 14px; border-bottom: 1px solid var(--rx-line); vertical-align: top; }
.rx-table tr:last-child td { border-bottom: 0; }
.rx-table tr:hover td { background: #fbfaf6; }

/* Badges */
.rx-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--rx-radius-pill);
  background: var(--rx-paper-2); color: var(--rx-ink);
  border: 1px solid var(--rx-line);
}
.rx-badge--ok { background: #dcfce7; color: #166534; border-color: #86efac; }
.rx-badge--warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.rx-badge--danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.rx-badge--info { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }

/* Alerts */
.rx-alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.rx-alert--success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.rx-alert--error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.rx-alert--info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.rx-alert--warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Footer credit */
.rx-credit {
  text-align: center;
  color: var(--rx-ink-muted);
  font-size: 11px;
  padding: 22px 0 14px;
  letter-spacing: .04em;
}
.rx-credit b { color: var(--rx-teal-900); }

/* Animations */
@keyframes rxFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rx-animate > * { animation: rxFadeUp .6s cubic-bezier(.2,.8,.2,1) both; }
.rx-animate > *:nth-child(1) { animation-delay: 0ms; }
.rx-animate > *:nth-child(2) { animation-delay: 80ms; }
.rx-animate > *:nth-child(3) { animation-delay: 140ms; }
.rx-animate > *:nth-child(4) { animation-delay: 200ms; }
.rx-animate > *:nth-child(5) { animation-delay: 260ms; }
.rx-animate > *:nth-child(6) { animation-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .rx-animate > *, .rx-stat, .rx-action { animation: none; transition: none; }
}
