@font-face {
  font-family: "Vazirmatn";
  src: url("Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ink: #16181b;
  --bg: #f3f1ed;
  --card: #fff;
  --line: #e2ddd3;
  --muted: #6a6d72;
  --brass: #c09434;
  --brass-lo: #8a6721;
  --red: #b3402f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Vazirmatn", Tahoma, sans-serif; background: var(--bg); color: #1d1e20; line-height: 1.8; font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.4; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; background: linear-gradient(180deg, #e6c77e, var(--brass)); color: #1b1408;
  transition: filter .2s, opacity .2s;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn--ghost { background: #fff; border-color: #cfc8ba; color: #333; }
.btn--text { background: none; color: var(--red); }
.btn--add { width: 100%; background: transparent; border: 1.5px dashed #c8c0b0; color: var(--brass-lo); height: 48px; }
.btn--add:hover { border-color: var(--brass); background: #fffaf0; }

/* ورود */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(800px 500px at 50% 0, rgba(192, 148, 52, .18), transparent 60%), var(--ink); }
.login__box { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 32px 28px; display: grid; gap: 14px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.login__box img { margin: 0 auto; }
.login__box h1 { font-size: 20px; }
.login__box p { margin: 0; color: var(--muted); font-size: 14px; }
.login__box .note { background: #fff7e3; color: #6e5317; padding: 10px; border-radius: 10px; }
.login__box label { display: grid; gap: 6px; text-align: right; font-weight: 600; font-size: 14px; }
.login__box input { padding: 11px 14px; border-radius: 10px; border: 1px solid #d6d0c4; }
.login__box input:focus { outline: 2px solid rgba(192, 148, 52, .4); border-color: var(--brass); }
.login__box .err { color: var(--red); }
.login__box .btn { height: 48px; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; }

/* چیدمان پنل */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #d7d8db; padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 8px 14px; border-bottom: 1px solid #2a2d32; }
.side__brand img { border-radius: 9px; }
.side__brand span { display: flex; flex-direction: column; font-weight: 800; color: #fff; line-height: 1.4; }
.side__brand small { font-weight: 400; color: #8c8f95; font-size: 12px; }
#tabs { display: flex; flex-direction: column; gap: 2px; }
#tabs button { text-align: right; border: 0; background: none; padding: 9px 12px; border-radius: 8px; color: #b9bbc0; display: flex; justify-content: space-between; align-items: center; }
#tabs button:hover { background: #22252a; color: #fff; }
#tabs button.is-on { background: rgba(230, 199, 126, .14); color: #e6c77e; }
#tabs b { background: var(--red); color: #fff; font-size: 12px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; }
.side__out { margin-top: auto; padding: 9px 12px; color: #8c8f95; text-decoration: none; font-size: 14px; }
.side__out:hover { color: #fff; }

.main { min-width: 0; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(243, 241, 237, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar h1 { font-size: 19px; }
.bar__state { margin-inline-start: auto; color: #a06a00; font-size: 13px; }
.bar__menu { display: none; border: 0; background: #fff; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.content { padding: 24px 28px 80px; max-width: 1000px; display: grid; gap: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.card h2 { font-size: 17px; margin-bottom: 4px; }
.card .desc { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid.inner { grid-column: span 1; }
.field { display: grid; gap: 5px; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 13.5px; font-weight: 600; color: #44464a; }
.field small { color: var(--muted); font-size: 12.5px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid #d6d0c4; background: #fcfbf9; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(192, 148, 52, .15); background: #fff; }
.field input[type="color"] { height: 42px; padding: 4px; }

.img-prev { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #efebe4; display: grid; place-items: center; border: 1px solid var(--line); }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-prev span { color: #a19b90; font-size: 13px; }
.img-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.list { display: grid; gap: 12px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; background: #fdfcfa; }
.item__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.item__head strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__tools { display: flex; gap: 4px; flex-shrink: 0; }
.item__tools button { border: 1px solid var(--line); background: #fff; border-radius: 7px; height: 30px; min-width: 30px; padding: 0 8px; font-size: 13px; }
.item__tools button:disabled { opacity: .35; cursor: default; }
.item__tools .del { color: var(--red); }
.empty { color: var(--muted); margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { text-align: right; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 2px; transition: border-color .2s; }
.tile:hover { border-color: var(--brass); }
.tile b { font-size: 28px; }
.tile span { color: var(--muted); font-size: 13.5px; }
.warn { background: #fff7e3; color: #6e5317; padding: 10px 14px; border-radius: 10px; margin: 8px 0 12px; }
.help { margin: 8px 0 0; padding-inline-start: 20px; color: #44464a; }

.msg { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; display: grid; gap: 10px; }
.msg.unread { border-inline-start: 4px solid var(--brass); }
.msg header { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.msg header strong { font-size: 16px; }
.msg header a { color: var(--brass-lo); font-weight: 700; text-decoration: none; }
.msg header time { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.msg dl { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; font-size: 14px; }
.msg dl div { display: flex; gap: 6px; }
.msg dt { color: var(--muted); }
.msg dd { margin: 0; font-weight: 600; }
.msg p { margin: 0; white-space: pre-wrap; background: #faf8f4; padding: 10px 12px; border-radius: 9px; }
.msg__img img { max-width: 220px; border-radius: 10px; border: 1px solid var(--line); }
.msg footer { display: flex; gap: 8px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 16px; }
.photo-grid .field > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.row-actions a { text-decoration: none; }
.mini-reqs { display: grid; gap: 8px; margin-bottom: 14px; }
.mini-req {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: right;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fdfcfa;
}
.mini-req.unread { border-inline-start: 4px solid var(--brass); background: #fffaf0; }
.mini-req span { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-req time { color: var(--muted); font-size: 12.5px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bulk__msg { color: var(--brass-lo); font-weight: 600; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1f6b43; color: #fff; padding: 10px 20px; border-radius: 10px; z-index: 100; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); }
.toast.bad { background: var(--red); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; right: 0; width: 260px; z-index: 30; transform: translateX(100%); transition: transform .25s; box-shadow: -10px 0 40px rgba(0, 0, 0, .4); }
  .side.open { transform: none; }
  .bar { padding: 10px 16px; }
  .bar__menu { display: block; }
  .bar h1 { font-size: 16px; }
  .bar__state { display: none; }
  .bar .btn { margin-inline-start: auto; padding: 0 14px; }
  .content { padding: 16px 16px 80px; }
  .grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .mini-req { grid-template-columns: 1fr; gap: 2px; }
}
