@font-face { font-family: Vazirmatn; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* رنگ‌های سازمانی جانزی (از فایل هویت بصری) */
:root {
  --janzi-purple: #490144;
  --janzi-magenta: #ae1e55;
  --janzi-plum: #712768;
  --janzi-rose: #c9839f;
  --janzi-blush: #efb4cc;

  --bg: #f8f5f7;
  --surface: #ffffff;
  --ink: #2a1a28;
  --ink-2: #6e5d6b;
  --line: #ebe1e8;
  --brand: var(--janzi-purple);
  --brand-ink: #ffffff;
  --brand-soft: #f4e9f2;
  --accent: var(--janzi-magenta);
  --accent-soft: #fbe8ef;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --ok-soft: #e7f3e8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(73, 1, 68, .06), 0 4px 16px rgba(73, 1, 68, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Vazirmatn, Tahoma, sans-serif; font-size: 16px; line-height: 1.7;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5rem; }
h1 { font-size: 1.35rem; }
.muted { color: var(--ink-2); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* سربرگ */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; }
.logo img { height: 30px; width: auto; display: block; }
.auth .logo img { height: 52px; }
.topbar { border-top: 3px solid var(--janzi-magenta); }
.tile.primary { background: linear-gradient(135deg, var(--janzi-purple), var(--janzi-magenta)); }
.topbar .spacer { flex: 1; }
.who { text-align: left; font-size: .85rem; line-height: 1.3; }
.who strong { display: block; font-size: .95rem; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }

main.wrap { padding-top: 24px; padding-bottom: 48px; }
::placeholder { color: var(--ink-2); opacity: .55; }

/* پیام‌ها */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; background: var(--ok-soft); }
.flash.error { background: var(--danger-soft); }
.flash.info { background: var(--brand-soft); }

/* داشبورد */
.hello { margin-bottom: 20px; }
.hello .date { color: var(--ink-2); font-size: .95rem; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 12px; align-items: flex-start; color: var(--ink);
  box-shadow: var(--shadow); min-height: 88px; position: relative;
}
a.tile:hover { border-color: var(--brand); }
.tile .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.tile.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tile.primary .ic { background: rgba(255,255,255,.18); color: var(--brand-ink); }
.tile.primary .desc { color: inherit; opacity: .85; }
.tile.soon { opacity: .62; box-shadow: none; }
.tile .title { font-weight: 700; display: block; }
.tile .desc { font-size: .85rem; color: var(--ink-2); line-height: 1.5; }
.badge { font-size: .72rem; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--line); color: var(--ink-2); margin-right: 6px; vertical-align: 2px; white-space: nowrap; }
.tile .title { display: inline; }
.tile .desc { display: block; }

/* فرم‌ها */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: .95rem; }
.field input, .field select {
  width: 100%; font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); min-height: 46px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.field input[type=checkbox] { width: auto; min-height: 0; margin-left: 8px; }
.field .help { font-size: .8rem; color: var(--ink-2); margin-top: 4px; }
.field .err { font-size: .85rem; color: var(--danger); margin-top: 4px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.btn {
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: var(--brand); color: var(--brand-ink);
}
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* صفحهٔ ورود */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px 24px; }
.auth .logo { justify-content: center; margin-bottom: 8px; font-size: 1.4rem; }
.auth .lead { text-align: center; color: var(--ink-2); margin-bottom: 24px; }
.code-input { letter-spacing: .6em; text-align: center; font-size: 1.4rem !important; }
.demo { background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-bottom: 16px; }
.demo b { font-size: 1.15rem; letter-spacing: .2em; }

/* جدول کاربران */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.toolbar .field { margin: 0; flex: 1 1 160px; }
.list { display: grid; gap: 8px; }
.row {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; color: var(--ink);
}
.row:hover { border-color: var(--brand); }
.row .name { font-weight: 700; }
.row .meta { font-size: .85rem; color: var(--ink-2); }
.pill { font-size: .78rem; padding: 2px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; align-self: start; }
.pill.off { background: var(--danger-soft); color: var(--danger); }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.info dt { color: var(--ink-2); }
dl.info dd { margin: 0; font-weight: 500; }
.empty { text-align: center; padding: 32px; color: var(--ink-2); }

/* حضور */
.count { font-size: .8rem; font-weight: 700; min-width: 24px; padding: 0 7px; border-radius: 99px; background: var(--janzi-magenta); color: #fff; margin-right: 6px; display: inline-block; text-align: center; }
.tile.primary .count { background: #fff; color: var(--janzi-magenta); }
.big-clock { text-align: center; padding: 8px 0 20px; }
.big-clock .t { font-size: 2.6rem; font-weight: 700; letter-spacing: .02em; color: var(--brand); line-height: 1.2; }
.big-clock .d { color: var(--ink-2); }
.btn.huge { min-height: 64px; font-size: 1.2rem; border-radius: 14px; }
.btn.accent { background: var(--janzi-magenta); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger-soft); }
.state { border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.state.pending { background: #fff5dc; }
.state.approved { background: var(--ok-soft); }
.state.rejected { background: var(--danger-soft); }
.st { font-size: .78rem; padding: 2px 10px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.st.pending { background: #fff1c7; color: #7a5a00; }
.st.approved { background: var(--ok-soft); color: #22662c; }
.st.rejected { background: var(--danger-soft); color: var(--danger); }
.section { margin: 28px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.section h2 { font-size: 1.05rem; margin: 0; }
.req { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; }
.req .name { font-weight: 700; }
.req .meta { font-size: .85rem; color: var(--ink-2); }
.req .ops { display: flex; gap: 6px; }
.req details { grid-column: 1 / -1; }
.req details summary { cursor: pointer; color: var(--danger); font-size: .85rem; list-style: none; }
.req details form { display: flex; gap: 6px; margin-top: 8px; }
.req details input { flex: 1; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.req input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); }
table.log { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
table.log th, table.log td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.log th { background: var(--brand-soft); font-weight: 500; color: var(--ink-2); }
.time-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.time-row input { font: inherit; width: 110px; text-align: center; padding: 9px; border: 1px solid var(--line); border-radius: 10px; }
.req .name, .req .meta { display: block; }
.select-all { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 10px; }
.select-all input { width: 20px; height: 20px; accent-color: var(--brand); }
.req details summary { color: var(--brand); }
.req details .reject-row { opacity: .85; }
.req details .reject-row input { font-size: .85rem; }
.diff-pos { color: var(--danger); font-weight: 700; }
.diff-neg { color: #22662c; font-weight: 700; }
.corrected { font-size: .75rem; color: var(--accent); display: block; }
.corrected { white-space: nowrap; }
