@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{
  --bg:#eef1f6; --surface:#ffffff; --surface-2:#f8fafc;
  --ink:#16202e; --muted:#64748b; --faint:#94a3b8; --border:#e5e9f0;
  --primary:#0f5c73; --primary-2:#127e9c; --ember:#c2570c; --ember-soft:#fdf0e6;
  --ok:#2f9e44; --warn:#f08c00; --bad:#e03131;
  --side-1:#122636; --side-2:#1b3b54;
  --shadow:0 1px 2px rgba(16,32,46,.04),0 6px 20px rgba(16,32,46,.06);
  --radius:16px;
  --c1:#127e9c; --c2:#c2570c; --c3:#2f9e44; --c4:#7048e8; --c5:#e8590c; --c6:#1098ad; --c7:#f59f00;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:'Vazirmatn',system-ui,sans-serif;background:var(--bg);color:var(--ink);font-size:15px;line-height:1.7;-webkit-font-smoothing:antialiased}
h1,h3{margin:0;font-weight:700}
button{font-family:inherit;cursor:pointer}
select{font-family:inherit}

/* icons via SVG masks (offline, crisp) */
.ic{display:inline-block;width:1.2em;height:1.2em;background-color:currentColor;vertical-align:-.2em;
  -webkit-mask:var(--i) center/contain no-repeat;mask:var(--i) center/contain no-repeat}
.ic-grid{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E")}
.ic-layers{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 3 8l9 5 9-5-9-5Z'/%3E%3Cpath d='M3 13l9 5 9-5'/%3E%3C/svg%3E")}
.ic-blast{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 2v5M12 17v5M2 12h5M17 12h5M5 5l3 3M16 16l3 3M19 5l-3 3M8 16l-3 3'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E")}
.ic-truck{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M2 6h11v9H2zM13 9h4l3 3v3h-7z'/%3E%3Ccircle cx='6' cy='18' r='1.6'/%3E%3Ccircle cx='17' cy='18' r='1.6'/%3E%3C/svg%3E")}
.ic-shield{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6l7-3Z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E")}
.ic-menu{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E")}
.ic-print{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6M6 18H4v-6h16v6h-2M8 14h8v6H8z'/%3E%3C/svg%3E")}
.ic-info{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E")}
.ic-id{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8' cy='11' r='2'/%3E%3Cpath d='M13 10h5M13 14h5M5 15c.7-1.3 4.3-1.3 5 0'/%3E%3C/svg%3E")}
.ic-cart{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.5 11h10L20 7H6'/%3E%3Ccircle cx='9' cy='19' r='1.5'/%3E%3Ccircle cx='17' cy='19' r='1.5'/%3E%3C/svg%3E")}
.ic-drop{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11Z'/%3E%3C/svg%3E")}
.ic-flask{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M9 3h6M10 3v6l-5 9a2 2 0 0 0 2 3h10a2 2 0 0 0 2-3l-5-9V3'/%3E%3Cpath d='M7 15h10'/%3E%3C/svg%3E")}
.ic-home{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E")}
.ic-map{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11a7 7 0 0 1 14 0c0 4.8-7 11-7 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E")}
.ic-chart{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M7 16v-5M12 16V7M17 16v-8'/%3E%3C/svg%3E")}
.ic-box{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 7l9-4 9 4-9 4-9-4Z'/%3E%3Cpath d='M3 7v10l9 4 9-4V7'/%3E%3Cpath d='M12 11v10'/%3E%3C/svg%3E")}
.ic-bell{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M6 16v-5a6 6 0 0 1 12 0v5l2 2H4l2-2Z'/%3E%3Cpath d='M10 20a2 2 0 0 0 4 0'/%3E%3C/svg%3E")}
.ic-org{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='5' rx='1'/%3E%3Crect x='3' y='16' width='6' height='5' rx='1'/%3E%3Crect x='15' y='16' width='6' height='5' rx='1'/%3E%3Cpath d='M12 8v4M6 16v-4h12v4'/%3E%3C/svg%3E")}

.app{display:flex;min-height:100vh}

/* sidebar (RTL: sits on the right) */
.sidebar{width:264px;flex:0 0 264px;background:linear-gradient(180deg,#122636,#1b3b54);color:#cdd9e5;
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{display:flex;gap:12px;align-items:center;padding:22px 20px;border-bottom:1px solid rgba(255,255,255,.08)}
.brand-logo{width:44px;height:44px;border-radius:12px;background:linear-gradient(135deg,var(--ember),#e8781f);
  display:grid;place-items:center;font-weight:700;font-size:22px;color:#fff;box-shadow:0 4px 12px rgba(194,87,12,.4)}
.brand-title{font-weight:700;color:#fff;font-size:15px}
.brand-sub{font-size:12px;color:#8ea6bd;margin-top:2px}
.nav{display:flex;flex-direction:column;gap:4px;padding:16px 12px;flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin}
a.nav-item{text-decoration:none}
.brand-logo{text-decoration:none}
.nav-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border:0;background:transparent;color:#b9c8d6;
  border-radius:12px;font-size:14.5px;font-weight:500;text-align:right;transition:all .16s}
.nav-item .ic{opacity:.85}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:rgba(18,126,156,.22);color:#fff;box-shadow:inset 3px 0 0 var(--ember)}
.side-footer{padding:16px 18px;border-top:1px solid rgba(255,255,255,.08);font-size:11.5px;color:#7f97ac}
.freshness{display:flex;align-items:center;gap:8px;color:#bcd0e0;margin-bottom:6px;font-size:12.5px}
.freshness .dot{width:8px;height:8px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 3px rgba(47,158,68,.25)}
.src{line-height:1.6}

/* main */
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;gap:16px;padding:16px 26px;background:var(--surface);
  border-bottom:1px solid var(--border)}
.menu-btn{display:none;border:0;background:transparent;color:var(--ink);font-size:20px;padding:4px}
.page-heading{flex:1;min-width:0}
.page-heading h1{font-size:19px}
.page-heading p{margin:2px 0 0;font-size:12.5px;color:var(--muted)}
.filters{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.field{display:flex;flex-direction:column;gap:3px}
.field label{font-size:11px;color:var(--muted)}
.field select{border:1px solid var(--border);background:var(--surface-2);border-radius:10px;padding:8px 10px;
  font-size:13px;color:var(--ink);min-width:118px}
.btn{border:1px solid transparent;border-radius:10px;padding:9px 15px;font-size:13px;font-weight:500;transition:all .15s}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-2)}
.btn-ghost{background:var(--surface-2);border-color:var(--border);color:var(--ink)}
.btn-ghost:hover{background:#eef2f7}
.btn-icon{padding:9px 11px}

.disclaimer{display:flex;align-items:center;gap:10px;margin:16px 26px 0;padding:11px 16px;
  background:var(--ember-soft);border:1px solid #f3d3b5;border-radius:12px;color:#8a3d06;font-size:12.5px}
.disclaimer .ic{flex:0 0 auto;color:var(--ember)}
.disclaimer span{flex:1}
.disclaimer .x{border:0;background:transparent;color:#b5651b;font-size:18px;line-height:1}

.page{display:none;padding:20px 26px 40px;animation:fade .25s ease}
.page.active{display:block}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* KPI cards */
.kpi-row{display:grid;grid-template-columns:repeat(5,1fr);gap:16px;margin-bottom:18px}
.kpi{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px;
  box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi::before{content:'';position:absolute;top:0;right:0;left:0;height:4px;background:var(--kc,var(--primary))}
.kpi-label{font-size:12.5px;color:var(--muted);margin-bottom:8px}
.kpi-value{font-size:26px;font-weight:700;color:var(--ink);letter-spacing:-.5px}
.kpi-unit{font-size:12px;color:var(--faint);font-weight:500;margin-inline-start:4px}
.kpi-sub{font-size:11.5px;color:var(--faint);margin-top:4px}

/* grid + cards */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:16px 18px;display:flex;flex-direction:column;min-width:0}
.card.span-2{grid-column:1 / -1}
.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:6px;flex-wrap:wrap}
.card-head h3{font-size:15px;flex:0 1 auto}
.card-head .card-why{margin-inline-start:auto;text-align:end}
.card-why{font-size:11.5px;color:var(--faint)}
.card-control{display:flex;align-items:center;gap:8px;margin:2px 0 4px;font-size:12.5px;color:var(--muted)}
.card-control select{border:1px solid var(--border);background:var(--surface-2);border-radius:8px;padding:5px 8px;font-size:12.5px}
.chart{width:100%;height:340px}
.card:not(.span-2) .chart{height:320px}

/* table */
.table-wrap{overflow:auto;max-height:360px;border-radius:10px;border:1px solid var(--border)}
table{width:100%;border-collapse:collapse;font-size:13px;white-space:nowrap}
thead th{position:sticky;top:0;background:var(--surface-2);color:var(--muted);font-weight:500;
  text-align:right;padding:10px 12px;border-bottom:1px solid var(--border)}
tbody td{padding:9px 12px;border-bottom:1px solid #f1f4f8;color:var(--ink)}
tbody tr:hover{background:var(--surface-2)}
.cell-alert{color:var(--bad);font-weight:700;background:rgba(224,49,49,.07);border-radius:6px}

/* row-cap footer: long tables paint a window of rows, this extends it */
.row-cap{position:sticky;bottom:0;display:flex;align-items:center;justify-content:center;gap:10px;
  padding:8px 12px;background:var(--surface-2);border-top:1px solid var(--border);
  color:var(--muted);font-size:12.5px}
.btn-more{border:1px solid var(--border);background:var(--surface);color:var(--ink);border-radius:8px;
  padding:5px 12px;font-family:inherit;font-size:12.5px;cursor:pointer}
.btn-more:hover{background:var(--surface-2);border-color:var(--primary)}

/* loading / empty */
.chart.loading::after,.table-wrap.loading::after{content:'در حال بارگذاری…';display:grid;place-items:center;
  height:100%;color:var(--faint);font-size:13px}
.empty{display:grid;place-items:center;height:100%;color:var(--faint);font-size:13px}

/* profile / geo / gap */
.profile{display:grid;grid-template-columns:repeat(3,1fr);gap:10px 18px;padding:6px 2px}
.profile-item{display:flex;flex-direction:column;gap:2px;padding:8px 0;border-bottom:1px dashed #eef2f7}
.profile-item .k{font-size:11.5px;color:var(--muted)}
.profile-item .v{font-size:14px;color:var(--ink);font-weight:500}
.geo{display:flex;flex-direction:column;gap:10px;font-size:13px}
.geo .coord{background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:10px 12px;color:var(--ink);word-break:break-word;line-height:1.9}
.geo .files{display:flex;flex-wrap:wrap;gap:6px}
.chip{background:#eef5f7;color:#0f5c73;border:1px solid #cfe3e9;border-radius:20px;padding:4px 11px;font-size:12px}
.badge{display:inline-flex;align-items:center;gap:6px;border-radius:20px;padding:4px 12px;font-size:12.5px;font-weight:500}
.badge.ok{background:#e6f5ec;color:#1b6b32}.badge.warn{background:#fdf0e6;color:#8a3d06}.badge.bad{background:#fceaea;color:#a51f1f}
.gap-note{display:flex;gap:12px;align-items:flex-start;background:repeating-linear-gradient(-45deg,#fbfcfe,#fbfcfe 10px,#f4f7fb 10px,#f4f7fb 20px);
  border:1px dashed #c9d4e0;border-radius:12px;padding:16px 18px;color:var(--muted);font-size:13px;line-height:1.9}
.gap-note .ic{color:var(--ember);flex:0 0 auto;font-size:20px}
.gap-note b{color:var(--ink);font-weight:500}
.table-wrap.tall{max-height:420px}

.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);opacity:0;
  background:#16202e;color:#fff;padding:11px 18px;border-radius:10px;font-size:13px;transition:all .25s;pointer-events:none;z-index:99}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* responsive */
.backdrop{display:none}
@media(max-width:1080px){.kpi-row{grid-template-columns:repeat(2,1fr)}.grid{grid-template-columns:1fr}.card.span-2{grid-column:auto}}
@media(max-width:980px){
  .sidebar{position:fixed;right:0;top:0;z-index:60;transform:translateX(100%);transition:transform .25s}
  .sidebar.open{transform:none;box-shadow:-12px 0 40px rgba(0,0,0,.25)}
  .menu-btn{display:block}
  .backdrop.show{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:55}
}
@media(max-width:560px){.kpi-row{grid-template-columns:1fr}.filters{gap:8px}.field select{min-width:98px}}

/* print */
@media print{
  .sidebar,.topbar .filters,.menu-btn,.disclaimer .x,.card-why{display:none!important}
  .app{display:block}.app-head{position:static}
  .page{display:block!important;padding:8px;page-break-after:always}
  .card{break-inside:avoid;box-shadow:none;border:1px solid #ccc}
  body{background:#fff}
}

/* ===== اصلاحات ۳۱ تیر ۱۴۰۵ ===== */
/* mine name shown on every page */
.mine-badge { display:inline-flex; align-items:center; gap:6px; margin-top:4px; font-size:12.5px; font-weight:700;
  color:#0f5c73; background:rgba(15,92,115,.08); padding:3px 10px; border-radius:999px; }
.mine-badge .dot { width:8px; height:8px; border-radius:50%; background:#0f5c73; }

/* collapsible cards — hidden in first view, revealed by clicking the header */
.card.collapsible > .card-head { cursor:pointer; user-select:none; }
.card.collapsible > .card-head::after { content:'▾'; margin-inline-start:auto; color:#94a3b8; font-size:14px; transition:transform .2s; }
.card.collapsible.collapsed > .card-head::after { transform:rotate(-90deg); }
.card.collapsible.collapsed > .card-head { margin-bottom:0; }
.card.collapsible.collapsed > .chart,
.card.collapsible.collapsed > .table-wrap,
.card.collapsible.collapsed > .card-control,
.card.collapsible.collapsed > [data-body] { display:none !important; }
.card.collapsible.collapsed { min-height:0; }
.reveal-hint { font-size:11px; color:#94a3b8; font-weight:500; margin-inline-start:8px; }

/* hidden extra KPI cards + toggle chip */
.kpi.kpi-extra { display:none; }
.kpi-row.show-extra .kpi.kpi-extra { display:flex; }
.kpi-more { align-self:center; border:1px dashed #cbd5e1; background:#fff; color:#475569; border-radius:12px;
  padding:8px 14px; font-family:inherit; font-size:12.5px; cursor:pointer; white-space:nowrap; }
.kpi-more:hover { border-color:#0f5c73; color:#0f5c73; }

/* searchable full-sheet tables (انبار و اموال / انبار ناریه) */
.search-box { display:flex; align-items:center; gap:8px; margin:0 0 12px; }
.search-box input { flex:1; max-width:420px; font-family:inherit; font-size:13px; padding:9px 12px;
  border:1px solid #dbe2ea; border-radius:10px; }
.search-box input:focus { outline:none; border-color:#0f5c73; }
.search-count { font-size:12px; color:#64748b; }
.big-table-wrap { max-height:620px; overflow:auto; }
.big-table-wrap table { font-size:12px; } .big-table-wrap th { position:sticky; top:0; z-index:1; }
.operator-banner { display:flex; flex-direction:column; gap:3px; background:linear-gradient(135deg,rgba(15,92,115,.10),rgba(18,126,156,.06));
  border:1px solid rgba(15,92,115,.25); border-inline-start:5px solid #0f5c73; border-radius:12px; padding:12px 16px; }
.operator-banner span { font-size:11.5px; color:#64748b; font-weight:600; }
.operator-banner b { font-size:17px; color:#0f5c73; font-weight:800; }

/* ===== holding shell: overview first, detail on demand ===== */
.holding .main { margin-inline-start:0; }
.crumbs { display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--faint); margin-bottom:2px; }
.crumbs a { color:var(--primary); text-decoration:none; font-weight:600; }
.crumbs a:hover { text-decoration:underline; }
.crumbs .sep { color:#cbd5e1; }

.subbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:10px 26px; background:var(--surface); border-bottom:1px solid var(--border); }
.subbar-note { font-size:11.5px; color:var(--faint); flex:1; min-width:220px; }
.grain-chip { font-size:11.5px; font-weight:600; color:var(--primary); background:rgba(15,92,115,.09);
  border-radius:999px; padding:5px 12px; white-space:nowrap; }
.seg { display:inline-flex; border:1px solid #cfd8e2; border-radius:9px; overflow:hidden; }
.seg button { border:0; background:#fff; padding:6px 13px; font-family:inherit; font-size:12.5px; color:#475569; }
.seg button.active { background:var(--primary); color:#fff; }

.hview { display:none; padding:18px 26px 44px; animation:fade .22s ease; }
.hview.active { display:block; }
.lede { font-size:11.5px; font-weight:700; letter-spacing:.09em; color:var(--faint);
  text-transform:uppercase; margin:30px 0 12px; }

/* ===== mine cards =====
   A mine card and a KPI card used to be the same object with different text, which read as one long
   undifferentiated row — but a KPI is one portfolio number, and a mine card is a place you can walk
   into. So they are built to look like different things: the KPI stays flat, small and topped by a
   coloured rule; the mine card is a tile with a masthead in its commodity colour, a plan-attainment
   meter as its centre of gravity, and a footer that says it is a door. The meter is the point — it
   is the one thing you cannot express as a number in a row, and it is what makes a wall of cards
   scannable: you read the bars, not the digits. */
.band-green  { --band:#3f8f56; --band-soft:rgba(63,143,86,.13);   --band-line:rgba(63,143,86,.34); }
.band-orange { --band:#d1802f; --band-soft:rgba(209,128,47,.14);  --band-line:rgba(209,128,47,.36); }
.band-yellow { --band:#c9a227; --band-soft:rgba(201,162,39,.16);  --band-line:rgba(201,162,39,.40); }
.band-red    { --band:#c14a45; --band-soft:rgba(193,74,69,.13);   --band-line:rgba(193,74,69,.34); }
.band-grey   { --band:#94a3b8; --band-soft:rgba(148,163,184,.14); --band-line:rgba(148,163,184,.38); }

.status-strip { display:grid; grid-template-columns:repeat(auto-fill,minmax(272px,1fr)); gap:14px; margin-bottom:18px; }

/* The whole card is washed in its band colour at very low alpha, rather than carrying a hard rail.
   At that alpha the tint is barely a colour and entirely a *grouping*: you sort a wall of forty
   cards into "fine / watch / behind / idle" from across the room without reading one digit. The
   card then holds only what a first glance is for — who it is, how much of plan it delivered, and
   whether anything is flagged. Incident counts, availability and licence countdowns moved off it:
   they are not first-glance questions, and each already has a whole chart of its own inside. */
.mine-card { position:relative; display:flex; flex-direction:column; cursor:pointer;
  background:linear-gradient(160deg, var(--band-soft), rgba(255,255,255,.9) 58%), var(--surface);
  border:1px solid var(--band-line); border-radius:18px; overflow:hidden;
  box-shadow:0 1px 2px rgba(16,32,46,.04); transition:transform .16s, box-shadow .16s; }
.mine-card:hover { transform:translateY(-3px); box-shadow:0 14px 32px rgba(16,32,46,.13); }

.mc-top { display:flex; align-items:flex-start; gap:11px; padding:15px 16px 9px; }
.mc-orb { width:34px; height:34px; border-radius:11px; flex:0 0 auto; display:grid; place-items:center;
  background:var(--mc,#888); color:#fff; font-size:12px; font-weight:800; letter-spacing:-.2px; }
.mc-id { min-width:0; flex:1; }
.mc-id h4 { font-size:15px; font-weight:700; color:var(--ink); line-height:1.45; margin:0; }
.mc-id p { margin:3px 0 0; font-size:11.5px; color:var(--muted); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.mc-state { flex:0 0 auto; font-size:10.5px; font-weight:700; padding:3px 9px; border-radius:999px;
  color:var(--band); background:rgba(255,255,255,.72); border:1px solid var(--band-line); }

/* the meter — the card's whole reason for not being a KPI */
.mc-meter { padding:4px 16px 14px; }
.mc-meter-track { height:8px; border-radius:99px; background:rgba(16,32,46,.09); overflow:hidden; }
.mc-meter-fill { display:block; height:100%; border-radius:99px; background:var(--band);
  transition:width .5s cubic-bezier(.22,1,.36,1); }
.mc-meter-cap { display:flex; align-items:baseline; gap:6px; margin-top:8px; font-size:11px; color:var(--muted); }
.mc-meter-cap b { font-size:22px; font-weight:800; color:var(--band); letter-spacing:-.6px; }
.mc-meter-cap .mc-of { margin-inline-start:auto; font-size:10.5px; color:var(--faint);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:54%; }

/* The fact strip is used only on the portal, where a card is a destination you are choosing between
   rather than a status you are scanning — identity beats alertness there, so the standing facts
   (commodity, grade, annual plan) earn their space. The command centre card deliberately has none. */
.mc-facts { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; margin-top:auto;
  background:var(--band-line); border-block-start:1px solid var(--band-line); }
.mc-facts div { background:rgba(255,255,255,.66); padding:9px 10px; text-align:center; min-width:0; }
.mc-facts span { display:block; font-size:10px; color:var(--faint); }
/* a polymetallic grade reads "Cu 0.42% / Pb 1.1% / Au 0.35 ppm" — long enough to wrap to three
   lines and make one card taller than every other card in its row. Clip it; the full string is on
   the element's title, and the metals page reports it properly. */
.mc-facts b { display:block; font-size:14px; font-weight:700; color:var(--ink); margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mc-facts + .mc-foot { margin-top:0; }

.mc-foot { display:flex; align-items:center; gap:6px; margin-top:auto; padding:9px 16px;
  background:rgba(255,255,255,.5); border-block-start:1px solid var(--band-line); font-size:11px; }
.mc-risk { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px;
  font-size:10.5px; font-weight:600; background:rgba(255,255,255,.75); }
.mc-risk.yellow { color:#8a6410; box-shadow:inset 0 0 0 1px rgba(201,162,39,.35); }
.mc-risk.red { color:#a3332f; box-shadow:inset 0 0 0 1px rgba(193,74,69,.35); }
.mc-risk.ok { color:#3f8f56; box-shadow:inset 0 0 0 1px rgba(63,143,86,.32); }
.mc-risk.more { color:var(--muted); box-shadow:inset 0 0 0 1px rgba(100,116,139,.3); cursor:help; }
.mc-risk.lic { color:#7c4a12; background:rgba(194,87,12,.10); box-shadow:inset 0 0 0 1px rgba(194,87,12,.3); }
.mc-go { margin-inline-start:auto; color:var(--primary); font-weight:700; flex:0 0 auto; }
.mine-card:hover .mc-go { text-decoration:underline; }

/* the shared colour key — printed wherever a band colour is used, so the scale is never implicit */
.band-key { display:flex; align-items:center; gap:13px; flex-wrap:wrap; padding:9px 12px; margin-top:10px;
  background:var(--surface-2); border:1px solid var(--border); border-radius:12px;
  font-size:11.5px; color:var(--muted); }
.band-key b { color:var(--ink); font-weight:700; font-size:11.5px; }
.band-key span { display:inline-flex; align-items:center; gap:6px; }
.band-key i { width:11px; height:11px; border-radius:4px; display:inline-block; flex:0 0 auto; }

.light { width:13px; height:13px; border-radius:50%; flex:0 0 auto; box-shadow:0 0 0 3px rgba(0,0,0,.05); }
.light.green { background:var(--ok); } .light.yellow { background:var(--warn); } .light.red { background:var(--bad); }
.chip-metal { font-size:10.5px; padding:2px 8px; border-radius:999px; color:#fff; background:var(--mc,#888); font-weight:700; }

.kpi-row-4 { grid-template-columns:repeat(4,1fr); }
.ov-body .grid { grid-template-columns:2fr 1fr; }
.card-more { margin-top:auto; padding-top:10px; font-size:12.5px; color:var(--primary); text-decoration:none; font-weight:600; }
.card-more:hover { text-decoration:underline; }
.alert-list { display:flex; flex-direction:column; gap:8px; max-height:280px; overflow:auto; }
.alert-item { display:flex; gap:10px; align-items:flex-start; padding:9px 11px; border-radius:10px;
  background:var(--surface-2); border-inline-start:4px solid var(--al,#94a3b8); font-size:12.5px; }
.alert-item .who { font-weight:700; color:var(--ink); }
.alert-item .what { color:var(--muted); line-height:1.7; }
.alert-empty { display:grid; place-items:center; padding:26px; color:var(--ok); font-size:13px; font-weight:600; }

/* The radar is the whole content of its card and carries eight outer labels, so it needs real
   height — at the shared 340px the bottom axis name was clipped by the card edge. */
#c_radar { height:560px; }
@media(max-width:900px){ #c_radar { height:440px; } }

/* domain switcher — stays put while you move between domains, so getting from one to the next
   never means going back to the command centre first */

/* domain tiles */
.domain-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(212px,1fr)); gap:13px; }
.domain-tile { display:flex; align-items:center; gap:12px; background:var(--surface); border:1px solid var(--border);
  border-radius:14px; padding:15px 16px; text-decoration:none; color:inherit; box-shadow:var(--shadow);
  transition:transform .16s, box-shadow .16s, border-color .16s; }
.domain-tile:hover { transform:translateY(-2px); box-shadow:0 10px 26px rgba(16,32,46,.12); border-color:var(--primary); }
.domain-tile .ic { font-size:20px; color:var(--primary); flex:0 0 auto; }
.domain-tile b { display:block; font-size:13.5px; font-weight:700; color:var(--ink); }
.domain-tile span { font-size:11px; color:var(--muted); line-height:1.6; }

/* progressive disclosure: the second layer of every domain page */
details.more { margin-top:16px; }
details.more > summary { list-style:none; cursor:pointer; user-select:none; display:inline-flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--border); border-radius:11px; padding:9px 16px;
  font-size:13px; font-weight:600; color:var(--primary); box-shadow:var(--shadow); }
details.more > summary::-webkit-details-marker { display:none; }
details.more > summary::after { content:'▾'; color:var(--faint); transition:transform .2s; }
details.more[open] > summary::after { transform:rotate(180deg); }
details.more > summary:hover { border-color:var(--primary); }
details.more > .grid { margin-top:14px; }

.legend-mines { display:flex; gap:14px; padding:0 0 12px; flex-wrap:wrap; font-size:12px; color:#475569; }
.legend-mines span { display:inline-flex; align-items:center; gap:6px; }
.legend-mines i { width:12px; height:12px; border-radius:3px; display:inline-block; }
.mine-cards-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:14px; }
.info-card { background:var(--surface-2); border:1px solid var(--border); border-radius:12px; padding:14px 16px; }
.info-card h4 { margin:0 0 10px; font-size:14.5px; color:var(--ink); }
.ic-rows { display:grid; gap:7px; }
.ic-rows > div { display:flex; justify-content:space-between; gap:12px; font-size:12px; border-bottom:1px dashed var(--border); padding-bottom:5px; }
.ic-rows span { color:var(--muted); } .ic-rows b { color:var(--ink); text-align:left; }

@media(max-width:1080px){ .kpi-row-4 { grid-template-columns:repeat(2,1fr); } .ov-body .grid { grid-template-columns:1fr; } }
@media print{ .subbar,.domain-grid,.card-more{display:none!important} .hview{display:block!important} details.more>summary{display:none} }


/* ===== the sticky command header =====
   The title bar, the date slicer and the domain tabs are the three controls you reach for *while*
   reading a chart — and all three used to scroll away, so changing the range from 12 months to 90
   days, or moving to the next domain, meant scrolling back to the top of a very long page first.
   They are one sticky block now.

   Sticky at full height would cost ~150px of every screen, so the block collapses as soon as the
   page scrolls: the breadcrumb, the subtitle and the mine badge go (all identity, none of it needed
   twice), the title shrinks to a label, and the date slicer moves into the empty half of the title
   row — space that was already being paid for and doing nothing. What survives is exactly the two
   things you scrolled down needing: the range presets and the domain tabs.

   The drag track goes with the collapse rather than being squeezed. A two-handle range slider needs
   both vertical room and pointer precision, and a compact bar can give it neither; the preset chips
   are what anyone reaches for mid-read anyway. Scroll back to the top and the full slicer returns. */
.app-head { position:sticky; top:0; z-index:30; background:var(--surface);
  transition:box-shadow .18s; }
.app-head.compact { box-shadow:0 6px 18px rgba(16,32,46,.09); }

/* the slot in the title row that receives the slicer while collapsed */
.head-slot { display:none; min-width:0; flex:1 1 auto; }
.app-head.compact .head-slot { display:block; }
.app-head.compact #slicerBar { display:none; }

.app-head.compact .topbar { padding:7px 26px; }
.app-head.compact .crumbs,
.app-head.compact #pageSub,
.app-head.compact #pageAudience,
.app-head.compact .mine-badge { display:none; }
.app-head.compact .page-heading h1 { font-size:15px; white-space:nowrap; }
.app-head.compact .filters .field label { display:none; }
.app-head.compact .filters .field select { padding:6px 9px; }

/* collapsed slicer: presets only, on one scrollable line */
.app-head.compact .head-slot .slicer { gap:0; min-width:0; }
.app-head.compact .head-slot .slicer-body { display:none; }
.app-head.compact .head-slot .slicer-chips { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none;
  padding-bottom:2px; justify-content:flex-end; }
.app-head.compact .head-slot .slicer-chips::-webkit-scrollbar { display:none; }
.app-head.compact .head-slot .slicer-chips button { white-space:nowrap; }

@media(max-width:900px){
  .app-head.compact .page-heading h1 { display:none; }
  .app-head.compact .head-slot .slicer-chips { justify-content:flex-start; }
}

/* ===== date slicer (drag handles + presets, Power BI style) ===== */
.slicer { display:flex; align-items:center; gap:16px; flex-wrap:wrap; flex:1; min-width:320px; }
.slicer-chips { display:flex; gap:5px; flex-wrap:wrap; }
.slicer-chips button { border:1px solid var(--border); background:var(--surface); color:var(--muted);
  border-radius:999px; padding:5px 12px; font-family:inherit; font-size:11.5px; font-weight:600;
  white-space:nowrap; transition:.14s; }
.slicer-chips button:hover { border-color:var(--primary); color:var(--primary); }
.slicer-chips button.active { background:var(--primary); border-color:var(--primary); color:#fff; }

.slicer-body { flex:1; min-width:260px; display:flex; flex-direction:column; gap:5px; }
.slicer-track { position:relative; height:34px; display:flex; align-items:center; }
.slicer-track::before { content:''; position:absolute; inset-inline:0; height:6px; border-radius:4px;
  background:var(--surface-2); border:1px solid var(--border); }
.slicer-spark { position:absolute; inset-inline:0; top:2px; height:20px; width:100%;
  fill:rgba(15,92,115,.16); pointer-events:none; }
.slicer-fill { position:absolute; height:6px; border-radius:4px; background:var(--primary); opacity:.85; }
.slicer-track input[type=range] { position:absolute; inset-inline:0; width:100%; margin:0; background:none;
  -webkit-appearance:none; appearance:none; pointer-events:none; height:34px; }
.slicer-track input[type=range]:focus-visible { outline:2px solid var(--primary-2); outline-offset:3px; border-radius:8px; }
.slicer-track input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; pointer-events:auto;
  width:18px; height:18px; border-radius:50%; background:#fff; border:3px solid var(--primary);
  box-shadow:0 2px 6px rgba(16,32,46,.25); cursor:grab; }
.slicer-track input[type=range]::-webkit-slider-thumb:active { cursor:grabbing; transform:scale(1.12); }
.slicer-track input[type=range]::-moz-range-thumb { pointer-events:auto; width:18px; height:18px;
  border-radius:50%; background:#fff; border:3px solid var(--primary);
  box-shadow:0 2px 6px rgba(16,32,46,.25); cursor:grab; }
.slicer-track input[type=range]::-moz-range-track { background:none; }

.slicer-read { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); flex-wrap:wrap; }
.slicer-read b { color:var(--ink); font-weight:700; font-size:12.5px; }
.s-arrow { color:var(--faint); }
.s-meta { color:var(--faint); font-size:11.5px; margin-inline-start:2px; }
.s-reset { margin-inline-start:auto; border:0; background:none; color:var(--primary); font-family:inherit;
  font-size:11.5px; font-weight:600; padding:2px 4px; }
.s-reset:hover { text-decoration:underline; }
.slicer.slicer-full .s-reset { visibility:hidden; }
.slicer-locked .slicer-track { opacity:.45; }
.slicer-locked .slicer-track input[type=range]::-webkit-slider-thumb { cursor:not-allowed; }

/* ===== drill-through menu ===== */
.drill-menu { position:fixed; z-index:80; min-width:238px; max-width:320px; background:var(--surface);
  border:1px solid var(--border); border-radius:13px; box-shadow:0 16px 44px rgba(16,32,46,.20);
  overflow:hidden; animation:fade .14s ease; }
.drill-menu .dm-head { padding:10px 14px 8px; border-bottom:1px solid var(--border); background:var(--surface-2); }
.drill-menu .dm-head b { display:block; font-size:13px; color:var(--ink); font-weight:700; }
.drill-menu .dm-head span { display:block; font-size:11px; color:var(--muted); margin-top:2px; }
.drill-menu button { display:block; width:100%; text-align:right; border:0; background:none;
  padding:10px 14px; font-family:inherit; border-bottom:1px solid #f4f7fa; }
.drill-menu button:last-child { border-bottom:0; }
.drill-menu button:hover { background:rgba(15,92,115,.07); }
.drill-menu .dm-label { display:block; font-size:12.5px; font-weight:600; color:var(--primary); }
.drill-menu .dm-hint { display:block; font-size:11px; color:var(--faint); margin-top:1px; line-height:1.6; }

/* ===== commodity strip — what this mine actually produces, stated up front =====
   A polymetallic licence was indistinguishable from a single-metal one anywhere on the mine page. */
.commodity-strip { display:flex; align-items:stretch; gap:12px; flex-wrap:wrap; margin-bottom:18px; }
.commodity-strip .cs-lead { display:flex; flex-direction:column; justify-content:center; gap:2px;
  padding:12px 18px; border-radius:14px; background:var(--surface); border:1px solid var(--border);
  box-shadow:var(--shadow); min-width:210px; }
.commodity-strip .cs-lead span { font-size:11.5px; color:var(--muted); font-weight:600; }
.commodity-strip .cs-lead b { font-size:15px; color:var(--ink); font-weight:700; }
.metal-chip { display:flex; flex-direction:column; gap:2px; padding:12px 18px; border-radius:14px;
  background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow);
  border-top:4px solid var(--mc,var(--primary)); min-width:150px; }
.metal-chip .mc-name { font-size:13px; font-weight:700; color:var(--mc,var(--ink)); }
.metal-chip .mc-grade { font-size:19px; font-weight:800; color:var(--ink); letter-spacing:-.3px; }
.metal-chip .mc-sub { font-size:11px; color:var(--muted); }
.poly-badge { display:inline-flex; align-items:center; gap:6px; align-self:center; padding:6px 14px;
  border-radius:999px; font-size:12px; font-weight:700; background:rgba(194,87,12,.10);
  color:var(--ember); border:1px solid rgba(194,87,12,.28); }

/* ===== every dashboard: one chart per row =====
   Side-by-side charts only worked while both were open and both happened to suit the same width.
   Half of them are collapsed by default, so opening one left a chart-sized hole next to it; and a
   time series squeezed into half a column loses exactly the resolution it exists to show. Full
   width, stacked, is easier to read and immune to both. Applies to the holding layer too — its
   overview used to run a 2fr/1fr split that made the alert list define the height of the chart
   beside it. Card grids that are NOT charts (mine cards, ID cards) keep their own auto-fit grids. */
.grid { grid-template-columns:1fr; }
.card.span-2 { grid-column:auto; }
.card .chart, .card:not(.span-2) .chart { height:380px; }
.app:not(.holding) .card .chart { height:360px; }
.app:not(.holding) .card.collapsible:not(.collapsed) .chart { height:400px; }
.ov-body .grid { grid-template-columns:1fr; }
#c_map { height:560px; }
#c_radar { height:560px; }

/* per-chart grain switch — independent of the page-wide slicer */
.grain-seg { display:inline-flex; border:1px solid var(--border); border-radius:8px; overflow:hidden; margin-inline-start:auto; }
.grain-seg button { border:0; background:var(--surface); color:var(--muted); font-family:inherit;
  font-size:11.5px; padding:4px 10px; border-inline-start:1px solid var(--border); }
.grain-seg button:first-child { border-inline-start:0; }
.grain-seg button.active { background:var(--primary); color:#fff; }
.card-head .grain-seg { align-self:center; }

/* search box that lives in a chart's header (long category lists: plates, machines) */
.chart-search { margin-inline-start:auto; font-family:inherit; font-size:12px; padding:5px 10px;
  border:1px solid var(--border); border-radius:8px; background:var(--surface-2); color:var(--ink);
  max-width:190px; }
.chart-search:focus { outline:none; border-color:var(--primary); background:var(--surface); }
.card-head .grain-seg + .chart-search, .card-head .chart-search + .grain-seg { margin-inline-start:8px; }

/* A chart whose natural width grows with the portfolio (one donut per mine) scrolls sideways inside
   its card instead of squeezing every element until they overlap. The canvas keeps its real width;
   only the window onto it is limited. */
.chart-scroll-x { overflow-x:auto; overflow-y:hidden; }
.chart-scroll-x > .chart { min-width:100%; }
.chart-scroll-x::-webkit-scrollbar { height:9px; }
.chart-scroll-x::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:99px; }
.chart-scroll-x::-webkit-scrollbar-track { background:var(--surface-2); border-radius:99px; }

/* a mine (or any open-list) picker living in a card's own header */
.card-pick { font-family:inherit; font-size:12px; padding:4px 9px; border-radius:8px; margin-inline-start:8px;
  border:1px solid var(--border); background:var(--surface-2); color:var(--ink); max-width:230px; }
.card-pick:focus { outline:none; border-color:var(--primary); background:var(--surface); }
.card-head .grain-seg + .card-pick { margin-inline-start:8px; }

/* ===== long-form chart help =====
   The caption in the corner is the right size for a label and the wrong size for an explanation.
   This button carries the explanation, and costs no page space until the reader asks for it. */
.help-wrap { position:relative; display:inline-flex; flex:0 0 auto; margin-inline-start:8px; }
.help-btn { display:inline-flex; align-items:center; gap:5px; font-family:inherit; font-size:11px;
  font-weight:600; color:var(--muted); background:var(--surface-2); border:1px solid var(--border);
  border-radius:999px; padding:3px 9px 3px 7px; cursor:help; transition:.15s; }
.help-btn:hover, .help-btn[aria-expanded="true"] { color:var(--primary); border-color:var(--primary);
  background:rgba(15,92,115,.06); }
.help-q { display:inline-grid; place-items:center; width:14px; height:14px; border-radius:50%;
  background:var(--muted); color:#fff; font-size:9.5px; font-weight:800; line-height:1; }
.help-btn:hover .help-q, .help-btn[aria-expanded="true"] .help-q { background:var(--primary); }

.help-pop { display:none; position:absolute; top:calc(100% + 9px); inset-inline-start:0; z-index:60;
  width:min(430px, 78vw); padding:14px 16px 4px; text-align:justify;
  background:var(--surface); border:1px solid var(--border); border-radius:14px;
  box-shadow:0 18px 46px rgba(16,32,46,.20); }
.help-pop.show { display:block; }
.help-pop.flip { inset-inline-start:auto; inset-inline-end:0; }
.help-pop b { display:block; font-size:13.5px; color:var(--ink); font-weight:700; margin-bottom:7px; }
.help-pop p { margin:0 0 11px; font-size:12.5px; line-height:2.05; color:var(--muted); font-weight:400; }
.help-pop p b { display:inline; font-size:inherit; color:var(--ink); margin:0; }
.help-pop i { font-style:normal; color:var(--ink); }
.help-pop::before { content:''; position:absolute; top:-6px; inset-inline-start:16px; width:10px; height:10px;
  background:var(--surface); border-inline-start:1px solid var(--border); border-block-start:1px solid var(--border);
  transform:rotate(45deg); }
.help-pop.flip::before { inset-inline-start:auto; inset-inline-end:16px; }

/* a card's own filter bar — sits under the head, above the chart, and never crosses the page slicer */
.card-filters { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:9px 11px; margin:2px 0 10px;
  background:var(--surface-2); border:1px solid var(--border); border-radius:11px; font-size:12px; color:var(--muted); }
.card-filters label { display:inline-flex; align-items:center; gap:6px; }
.card-filters select { font-family:inherit; font-size:12px; padding:4px 9px; border-radius:8px;
  border:1px solid var(--border); background:var(--surface); color:var(--ink); }
.card-filters select:focus { outline:none; border-color:var(--primary); }
.card-filters .cf-note { margin-inline-start:auto; font-size:11px; color:var(--faint); }

/* ===== table toolbar: search + sortable headers (applied to every table) ===== */
.tbl-bar { display:flex; align-items:center; gap:10px; margin:2px 0 10px; flex-wrap:wrap; }
.tbl-bar .tbl-q { flex:0 1 260px; font-family:inherit; font-size:12.5px; padding:7px 11px;
  border:1px solid var(--border); border-radius:9px; background:var(--surface-2); color:var(--ink); }
.tbl-bar .tbl-q:focus { outline:none; border-color:var(--primary); background:var(--surface); }
.tbl-bar .tbl-count { font-size:11.5px; color:var(--muted); white-space:nowrap; }
.tbl-bar .tbl-hint { font-size:11px; color:var(--faint); margin-inline-start:auto; }
thead th.sortable { cursor:pointer; user-select:none; padding-inline-end:20px; position:relative; }
thead th.sortable::after { content:'⇅'; position:absolute; inset-inline-end:7px; opacity:.32; font-size:10px; }
thead th.sortable:hover { color:var(--primary); }
thead th.sort-asc::after { content:'▲'; opacity:.9; color:var(--primary); }
thead th.sort-desc::after { content:'▼'; opacity:.9; color:var(--primary); }
.table-wrap.tbl-empty::after { content:'ردیفی با این جستجو پیدا نشد'; display:block; padding:22px;
  text-align:center; color:var(--faint); font-size:12.5px; }

.chart-drillable { cursor:pointer; }
.drill-hint { font-size:11px; color:var(--faint); }
@media(max-width:720px){ .slicer { min-width:0; } .slicer-body { min-width:180px; } }

/* the licence tab's map, the lab scatter and the face-total cards that sit inside a chart card */
#c_license_map { height:560px; }
#c_tech_scatter { height:460px; }
.card .kpi-row.face-kpis { margin:4px 0 12px; }
.card-control select + label { margin-inline-start:10px; }

/* ===== holding sidebar =====
   The same component as the single-mine sidebar — same width, rhythm, drawer behaviour on a narrow
   screen — so the two layers read as one product. Only the palette differs, and it has to differ by
   HUE, not by shade: the first attempt was petrol teal, which sits next to the single mine's navy on
   the colour wheel and read as "both navy" beside it. Bronze and dark umber with a gold accent is the
   warm family opposite that navy, so which layer you are on is obvious from the edge of the screen.
   The portal's holding card uses the same colours, so the holding keeps one identity. Items are a
   touch tighter than the single-mine list: fourteen-plus entries and group labels, and the nav
   scrolls on a short screen rather than pushing the footer off it. */
.app.holding .sidebar { background:linear-gradient(180deg,#2c1f16 0%,#3e2c1f 55%,#553c2a 100%); color:#efe2d4; }
.app.holding .brand { border-bottom-color:rgba(255,236,214,.12); }
.app.holding .brand-title { color:#fff7ee; }
.app.holding .brand-logo { background:linear-gradient(135deg,#c28a26,#ebc160); color:#2c1f16;
  box-shadow:0 4px 12px rgba(194,138,38,.42); }
.app.holding .brand-sub { color:#cdb298; }
.app.holding .nav { gap:2px; padding-top:10px; }
.app.holding .nav-item { color:#e3d0bd; padding:10px 14px; font-size:14px; }
.app.holding .nav-item:hover { background:rgba(255,236,214,.08); color:#fff; }
.app.holding .nav-item.active { background:rgba(235,193,96,.16); color:#fff; box-shadow:inset 3px 0 0 #e6b24a; }
.app.holding .side-footer { border-top-color:rgba(255,236,214,.12); color:#b99d82; }
.app.holding .freshness { color:#e8d6c3; }
.nav-group { padding:14px 14px 5px; font-size:10.5px; font-weight:700; letter-spacing:.04em;
  color:rgba(255,236,214,.5); }
.nav-group:first-child { padding-top:4px; }

/* ===== operator cards =====
   Built from the mine-card parts (band variables, meter, footer chips) so an operator reads as the
   same kind of object one level up. The company colour runs along the top edge; the band colour is
   still plan attainment, and each of its mines is a small button that walks into that mine. */
.operator-strip { display:grid; grid-template-columns:repeat(auto-fill,minmax(310px,1fr)); gap:14px; margin-bottom:12px; }
.op-card { display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--border);
  border-top:4px solid var(--oc,#888); border-radius:18px; overflow:hidden; box-shadow:0 1px 2px rgba(16,32,46,.05); }
.op-head { display:flex; align-items:flex-start; gap:10px; padding:14px 16px 8px; }
.op-dot { width:12px; height:12px; border-radius:4px; background:var(--oc,#888); margin-top:7px; flex:0 0 auto; }
.op-id { flex:1; min-width:0; }
.op-id h4 { margin:0; font-size:15px; font-weight:700; color:var(--ink); line-height:1.5; }
.op-id p { margin:2px 0 0; font-size:11.5px; color:var(--muted); line-height:1.7; }
.op-mines { display:flex; flex-wrap:wrap; gap:6px; padding:0 16px 12px; }
.op-mine { display:inline-flex; align-items:center; gap:6px; font-family:inherit; font-size:11.5px; cursor:pointer;
  color:var(--ink); background:var(--band-soft); border:1px solid var(--band-line); border-radius:999px; padding:3px 10px; }
.op-mine b { color:var(--band); font-weight:800; }
.op-mine:hover { box-shadow:0 2px 8px rgba(16,32,46,.14); }
#c_op_efficiency { height:560px; }
#c_op_mix, #c_op_plan, #c_op_safety, #c_op_risk { height:300px; }

/* ── signed-in account: sidebar footer and portal ─────────────────────────────── */
.user-box{margin-top:12px;padding-top:12px;border-top:1px solid rgba(255,255,255,.10);font-size:12.5px}
.ub-who{display:flex;align-items:center;gap:10px}
.ub-who b{display:block;color:#fff;font-weight:600;font-size:13px;line-height:1.5}
.ub-who small{display:block;opacity:.75;font-size:11.5px}
.ub-avatar{width:32px;height:32px;border-radius:50%;flex:0 0 auto;display:grid;place-items:center;
  background:rgba(255,255,255,.14);color:#fff;font-weight:700}
.ub-mode{display:flex;gap:3px;margin-top:10px;padding:3px;border-radius:10px;background:rgba(0,0,0,.22)}
.ub-mode button{flex:1;border:0;background:transparent;color:inherit;font:inherit;font-size:12px;
  padding:6px 4px;border-radius:8px;cursor:pointer}
.ub-mode button.on{background:#fff;color:#16202e;font-weight:700}
.ub-mode button[data-mode="synthetic"].on{background:#f2c14e;color:#3b2a00}
.ub-chip{display:inline-block;margin-top:10px;padding:3px 10px;border-radius:999px;
  background:rgba(63,143,86,.24);color:#d9f2df;font-size:11.5px}
.ub-actions{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:10px}
.ub-link{border:0;background:none;padding:0;color:inherit;opacity:.85;font:inherit;font-size:12px;cursor:pointer;
  text-decoration:underline;text-underline-offset:3px}
.ub-link:hover{opacity:1}
.ub-warn{margin-top:10px;padding:7px 9px;border-radius:8px;background:rgba(242,193,78,.16);color:#f6d98e;
  font-size:11.5px;line-height:1.7;display:flex;align-items:flex-start;gap:6px}
.ub-warn span{flex:1}
.ub-x{border:0;background:none;color:inherit;opacity:.75;font-size:16px;line-height:1;padding:0 2px;cursor:pointer}
.ub-x:hover{opacity:1}
.portal .user-box{margin:0;padding:12px 14px;border:1px solid var(--border);border-radius:16px;
  background:var(--surface);color:var(--muted);box-shadow:var(--shadow);min-width:240px}
.portal .ub-who b{color:var(--ink)}
.portal .ub-avatar{background:rgba(18,126,156,.12);color:#0f5c73}
.portal .ub-mode{background:#eef2f6}
.portal .ub-mode button.on{box-shadow:0 1px 3px rgba(16,32,46,.16)}
.portal .ub-chip{background:rgba(63,143,86,.12);color:#2f7a45}
.portal .ub-warn{background:#fff4d6;color:#7a5a00}
/* demonstration data must never be mistaken for the client's own */
.demo-ribbon{position:fixed;left:14px;bottom:14px;z-index:9000;max-width:min(470px,calc(100vw - 28px));
  padding:8px 14px;border-radius:12px;background:#f2c14e;color:#3b2a00;font-size:12.5px;line-height:1.8;
  box-shadow:0 8px 24px rgba(59,42,0,.25);pointer-events:none}
@media print{.demo-ribbon{position:static;margin:8px 0}}
.ub-dialog{position:fixed;inset:0;z-index:9500;display:grid;place-items:center;padding:16px;background:rgba(16,32,46,.45)}
.ub-card{width:min(380px,100%);padding:22px;border-radius:18px;background:#fff;color:#16202e;
  box-shadow:0 24px 60px rgba(16,32,46,.3)}
.ub-card h3{margin:0 0 10px;font-size:16px}
.ub-card label{display:block;margin-top:10px;font-size:12.5px;color:#64748b}
.ub-card input{display:block;width:100%;box-sizing:border-box;margin-top:5px;padding:9px 11px;border:1px solid #dbe2ea;
  border-radius:10px;font:inherit;direction:ltr;text-align:left}
.ub-err{min-height:18px;margin-top:10px;color:#c14a45;font-size:12px}
.ub-row{display:flex;gap:8px;margin-top:6px}

/* ── delivered files (licence scan, KMZ) and data-quality findings ─────────────── */
.attach-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px;padding:4px 2px}
.att-tile{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:14px;overflow:hidden;
  background:var(--surface);color:inherit;text-decoration:none;transition:box-shadow .15s,transform .15s}
.att-tile:hover{box-shadow:0 10px 26px rgba(16,32,46,.12);transform:translateY(-2px)}
.att-tile img{display:block;width:100%;height:180px;object-fit:cover;object-position:top;background:#f1f4f7}
.att-icon{height:180px;display:grid;place-items:center;font-weight:800;font-size:26px;letter-spacing:.06em}
.att-icon.pdf{background:#fbeceb;color:#b3413b}
.att-icon.kmz{background:#e8f3ef;color:#2f7a55}
.att-meta{display:flex;flex-direction:column;gap:2px;padding:10px 12px;font-size:12.5px}
.att-meta span{color:var(--muted)}
.att-meta small{color:var(--faint);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dq-summary{padding:6px 4px 12px;font-size:12.5px;color:var(--muted);line-height:1.9}
.dq-rows{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px}
.dq-msg{min-width:320px;line-height:1.9}
#c_mine_boundary{height:420px}
.att-icon.image{background:#eef3f8;color:#2f5f8f}

/* map zoom (holding maps) */
.map-zoom{display:flex;gap:4px;margin-inline-start:auto}
.map-zoom button{width:28px;height:28px;border:1px solid var(--border);border-radius:8px;background:var(--surface);
  color:var(--ink);font:inherit;font-size:15px;line-height:1;cursor:pointer}
.map-zoom button:hover{background:#eef2f7}
.ic-upload{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4M7 9l5-5 5 5'/%3E%3Cpath d='M4 15v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4'/%3E%3C/svg%3E")}

/* ── Excel upload tab ───────────────────────────────────────────────────────── */
.upload-form{display:flex;flex-direction:column;gap:14px;padding:4px 2px}
.upload-pick{position:relative;display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px;
  border:1.5px dashed var(--border);border-radius:14px;background:var(--surface-2);cursor:pointer}
.upload-pick input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer}
.upload-name{color:var(--muted);font-size:13px}
.upload-hint{margin:0;color:var(--muted);font-size:12.5px;line-height:1.9}
.upload-mode{margin:0;padding:10px 14px;border:1px solid var(--border);border-radius:12px}
.upload-mode legend{padding:0 6px;font-size:12.5px;color:var(--muted)}
.upload-mode label{display:flex;gap:10px;align-items:flex-start;padding:6px 0;font-size:13px;line-height:1.9;cursor:pointer}
.upload-mode input{margin-top:7px}
.upload-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.upload-actions .btn-primary[disabled]{opacity:.5;cursor:not-allowed}
.upload-status{font-size:13px;line-height:1.9;color:var(--ink)}
