@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Manrope:wght@500;600;700&display=swap');

:root {
  --ink: #17211d;
  --muted: #66716c;
  --line: #dde3df;
  --soft: #f4f6f4;
  --paper: #ffffff;
  --green: #1d5944;
  --green-2: #39745e;
  --mint: #dcebe4;
  --amber: #9a691d;
  --amber-bg: #f8ecd7;
  --red: #99493f;
  --red-bg: #f7e6e3;
  --sidebar: #14251f;
  --shadow: 0 18px 60px rgba(19, 34, 28, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f7f8f7; font: 14px/1.5 "DM Sans", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; background: var(--sidebar); color: #d9e4df; padding: 28px 20px 22px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; margin: 0 8px 42px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #668176; border-radius: 9px; font: 700 12px/1 Manrope; letter-spacing: .08em; }
.brand strong, .brand small { display: block; font-family: Manrope; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: #aebdb7; font-size: 12px; margin-top: 1px; }
nav { display: grid; gap: 6px; }
nav a { display: flex; gap: 11px; align-items: center; padding: 11px 12px; border-radius: 8px; color: #aebdb7; text-decoration: none; font-weight: 500; }
nav a span { width: 19px; text-align: center; font-size: 17px; }
nav a:hover, nav a.active { color: white; background: #20372f; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #2b4138; padding: 19px 8px 0; display: flex; gap: 10px; align-items: flex-start; color: #b9c6c1; font-size: 12px; }
.sidebar-foot small { color: #82978e; }
.status-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: #73bd98; box-shadow: 0 0 0 4px rgba(115,189,152,.1); }

main { margin-left: 244px; min-height: 100vh; }
.topbar { height: 70px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: space-between; padding: 0 38px; position: sticky; top: 0; z-index: 10; }
.global-search { display: flex; align-items: center; gap: 10px; width: min(520px, 55vw); color: #77817d; }
.global-search > span { font-size: 23px; transform: rotate(-15deg); }
.global-search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }
kbd { border: 1px solid #d8ddda; background: #f8f9f8; border-radius: 5px; padding: 1px 7px; color: #8b938f; font-size: 11px; }
.topbar-meta { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border: 0; background: var(--green); color: white; border-radius: 50%; font-weight: 600; }
.content { max-width: 1580px; margin: auto; padding: 36px 38px 70px; }

.page-head { display: flex; justify-content: space-between; gap: 28px; margin-bottom: 29px; align-items: flex-end; }
.eyebrow { color: var(--green-2); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; margin-bottom: 7px; }
h1, h2, h3, h4 { font-family: Manrope, sans-serif; margin: 0; }
h1 { font-size: 29px; letter-spacing: -.035em; }
h2 { font-size: 18px; letter-spacing: -.02em; }
h3 { font-size: 14px; }
.page-head p { color: var(--muted); margin: 7px 0 0; max-width: 730px; }
.disclaimer-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); white-space: nowrap; font-size: 11px; }
.atla-note { display: inline-flex; margin: -17px 0 22px; padding: 5px 9px; border-radius: 6px; background: var(--mint); color: var(--green); font: 600 11px Manrope; letter-spacing: .03em; }

.sector-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
.sector-tab { min-height: 63px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); cursor: pointer; text-align: left; }
.sector-tab span, .sector-tab small { display: block; }
.sector-tab span { font: 600 12px Manrope; }
.sector-tab small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.sector-tab:hover { border-color: #aebbb5; }
.sector-tab.active { border-color: var(--green); background: var(--green); color: white; }
.sector-tab.active small { color: #c7dbd2; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.stat, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; }
.stat { padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.stat-value { font: 600 24px/1.15 Manrope; margin-top: 9px; letter-spacing: -.03em; }
.stat-foot { margin-top: 7px; color: #87908c; font-size: 11px; }
.panel { margin-bottom: 18px; overflow: hidden; }
.panel-head { min-height: 61px; padding: 16px 19px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 20px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); gap: 18px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { position: relative; }
.filter label { position: absolute; left: 10px; top: 5px; color: #818a86; text-transform: uppercase; letter-spacing: .06em; font-size: 8px; pointer-events: none; }
.filter input, .filter select { height: 44px; padding: 16px 30px 3px 10px; min-width: 118px; border: 1px solid #d8dedb; border-radius: 7px; outline: 0; color: var(--ink); background: white; }
.filter input:focus, .filter select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(57,116,94,.09); }
.filter-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.button { border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); padding: 8px 12px; cursor: pointer; font-weight: 500; }
.button:hover { border-color: #aebbb5; }
.button.primary { background: var(--green); color: white; border-color: var(--green); }

.matrix-wrap { position: relative; min-height: 410px; }
.matrix { width: 100%; height: 410px; display: block; overflow: visible; }
.axis-label { fill: #6f7974; font: 10px DM Sans; letter-spacing: .02em; }
.grid-line { stroke: #e6eae7; stroke-width: 1; }
.quad { fill: #f8faf8; }
.quad.highlight { fill: #edf5f1; }
.quad-label { fill: #819089; font: 600 10px DM Sans; letter-spacing: .07em; text-transform: uppercase; }
.bubble { fill: #2f7158; fill-opacity: .62; stroke: #fff; stroke-width: 1.2; cursor: pointer; transition: fill-opacity .15s; }
.bubble:hover { fill-opacity: .95; }
.chart-tooltip { position: absolute; pointer-events: none; padding: 10px 12px; border-radius: 7px; background: #15251f; color: white; box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translate(-50%, -105%); min-width: 180px; z-index: 4; }
.chart-tooltip strong { display: block; font-size: 12px; margin-bottom: 4px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; gap: 6px; align-items: center; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green-2); opacity: .7; }
.metric-explainer { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.metric-explainer summary { display: flex; align-items: center; gap: 8px; padding: 11px 13px; color: var(--green); font-weight: 600; font-size: 12px; cursor: pointer; list-style: none; }
.metric-explainer summary::-webkit-details-marker { display: none; }
.metric-explainer summary::after { content: '+'; margin-left: auto; font-size: 17px; font-weight: 400; }
.metric-explainer[open] summary::after { content: '−'; }
.info-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--mint); font: 700 11px Manrope, sans-serif; }
.metric-explainer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 14px 15px; border-top: 1px solid var(--line); }
.metric-explainer-grid section { padding-top: 14px; min-width: 0; }
.metric-explainer-grid section + section { border-left: 1px solid var(--line); padding-left: 16px; }
.metric-explainer-grid h3 { margin: 0 0 7px; font-size: 13px; }
.metric-explainer-grid p, .metric-explainer-grid li { color: var(--muted); font-size: 11px; line-height: 1.5; }
.metric-explainer-grid p { margin: 7px 0; }
.metric-explainer-grid ul { margin: 7px 0; padding-left: 17px; columns: 2; }
.metric-explainer-grid .formula { padding: 7px 9px; border-radius: 6px; background: var(--soft); color: var(--text); font-weight: 600; }

.insight-list { display: grid; gap: 2px; }
.insight { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 15px 0; border-bottom: 1px solid #edf0ee; align-items: center; cursor: pointer; }
.insight:last-child { border: 0; }
.rank { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--soft); color: var(--muted); font-size: 11px; }
.insight strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight > span:nth-child(2) { min-width: 0; }
.insight small { color: var(--muted); }
.insight-value { text-align: right; font-weight: 600; color: var(--green); white-space: nowrap; }
.method-value { text-align: right; white-space: nowrap; }
.method-value strong, .method-value small { display: block; }
.method-value strong { color: var(--green); font-size: 12px; }
.method-value small { margin-top: 2px; }

.signal-set { display: inline-flex; gap: 4px; }
.signal-pill { padding: 3px 6px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: 9px; }
.signal-pill.operational { color: var(--green); background: var(--mint); }
.signal-pill.productivity { color: var(--amber); background: var(--amber-bg); }
.signal-pill.carveout { color: #4f5e89; background: #e8ebf4; }
.custom-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.custom-method { min-width: 0; }
.custom-method .insight { grid-template-columns: 34px minmax(0, 1fr) auto; }
.mapping-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.mapping-item { padding-left: 13px; border-left: 2px solid var(--mint); }
.mapping-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th { position: relative; text-align: right; padding: 10px 14px; color: #77817c; background: #fafbfa; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; font-size: 9px; font-weight: 600; cursor: default; }
th:first-child, td:first-child { text-align: left; }
td { text-align: right; padding: 13px 14px; border-bottom: 1px solid #edf0ee; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .12s; }
tbody tr[data-company] { cursor: pointer; }
tbody tr:hover { background: #f8faf8; }
.company-cell strong, .company-cell small { display: block; }
.company-cell strong { font-size: 13px; max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.company-cell small { color: #8a928e; margin-top: 2px; }
.industry-cell { max-width: 230px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.metric-positive { color: var(--green); font-weight: 600; }
.metric-negative { color: var(--red); }
.pill { display: inline-flex; padding: 3px 7px; border-radius: 99px; font-size: 10px; background: var(--soft); color: var(--muted); }
.pill.high { color: var(--red); background: var(--red-bg); }
.pill.good { color: var(--green); background: var(--mint); }
.pill.warn { color: var(--amber); background: var(--amber-bg); }
.table-footer { padding: 12px 17px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.method-card { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.method-number { display: grid; place-items: center; width: 30px; height: 30px; background: var(--mint); color: var(--green); border-radius: 50%; font-weight: 600; margin-bottom: 14px; }
.method-card p, .method-card li { color: var(--muted); }
.method-card ul { padding-left: 17px; margin: 10px 0 0; }

.company-dialog { width: min(1140px, calc(100vw - 40px)); max-width: none; height: min(860px, calc(100vh - 40px)); max-height: none; padding: 0; border: 0; border-radius: 14px; box-shadow: var(--shadow); overflow: auto; }
.company-dialog::backdrop { background: rgba(15,28,23,.55); backdrop-filter: blur(3px); }
.dialog-close { position: sticky; float: right; top: 17px; margin: 17px 17px 0 0; z-index: 5; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; color: var(--muted); font-size: 20px; }
.detail-head { padding: 37px 42px 28px; border-bottom: 1px solid var(--line); }
.detail-head h2 { font-size: 25px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); margin-top: 8px; }
.detail-content { padding: 26px 42px 45px; }
.detail-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.detail-kpi { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.detail-kpi span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.detail-kpi strong { display: block; font: 600 18px Manrope; margin-top: 6px; }
.gap-bridge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 18px; background: #f5f8f6; border-radius: 9px; margin: 12px 0 25px; }
.gap-bridge div { border-left: 2px solid #bdcec6; padding-left: 12px; }
.gap-bridge div:last-child { border-color: var(--green); }
.gap-bridge small, .gap-bridge strong { display: block; }
.gap-bridge small { color: var(--muted); }
.gap-bridge strong { font-size: 16px; margin-top: 4px; }
.gap-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 12px 0 25px; }
.gap-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.gap-card strong { display: block; text-transform: capitalize; }
.gap-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.line-chart-wrap { margin: 12px 0 25px; }
.line-chart-scroll { max-width: 100%; overflow-x: auto; border-radius: 8px; background: #fbfcfb; -webkit-overflow-scrolling: touch; }
.line-chart { display: block; width: 920px; max-width: none; height: 220px; background: #fbfcfb; border-radius: 8px; }
.history-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 28px; }
.history-charts > div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: hidden; }
.history-charts .line-chart-wrap { margin: 8px 0 0; }
.line-chart-wrap.compact .line-chart { width: 620px; height: 180px; }
.line { fill: none; stroke: var(--green); stroke-width: 2.5; }
.line-area { fill: rgba(57,116,94,.08); }
.chart-dot { fill: white; stroke: var(--green); stroke-width: 2; }
.grid-line { stroke: #dce5e0; stroke-width: 1; }
.chart-y-label, .chart-x-label { fill: #718078; font: 10px DM Sans, sans-serif; }
.chart-point-label { fill: #1f5140; font: 600 10px DM Sans, sans-serif; paint-order: stroke; stroke: #fbfcfb; stroke-width: 3px; stroke-linejoin: round; }
.peer-note { display: flex; gap: 9px; align-items: flex-start; padding: 12px 14px; background: #f5f8f6; color: var(--muted); border-radius: 7px; margin: 9px 0 14px; font-size: 12px; }
.data-quality { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 24px; }
.quality-fact { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }

.loading-page { min-height: 500px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loader { width: 27px; height: 27px; border: 2px solid #d9e3de; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.toast { position: fixed; right: 28px; bottom: 28px; z-index: 50; padding: 11px 15px; border-radius: 7px; background: var(--sidebar); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .sidebar { width: 78px; padding-inline: 13px; }
  .brand { margin-inline: 7px; }
  .brand > span:last-child, nav a:not(.active)::after, nav a { font-size: 0; }
  nav a { justify-content: center; }
  nav a span { font-size: 18px; }
  .sidebar-foot span:not(.status-dot) { display: none; }
  main { margin-left: 78px; }
  .two-col { grid-template-columns: 1fr; }
  .sector-tabs { grid-template-columns: repeat(3, 1fr); }
  .custom-method-grid { grid-template-columns: 1fr; }
  .mapping-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 700px) {
  .sidebar { inset: auto 0 0 0; width: 100%; height: 62px; flex-direction: row; padding: 8px; }
  .brand, .sidebar-foot { display: none; }
  nav { display: flex; width: 100%; justify-content: space-around; }
  nav a { width: 56px; }
  main { margin: 0 0 62px; }
  .topbar { padding: 0 18px; }
  .topbar-meta span { display: none; }
  .content { padding: 25px 16px 45px; }
  .page-head { display: block; }
  .disclaimer-pill { display: inline-block; margin-top: 13px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px; }
  .stat-value { font-size: 19px; }
  .method-grid, .detail-kpis, .gap-cards { grid-template-columns: 1fr 1fr; }
  .history-charts { grid-template-columns: 1fr; }
  .metric-explainer-grid { grid-template-columns: 1fr; }
  .metric-explainer-grid section + section { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .metric-explainer-grid ul { columns: 1; }
  .sector-tabs { grid-template-columns: 1fr 1fr; }
  .mapping-grid { grid-template-columns: 1fr; }
  .detail-head, .detail-content { padding-left: 20px; padding-right: 20px; }
}
