:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #10203a;
  --muted: #6b7a90;
  --line: #e3e8f0;
  --brand: #134e7f;
  --brand-2: #1d6fb8;
  --accent: #f39c12;
  --ok: #12805c;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 58, .06), 0 8px 24px rgba(16, 32, 58, .06);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, "Iranian Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; padding-inline: clamp(24px, 5vw, 140px); margin-inline: auto; }

/* ---------- header ---------- */
.topbar {
  background: linear-gradient(135deg, #0d2f4f, #134e7f 55%, #1a639f);
  color: #fff;
  box-shadow: 0 2px 14px rgba(13, 47, 79, .25);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 74px; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; white-space: nowrap; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, #ffb84d, var(--accent));
  color: #3a2400; font-weight: 800; display: grid; place-items: center; font-size: 19px;
}
.brand-text strong { font-weight: 800; color: #ffb84d; }

.search { flex: 1; display: flex; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; overflow: hidden; }
.search input { flex: 1; border: 0; background: transparent; color: #fff; padding: 11px 16px; font: inherit; outline: none; }
.search input::placeholder { color: rgba(255, 255, 255, .65); }
.search button { border: 0; background: rgba(255, 255, 255, .14); color: #fff; padding: 0 16px; cursor: pointer; display: grid; place-items: center; }
.search button:hover { background: rgba(255, 255, 255, .24); }

.cart-link { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px; background: rgba(255, 255, 255, .1); white-space: nowrap; }
.cart-link:hover { background: rgba(255, 255, 255, .18); }
.badge { background: var(--accent); color: #2c1a00; border-radius: 999px; padding: 0 8px; font-size: 12px; }

/* ---------- layout ---------- */
.main { padding-block: 28px 60px; min-height: 60vh; }

.hero {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: center;
  background: linear-gradient(120deg, #ffffff, #eef4fb);
  border: 1px solid var(--line); border-radius: 22px; padding: 34px 38px; margin-bottom: 34px;
  box-shadow: var(--shadow);
}
.pill { display: inline-block; background: #e8f1fb; color: var(--brand); border-radius: 999px; padding: 4px 14px; font-size: 12.5px; margin-bottom: 12px; }
.hero h1 { font-size: 34px; line-height: 1.45; margin: 0 0 12px; letter-spacing: -.3px; }
.hero p { color: var(--muted); margin: 0 0 22px; max-width: 56ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: grid; gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; display: flex; align-items: baseline; justify-content: space-between; }
.stat b { font-size: 22px; color: var(--brand); }
.stat span { color: var(--muted); font-size: 13px; }

.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; margin: 0; }
.more { color: var(--brand-2); font-size: 13.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; display: flex; gap: 8px; align-items: center; font-size: 13.5px; transition: .15s; }
.chip b { color: var(--muted); font-size: 12px; font-weight: 400; }
.chip:hover { border-color: var(--brand-2); color: var(--brand-2); transform: translateY(-1px); }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: .18s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: #cdd9e8; }
.card-img { aspect-ratio: 4 / 3; background: #eef2f7; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.3em; }
.card-title:hover { color: var(--brand-2); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.code { color: var(--muted); font-size: 12px; direction: ltr; }
.stock { font-size: 11.5px; border-radius: 999px; padding: 2px 10px; }
.stock.in { background: #e7f6ef; color: var(--ok); }
.stock.out { background: #fdeaea; color: var(--danger); }
.stock.unknown { background: #eef2f7; color: #5b6b80; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-weight: 700; color: var(--brand); font-size: 15px; }
.unit { font-size: 11px; font-weight: 400; color: var(--muted); }
.price-date { font-size: 10.5px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 18px; font: inherit; font-size: 14px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: #b9c7d8; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(19, 78, 127, .25); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.link { background: none; border: 0; color: var(--brand-2); cursor: pointer; font: inherit; padding: 0; }
.link.danger { color: var(--danger); }

/* ---------- list page ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; margin: 6px 0; }
.breadcrumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.breadcrumb a:hover { color: var(--brand-2); }

.layout { display: grid; grid-template-columns: 250px 1fr; gap: 26px; align-items: start; }
.sidebar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; position: sticky; top: 92px; }
.sidebar h3 { font-size: 14px; margin: 4px 6px 12px; color: var(--muted); font-weight: 600; }
.cat-list { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow: auto; }
.cat-list a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; }
.cat-list a:hover { background: #f1f5fa; }
.cat-list a.active { background: #e8f1fb; color: var(--brand); font-weight: 600; }
.cnt { color: var(--muted); font-size: 11.5px; }

.toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.toolbar label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
select, input[type="text"], input[type="tel"], input[type="number"], textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29, 111, 184, .12); }

.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 26px; font-size: 13.5px; }.pager a { border: 1px solid var(--line); background: #fff; padding: 7px 16px; border-radius: 9px; }
.pager a:hover { border-color: var(--brand-2); color: var(--brand-2); }

.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 46px; text-align: center; color: var(--muted); }

/* ---------- list rows ---------- */
.items { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.items-head, .row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 175px 215px; gap: 14px; align-items: center; }
.items-head { padding: 10px 16px; background: #f7f9fc; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; }
.row { padding: 11px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:hover { background: #f8fafd; }
.row-main { min-width: 0; }
.row-title { font-size: 13.5px; font-weight: 600; line-height: 1.7; display: block; }
.row-title:hover { color: var(--brand-2); }
.row-meta { display: flex; gap: 14px; margin-top: 2px; font-size: 11.5px; }
.row-cell { font-size: 13px; }
.row-price { font-weight: 700; color: var(--brand); }
.row-action form { margin: 0; }
.row-add { display: flex; gap: 8px; align-items: center; justify-content: flex-start; }
.stepper { display: flex; align-items: center; gap: 4px; }
.step { width: 30px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font: inherit; font-size: 17px; line-height: 1; color: var(--brand); display: grid; place-items: center; padding: 0; }
.step:hover { background: #eef4fb; border-color: #b9c7d8; }
.qty-input { width: 48px; height: 34px; padding: 0; text-align: center; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13.5px; background: #fff; color: var(--ink); -moz-appearance: textfield; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row-action .btn { flex: 0 0 auto; white-space: nowrap; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); background: #12805c; color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .items-head { display: none; }
  .row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .row-main { grid-column: 1; }
  .row-stock { grid-column: 1; }
  .row-price { grid-column: 1; }
  .row-action { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- product ---------- */
.product { display: grid; grid-template-columns: 1fr; gap: 22px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); margin: 14px 0 34px; }
.product-media { border-radius: 14px; overflow: hidden; background: #eef2f7; align-self: start; }
.product-info h1 { font-size: 24px; line-height: 1.6; margin: 0 0 12px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.product-meta b { color: var(--ink); font-weight: 600; }

.buybox { background: #f8fafd; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.buybox-price { flex: 1 1 240px; }
.buybox-price .label { font-size: 12.5px; color: var(--muted); }
.amount { font-size: 26px; font-weight: 800; color: var(--brand); }
.add-form { display: flex; gap: 12px; align-items: flex-end; flex: 0 0 auto; }
.add-form label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.add-form input { width: 90px; }
.add-form .btn { flex: 0 0 auto; min-width: 200px; }

.notes { margin-top: 18px; font-size: 13px; color: var(--muted); }
.notes p { margin: 4px 0; }

.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 13.5px; }
.alert.ok { background: #e7f6ef; color: #0c6b4c; }
.alert.warn { background: #fff7e8; color: var(--warn); }
.alert a { text-decoration: underline; }

/* ---------- cart / checkout ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 13px 14px; text-align: right; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.table thead th { background: #f7f9fc; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: #f7f9fc; font-weight: 700; }
.qty { width: 76px; text-align: center; }

.cart-actions { display: flex; gap: 10px; margin-top: 16px; }

.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 92px; }
.summary h3 { margin: 0 0 14px; font-size: 16px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; }
.summary .row.total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 14px; font-size: 15px; }
.summary .row.total b { color: var(--brand); font-size: 17px; }
.summary .btn { margin-top: 16px; }

.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
.form input, .form textarea { width: 100%; }
.form .btn { margin-top: 6px; }

/* ---------- order success ---------- */
.success { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 34px; text-align: center; box-shadow: var(--shadow); margin-bottom: 30px; }
.check { width: 62px; height: 62px; border-radius: 50%; background: #e7f6ef; color: var(--ok); font-size: 30px; display: grid; place-items: center; margin: 0 auto 14px; }
.success h1 { margin: 0 0 8px; font-size: 24px; }
.tracking { direction: ltr; display: inline-block; background: #eef4fb; color: var(--brand); padding: 3px 14px; border-radius: 8px; letter-spacing: .5px; }

.order-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 20px 0 24px; }
.order-meta div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; gap: 4px; }
.order-meta span { font-size: 12px; color: var(--muted); }
.order-meta b { font-size: 13.5px; font-weight: 600; }

/* ---------- error ---------- */
.error-page { text-align: center; padding: 70px 20px; }
.error-page .code { font-size: 64px; font-weight: 800; color: #dbe4ef; line-height: 1; }
.error-page h1 { margin: 10px 0; }

/* ---------- footer ---------- */
.footer { background: #0d2338; color: #c9d6e5; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; padding: 30px 0 22px; }
.footer strong { color: #fff; font-size: 16px; }
.footer p { margin: 6px 0 0; font-size: 13px; color: #93a7bd; }
.footer-links { display: flex; gap: 20px; font-size: 13.5px; align-items: center; }
.footer-links a:hover { color: #fff; }
.copyright { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 0 20px; font-size: 12px; color: #7d92aa; }

@media (max-width: 980px) {
  .hero, .product, .layout, .form-row { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .summary { position: static; }
  .hero h1 { font-size: 26px; }
  .topbar-inner { height: auto; padding: 12px 0; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .cart-link span { display: none; }
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag { background: #e8f1fb; color: var(--brand); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; display: inline-flex; gap: 8px; align-items: center; }
.tag a { color: var(--brand); font-weight: 700; }

/* ---------- landing / auth ---------- */
.landing-hero { background: linear-gradient(120deg, #ffffff, #eef4fb); border: 1px solid var(--line); border-radius: 22px; padding: 34px 38px; margin-bottom: 26px; box-shadow: var(--shadow); }
.landing-hero h1 { font-size: 32px; margin: 10px 0 12px; }
.landing-hero p { color: var(--muted); max-width: 70ch; margin: 0; }

.auth-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 22px; margin-bottom: 26px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 18px; margin: 0 0 6px; }
.form-plain { display: grid; gap: 14px; margin-top: 14px; }
.form-plain label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form-plain input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; }
.form-plain input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29,111,184,.12); outline: none; }
.form-plain .btn { margin-top: 4px; }

.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.step-card b { width: 30px; height: 30px; border-radius: 50%; background: #e8f1fb; color: var(--brand); display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; }

/* ---------- header user ---------- */
.guest-actions { display: flex; gap: 8px; margin-inline-start: auto; }
.guest-actions .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.guest-actions .btn-primary { background: var(--accent); border-color: transparent; color: #2c1a00; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.link-btn { background: none; border: 0; color: #ffd08a; cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- admin ---------- */
.admin-login { max-width: 420px; margin: 40px auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.admin-login h1 { font-size: 20px; margin: 0 0 6px; }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.users-head, .users-row { display: grid; grid-template-columns: minmax(0,1fr) 150px 130px 190px; gap: 14px; align-items: center; }
.user-actions { display: flex; gap: 8px; }
.user-actions form { margin: 0; }

@media (max-width: 900px) {
  .auth-grid, .landing-steps { grid-template-columns: 1fr; }
  .users-head { display: none; }
  .users-row { grid-template-columns: 1fr auto; }
}

/* ---------- brand logo ---------- */
.brand-logo { height: 52px; width: auto; display: block; }
.brand { display: flex; align-items: center; gap: 10px; }
@media (max-width: 520px) { .brand-logo { height: 28px; } }

.brand-mark-img { height: 34px; width: 34px; display: block; opacity: .95; }
.brand-name { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
/* ---------- landing background ---------- */
.landing-hero {
  position: relative;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  padding: 56px 48px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background-image:
    linear-gradient(to left, rgba(7,16,29,.95) 0%, rgba(7,16,29,.86) 42%, rgba(7,16,29,.30) 100%),
    url('/landing-bg.webp');
  background-size: cover;
  background-position: left center;
  box-shadow: 0 22px 55px rgba(7,16,29,.28);
}
.landing-hero h1 { color: #fff; font-size: 34px; line-height: 1.5; margin: 12px 0 14px; max-width: 24ch; }
.landing-hero p { color: rgba(255,255,255,.82); max-width: 58ch; line-height: 2; }
.landing-hero .pill { background: rgba(255,255,255,.13); color: #fff; border: 1px solid rgba(255,255,255,.2); }

@media (max-width: 760px) {
  .landing-hero { padding: 34px 22px; min-height: 340px; background-image: linear-gradient(to bottom, rgba(7,16,29,.72), rgba(7,16,29,.95)), url('/landing-bg.webp'); }
  .landing-hero h1 { font-size: 25px; }
}
/* ---------- admin entry on landing ---------- */
.admin-entry-wrap { display: flex; justify-content: center; margin: 2px 0 30px; }
.admin-entry { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; transition: .15s; }
.admin-entry svg { opacity: .8; }
.admin-entry:hover { color: var(--brand); border-color: #c4d3e4; background: #f8fbff; }
.admin-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: rgba(255,255,255,.72); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); transition: .15s; }
.admin-icon:hover { color: #fff; background: rgba(255,255,255,.16); }
/* ---------- admin roles ---------- */
.users-head, .users-row { grid-template-columns: minmax(0,1fr) 130px 110px 130px 250px; }
.user-actions { flex-wrap: wrap; row-gap: 6px; }
.promote-form { display: flex; gap: 6px; align-items: center; }
.mini-input { width: 110px; padding: 6px 8px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
@media (max-width: 1100px) {
  .users-head { display: none; }
  .users-row { grid-template-columns: 1fr 1fr; }
}
/* ---------- roles ---------- */
.users-head, .users-row { grid-template-columns: minmax(0,1fr) 120px 100px 100px 330px; }
.role-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mini-select { padding: 6px 8px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.role-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.role-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 11.5px; color: var(--muted); }
.role-chip b { color: var(--brand); font-weight: 600; margin-inline-end: 4px; }
@media (max-width: 1180px) {
  .users-head { display: none; }
  .users-row { grid-template-columns: 1fr 1fr; }
}
/* ---------- price alert & settings ---------- */
.price-alert { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.price-alert b { color: #8a4b00; }
.settings-actions { display: flex; gap: 8px; align-items: center; }
.settings-actions form { margin: 0; }
.settings-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.settings-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.settings-row b { font-weight: 600; }
.text-warn { color: #b45309; }
.text-ok { color: #12805c; }
.settings-form { margin-top: 18px; max-width: 320px; }
/* ---------- user detail / admin powers ---------- */
.settings-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.settings-form input, .settings-form select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13.5px; background: #fff; color: var(--ink); }
.settings-sep { border: 0; border-top: 1px dashed var(--line); margin: 18px 0; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f0c9c9; }
.btn-danger:hover { background: #fdf2f2; border-color: var(--danger); }
/* ---------- price status flags ---------- */
.price-flag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.price-flag.ok { background: #e7f6ef; color: #12805c; }
.price-flag.bad { background: #fdeaea; color: #b91c1c; animation: flagBlink 1.2s ease-in-out infinite; }
.price-flag.none { background: #eef2f7; color: #5b6b80; }
@keyframes flagBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .price-flag.bad { animation: none; } }
/* ---------- price status line ---------- */
.price-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.price-status .price-date { margin-top: 0; }
.step:disabled, .qty-input:disabled { opacity: .45; cursor: not-allowed; }
/* ---------- orders desk ---------- */
.orders-head, .orders-row { grid-template-columns: minmax(0,1fr) 90px 160px 130px 90px; }
.order-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; }
.st-pending { background: #fff4e5; color: #a35f00; }
.st-approved { background: #e7f6ef; color: #12805c; }
.st-rejected { background: #fdeaea; color: #b91c1c; }
.st-invoiced { background: #e8f1fb; color: #1d4f8b; }
.active-tag { background: #e8f1fb; border-color: #b9d3ee; color: var(--brand); }
.order-edit-head, .order-edit-row { grid-template-columns: minmax(0,1fr) 100px 90px 80px 80px 130px; }
.order-edit-row .qty-input { width: 70px; }
.order-actions { display: flex; align-items: center; gap: 16px; margin: 16px 0 22px; }
.order-decision { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.reject-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.order-card { margin-bottom: 18px; }
@media (max-width: 900px) {
  .orders-head, .order-edit-head { display: none; }
  .orders-row, .order-edit-row { grid-template-columns: 1fr 1fr; }
}
/* ---------- account ---------- */
.account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.account-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 6px; }
.account-card span { font-size: 12.5px; color: var(--muted); }
.account-card b { font-size: 19px; color: var(--brand); }
@media (max-width: 820px) { .account-grid { grid-template-columns: 1fr; } }
/* ---------- settings page ---------- */
.site-notice { background: #fff8e6; color: #7a5200; text-align: center; padding: 10px 16px; font-size: 13.5px; border-bottom: 1px solid #f0e0b8; }
.settings-page { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.settings-page .settings-card { margin: 0; }
.settings-page h2 { font-size: 16px; margin: 0 0 14px; color: var(--brand); }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 13px; color: #33465c; }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid #cfe0f3; border-color: #9dc0e6; }
.field-wide { grid-column: 1 / -1; }
.field.checkbox { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.field.checkbox span { font-size: 13.5px; }
.field.readonly b { font-size: 15px; color: var(--brand); }
.settings-save { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; grid-column: 1 / -1; }
@media (max-width: 760px) { .settings-grid { grid-template-columns: 1fr; } }
/* ---------- finance ---------- */
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 26px; }
.fin-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.fin-card span { font-size: 12.5px; color: var(--muted); }
.fin-card b { font-size: 18px; color: var(--brand); }
.fin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.fin-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
.fin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fin-columns .section { margin: 0 0 20px; }
@media (max-width: 900px) { .fin-columns { grid-template-columns: 1fr; } }
/* ---------- voice typing ---------- */
.voice-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.mic-btn { display: inline-flex; align-items: center; gap: 12px; padding: 16px 26px; border-radius: 14px; border: 1px solid var(--line); background: #f7fafd; color: var(--brand); font: inherit; font-size: 16px; cursor: pointer; transition: background .15s; }
.mic-btn:hover { background: #eef4fb; }
.mic-btn.on { background: #fdeaea; border-color: #f3b4b4; color: #b91c1c; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(185,28,28,.18); } 50% { box-shadow: 0 0 0 12px rgba(185,28,28,0); } }
.voice-text { width: 100%; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; font: inherit; line-height: 2; resize: vertical; background: #fbfdff; color: var(--ink); }
.voice-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- CRM ---------- */
.crm-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 22px; }
.crm-nav a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #33465c; font-size: 13.5px; }
.crm-nav a:hover { background: #eef4fb; }
.crm-nav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.crm-funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.crm-stage { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.crm-stage span { font-size: 12.5px; color: var(--muted); }
.crm-stage b { font-size: 20px; color: var(--brand); }
.inline-form { display: inline-block; margin: 0; }
.inline-form select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; background: #fff; }
.crm-actions { display: flex; gap: 6px; }
.row-done b, .row-done .muted { opacity: .55; text-decoration: line-through; }
/* ---------- ERP ---------- */
.search-bar { display: flex; gap: 10px; margin: 0 0 20px; }
.search-bar input { flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: #fff; }
.field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; direction: ltr; text-align: left; }
/* صفحه‌های محتوایی */
.content-page { display: grid; gap: 1rem; max-width: 900px; margin: 0 auto; }
.content-page .card { padding: 1.25rem 1.5rem; }
.content-page h2 { margin-top: 0; font-size: 1.1rem; }
.content-page p { line-height: 2; margin: .5rem 0; }
.content-page ul { line-height: 2; padding-inline-start: 1.2rem; margin: .5rem 0; }
.content-page li { margin-bottom: .35rem; }

/* داشبورد مدیریتی */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.dash-kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { color: var(--muted); font-size: 12.5px; }
.kpi-value { font-size: 20px; color: var(--brand); }
.kpi-sub { color: var(--muted); font-size: 12px; }
.dash-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.dash-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.dash-panel h2 { font-size: 15px; margin: 0 0 12px; }
.dash-chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 8px; }
.dash-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.dash-bar { width: 100%; max-width: 26px; background: linear-gradient(180deg, #3aa0ff, #1e63b8); border-radius: 6px 6px 0 0; min-height: 3px; }
.dash-bar-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dash-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dash-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.dash-list li:last-child { border-bottom: 0; }
.dash-rank { padding-inline-start: 1.1rem; display: grid; gap: 8px; font-size: 13.5px; margin: 0; }
.dash-rank li span { font-weight: 600; }
.dash-rank li b { color: var(--brand); margin-inline-start: 8px; }
.dash-rank li i { color: var(--muted); font-style: normal; font-size: 12px; margin-inline-start: 8px; }


/* داشبورد — نسخهٔ کامل */
.dash-tabs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-export { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.dash-export a { text-decoration: underline; }
.delta { font-style: normal; font-size: 11.5px; margin-inline-start: 6px; }
.delta.up { color: #0c6b4c; }
.delta.down { color: #b3261e; }
.dash-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dash-queue a { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fc; }
.dash-queue a b { font-size: 20px; color: var(--brand); }
.dash-queue a span { font-size: 12.5px; color: var(--muted); }
.dash-funnel { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dash-funnel li { display: grid; grid-template-columns: 1fr 90px 34px; gap: 8px; align-items: center; font-size: 12.5px; }
.funnel-bar { background: #eef2f7; border-radius: 6px; height: 10px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3aa0ff, #1e63b8); }
.usage { background: #eef2f7; border-radius: 6px; height: 8px; overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; margin-inline-end: 6px; }
.usage i { display: block; height: 100%; background: #f0a02a; }
.dash-activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 12.5px; }
.dash-activity li { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.dash-activity i { grid-column: 1 / -1; color: var(--muted); font-style: normal; font-size: 11.5px; }

/* مکاتبه و وظایف داخلی */
.section-title { font-size: 15px; margin: 22px 0 10px; }
.thread { display: grid; gap: 10px; margin-bottom: 18px; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.msg.mine { background: #eef6ff; border-color: #cfe3f8; }
.msg-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.msg-body { white-space: pre-wrap; line-height: 1.9; font-size: 14px; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; }
.form-card label { display: grid; gap: 6px; font-size: 13px; }
.form-card input, .form-card select, .form-card textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; }
.badge-new, .badge-done, .badge-late, .badge-open { font-size: 11px; border-radius: 999px; padding: 3px 9px; }
.badge-new { background: #1e63b8; color: #fff; }
.badge-done { background: #e7f6ef; color: #0c6b4c; }
.badge-late { background: #fdecea; color: #b3261e; }
.badge-open { background: #fff7e8; color: #a76a00; }
.inbox-row, .task-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; }
.dash-target { display: flex; flex-direction: column; gap: 8px; }
.dash-target .bar { height: 12px; background: #eef2f7; border-radius: 8px; overflow: hidden; }
.dash-target .bar i { display: block; height: 100%; background: linear-gradient(90deg, #3aa0ff, #1e63b8); }

/* نشان نمایندگی ایساکو */
.dealer-badge { width: fit-content; display: inline-flex; align-items: center; gap: 8px; background: #f4f7fb; border: 1px solid #e2eaf3; color: #4a5a6a; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; margin: 10px 0 0; text-decoration: none; }
.dealer-badge img { width: 20px; height: 20px; opacity: .85; }
.dealer-badge b { font-weight: 700; color: #1f3f66; letter-spacing: .5px; }

.isaco-mark { font: 700 10px/1 Arial, sans-serif; letter-spacing: .6px; background: #0b4ea2; color: #fff; padding: 4px 6px; border-radius: 5px; }

.isaco-shield { height: 20px; width: auto; border-radius: 4px; }


/* شبکه‌های اجتماعی */
.social-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.social-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: #2a3a4a; background: #fff; text-decoration: none; }
.social-btn:hover { border-color: #cdd9e8; box-shadow: var(--shadow); }
.social-btn.instagram svg { color: #c13584; }
.social-btn.telegram svg { color: #229ed9; }
.social-btn.rubika svg { color: #0b4ea2; }

/* پیوند نقشه */
.map-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; }
.map-link:hover { color: var(--brand-2); }
.map-link svg { flex: 0 0 auto; }
