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

/* فونت و آیکن‌ها محلی هستند و هیچ درخواستی به Google Fonts یا jsDelivr ارسال نمی‌شود. */

/* Local font only: upload assets/fonts/Vazirmatn.woff2 to your host. */

400;500;600;700;800&display=swap');

:root{
  --navy:#0B1F3A;
  --navy-2:#0A2647;
  --navy-3:#123C69;
  --blue:#1D4ED8;
  --bg:#F4F7FB;
  --card:#FFFFFF;
  --text:#111827;
  --muted:#64748B;
  --border:#D9E2EC;
  --success:#16A34A;
  --warning:#F59E0B;
  --danger:#DC2626;
  --shadow:0 10px 30px rgba(11,31,58,.08);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Vazirmatn', Tahoma, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.8;
  font-size:14px;
}
body, input, select, textarea, button{font-family:'Vazirmatn', Tahoma, Arial, sans-serif}
a{color:inherit;text-decoration:none}

.topbar{
  background:linear-gradient(135deg,var(--navy),var(--navy-3));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px 28px;
  position:sticky;
  top:0;
  z-index:20;
  box-shadow:var(--shadow);
}
.brand{display:flex;align-items:center;gap:12px}
.brand strong{display:block;font-size:18px;font-weight:800}
.brand span{display:block;color:#CFE1F5;font-size:12px;margin-top:2px}
.brand-mark{
  width:44px;height:44px;border-radius:16px;background:#fff;color:var(--navy);
  display:grid;place-items:center;font-weight:900;letter-spacing:.5px;
  box-shadow:0 8px 20px rgba(255,255,255,.18);
}
.userbox{display:flex;align-items:center;gap:12px;font-size:13px}
.userbox a{background:rgba(255,255,255,.12);padding:7px 12px;border-radius:12px}
.userbox a:hover{background:rgba(255,255,255,.22)}

.nav{
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  gap:8px;
  padding:10px 28px;
  position:sticky;
  top:80px;
  z-index:19;
  overflow-x:auto;
}
.nav-link{padding:9px 14px;border-radius:12px;color:var(--navy);white-space:nowrap;font-weight:600}
.nav-link:hover,.nav-link.active{background:#EAF1F9;color:var(--navy-3)}
.nav-link.active{box-shadow:inset 0 -2px 0 var(--navy-3)}

.container{max-width:1380px;margin:22px auto;padding:0 20px 40px}
.footer{text-align:center;color:var(--muted);padding:24px;font-size:12px}

.alert{padding:12px 16px;border-radius:14px;margin-bottom:16px;border:1px solid var(--border);background:#fff;box-shadow:var(--shadow)}
.alert.success{border-color:#A7F3D0;background:#ECFDF5;color:#065F46}
.alert.error{border-color:#FECACA;background:#FEF2F2;color:#991B1B}

.hero{
  display:flex;justify-content:space-between;align-items:center;gap:20px;
  background:linear-gradient(135deg,#fff,#EEF5FF);border:1px solid var(--border);
  border-radius:24px;padding:24px 26px;box-shadow:var(--shadow);margin-bottom:18px;
}
.hero h1{margin:0 0 6px;font-size:26px;color:var(--navy);font-weight:900}
.hero p{margin:0;color:var(--muted)}

.card{
  background:var(--card);border:1px solid var(--border);border-radius:22px;
  padding:18px;box-shadow:var(--shadow);margin-bottom:18px;
}
.card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.card-header h1,.card-header h2{margin:0;color:var(--navy);font-weight:900;font-size:20px}
.card-header span{color:var(--muted);font-size:12px}

.kpi-grid{display:grid;grid-template-columns:repeat(6,minmax(150px,1fr));gap:12px;margin-bottom:18px}
.kpi{background:#fff;border:1px solid var(--border);border-radius:20px;padding:18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi:before{content:"";position:absolute;inset-inline-start:0;top:0;width:5px;height:100%;background:var(--navy-3)}
.kpi.warn:before{background:var(--warning)}
.kpi.danger:before{background:var(--danger)}
.kpi span{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}
.kpi strong{font-size:28px;color:var(--navy);font-weight:900}

.btn{
  border:1px solid var(--border);background:#fff;color:var(--navy);border-radius:12px;
  padding:9px 14px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;gap:6px;
  transition:.15s ease;
}
.btn:hover{transform:translateY(-1px);box-shadow:0 6px 14px rgba(11,31,58,.08)}
.btn.primary{background:var(--navy);border-color:var(--navy);color:#fff}
.btn.danger{background:#FEF2F2;border-color:#FECACA;color:#991B1B}
.btn.small{padding:6px 10px;font-size:12px;border-radius:10px}
.actions-bar{display:flex;gap:10px;align-items:center;margin-top:14px;flex-wrap:wrap}
.actions-bar.full{grid-column:1/-1}
.inline-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px}
.inline-actions form{display:inline}

.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:16px;background:#fff}
.data-table{width:100%;border-collapse:separate;border-spacing:0;min-width:800px}
.data-table th,.data-table td{padding:12px;border-bottom:1px solid var(--border);vertical-align:middle;text-align:right}
.data-table th{background:#F1F5F9;color:var(--navy);font-weight:800;white-space:nowrap}
.data-table tr:last-child td{border-bottom:0}
.data-table tbody tr:hover{background:#F8FAFC}
.dashboard-table .row-needs-action{background:#FFF7ED}
.dashboard-table .row-installed-muni{background:#F0FDF4}
.matrix-wrap{max-height:72vh}
.matrix-table{min-width:1200px}
.matrix-table th{position:sticky;top:0;z-index:5}
.sticky-col{position:sticky;right:0;z-index:6;background:#F8FAFC!important;min-width:250px;box-shadow:-8px 0 12px rgba(11,31,58,.06)}
.matrix-table th.sticky-col{z-index:7;background:#E2E8F0!important}

.badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:26px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:800;white-space:nowrap;
}
.badge-empty{background:#E5E7EB;color:#334155}
.priority{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:3px 9px;font-size:11px;font-weight:800;background:#E2E8F0;color:#334155;white-space:nowrap}
.priority-1,.priority-high{background:#FEE2E2;color:#991B1B}
.priority-2,.priority-mid{background:#FEF3C7;color:#92400E}
.priority-3,.priority-low{background:#DCFCE7;color:#166534}
.muted{color:var(--muted)}
.empty{color:var(--muted);margin:12px 0}

.input{
  width:100%;border:1px solid var(--border);border-radius:12px;background:#fff;color:var(--text);
  padding:9px 11px;outline:none;min-height:40px;
}
.input:focus{border-color:var(--navy-3);box-shadow:0 0 0 3px rgba(18,60,105,.12)}
.select-status{min-width:150px}
.note-input{margin-top:6px;min-height:34px;font-size:12px;padding:6px 9px}
.small-input{max-width:90px}
.color-input{width:58px;min-width:58px;padding:3px}
.ltr{direction:ltr;text-align:left}
.checkbox{display:flex;align-items:center;gap:6px;white-space:nowrap;color:var(--muted);font-size:13px}
textarea.input{resize:vertical}

.login-wrap{min-height:65vh;display:grid;place-items:center}
.login-card{width:min(430px,100%);background:#fff;border:1px solid var(--border);border-radius:26px;padding:28px;box-shadow:var(--shadow)}
.login-card h1{margin:0 0 6px;color:var(--navy);font-size:24px;font-weight:900}
.login-card p{margin:0 0 18px;color:var(--muted)}
.login-card label,.form-grid label{display:block;font-weight:700;color:var(--navy);margin-top:12px;margin-bottom:5px}
.login-card .btn{width:100%;justify-content:center;margin-top:16px}
.hint{margin-top:12px;color:var(--muted);font-size:12px;background:#F8FAFC;padding:10px;border-radius:12px}

.grid-2{display:grid;grid-template-columns:minmax(360px, .9fr) minmax(420px, 1.1fr);gap:18px;align-items:start}
.form-grid{display:grid;grid-template-columns:1fr;gap:6px}
.inline-form{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.add-form .input{max-width:220px}
.row-form{display:grid;grid-template-columns:1.4fr 90px 90px auto auto;gap:10px;align-items:center}
.delete-line{margin-top:8px;display:inline-block}
.status-row{display:grid;grid-template-columns:1.2fr 1.4fr 60px 60px 90px auto auto auto;gap:8px;align-items:center;border-top:1px solid var(--border);padding:10px 0}
.settings-list{margin-top:8px}
.help-box{background:#F8FAFC;border:1px dashed var(--border);border-radius:16px;padding:14px;margin-top:18px;color:var(--muted)}
.help-box b{color:var(--navy)}

.challenge-list{display:flex;flex-direction:column;gap:10px}
.challenge-item{border:1px solid var(--border);border-radius:16px;background:#fff;overflow:hidden}
.challenge-item[open]{box-shadow:0 8px 18px rgba(11,31,58,.06)}
.challenge-item.closed{opacity:.68}
.challenge-item summary{cursor:pointer;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 14px;list-style:none}
.challenge-item summary::-webkit-details-marker{display:none}
.challenge-detail{padding:0 16px 14px;color:#334155;border-top:1px solid var(--border);background:#FBFDFF}
.challenge-detail p{margin:10px 0}
.info-icon{width:26px;height:26px;display:inline-grid;place-items:center;border-radius:50%;background:#DBEAFE;color:#1D4ED8;font-weight:900;flex:0 0 26px}
.compact .challenge-item summary strong{max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media (max-width:1100px){
  .kpi-grid{grid-template-columns:repeat(3,1fr)}
  .grid-2{grid-template-columns:1fr}
  .nav{top:79px}
}
@media (max-width:760px){
  .topbar{position:static;flex-direction:column;align-items:flex-start;padding:16px}
  .nav{position:static;padding:8px 16px}
  .container{padding:0 12px;margin-top:14px}
  .hero{flex-direction:column;align-items:flex-start;padding:18px}
  .kpi-grid{grid-template-columns:1fr 1fr}
  .card{padding:14px;border-radius:18px}
  .card-header{flex-direction:column}
  .row-form,.status-row{grid-template-columns:1fr}
  .add-form .input{max-width:none}
  .small-input,.color-input{max-width:100%;width:100%}
}

/* v3 additions */
.hero-actions{display:flex;gap:10px;flex-wrap:wrap}
.path-badge{display:inline-flex;align-items:center;border-radius:999px;padding:3px 9px;font-size:11px;font-weight:800;white-space:nowrap}
.path-direct{background:#DBEAFE;color:#1E3A8A}
.path-local{background:#FEF3C7;color:#92400E}
.path-unknown{background:#E2E8F0;color:#334155}
.progress-wrap{min-width:130px}
.progress-text{font-weight:900;color:var(--navy);font-size:12px;margin-bottom:3px;direction:ltr;text-align:left}
.progress{height:10px;background:#E5E7EB;border-radius:999px;overflow:hidden;direction:ltr}
.progress span{height:100%;display:block;border-radius:999px;background:#94A3B8}
.progress span.low{background:#F59E0B}
.progress span.mid{background:#2563EB}
.progress span.done{background:#16A34A}
.percent-pill{display:inline-flex;margin-top:4px;background:#EAF1F9;color:var(--navy);border-radius:999px;padding:2px 8px;font-weight:900;font-size:12px;direction:ltr}
.stage-group-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0 10px}
.stage-group-title h2{margin:0;color:var(--navy);font-size:18px;font-weight:900}
.stage-group-title span{color:var(--muted);font-size:12px}
.summary-row td{background:#F8FAFC!important;border-top:2px solid var(--navy-3)}
.stage-matrix-wrap{margin-bottom:16px}
.row-challenge{background:#FEF2F2!important}
.row-needs-action{background:#FFF7ED!important}
.row-complete{background:#F0FDF4!important}
.mini-detail summary{cursor:pointer;display:flex;gap:6px;align-items:center;list-style:none;color:var(--navy);font-weight:800}
.mini-detail summary::-webkit-details-marker{display:none}
.mini-detail div{margin-top:8px;padding:10px;border-radius:12px;background:#fff;border:1px solid var(--border);min-width:180px;color:#334155}
.mini-detail a{color:var(--blue);font-weight:800}
.city-row-form{grid-template-columns:1.3fr 90px 1.3fr 90px auto auto}
.stage-row{display:grid;grid-template-columns:1.4fr 1.2fr 90px 90px auto auto;gap:8px;align-items:center;border-top:1px solid var(--border);padding:10px 0}
.settings-grid{grid-template-columns:1fr 1fr}
.data-table small{display:block;color:var(--muted);font-size:11px;margin-top:4px;line-height:1.5}

@media (max-width:760px){
  .city-row-form,.stage-row{grid-template-columns:1fr}
  .settings-grid{grid-template-columns:1fr}
}

/* v4 simplified dashboard */
.path-icon{width:34px;height:34px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;font-size:17px;border:1px solid rgba(15,23,42,.08)}
.sort-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-inline-start:auto}
.sort-form label{font-size:12px;color:var(--muted);font-weight:800}
.sort-form .input{min-width:180px;padding:8px 10px}
.dashboard-table th[title="مسیر نصب"]{min-width:58px;text-align:center}
.dashboard-table td:nth-child(3){text-align:center}
.priority{min-width:26px;justify-content:center;padding:3px 8px}

/* v5 simplification */
.quick-edit-table{min-width:1550px}
.quick-edit-table th,.quick-edit-table td{padding:9px 8px}
.quick-select{min-width:126px;max-width:148px;min-height:34px;padding:6px 8px;font-size:12px;border-radius:10px}
.sticky-actions{position:sticky;bottom:0;background:rgba(255,255,255,.94);backdrop-filter:blur(8px);border:1px solid var(--border);border-radius:16px;padding:10px 12px;z-index:10;box-shadow:var(--shadow)}
.link-details{position:relative;display:inline-block}
.link-details summary{cursor:pointer;list-style:none;display:inline-flex;align-items:center;justify-content:center}
.link-details summary::-webkit-details-marker{display:none}
.link-icon{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:999px;background:#EAF1F9;color:var(--navy-3);font-weight:900;border:1px solid #CFE1F5}
.link-panel{position:absolute;left:0;top:38px;z-index:30;width:320px;background:#fff;border:1px solid var(--border);box-shadow:var(--shadow);border-radius:16px;padding:12px;display:grid;gap:6px}
.link-panel label{font-size:11px;color:var(--muted);font-weight:800;margin-top:4px}
.mini-input{min-height:32px;padding:6px 8px;font-size:12px;border-radius:10px}
.challenge-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;border-radius:999px;background:#FEE2E2;color:#991B1B;font-weight:900;font-size:11px;margin-inline-start:4px}
.tooltip{cursor:help}
.challenge-dashboard-table{min-width:1100px}
.challenge-dashboard-table td:nth-child(4){min-width:260px;max-width:420px;white-space:normal}
.settings-layout{display:grid;grid-template-columns:1fr;gap:18px}
.owner-row{display:grid;grid-template-columns:1.4fr 1fr 1fr 90px auto auto;gap:8px;align-items:center;border-top:1px solid var(--border);padding:10px 0}
.status-row{grid-template-columns:1.2fr 1.2fr 1.4fr 60px 60px 90px auto auto auto}
.row-complete{background:#F0FDF4!important}
.row-challenge{background:#FEF2F2!important}
.row-needs-action{background:#FFF7ED!important}
@media (max-width:760px){.owner-row{grid-template-columns:1fr}.link-panel{left:auto;right:0;width:280px}.quick-edit-table{min-width:1300px}}

/* v6 dashboard refinements */
.dashboard-no-scroll{overflow-x:visible!important;overflow-y:visible!important}
.dashboard-compact{min-width:0!important;width:100%;table-layout:fixed;font-size:12px}
.dashboard-compact th,.dashboard-compact td{padding:8px 6px;white-space:normal;word-break:normal;overflow-wrap:anywhere;line-height:1.55}
.dashboard-compact .badge{font-size:11px;padding:3px 7px;white-space:normal;line-height:1.5;min-height:24px}
.dashboard-compact .quick-select{min-width:0;max-width:100%;width:100%;font-size:11px;padding:6px 5px}
.dashboard-compact .col-priority{width:44px;text-align:center}
.dashboard-compact .col-city{width:15%}
.dashboard-compact .col-link{width:74px;text-align:center}
.dashboard-compact .col-challenge{width:70px;text-align:center}
.dashboard-compact .col-progress{width:104px;text-align:left}
.dashboard-compact .progress-wrap{min-width:0;width:96px;margin-inline-start:auto}
.city-cell strong{display:block;color:var(--navy);font-size:13px;line-height:1.4}
.city-cell small{display:block;color:var(--muted);font-size:10.5px;margin-top:2px;line-height:1.35}
.link-open{display:inline-flex;align-items:center;justify-content:center;gap:3px;border:1px solid #CFE1F5;background:#EAF1F9;color:var(--navy-3);border-radius:999px;padding:4px 7px;font-size:11px;font-weight:900;white-space:nowrap;text-decoration:none}
.link-open:hover{background:#DBEAFE;color:#1E3A8A}
.dashboard-compact .mini-input{min-width:0;width:100%;font-size:11px;padding:5px 6px}
.dashboard-compact .info-icon{width:24px;height:24px;flex-basis:24px}
.quick-edit-table{min-width:0!important}
@media (max-width:1100px){
  .dashboard-compact{font-size:11px}
  .dashboard-compact th,.dashboard-compact td{padding:7px 4px}
  .dashboard-compact .badge{font-size:10px;padding:3px 5px}
  .dashboard-compact .col-city{width:16%}
  .dashboard-compact .col-progress{width:92px}
  .dashboard-compact .progress-wrap{width:84px}
}
@media (max-width:760px){
  .dashboard-no-scroll{overflow-x:visible!important}
  .dashboard-compact{display:block;border-collapse:separate}
  .dashboard-compact thead{display:none}
  .dashboard-compact tbody,.dashboard-compact tr,.dashboard-compact td{display:block;width:100%}
  .dashboard-compact tr{border:1px solid var(--border);border-radius:16px;margin-bottom:12px;overflow:hidden;background:#fff!important}
  .dashboard-compact td{border-bottom:1px solid var(--border);padding:10px 12px;text-align:right}
  .dashboard-compact td:last-child{border-bottom:0}
  .dashboard-compact td:before{content:attr(data-label);display:block;font-size:11px;color:var(--muted);font-weight:800;margin-bottom:4px}
  .dashboard-compact .progress-wrap{width:100%;margin-inline-start:0}
}

/* v7 UX refinements */
.container{margin-top:12px}
.compact-top{padding:12px 14px;margin-bottom:14px}
.dashboard-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.dashboard-title h1{margin:0;color:var(--navy);font-size:18px;font-weight:900}
.dashboard-title span{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.dashboard-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dashboard-tools .btn{padding:7px 10px}
.sort-form{margin:0}
.sort-form .sort-select{min-width:136px;min-height:34px;padding:6px 8px;font-size:12px}
.dashboard-table th,.dashboard-table td{text-align:center!important;vertical-align:middle}
.dashboard-table .city-cell{text-align:center!important}
.dashboard-compact .col-priority{width:38px}
.dashboard-compact .col-city{width:14%}
.dashboard-compact .col-link{width:70px}
.dashboard-compact .col-challenge{width:54px}
.dashboard-compact .col-progress{width:98px;text-align:center!important}
.dashboard-compact .progress-wrap{margin:0 auto;width:88px}
.dashboard-compact .select-status{min-width:0;width:100%}
.challenge-count-link{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;border-radius:999px;background:#FEE2E2;color:#991B1B;font-weight:900;font-size:12px;text-decoration:none;border:1px solid #FECACA}
.challenge-count-link:hover{background:#FCA5A5;color:#7F1D1D}
.challenge-card{margin-top:8px}
.challenge-dashboard-table{min-width:0!important;table-layout:fixed}
.challenge-dashboard-table th,.challenge-dashboard-table td{text-align:center!important;white-space:normal;overflow-wrap:anywhere}
.challenge-dashboard-table td:nth-child(2),.challenge-dashboard-table td:nth-child(4){text-align:right!important}
@media (max-width:1180px){
  .dashboard-compact{font-size:11px}
  .dashboard-compact th,.dashboard-compact td{padding:7px 4px}
  .dashboard-compact .col-city{width:13%}
  .dashboard-compact .badge{font-size:10px;padding:2px 5px}
  .dashboard-compact .progress-wrap{width:78px}
}
@media (max-width:760px){
  .dashboard-toolbar{align-items:flex-start;flex-direction:column}
  .dashboard-tools{width:100%}
  .sort-form,.sort-form .sort-select{width:100%}
  .dashboard-table td{text-align:right!important}
  .dashboard-table .city-cell{text-align:right!important}
  .challenge-dashboard-table{display:block}
}

/* v8 refinements */
.brand-mark{font-size:0}
.brand-mark::after{content:"محیا";font-size:12px;font-weight:900}
.footer{padding:16px;color:#475569}
.dashboard-title{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.subtle-stats{display:flex;align-items:center;gap:6px;flex-wrap:wrap;color:var(--muted);font-size:11px}
.subtle-stats span{display:inline-flex;align-items:center;gap:3px;background:#F8FAFC;border:1px solid var(--border);border-radius:999px;padding:3px 8px;color:#475569}
.subtle-stats b{color:var(--navy);font-weight:900}
.dashboard-compact .col-city{width:16%}
.dashboard-compact .col-progress{width:106px;text-align:center!important}
.dashboard-table .city-cell{text-align:right!important}
.city-cell strong,.city-cell small{text-align:right!important}
.deadline-line{margin-top:4px;display:flex;justify-content:center;align-items:center}
.schedule-chip{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:2px 7px;font-size:10px;font-weight:900;line-height:1.45;white-space:nowrap;border:1px solid transparent}
.schedule-chip.locked{background:#EFF6FF;color:#1E3A8A;border-color:#BFDBFE}
.schedule-chip.overdue{background:#FEF2F2;color:#991B1B;border-color:#FECACA}
.schedule-chip.empty{background:#F8FAFC;color:#94A3B8;border-color:#E2E8F0}
.deadline-input{margin-top:2px;min-height:28px;text-align:center;direction:ltr;font-size:10.5px!important;padding:4px 5px!important}
.dashboard-compact th,.dashboard-compact td{padding:7px 5px}
.dashboard-compact .badge{max-width:100%}
.settings-intro{display:flex;align-items:center;justify-content:space-between;padding:14px 18px}
.settings-intro h1{margin:0;color:var(--navy);font-size:20px;font-weight:900}
.settings-intro p{margin:4px 0 0;color:var(--muted);font-size:12px}
.settings-section{background:#fff;border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow);margin-bottom:14px;overflow:hidden}
.settings-section>summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;list-style:none;background:linear-gradient(180deg,#fff,#F8FAFC)}
.settings-section>summary::-webkit-details-marker{display:none}
.settings-section>summary strong{color:var(--navy);font-size:16px;font-weight:900}
.settings-section>summary span{color:var(--muted);font-size:12px}
.settings-body{padding:14px 18px 18px;border-top:1px solid var(--border)}
.compact-add-form{background:#F8FAFC;border:1px solid var(--border);border-radius:16px;padding:10px}
.scope-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.scope-box{border:1px solid var(--border);border-radius:16px;background:#fff;overflow:hidden}
.scope-box>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:#F8FAFC;color:var(--navy);font-weight:900}
.scope-box>summary::-webkit-details-marker{display:none}
.scope-box>summary em{font-style:normal;background:#EAF1F9;color:var(--navy-3);border-radius:999px;padding:2px 8px;font-size:11px}
.scope-box .settings-list{padding:8px 10px;margin:0}
.tidy-status-row{grid-template-columns:1.2fr 1.4fr 52px 52px 72px auto auto auto!important;gap:6px;font-size:12px}
.tidy-status-row .input{min-height:34px;padding:6px 8px;font-size:12px}
.owner-list{max-width:980px}
.account-form{max-width:520px}
.login-card::before{content:"شرکت محیاپرداز یزد";display:inline-flex;margin-bottom:10px;background:#EAF1F9;color:var(--navy-3);border-radius:999px;padding:4px 10px;font-size:12px;font-weight:900}
@media (max-width:1180px){
  .dashboard-compact .col-city{width:15%}
  .schedule-chip{font-size:9.5px;padding:2px 5px}
}
@media (max-width:900px){.scope-grid{grid-template-columns:1fr}.subtle-stats{width:100%}}
@media (max-width:760px){
  .dashboard-table .city-cell{text-align:right!important}
  .deadline-line{justify-content:flex-start}
  .settings-section>summary{align-items:flex-start;flex-direction:column}
}

/* v9: نصب/تحویل با تاریخ تعهد و تاریخ انجام داخل همان سلول */
.dashboard-compact .col-install-status{width:22%}
.dashboard-compact .col-city{width:17%}
.dashboard-compact .col-progress{width:96px;text-align:center!important}
.install-status-cell{min-width:0}
.status-stack{display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center}
.status-line{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0}
.status-line + .status-line{border-top:1px dashed #E2E8F0;padding-top:6px;width:100%}
.status-caption{display:inline-flex;align-items:center;justify-content:center;background:#F1F5F9;color:#334155;border:1px solid #E2E8F0;border-radius:999px;padding:1px 7px;font-size:10px;font-weight:900;line-height:1.6;white-space:nowrap}
.status-line .badge{max-width:100%;white-space:normal;text-align:center}
.timeline-line{display:block;font-size:10px;font-weight:800;line-height:1.5;text-align:center}
.done-date{color:#94A3B8;font-weight:700}
.target-date{color:#1E3A8A;background:#EFF6FF;border:1px solid #BFDBFE;border-radius:999px;padding:1px 6px}
.overdue-date{color:#991B1B;background:#FEF2F2;border:1px solid #FECACA;border-radius:999px;padding:1px 6px}
.unknown-date{color:#94A3B8;background:#F8FAFC;border:1px solid #E2E8F0;border-radius:999px;padding:1px 6px}
.edit-line{gap:4px;width:100%}
.edit-line .quick-select{width:100%;max-width:150px}
.deadline-edit-label{font-size:9.5px;color:#64748B;font-weight:900;line-height:1;margin-top:1px}
.edit-line .deadline-input{max-width:140px;margin-top:0!important}
@media (max-width:1180px){
  .dashboard-compact .col-install-status{width:23%}
  .status-caption,.timeline-line{font-size:9.2px}
  .edit-line .quick-select{max-width:130px}
}
@media (max-width:760px){
  .status-stack,.status-line{align-items:flex-start}
  .timeline-line{text-align:right}
  .status-line + .status-line{align-items:flex-start}
}


/* v10: بازگشت به دو ستون نصب و نمایش حرفه‌ای زمان‌بندی */
.dashboard-compact .col-install-status{width:auto}
.dashboard-compact .col-local-install{width:12%}
.dashboard-compact .col-server-install{width:14%}
.dashboard-compact .col-delivery-dep{width:13%}
.dashboard-compact .col-delivery-muni{width:13%}
.dashboard-compact .col-city{width:15%}
.dashboard-compact .col-priority{width:38px}
.dashboard-compact .col-link{width:68px}
.dashboard-compact .col-challenge{width:52px}
.dashboard-compact .col-progress{width:92px;text-align:center!important}
.install-status-cell{min-width:0;text-align:center!important}
.install-status-cell .status-line{width:100%}
.timeline-line{max-width:100%;white-space:normal}
.target-date{color:#1E3A8A;background:#EFF6FF;border:1px solid #BFDBFE;border-radius:999px;padding:1px 6px}
.today-date{color:#92400E;background:#FEF3C7;border:1px solid #FDE68A;border-radius:999px;padding:1px 6px}
.overdue-date{color:#991B1B;background:#FEF2F2;border:1px solid #FECACA;border-radius:999px;padding:1px 6px}
.schedule-chip.today{background:#FEF3C7;color:#92400E;border-color:#FDE68A}
.status-line + .status-line{border-top:0;padding-top:0}
@media (max-width:1180px){
  .dashboard-compact .col-city{width:14%}
  .dashboard-compact .col-local-install{width:12%}
  .dashboard-compact .col-server-install{width:14%}
  .dashboard-compact .col-delivery-dep{width:13%}
  .dashboard-compact .col-delivery-muni{width:13%}
  .timeline-line{font-size:8.8px;padding-inline:4px}
}

/* v11: زمان‌بندی فشرده و حذف زمان تعهد برای وضعیت «نیاز ندارد» */
.deadline-edit-wrap{display:flex;flex-direction:column;align-items:center;gap:3px;width:100%}
.timeline-mini{display:inline-flex;align-items:center;justify-content:center;margin-top:2px;border-radius:999px;padding:1px 6px;font-size:9.5px;font-weight:900;line-height:1.45;white-space:nowrap}
.timeline-mini.ahead{background:#ECFDF5;color:#047857;border:1px solid #A7F3D0}
.timeline-mini.ontime{background:#EFF6FF;color:#1D4ED8;border:1px solid #BFDBFE}
.timeline-mini.late{background:#FEF2F2;color:#B91C1C;border:1px solid #FECACA}
.timeline-line.target-date{background:#EEF2FF;color:#3730A3;border-color:#C7D2FE}
.timeline-line.overdue-date{font-weight:950}
.timeline-line.unknown-date{font-weight:800;color:#64748B;background:#F8FAFC}
.edit-line .deadline-edit-wrap .schedule-chip{max-width:140px;white-space:normal;text-align:center}
@media (max-width:1180px){.timeline-mini{font-size:8.6px;padding:1px 5px}}

.btn-reset-deadline {
  border: 0;
  border-radius: 999px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.7;
  cursor: pointer;
  background: #FEF3C7;
  color: #92400E;
  margin-inline-start: 4px;
  white-space: nowrap;
}
.btn-reset-deadline:hover { background: #FDE68A; }
.deadline-edit-wrap .schedule-chip { margin-inline-end: 2px; }

/* v13: کارتابل نصب و فیلتر IT / غیر IT */
.dashboard-compact .col-cartable{width:14%}
.cartable-td{min-width:120px;text-align:center!important}
.cartable-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;line-height:1.45;max-width:150px;margin:auto}
.cartable-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:2px 8px;font-size:10px;font-weight:950;white-space:nowrap;border:1px solid transparent}
.cartable-cell small{font-size:10px;font-weight:800;color:#334155;max-width:100%;white-space:normal}
.cartable-cell em{font-style:normal;font-size:9.5px;color:#64748B;max-width:100%;white-space:normal}
.cartable-it .cartable-badge{background:#DBEAFE;color:#1E3A8A;border-color:#BFDBFE}
.cartable-other .cartable-badge{background:#FFF7ED;color:#9A3412;border-color:#FED7AA}
.cartable-paused .cartable-badge{background:#FEE2E2;color:#991B1B;border-color:#FECACA}
.row-paused{opacity:.58;background:#F8FAFC!important}
.row-paused .city-cell strong::after{content:' توقف نصب';display:inline-flex;margin-inline-start:6px;border-radius:999px;background:#FEE2E2;color:#991B1B;border:1px solid #FECACA;padding:1px 6px;font-size:9px;font-weight:900}
.cartable-edit{display:grid;grid-template-columns:1fr;gap:4px;min-width:150px}
.cartable-edit label{font-size:9.5px;color:#64748B;font-weight:900;line-height:1;text-align:center}
.cartable-edit .mini-input,.cartable-edit .mini-textarea{font-size:10px;min-height:28px;padding:5px 7px}
.cartable-edit .pause-check{justify-content:center;margin:2px 0;color:#991B1B;font-weight:900}
.dashboard-tools{gap:6px;flex-wrap:wrap}
.sort-form{margin:0}
.sort-select{min-width:130px;font-size:11px;padding-block:6px}
@media (max-width:1180px){
  .dashboard-compact .col-cartable{width:13%}
  .cartable-badge{font-size:9px;padding:1px 6px}
  .cartable-cell small,.cartable-cell em{font-size:8.5px}
}


/* v14: انتقال لینک نمایش سامانه به کنار نام شهر */
.dashboard-compact .col-link{display:none}
.dashboard-compact .col-city{width:17%}
.dashboard-compact .col-cartable{width:15%}
.city-title-line{display:flex;align-items:center;justify-content:flex-start;gap:6px;min-width:0}
.city-title-line strong{display:inline-block!important;min-width:0}
.city-system-link{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:999px;border:1px solid #BFDBFE;background:#EFF6FF;color:#1E3A8A;text-decoration:none;font-size:12px;line-height:1;flex:0 0 22px}
.city-system-link:hover{background:#DBEAFE;color:#0F172A;transform:translateY(-1px)}
.city-link-input{margin-top:5px;width:100%;font-size:10.5px;padding:5px 6px}
.dashboard-table .city-cell{text-align:right!important}
@media (max-width:1180px){.dashboard-compact .col-city{width:16%}.dashboard-compact .col-cartable{width:14%}.city-system-link{width:20px;height:20px;font-size:11px}}

/* v15: link icon beside city + wide challenges page */
.city-system-link{font-size:0!important}
.city-system-link::before{content:'🔗';font-size:12px;line-height:1}
.challenge-page-head{margin-bottom:12px;padding:14px 16px}
.compact-header{align-items:center;margin-bottom:0}
.challenge-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.inline-filter-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0}
.inline-filter-form label{font-size:12px;color:var(--muted);font-weight:900}
.inline-filter-form .input{min-width:180px;max-width:240px;min-height:34px;padding:6px 9px;font-size:12px;border-radius:10px}
.is-hidden{display:none!important}
.challenge-form-card{border-color:#CFE1F5;background:linear-gradient(135deg,#fff,#F8FBFF)}
.challenge-form-grid{grid-template-columns:repeat(2,minmax(240px,1fr));gap:8px 14px}
.challenge-form-grid .span-2{grid-column:1/-1}
.challenge-open-check{align-self:end;margin-top:28px;color:var(--navy);font-weight:800}
.challenge-table-wrap{overflow:auto;max-height:70vh}
.challenge-wide-table{min-width:1500px}
.challenge-wide-table th,.challenge-wide-table td{font-size:12px;vertical-align:top;text-align:right}
.challenge-wide-table th{position:sticky;top:0;z-index:3}
.challenge-title-col{min-width:190px;font-weight:800;color:var(--navy)}
.challenge-desc-col{min-width:260px;max-width:360px;color:#334155;line-height:1.7}
.challenge-action-col{min-width:240px;max-width:340px;color:#334155;line-height:1.7}
.challenge-closed-row{opacity:.62;background:#F8FAFC}
.badge-open{background:#DCFCE7;color:#166534}
.table-actions{margin:0;gap:6px;flex-wrap:nowrap}
.table-actions form{display:inline-flex;margin:0}
@media (max-width:760px){.challenge-form-grid{grid-template-columns:1fr}.challenge-head-actions{justify-content:flex-start}.inline-filter-form .input{max-width:none}}
/* v16: نمایش نسخه سامانه کنار نام شهر */
.city-title-line { gap: 6px; align-items: baseline; }
.city-version-inline {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 500;
    margin-inline-start: 4px;
    white-space: nowrap;
}

/* v17: wide cities page */
.city-page-head{margin-bottom:12px;padding:14px 16px}
.city-form-card{border-color:#CFE1F5;background:linear-gradient(135deg,#fff,#F8FBFF)}
.city-form-grid{grid-template-columns:repeat(2,minmax(240px,1fr));gap:8px 14px}
.city-form-grid .span-2{grid-column:1/-1}
.city-pause-check{align-self:end;margin-top:28px;color:var(--navy);font-weight:800}
.city-table-wrap{overflow:auto;max-height:72vh}
.city-wide-table{min-width:1500px}
.city-wide-table th,.city-wide-table td{font-size:12px;vertical-align:top;text-align:right}
.city-wide-table th{position:sticky;top:0;z-index:3}
.city-list-name{min-width:210px}
.city-list-name .city-title-line{justify-content:flex-start;align-items:center;gap:6px}
.city-list-name strong{display:inline-block;color:var(--navy);font-size:13px}
.city-list-name small{display:block;margin-top:3px}
.city-stage-col{min-width:200px;color:#334155;line-height:1.7}
.city-action-col{min-width:210px;color:#334155;line-height:1.7}
@media (max-width:760px){.city-form-grid{grid-template-columns:1fr}.city-page-head .challenge-head-actions{justify-content:flex-start}}

/* v18: compact cities table + modal details */
.city-table-compact-wrap{overflow:visible;max-height:none;border-radius:16px}
.city-compact-table{min-width:0!important;width:100%;table-layout:fixed}
.city-compact-table th,.city-compact-table td{font-size:12px;text-align:center;vertical-align:middle;padding:10px 8px;overflow-wrap:anywhere;word-break:normal}
.city-compact-table th:nth-child(1),.city-compact-table td:nth-child(1){width:54px}
.city-compact-table th:nth-child(2),.city-compact-table td:nth-child(2){width:23%;text-align:right}
.city-compact-table th:nth-child(3),.city-compact-table td:nth-child(3){width:14%}
.city-compact-table th:nth-child(4),.city-compact-table td:nth-child(4){width:18%}
.city-compact-table th:nth-child(5),.city-compact-table td:nth-child(5){width:15%}
.city-compact-table th:nth-child(6),.city-compact-table td:nth-child(6){width:78px}
.city-compact-table th:nth-child(7),.city-compact-table td:nth-child(7){width:74px}
.city-compact-table th:nth-child(8),.city-compact-table td:nth-child(8){width:168px;text-align:center}
.compact-city-name small{line-height:1.55}
.city-actions{justify-content:center;gap:5px;flex-wrap:wrap}
.city-actions .btn{padding:5px 8px;font-size:11px;border-radius:10px}
.city-actions form{display:inline-flex;margin:0}
.city-show-btn{background:#EEF5FF;border-color:#CFE1F5;color:var(--navy-3);font-weight:800}
.icon-link{font-size:13px;padding:1px 5px;line-height:1;border-radius:8px;background:#EAF1F9;color:var(--navy-3);border:1px solid #CFE1F5}
.city-stage-col,.city-action-col{font-size:11px;line-height:1.6;color:#334155}
.pause-col small{display:block;margin-top:3px}
.active-col .badge,.pause-col .badge{font-size:10px;padding:3px 7px}

.app-modal{display:none;position:fixed;inset:0;z-index:1000;align-items:center;justify-content:center;padding:18px}
.app-modal.is-open{display:flex}
.app-modal-backdrop{position:absolute;inset:0;background:rgba(11,31,58,.48);backdrop-filter:blur(2px)}
.app-modal-card{position:relative;width:min(860px,96vw);max-height:88vh;overflow:auto;background:#fff;border-radius:24px;border:1px solid var(--border);box-shadow:0 24px 80px rgba(11,31,58,.24);padding:20px}
.app-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:14px}
.app-modal-head h2{margin:0;color:var(--navy);font-size:18px;font-weight:900}
.app-modal-head span{display:block;color:var(--muted);font-size:12px;margin-top:3px}
.modal-close{border:0;background:#F1F5F9;color:var(--navy);width:34px;height:34px;border-radius:12px;font-size:22px;line-height:1;cursor:pointer}
.modal-close:hover{background:#E2E8F0}
.city-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.city-detail-grid section{border:1px solid var(--border);border-radius:18px;padding:14px;background:#FBFDFF}
.city-detail-grid h3{margin:0 0 10px;color:var(--navy-3);font-size:13px;font-weight:900}
.city-detail-grid dl{margin:0;display:grid;grid-template-columns:120px minmax(0,1fr);gap:7px 10px;align-items:start}
.city-detail-grid dt{color:var(--muted);font-size:11px;font-weight:700}
.city-detail-grid dd{margin:0;color:#0F172A;font-size:12px;font-weight:600;min-width:0;overflow-wrap:anywhere}
.city-detail-grid dd.multiline{white-space:pre-wrap;line-height:1.8}
.modal-url{display:block;margin-top:4px;color:var(--muted);direction:ltr;text-align:left;font-size:10px}
@media (max-width: 900px){
  .city-compact-table{table-layout:auto}
  .city-table-compact-wrap{overflow:auto}
  .city-compact-table{min-width:860px!important}
  .city-detail-grid{grid-template-columns:1fr}
}

/* v19: true modal overlay + no horizontal scroll in cities table */
body.modal-open{overflow:hidden}
.app-modal[hidden]{display:none!important}
.app-modal{position:fixed!important;inset:0!important;z-index:99999!important;display:none!important;align-items:center!important;justify-content:center!important;padding:20px!important}
.app-modal.is-open{display:flex!important}
.app-modal-backdrop{position:fixed!important;inset:0!important;background:rgba(11,31,58,.56)!important;backdrop-filter:blur(3px)!important;z-index:0!important}
.app-modal-card{position:relative!important;z-index:1!important;width:min(820px,94vw)!important;max-height:86vh!important;overflow:auto!important;background:#fff!important;border-radius:24px!important;box-shadow:0 28px 90px rgba(11,31,58,.32)!important}

.city-table-compact-wrap{overflow-x:hidden!important;overflow-y:visible!important;width:100%!important}
.city-compact-table{width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important}
.city-compact-table th,.city-compact-table td{padding:9px 6px!important;white-space:normal!important;overflow:hidden!important;text-overflow:ellipsis!important;overflow-wrap:anywhere!important}
.city-compact-table th:nth-child(1),.city-compact-table td:nth-child(1){width:42px!important}
.city-compact-table th:nth-child(2),.city-compact-table td:nth-child(2){width:28%!important;text-align:right!important}
.city-compact-table th:nth-child(3),.city-compact-table td:nth-child(3){width:18%!important}
.city-compact-table th:nth-child(4),.city-compact-table td:nth-child(4){width:18%!important}
.city-compact-table th:nth-child(5),.city-compact-table td:nth-child(5){width:70px!important}
.city-compact-table th:nth-child(6),.city-compact-table td:nth-child(6){width:70px!important}
.city-compact-table th:nth-child(7),.city-compact-table td:nth-child(7){width:150px!important}
.city-stage-col{max-width:100%;display:table-cell!important}
.city-stage-col,.cartable-cell small,.cartable-cell em{display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important}
.city-actions{display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;flex-wrap:nowrap!important}
.city-actions .btn{padding:5px 7px!important;font-size:10.5px!important;min-width:auto!important}
.city-actions form{display:inline-flex!important}
.compact-city-name small{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.city-title-line{display:flex;align-items:center;gap:5px;min-width:0}
.city-title-line strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
@media (max-width:900px){
  .city-table-compact-wrap{overflow-x:hidden!important}
  .city-compact-table{min-width:0!important;font-size:11px!important}
  .city-compact-table th,.city-compact-table td{font-size:10.5px!important;padding:7px 4px!important}
  .city-compact-table th:nth-child(7),.city-compact-table td:nth-child(7){width:120px!important}
  .city-actions .btn{padding:4px 5px!important;font-size:9.5px!important}
}

/* Jalali date picker */
.jalali-date {
    cursor: pointer;
    background-image: linear-gradient(transparent, transparent), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231c3763' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 36px !important;
}
.jdp-popover {
    position: absolute;
    z-index: 99999;
    width: 292px;
    display: none;
    direction: rtl;
    background: #fff;
    border: 1px solid rgba(28, 55, 99, .18);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 34, 66, .18);
    padding: 12px;
    font-family:'Vazirmatn',Tahoma,Arial,sans-serif;
}
.jdp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.jdp-head button,
.jdp-actions button {
    border: 0;
    background: #f2f6fb;
    color: #1c3763;
    border-radius: 10px;
    padding: 7px 10px;
    cursor: pointer;
    font: inherit;
}
.jdp-head button:hover,
.jdp-actions button:hover,
.jdp-day:hover { background: #e6eef8; }
.jdp-title { color: #172f55; font-size: 14px; }
.jdp-week,
.jdp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.jdp-week span {
    font-size: 11px;
    color: #7a8798;
    padding: 4px 0;
}
.jdp-day,
.jdp-blank {
    height: 34px;
    border-radius: 10px;
}
.jdp-day {
    border: 0;
    background: transparent;
    color: #233a5c;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}
.jdp-day.is-today {
    outline: 1px dashed #1c3763;
    outline-offset: -3px;
}
.jdp-day.is-selected {
    background: #1c3763;
    color: #fff;
}
.jdp-actions {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 10px;
}
.jdp-actions .jdp-clear { color: #a34040; }

/* v22 project-control enhancements */
.manager-line{display:block;color:#40516b;font-size:11px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.updated-line{display:block;color:#728197;font-size:10.5px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.updated-line.stale{color:#b45309;font-weight:700}
.row-stale td{box-shadow:inset 0 0 0 999px rgba(251,191,36,.035)}
.stat-overdue b{color:#b91c1c}
.importance-badge{display:inline-flex;align-items:center;border-radius:999px;padding:2px 6px;font-size:10px;margin-inline-start:4px;border:1px solid transparent;white-space:nowrap}
.importance-normal{background:#eef2f7;color:#475569;border-color:#d9e2ef}
.importance-important{background:#dbeafe;color:#1d4ed8;border-color:#bfdbfe}
.importance-urgent{background:#ffedd5;color:#c2410c;border-color:#fed7aa}
.importance-critical{background:#fee2e2;color:#b91c1c;border-color:#fecaca}
.settings-quick-nav{position:sticky;top:0;z-index:5;display:flex;gap:8px;flex-wrap:wrap;background:rgba(246,249,253,.94);backdrop-filter:blur(6px);padding:10px;border:1px solid rgba(28,55,99,.08);border-radius:18px;margin-bottom:12px}
.settings-quick-nav a{padding:7px 11px;border-radius:999px;background:#fff;color:#1c3763;text-decoration:none;font-size:12px;border:1px solid rgba(28,55,99,.12)}
.settings-quick-nav a:hover{background:#eaf1fb}
.compact-settings-section .settings-body{padding-top:10px}
.progress-weight-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.weight-card{border:1px solid rgba(28,55,99,.12);border-radius:18px;background:#fff;padding:12px}
.weight-card h3{margin:0 0 10px;font-size:14px;color:#1c3763}
.weight-card label{display:grid;grid-template-columns:1fr 72px;align-items:center;gap:8px;margin-bottom:8px;font-size:12px;color:#40516b}
.weight-card .input{height:34px;text-align:center}
.report-table th,.report-table td,.history-table th,.history-table td{font-size:12px;vertical-align:top}
.history-table td{max-width:220px;overflow-wrap:anywhere}
@media(max-width:900px){.progress-weight-grid{grid-template-columns:1fr}.settings-quick-nav{position:static}.weight-card label{grid-template-columns:1fr 64px}}

/* v23: minimal inline CSS icons */
.icon-text{display:inline-flex!important;align-items:center;gap:4px;min-width:0}
.css-icon{display:inline-block;position:relative;flex:0 0 auto;width:13px;height:13px;color:currentColor;opacity:.85}
.icon-user::before{content:'';position:absolute;top:1px;left:4px;width:5px;height:5px;border:1.7px solid currentColor;border-radius:50%;background:transparent}
.icon-user::after{content:'';position:absolute;left:1.5px;bottom:1px;width:10px;height:5.5px;border:1.7px solid currentColor;border-top-left-radius:7px;border-top-right-radius:7px;border-bottom:0;background:transparent}
.icon-refresh{border:1.7px solid currentColor;border-left-color:transparent;border-radius:50%;box-sizing:border-box}
.icon-refresh::after{content:'';position:absolute;right:-1px;top:0;width:4px;height:4px;border-top:1.7px solid currentColor;border-right:1.7px solid currentColor;transform:rotate(25deg);border-radius:1px}
.manager-line.icon-text,.updated-line.icon-text{display:flex!important;width:100%}
.manager-line .css-icon{color:#1E3A8A}
.updated-line .css-icon{color:#64748B}
.updated-line.stale .css-icon{color:#b45309}
.city-manager-mini{display:flex!important;color:#64748B;font-size:11px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.city-manager-mini .css-icon{color:#1E3A8A;width:12px;height:12px}
.history-city-btn{background:#F8FAFC!important;color:#334155!important;border-color:#CBD5E1!important}
.history-city-btn:hover{background:#E2E8F0!important;color:#0F172A!important}

/* v24: Bootstrap Icons + tabbed settings */
.icon-text{display:inline-flex!important;align-items:center;gap:5px;min-width:0}
.icon-text .bi{font-size:13px;line-height:1;flex:0 0 auto;color:currentColor;opacity:.9}
.manager-line .bi,.city-manager-mini .bi{color:#1E3A8A}
.updated-line .bi{color:#64748B}
.updated-line.stale .bi{color:#b45309}
.city-system-link{font-size:14px!important}
.city-system-link::before{content:none!important;display:none!important}
.city-system-link .bi{font-size:14px;line-height:1}
.history-city-btn{display:inline-flex!important;align-items:center;justify-content:center;gap:5px}
.history-city-btn .bi{font-size:13px;line-height:1}

.settings-tabs{position:sticky;top:0;z-index:8;display:flex;gap:8px;flex-wrap:wrap;background:rgba(246,249,253,.96);backdrop-filter:blur(8px);padding:10px;border:1px solid rgba(28,55,99,.08);border-radius:18px;margin-bottom:12px;box-shadow:0 10px 24px rgba(15,23,42,.04)}
.settings-tabs a{display:inline-flex;align-items:center;justify-content:center;padding:8px 13px;border-radius:999px;background:#fff;color:#1c3763;text-decoration:none;font-size:12px;font-weight:800;border:1px solid rgba(28,55,99,.12);transition:.15s ease;white-space:nowrap}
.settings-tabs a:hover{background:#eaf1fb;transform:translateY(-1px)}
.settings-tabs a.active{background:#1c3763;color:#fff;border-color:#1c3763;box-shadow:0 8px 18px rgba(28,55,99,.18)}
.tidy-settings>.settings-section[hidden]{display:none!important}
.tidy-settings>.settings-section{margin-bottom:0}
.tidy-settings>.settings-section>summary{cursor:default;pointer-events:none;background:linear-gradient(180deg,#fff,#F8FAFC)}
.tidy-settings>.settings-section .settings-body{max-height:calc(100vh - 285px);overflow:auto;scrollbar-width:thin}
.settings-intro{margin-bottom:0}
@media(max-width:900px){.settings-tabs{position:static}.tidy-settings>.settings-section .settings-body{max-height:none;overflow:visible}.settings-tabs a{font-size:11.5px;padding:7px 10px}}


/* v25: requested UX refinements */
.tidy-settings>.settings-section .settings-body{max-height:none!important;overflow:visible!important;height:auto!important;}
.tidy-settings>.settings-section{overflow:visible!important;}
.settings-layout,.tidy-settings{overflow:visible!important;}
.city-compact-table th:nth-child(1),.city-compact-table td:nth-child(1){width:42px!important}
.city-compact-table th:nth-child(2),.city-compact-table td:nth-child(2){width:27%!important;text-align:right!important}
.city-compact-table th:nth-child(3),.city-compact-table td:nth-child(3){width:19%!important}
.city-compact-table th:nth-child(4),.city-compact-table td:nth-child(4){width:74px!important}
.city-compact-table th:nth-child(5),.city-compact-table td:nth-child(5){width:74px!important}
.city-compact-table th:nth-child(6),.city-compact-table td:nth-child(6){width:220px!important;min-width:220px!important}
.city-actions{gap:6px!important;flex-wrap:wrap!important;min-width:210px!important}
.city-actions .btn{padding:6px 8px!important;font-size:11px!important}
.city-actions .history-city-btn span{display:inline!important}
.city-manager-mini .bi,.manager-line .bi{font-size:12px!important;color:#475569!important;opacity:.85!important}
.challenge-head-actions .inline-filter-form label{display:none!important}

/* v26: city form cleanup + optional pause modal + status notes */
.city-form-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px 12px!important;align-items:start}
.city-form-grid .span-2{grid-column:span 2!important}
.city-form-grid .span-3,.city-form-grid .full{grid-column:1/-1!important}
.form-section-title{display:flex;align-items:center;gap:7px;margin:2px 0 0;padding:9px 11px;border-radius:14px;background:#F1F5F9;color:#1E3A8A;font-weight:900;font-size:12px;border:1px solid #E2E8F0}
.form-section-title .bi{font-size:14px}
.status-note-mini{display:block;margin-top:4px;padding:3px 7px;border-radius:9px;background:#F8FAFC;color:#475569;font-size:10.5px;line-height:1.55;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border:1px solid #E2E8F0}
.warning{background:#FFF7ED!important;color:#9A3412!important;border-color:#FED7AA!important}
.warning:hover{background:#FFEDD5!important}
.compact-modal{max-width:520px!important}
.pause-modal-form label{display:block;font-weight:800;color:#1c3763;margin:10px 0 5px}
.pause-resume-box{padding:10px 12px;border:1px solid #FED7AA;border-radius:14px;background:#FFF7ED;margin-bottom:10px}
.pause-fields[hidden],.pause-resume-box[hidden]{display:none!important}
.city-actions{min-width:250px!important}
.city-form-card .actions-bar.full{margin-top:4px}
@media(max-width:980px){.city-form-grid{grid-template-columns:1fr!important}.city-form-grid .span-2,.city-form-grid .span-3,.city-form-grid .full{grid-column:1/-1!important}.status-note-mini{max-width:100%}}


/* ===== v27 definitive topbar/background fix =====
   علت: اگر --navy-3 یا --shadow تعریف نشده باشد، background gradient کامل invalid می‌شود.
   این بخش عمداً انتهای فایل آمده تا روی قوانین قبلی غلبه کند.
*/
:root{
  --navy:#0b1f3a;
  --navy-2:#102b4e;
  --navy-3:#163f6b;
  --blue:#1768ac;
  --blue-2:#1e88d6;
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#152033;
  --muted:#64748b;
  --border:#e5e7eb;
  --shadow:0 12px 28px rgba(15,23,42,.08);
}

.topbar{
  background:linear-gradient(135deg, var(--navy, #0b1f3a), var(--navy-3, #163f6b)) !important;
  color:#fff !important;
  box-shadow:var(--shadow, 0 12px 28px rgba(15,23,42,.08)) !important;
  opacity:1 !important;
}

.topbar h1,
.topbar .brand-title,
.topbar .brand-subtitle,
.topbar p,
.topbar small,
.topbar a,
.topbar .user-name{
  color:#fff !important;
}

.topbar .logo,
.topbar .brand-badge,
.topbar .brand-mark{
  background:#fff !important;
  color:var(--navy, #0b1f3a) !important;
}

body{
  background:var(--bg, #f4f7fb) !important;
}

