*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #f7f6f3; --surface: #ffffff; --surface2: #f1f0ec;
    --border: rgba(0,0,0,0.1); --border2: rgba(0,0,0,0.18);
    --text: #1a1a18; --text2: #6b6b68; --text3: #9a9a96;
    --primary: #0f6e56; --primary-light: #e1f5ee;
    --gov: #185fa5; --gov-light: #e6f1fb;
    --priv: #854f0b; --priv-light: #faeeda;
    --active: #3b6d11; --active-light: #eaf3de;
    --expired: #a32d2d; --expired-light: #fcebeb;
    --new-c: #534ab7; --new-light: #eeedfe;
    --radius: 10px; --radius-sm: 6px;
  }
  body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; direction: rtl; }
  .container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
  .kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; margin-bottom: 1.2rem; }
  .kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; position: relative; overflow: hidden; }
  .kpi-card::before { content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%; background: var(--accent, var(--primary)); border-radius: 0 var(--radius) var(--radius) 0; }
  .kpi-label { font-size: 11px; color: var(--text2); margin-bottom: 4px; }
  .kpi-value { font-size: 24px; font-weight: 700; color: var(--accent, var(--primary)); }
  .toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
  .toolbar input, .toolbar select { font-family: inherit; font-size: 13px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border2); background: var(--bg); color: var(--text); direction: rtl; outline: none; }
  .toolbar input { flex: 1; min-width: 160px; }
  .toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }
  .toolbar label { font-size: 12px; color: var(--text2); white-space: nowrap; }
  .charts-row { display: grid; grid-template-columns: 300px 1fr; gap: 10px; margin-bottom: 1.2rem; }
  .chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
  .chart-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
  .chart-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text2); }
  .legend-item { display: flex; align-items: center; gap: 4px; }
  .legend-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
  .table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.2rem; }
  .table-header { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
  .table-header h3 { font-size: 13px; font-weight: 600; }
  .table-header .count { font-size: 12px; color: var(--text2); }
  table { width: 100%; border-collapse: collapse; font-size: 12px; }
  thead th { padding: 9px 12px; text-align: right; font-weight: 600; font-size: 11px; color: var(--text2); background: var(--surface2); border-bottom: 1px solid var(--border); white-space: nowrap; }
  tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--surface2); }
  tbody tr.selected { background: #e8f4f1; }
  td { padding: 10px 12px; vertical-align: middle; }
  .td-name { font-weight: 500; }
  .td-num { text-align: center; font-weight: 600; }
  .badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
  .detail-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 1.2rem; display: none; }
  .detail-panel.show { display: block; }
  .detail-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
  .detail-meta { font-size: 12px; color: var(--text2); margin-bottom: 12px; }
  .detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
  .detail-stat { background: var(--surface2); border-radius: var(--radius-sm); padding: 10px 12px; }
  .detail-stat-label { font-size: 11px; color: var(--text2); margin-bottom: 3px; }
  .detail-stat-val { font-size: 16px; font-weight: 700; color: var(--text); }
  .detail-section { margin-bottom: 10px; }
  .detail-section-title { font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
  .detail-section-body { font-size: 13px; line-height: 1.6; color: var(--text); background: var(--surface2); border-radius: var(--radius-sm); padding: 10px 12px; }
  .close-detail-btn { background: none; border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--text2); }
  .close-detail-btn:hover { background: var(--surface2); }
  @media(max-width:700px){.kpi-grid{grid-template-columns:repeat(2,1fr);}.charts-row{grid-template-columns:1fr;}.detail-stats{grid-template-columns:repeat(2,1fr);}}