/* طراحیِ تازهٔ PMO — بخشِ دوم: آیکون‌ها، ناوبریِ کناریِ دسکتاپ، داکِ تبلت، کانبان و پنلِ مدیر پروژه.
 * بعد از theme.css بار می‌شود. */

:root {
  --i-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V20h14V9.5'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E");
  --i-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6'/%3E%3Cpath d='M8 13h8M8 17h5'/%3E%3C/svg%3E");
  --i-kanban: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2.5'/%3E%3Cpath d='M9 4v16M15 4v16'/%3E%3C/svg%3E");
  --i-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 15 4-4 3 3 5-6'/%3E%3C/svg%3E");
  --i-coin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M14.6 9.4C14.1 8.5 13.1 8 12 8c-1.7 0-3 .9-3 2s1.3 1.7 3 2 3 .9 3 2-1.3 2-3 2c-1.1 0-2.1-.5-2.6-1.4M12 6.5v11'/%3E%3C/svg%3E");
  --i-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3C/svg%3E");
  --i-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3.2 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17.2l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z'/%3E%3C/svg%3E");
  --i-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E");
  --i-archive: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1.5'/%3E%3Cpath d='M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9'/%3E%3Cpath d='M10 13h4'/%3E%3C/svg%3E");
  --i-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.5a6 6 0 0 1 3.5 5.5'/%3E%3C/svg%3E");
  --i-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13'/%3E%3Cpath d='M3.5 6h.01M3.5 12h.01M3.5 18h.01'/%3E%3C/svg%3E");
  --i-message: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8.5 8.5 0 0 1-12.4 7.6L3.5 21l1.4-4.8A8.5 8.5 0 1 1 21 12z'/%3E%3C/svg%3E");
  --i-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
  --i-monitor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E");
  --i-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2.5' width='10' height='19' rx='2.5'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E");
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  --i-bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 8 3 8H3s3-1 3-8'/%3E%3Cpath d='M10.3 20a2 2 0 0 0 3.4 0'/%3E%3C/svg%3E");
}
button[onclick*="switchAdminSection('home')"],
button[onclick*="switchAfrTab('dashboard')"],
button[onclick*="switchViewerTab('dashboard')"] { --ic: var(--i-home); }
button[onclick*="switchAdminSection('contracts')"],
button[onclick*="switchAfrTab('contracts')"],
button[onclick*="switchViewerTab('contracts')"],
button[onclick*="switchAccountingTab('contracts')"] { --ic: var(--i-doc); }
button[onclick*="switchAdminSection('kanban')"] { --ic: var(--i-kanban); }
button[onclick*="switchAdminSection('reports')"] { --ic: var(--i-chart); }
button[onclick*="switchAfrTab('financial')"],
button[onclick*="switchViewerTab('financial')"],
button[onclick*="switchAccountingTab('financial')"] { --ic: var(--i-coin); }
button[onclick*="switchAdminSection('more')"],
button[onclick*="switchAfrTab('more')"],
button[onclick*="switchViewerTab('more')"] { --ic: var(--i-grid); }
button[onclick*="switchViewerTab('special')"] { --ic: var(--i-star); }
button[onclick*="switchAdminTab('exports')"],
button[onclick*="switchAccountingTab('exports')"] { --ic: var(--i-download); }
button[onclick*="switchAdminTab('backup')"] { --ic: var(--i-archive); }
button[onclick*="switchAdminTab('users')"] { --ic: var(--i-users); }
button[onclick*="switchAdminTab('log')"] { --ic: var(--i-list); }
button[onclick*="switchAdminTab('pmoComments')"] { --ic: var(--i-message); }
button[onclick*="switchAdminTab('pmoMessages')"] { --ic: var(--i-mail); }
button[onclick*="switchAdminTab('panels')"] { --ic: var(--i-monitor); }
button[onclick*="installApp()"] { --ic: var(--i-phone); }
button[onclick*="openAddModal()"] { --ic: var(--i-plus); }
button[onclick*="openNotifications()"] { --ic: var(--i-bell); }

/* ───────── آیکون‌های خطیِ یکدست به‌جای نمادها و ایموجی‌های ناوبری (همان دکمه‌ها، فقط تصویر) */
.admin-bottom-nav button span, .admin-hub-grid button span, .admin-home-actions button span {
  display: block; width: 22px; height: 22px; margin: 0 auto; font-size: 0 !important; line-height: 0;
  background-color: currentColor;
  -webkit-mask: var(--ic, var(--i-grid)) center / contain no-repeat; mask: var(--ic, var(--i-grid)) center / contain no-repeat;
}
.admin-home-actions button span { width: 24px; height: 24px; }
.admin-hub-grid button span { width: 24px; height: 24px; color: var(--amber); }
.admin-hub-grid button.active span { color: currentColor; }

/* ───────── ناوبریِ موبایل: نشانگرِ قرصیِ نقشِ فعال روی آیکون */
.admin-bottom-nav { gap: 4px; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); }
.admin-bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: transparent !important; box-shadow: none !important; padding: 4px 2px 2px; }
.admin-bottom-nav button span { width: 22px; height: 22px; padding: 0; position: relative; }
.admin-bottom-nav button::before {
  content: ''; position: absolute; width: 54px; height: 30px; border-radius: 999px; margin-top: -4px;
  background: transparent; transition: background-color .2s ease;
}
.admin-bottom-nav button { position: relative; }
.admin-bottom-nav button.active::before { background: var(--amber-dim); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 30%, transparent); }
.admin-bottom-nav button.active { color: var(--amber); font-weight: 900; }

/* ───────── دکمه‌های میان‌بُر و قهرمانِ پنلِ مدیر پروژه */
.viewer-quicklinks { gap: 8px; }
.viewer-quicklinks button {
  border-radius: var(--r-m) !important; padding: 12px 12px !important; font-size: 12.5px !important; text-align: start;
  background: var(--panel) !important; box-shadow: var(--lift);
}
.viewer-quicklinks button:hover { color: var(--ink); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)) !important; }
.viewer-quicklinks button.active { background: var(--teal-dim) !important; color: var(--teal) !important; }
.viewer-hero {
  border-radius: var(--r-l) !important; box-shadow: var(--lift);
  background: linear-gradient(120deg, rgba(226, 167, 92, .16), transparent 55%), var(--panel) !important;
}
.viewer-hero-title { font-size: 16px; }
.viewer-report-note { font-size: 12.5px; }
.kpi-card[onclick]:hover { border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); box-shadow: var(--lift-hover); }

/* کانبان */
.admin-kanban-card { border-radius: var(--r-m); padding: 14px 16px; box-shadow: var(--lift); }
.admin-kanban-card:hover { border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); box-shadow: var(--lift-hover); }
.admin-kanban-card-title strong { font-size: 14.5px; font-weight: 800; }
.admin-kanban-card-title span { font-size: 11px; }
.admin-kanban-progress { height: 6px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.admin-kanban-progress span { background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 65%, transparent), var(--teal)); }
.admin-kanban-meta { font-size: 11.5px; }
.admin-kanban-stages button { padding: 8px 13px; font-size: 12px; }
.admin-kanban-stages button.active { background: var(--amber-dim); }

/* ───────── دسکتاپ (≥۱۱۰۰px): ناوبری به نوارِ کناریِ ثابت تبدیل می‌شود */
@media (min-width: 1100px) {
  header .wrap { max-width: none; padding-inline: 28px; }
  body:has(.admin-bottom-nav) #app.wrap {
    max-width: min(1240px, calc(100vw - 316px)); margin-inline-start: 276px; margin-inline-end: auto; padding-inline: 12px 28px;
  }
  body:has(.admin-bottom-nav) .admin-shell { padding-bottom: 40px; }
  .admin-bottom-nav {
    top: 92px !important; bottom: auto !important; right: 20px !important; left: auto !important; transform: none !important;
    width: 236px !important; display: flex !important; flex-direction: column; gap: 4px;
    padding: 12px !important; border-radius: 18px; border: 1px solid var(--line) !important; box-shadow: var(--lift-hover);
    background: var(--panel) !important;
  }
  .admin-bottom-nav::before {
    content: 'ناوبری'; display: block; font-size: 11px; font-weight: 800; color: var(--ink-faint);
    padding: 2px 10px 8px; letter-spacing: .2px;
  }
  .admin-bottom-nav button {
    flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 13.5px; font-weight: 700;
    padding: 11px 12px; border-radius: 12px; text-align: start; color: var(--ink-soft);
  }
  .admin-bottom-nav button span { margin: 0; flex-shrink: 0; }
  .admin-bottom-nav button::before { inset: 0; width: auto; height: auto; margin: 0; border-radius: 12px; }
  .admin-bottom-nav button:hover::before { background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .admin-bottom-nav button.active::before { background: var(--amber-dim); }
  .admin-bottom-nav button.active::after {
    content: ''; position: absolute; inset-inline-start: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--amber);
  }
  .admin-bottom-nav button > * { position: relative; }
  .admin-bottom-nav button { isolation: isolate; }
  .admin-bottom-nav button::before { z-index: -1; }
  /* داشبورد پهن: KPI ها در یک ردیف، دکمه‌های میان‌بُر کنارِ هم */
  .kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .viewer-quicklinks button { flex: 1 1 0; }
  .admin-hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-kanban-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
  /* فیلترهای «مدیریتِ قراردادها» در یک ردیف */
  #adminBody:has(> #adminSearch) { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 1fr); column-gap: 10px; align-items: start; }
  #adminBody:has(> #adminSearch) > * { grid-column: 1 / -1; }
  #adminBody > #adminSearch { grid-column: 1; }
  #adminBody:has(> #adminSearch) > div:has(#stageFilter) { grid-column: 2; }
  #adminBody:has(> #adminSearch) > div:has(#contractMonthFilter) { grid-column: 3; }
}
@media (min-width: 1100px) and (max-width: 1279px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* تبلت (۷۶۰ تا ۱۰۹۹): داکِ شناورِ پایین، محتوا پهن‌تر */
@media (min-width: 760px) and (max-width: 1099px) {
  .wrap { max-width: 920px; padding: 0 24px; }
  .admin-shell { padding-bottom: 108px; }
  .admin-bottom-nav {
    width: min(640px, calc(100% - 40px)); bottom: 14px; border-radius: 18px;
    border: 1px solid var(--line) !important; box-shadow: var(--lift-hover);
  }
}
