@font-face {
  font-family: Vazirmatn;
  src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 100 600;
  font-style: normal;
  font-display: swap;
}

.setup-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: #f7f8fb; }
.setup-shell { width: min(1050px,100%); background: #fff; border: 1px solid #e7eaf0; border-radius: 22px; padding: 36px; box-shadow: 0 20px 60px #17203314; }
.setup-shell h1 { margin: 10px 0; }
.setup-shell > .muted { line-height: 2; }
.setup-grid { margin-top: 24px; }
.setup-grid .setting-field { border-top: 1px solid #e7eaf0; padding-top: 14px; }

@font-face {
  font-family: Vazirmatn;
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root,
body,
button,
input {
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
}

.chart-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  min-height: 245px;
  margin-bottom: 22px;
  padding: 28px 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(120deg, #fff 55%, #f5f8ff);
}

.chart-copy h2 { margin: 8px 0 4px; font-size: 19px; }
.chart-copy > p { margin: 0 0 22px; font-size: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; }

.chart-legend button {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 8px;
  min-width: 130px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: right;
}

.chart-legend i { width: 8px; height: 8px; border-radius: 50%; }
.chart-legend i.todo { background: #94a3b8; }
.chart-legend i.active { background: #f59e0b; }
.chart-legend i.done { background: #10b981; }
.chart-legend span { font-size: 9px; color: var(--muted); }
.chart-legend strong { grid-column: 2; font-size: 17px; }
.donut-wrap { display: grid; place-items: center; }

.donut {
  position: relative;
  width: 172px;
  height: 172px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8ecf2;
  box-shadow: 0 13px 32px #17203318;
  transition: background .4s;
}

.donut::before { content: ""; position: absolute; inset: 24px; border-radius: 50%; background: #fff; }
.donut div { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 1; }
.donut strong { font-size: 28px; line-height: 1.3; }
.donut small { color: var(--muted); font-size: 9px; }

table th { font-size: 12px; }
table td { font-size: 13px; }
.summary strong { font-size: 13px; }
.status { font-size: 11px; }
.user-cell small { font-size: 11px; }
.operation-complete { color: var(--muted); font-size: 11px; }
.action.revoke { background: #fff3e4; color: #a45500; }
.status.revoked { background: #fff3e4; color: #a45500; }

.settings-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 22px 25px;
  border: 1px solid #dce6fa;
  border-radius: 13px;
  background: linear-gradient(120deg, #fff, #f3f7ff);
}
.settings-intro h2 { margin: 7px 0 4px; font-size: 19px; }
.settings-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.restart-note { padding: 10px 13px; border-radius: 8px; background: #fff3d8; color: #8a5708; font-size: 10px; white-space: nowrap; }
.settings-form { display: grid; gap: 15px; }
.settings-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.settings-card-head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.settings-card-head h3 { margin: 0 0 6px; font-size: 17px; }
.settings-card-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 22px; }
.setting-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.setting-field.wide { grid-column: 1 / -1; }
.setting-field > span { font-size: 14px; font-weight: 700; line-height: 1.7; }
.setting-field input,.setting-field select { width: 100%; padding: 12px 13px; border: 1px solid #dfe3ea; border-radius: 8px; background: #fff; color: var(--ink); outline: none; direction: ltr; text-align: left; font-size: 14px; }
.setting-field input:focus,.setting-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #176bff12; }
.setting-field small { color: var(--muted); font-size: 11px; line-height: 1.8; }
.setting-field code,.callback-box code { direction: ltr; font-family: monospace; }
.callback-box { display: flex; justify-content: space-between; gap: 15px; margin: 0 22px 22px; padding: 12px 14px; border-radius: 8px; background: #f6f8fb; color: var(--muted); font-size: 10px; }
.callback-box code { color: var(--ink); user-select: all; }
.status-settings { border-color: #cfdbf3; }
.status-settings .settings-card-head { background: #f7f9ff; }
.settings-actions { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 11px; background: #fffffff2; box-shadow: 0 12px 35px #17203318; backdrop-filter: blur(8px); z-index: 3; }
.settings-actions span { color: #57657a; font-size: 10px; }
.settings-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #eef2f7; scrollbar-width: thin; }
.settings-tab { flex: 1 0 auto; min-width: 105px; padding: 11px 15px; border: 0; border-radius: 8px; background: transparent; color: #667085; font-size: 12px; font-weight: 600; white-space: nowrap; }
.settings-tab:hover { color: var(--ink); background: #ffffff80; }
.settings-tab.active { color: var(--primary); background: #fff; box-shadow: 0 3px 10px #17203312; }
.settings-panels { min-height: 290px; }
.settings-panel { animation: settings-panel-in .18s ease-out; }
@keyframes settings-panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.user-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nav-section-title { padding: 5px 12px 8px; color: #64748b; font-size: 9px; font-weight: 700; }
.management-title { margin-top: 22px; padding-top: 15px; border-top: 1px solid #ffffff12; }
.filter-nav { display: flex; flex-direction: column; gap: 6px; }
.filter-menu { min-height: 45px; padding-block: 12px; }
.filter-menu b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 1.6; }
.filter-menu > span { font-size: 19px; }
.add-filter { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 9px; padding: 9px; border: 1px dashed #516078; border-radius: 8px; background: transparent; color: #9ba8ba; font-size: 10px; }
.add-filter:hover { border-color: #7da7f8; color: #fff; background: #ffffff0a; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.topbar-actions .button { margin-right: 0; }

.admin-dialog { width: min(480px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 30px 90px #11182750; }
.admin-dialog.wide-dialog { width: min(780px, calc(100% - 28px)); }
.admin-dialog::backdrop { background: #111827aa; backdrop-filter: blur(3px); }
.admin-dialog form { padding: 25px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.dialog-head h2 { margin: 6px 0 0; font-size: 20px; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 8px; background: #f1f3f7; color: #667085; font-size: 22px; }
.admin-dialog .setting-field { margin-bottom: 15px; }
.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-grid .setting-field { margin: 0; }
.dialog-grid .wide { grid-column: 1 / -1; }
.dialog-hint { padding: 10px 12px; border-radius: 8px; background: #f5f7fb; color: var(--muted); font-size: 10px; line-height: 1.8; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.filter-config-section { margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line); }
.filter-config-section h3 { margin: 0 0 4px; font-size: 13px; }
.filter-config-section > p { margin: 0 0 14px; color: var(--muted); font-size: 9px; }
.column-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.column-option { display: flex; align-items: center; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; cursor: pointer; }
.column-option:has(input:checked) { border-color: #9bbbf8; background: #f3f7ff; }
.column-option input { accent-color: var(--primary); }
.column-option small { margin-right: auto; color: var(--muted); font-size: 8px; }
.work-duration { display: inline-flex; padding: 5px 9px; border-radius: 7px; background: #edf5ff; color: #175fb8; font-size: 11px; font-weight: 700; }
.work-duration.unavailable { background: #ffebed; color: #bd2433; }
.worklog-details-button { padding: 6px 10px; border: 1px solid #bcd1f5; border-radius: 7px; background: #f3f7ff; color: #175fb8; font-size: 10px; font-weight: 700; }
.worklog-details-button:hover { border-color: var(--primary); background: #eaf2ff; }
.worklog-dialog-content { padding: 25px; }
.worklog-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 13px 16px; border-radius: 9px; background: #f3f7ff; color: #5d6b80; font-size: 10px; }
.worklog-summary strong { color: var(--primary); font-size: 15px; }
.worklog-person { display: flex; flex-direction: column; gap: 3px; }
.worklog-person small { color: var(--muted); font-size: 9px; }
.worklog-dialog .table-wrap { max-height: 55vh; border: 1px solid var(--line); border-radius: 9px; }
.worklog-dialog thead { position: sticky; top: 0; z-index: 1; }
.worklog-detail-section + .worklog-detail-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.worklog-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.worklog-section-title h3 { margin: 0; font-size: 13px; }
.worklog-section-title p { margin: 0; color: var(--muted); font-size: 9px; }
.issue-key.plain { color: var(--ink); }
.toggle-setting { display: flex; align-items: center; gap: 10px; margin: 17px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.toggle-setting input { width: 17px; height: 17px; accent-color: var(--primary); }
.toggle-setting span { display: flex; flex-direction: column; gap: 3px; }
.toggle-setting strong { font-size: 11px; }
.toggle-setting small { color: var(--muted); font-size: 9px; }
.inline-empty { width: 100%; margin: 0; box-shadow: none; }
.groups-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px; }
.groups-list article { display: flex; align-items: center; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.groups-list article > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.groups-list article strong { font-size: 13px; }
.groups-list article small { color: var(--muted); font-size: 10px; }
.group-actions { display: flex; gap: 5px; margin-right: auto; }
.group-actions button { white-space: nowrap; }
.group-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #edf3ff; color: var(--primary); font-size: 18px; }
.compact-empty { grid-column: 1 / -1; min-height: 180px; }
.user-groups { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.user-groups > span { padding: 4px 7px; border-radius: 6px; background: #edf3ff; color: #285eaa; font-size: 9px; }
.user-groups > small { color: var(--muted); }
.user-groups > button { border: 0; background: transparent; color: var(--primary); font-size: 9px; }
.member-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-options { display: flex; gap: 18px; margin-bottom: 12px; }
.access-options label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; cursor: pointer; }
.access-options input { accent-color: var(--primary); }
.disabled-options { opacity: .45; pointer-events: none; }
.split-actions { align-items: center; }
.split-actions > span { flex: 1; }
.button.danger { background: #ffebed; color: #b42335; }
.jira-details-button { border: 1px solid #cbdaf4; border-radius: 7px; padding: 7px 11px; background: #edf3ff; color: #205da9; font: inherit; font-size: 10px; font-weight: 700; white-space: nowrap; }
.jira-details-content { padding: 24px; }
.jira-details-dialog { width: min(960px, calc(100vw - 28px)); }
.jira-details-dialog .dialog-head h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 16px; }
.details-loading { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.details-loading span { width: 31px; height: 31px; border: 3px solid #e5e7eb; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.inline-error { margin: 18px 0; padding: 14px; border-radius: 9px; background: #ffebed; color: #b42335; }
.jira-details-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 18px 0; }
.jira-details-meta > div { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; }
.jira-details-meta small { color: var(--muted); font-size: 9px; }
.jira-details-meta strong { font-size: 11px; overflow-wrap: anywhere; }
.jira-details-section { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.jira-details-section h3 { margin: 0 0 11px; font-size: 13px; }
.jira-description, .jira-comments p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; line-height: 2; }
.jira-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.jira-tags > span:not(.muted) { padding: 5px 9px; border-radius: 7px; background: #edf3ff; color: #285eaa; font-size: 9px; }
.jira-links { display: flex; flex-direction: column; gap: 8px; }
.jira-links a { color: var(--primary); font-size: 11px; text-decoration: none; overflow-wrap: anywhere; }
.jira-comments { display: flex; flex-direction: column; gap: 9px; max-height: 360px; overflow-y: auto; }
.jira-comments article { padding: 11px 13px; border-radius: 9px; background: #f8fafc; }
.jira-comments header { display: flex; justify-content: space-between; gap: 12px; }
.jira-comments header strong { font-size: 10px; }
.jira-comments time { color: var(--muted); font-size: 9px; }
.jira-comments p { margin: 8px 0 0; }

.status-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.status-tab {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 11px;
  row-gap: 2px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: right;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.status-tab:hover {
  transform: translateY(-1px);
  border-color: #b9c8e4;
}

.status-tab.active {
  border-color: var(--primary);
  box-shadow: 0 7px 20px #176bff1f, inset 0 -3px var(--primary);
}

.status-tab strong { font-size: 13px; }
.status-tab small { grid-column: 2; color: var(--muted); direction: ltr; text-align: right; font-size: 10px; }
.tab-dot { grid-row: 1 / 3; width: 11px; height: 11px; border-radius: 50%; }
.tab-dot.todo { background: #94a3b8; }
.tab-dot.active { background: #f59e0b; }
.tab-dot.done { background: #10b981; }

@media (max-width: 650px) {
  .chart-panel { grid-template-columns: 1fr; gap: 24px; padding: 24px 18px; }
  .chart-copy { text-align: center; }
  .chart-legend { justify-content: center; }
  .chart-legend button { min-width: calc(50% - 4px); }
  .donut { width: 150px; height: 150px; }
  .status-tabs { grid-template-columns: 1fr; gap: 8px; }
  .status-tab { padding: 12px 15px; }
  .settings-intro { align-items: stretch; flex-direction: column; }
  .restart-note { white-space: normal; }
  .settings-grid { grid-template-columns: 1fr; padding: 17px; }
  .setting-field.wide { grid-column: auto; }
  .callback-box { flex-direction: column; margin: 0 17px 17px; overflow-wrap: anywhere; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-tabs { margin-inline: -2px; }
  .settings-tab { min-width: 115px; font-size: 12px; }
  .user-metrics { grid-template-columns: 1fr 1fr; }
  .groups-list { grid-template-columns: 1fr; padding: 14px; }
  .topbar-actions .button { padding: 8px 9px; font-size: 0; }
  .topbar-actions .button:first-letter { font-size: 15px; }
  .dialog-grid,.column-options { grid-template-columns: 1fr; }
  .jira-details-meta { grid-template-columns: 1fr 1fr; }
  .jira-details-content { padding: 18px; }
  .dialog-grid .wide { grid-column: auto; }
  .admin-dialog form { padding: 20px; }
}
