/* IntuneHydrator — visual system
   Palette source: Anthropic dataviz skill reference palette (validated defaults). */

:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --surface-2: #ffffff;
  --page-plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);

  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;

  --status-good: #0ca30c; --status-warning: #fab219; --status-serious: #ec835a; --status-critical: #d03b3b;

  --radius: 10px; --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(11,11,11,0.04), 0 1px 8px rgba(11,11,11,0.04);
  --shadow-modal: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1: #1a1a19; --surface-2: #202020; --page-plane: #0d0d0d;
    --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #898781;
    --gridline: #2c2c2a; --baseline: #383835; --border: rgba(255,255,255,0.10);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  }
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--page-plane); color:var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size:15px; line-height:1.5; }
a { color: var(--series-1); }
.container { max-width: 1280px; margin:0 auto; padding: 0 24px 64px; }

.topbar { display:flex; align-items:center; justify-content:space-between; padding:14px 24px;
  border-bottom:1px solid var(--border); background:var(--surface-1); gap:16px; flex-wrap:wrap; }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; font-size:17px; text-decoration:none; color:var(--text-primary); }
.brand .mark { width:28px; height:28px; border-radius:7px; background:linear-gradient(135deg,var(--series-1),var(--series-7));
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:15px; }
.topbar .sub { color:var(--text-secondary); font-size:13px; }
.topbar-right { display:flex; align-items:center; gap:14px; }

.subnav { background:var(--surface-1); border-bottom:1px solid var(--border); }
.subnav-inner { display:flex; gap:4px; padding:0; }
.subnav a { display:inline-block; padding:12px 16px; color:var(--text-secondary); text-decoration:none; font-size:13.5px; font-weight:600; border-bottom:2px solid transparent; transition: all 0.15s ease; }
.subnav a:hover { color:var(--text-primary); }
.subnav a.active { color:var(--series-1); border-bottom-color:var(--series-1); background:color-mix(in srgb, var(--series-1) 8%, transparent); border-radius:var(--radius-sm) var(--radius-sm) 0 0; }

.hero { padding:48px 0 24px; }
.hero h1 { font-size:26px; margin:0 0 8px; letter-spacing:-0.01em; }
.hero p { color:var(--text-secondary); max-width:720px; margin:0; }

.card { background:var(--surface-1); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-card); padding:24px; }
.card + .card { margin-top:16px; }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:none; border-radius:var(--radius-sm); padding:10px 18px;
  font-size:13.5px; font-weight:600; cursor:pointer; background:var(--series-1); color:#fff; text-decoration:none; transition: opacity 0.15s ease, transform 0.05s ease; }
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn.secondary { background:transparent; color:var(--text-primary); border:1px solid var(--border); }
.btn.secondary:hover { background:var(--surface-2); border-color:var(--baseline); }
.btn.small { padding:6px 12px; font-size:12.5px; }
.btn.danger { background: var(--status-critical); }
.btn.good { background: var(--status-good); }

.btn-copy { display:inline-flex; align-items:center; gap:5px; padding:4px 8px; font-size:11.5px; font-weight:600; border-radius:4px;
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-secondary); cursor:pointer; transition: all 0.15s ease; }
.btn-copy:hover { color:var(--text-primary); border-color:var(--baseline); background:var(--surface-1); }
.btn-copy.copied { color:var(--status-good); border-color:var(--status-good); background:color-mix(in srgb, var(--status-good) 10%, transparent); }

.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--text-secondary); }
.form-group input[type=text], .form-group input[type=url] {
  width:100%; padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--border);
  background:var(--surface-2); color:var(--text-primary); font-size:13.5px; font-family: ui-monospace, monospace;
}
.form-group .hint { color:var(--text-muted); font-size:12px; margin-top:5px; }
.form-row { margin-top:20px; display:flex; justify-content:flex-end; gap:12px; }

.alert { border-radius:var(--radius-sm); padding:12px 16px; font-size:13.5px; margin-bottom:16px; border:1px solid var(--border); }
.alert-danger { background: color-mix(in srgb, var(--status-critical) 10%, var(--surface-1)); color: var(--status-critical); }
.alert-warning { background: color-mix(in srgb, var(--status-warning) 14%, var(--surface-1)); color:#7a5200; }
.alert-info { background: color-mix(in srgb, var(--series-1) 10%, var(--surface-1)); color: var(--series-1); }
.alert-good { background: color-mix(in srgb, var(--status-good) 10%, var(--surface-1)); color: var(--status-good); }

.steps { counter-reset: step; margin:20px 0; padding:0; list-style:none; }
.steps li { counter-increment: step; position:relative; padding-left:38px; margin-bottom:16px; font-size:13.5px; color:var(--text-secondary); }
.steps li::before { content: counter(step); position:absolute; left:0; top:0; width:24px; height:24px; border-radius:50%;
  background:var(--series-1); color:#fff; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.steps code, .notes code, td code, .plan-meta code { background:var(--page-plane); padding:2px 6px; border-radius:4px; font-size:12px; border:1px solid var(--border); }
.steps pre, .notes pre { background:var(--page-plane); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px; overflow-x:auto; font-size:12.5px; }

.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:14px; margin:24px 0; }
.kpi { background:var(--surface-1); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; }
.kpi .label { color:var(--text-secondary); font-size:12.5px; text-transform:uppercase; letter-spacing:.03em; }
.kpi .value { font-size:26px; font-weight:700; margin-top:4px; font-variant-numeric: tabular-nums; }
.kpi .sub { color:var(--text-muted); font-size:12px; margin-top:2px; }

.section { margin-top:36px; }
.section-header { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:16px; flex-wrap:wrap; gap:12px; }
.section h2 { font-size:17px; margin:0 0 4px; }
.section .desc { color:var(--text-secondary); font-size:13px; margin:0; }

.chart-grid { display:grid; grid-template-columns:2fr 1fr; gap:16px; }
.chart-grid.two { grid-template-columns:1fr 1fr; }
@media (max-width:900px) { .chart-grid, .chart-grid.two { grid-template-columns:1fr; } }
.chart-card { background:var(--surface-1); border:1px solid var(--border); border-radius:var(--radius); padding:18px; }
.chart-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.chart-card h3 { font-size:13.5px; margin:0; color:var(--text-secondary); font-weight:600; }
.chart-hint { font-size:11.5px; color:var(--text-muted); }
.chart-card canvas { max-height:280px; cursor:pointer; }

.table-toolbar { display:flex; gap:10px; margin-bottom:12px; flex-wrap:wrap; align-items:center; }
.table-toolbar input[type=search], .table-toolbar select {
  padding:8px 12px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--surface-2); color:var(--text-primary); font-size:13.5px;
}
.table-toolbar input[type=search] { flex:1; min-width:200px; }
.table-toolbar .count { color:var(--text-muted); font-size:12.5px; margin-left:auto; }

.table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface-1); }
table.data { width:100%; border-collapse:collapse; font-size:13px; }
table.data th { text-align:left; padding:10px 12px; color:var(--text-secondary); font-weight:600; border-bottom:1px solid var(--gridline); white-space:nowrap; cursor:pointer; user-select:none; }
table.data th.sorted::after { content:' \25BE'; color:var(--text-muted); }
table.data td { padding:9px 12px; border-bottom:1px solid var(--gridline); vertical-align:top; }
table.data tbody tr:hover { background:var(--page-plane); }
.muted { color:var(--text-muted); }

.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:11.5px; font-weight:600; }
.badge-good { background: color-mix(in srgb, var(--status-good) 16%, transparent); color: var(--status-good); }
.badge-critical { background: color-mix(in srgb, var(--status-critical) 14%, transparent); color: var(--status-critical); }
.badge-mixed { background: color-mix(in srgb, var(--series-4) 20%, transparent); color: #8a6400; }
.badge-neutral { background: color-mix(in srgb, var(--series-1) 12%, transparent); color: var(--series-1); }
.badge-beta { background: color-mix(in srgb, var(--series-7) 16%, transparent); color: var(--series-7); }

/* Plan items */
.plan-item { border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; margin-bottom:12px; background:var(--surface-1); }
.plan-item .plan-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.plan-item .plan-title { font-weight:600; font-size:14.5px; }
.plan-item .plan-meta { color:var(--text-muted); font-size:12.5px; margin-top:4px; }
.plan-item details { margin-top:10px; }
.plan-item summary { cursor:pointer; color:var(--series-1); font-size:12.5px; font-weight:600; user-select:none; }
.plan-item pre { margin-top:8px; background:var(--page-plane); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px; font-size:12px; overflow-x:auto; }
.payload-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }

/* MODALS */
body.modal-open { overflow: hidden; }
.modal-wrapper {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  padding: 20px;
}
.modal-wrapper.active { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-modal); width: 100%; max-width: 580px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden; transform: scale(0.96); transition: transform 0.2s ease;
}
.modal-wrapper.active .modal-box { transform: scale(1); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px 22px; overflow-y: auto; font-size: 13.5px; color: var(--text-secondary); }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; justify-content: flex-end; gap: 10px; }

/* LOADING OVERLAY */
.loading-overlay {
  position: fixed; inset: 0; z-index: 10001;
  display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
}
.loading-overlay.active { display: flex; }
.loading-box {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 36px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: var(--shadow-modal); max-width: 380px; text-align: center;
}
.spinner {
  width: 36px; height: 36px; border: 3px solid color-mix(in srgb, var(--series-1) 20%, transparent);
  border-top-color: var(--series-1); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* TOAST NOTIFICATIONS */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10002; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(12px); transition: all 0.25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-good { border-left: 4px solid var(--status-good); }
.toast-critical { border-left: 4px solid var(--status-critical); }
.toast-info { border-left: 4px solid var(--series-1); }

/* ARCHITECTURE PILLARS GRID */
.architecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.pillar-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.pillar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.pillar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pillar-icon { font-size: 18px; }
.pillar-order {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.pillar-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.pillar-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
  flex: 1;
}
.pillar-progress-wrap {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.pillar-progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.pillar-progress-fill {
  height: 100%;
  background: var(--series-1);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.pillar-status-ok .pillar-progress-fill { background: var(--status-good); }
.pillar-status-critical .pillar-progress-fill { background: var(--status-critical); }
.pillar-status-high .pillar-progress-fill { background: var(--status-critical); }
.pillar-status-medium .pillar-progress-fill { background: var(--status-warning); }
.pillar-status-not_licensed .pillar-progress-fill { background: var(--baseline); }

.pillar-status-critical { border-left: 4px solid var(--status-critical); }
.pillar-status-high { border-left: 4px solid var(--status-critical); }
.pillar-status-medium { border-left: 4px solid var(--status-warning); }
.pillar-status-ok { border-left: 4px solid var(--status-good); }
.pillar-status-not_licensed { border-left: 4px solid var(--border); opacity: 0.85; }

.pillar-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-secondary);
}

footer.app-footer { text-align:center; color:var(--text-muted); font-size:12px; padding:40px 0; }
