/*
 * Tech9IQ UI kit — the look of the AWS module (Tech9IQ/aws_observability, main),
 * rebuilt in plain CSS so the Ops Console, Customer-Login and Billing share it.
 * The same file lives in each of those repos; change it in all three.
 *
 * Values are the AWS module's own (its tailwind.config.js brand/semantic scales
 * plus Tailwind's slate), with its known inconsistencies fixed rather than copied:
 * one input style, one focus ring, header and top bar the same height, success
 * notices with a green border, light chart colours.
 *
 * Icons: /assets/icons.svg (lucide 0.446), used as
 *   <svg class="i"><use href="/assets/icons.svg#i-server"/></svg>
 */

:root {
  /* Brand (Tech9IQ) */
  --t9-brand-50:#eef4f7; --t9-brand-100:#d6e4ee; --t9-brand-200:#b7ced9; --t9-brand-300:#98b7c7; --t9-brand-400:#7a9eb2;
  --t9-brand-500:#5b788a; --t9-brand-600:#4c6575; --t9-brand-700:#3d525f; --t9-brand-800:#2f3f49; --t9-brand-900:#212c33;
  --t9-accent-400:#6ed2f5; --t9-accent-500:#46c4f2; --t9-accent-600:#3aafe0;

  /* Status: badge fill / solid / text */
  --t9-success-50:#d5edd5; --t9-success-200:#a9d8aa; --t9-success-500:#71c173; --t9-success-700:#3a7a3b;
  --t9-warning-50:#fef5e0; --t9-warning-200:#fbe2a6; --t9-warning-500:#f39c12; --t9-warning-700:#b7770d;
  --t9-danger-50:#fce8e6;  --t9-danger-200:#f6c3bd;  --t9-danger-500:#e74c3c;  --t9-danger-700:#c0392b;
  --t9-info-50:#d0eef9;    --t9-info-200:#a5dcf1;    --t9-info-500:#46c4f2;    --t9-info-700:#1a7aa8;

  /* Neutrals (slate) */
  --t9-slate-50:#f8fafc; --t9-slate-100:#f1f5f9; --t9-slate-200:#e2e8f0; --t9-slate-300:#cbd5e1; --t9-slate-400:#94a3b8;
  --t9-slate-500:#64748b; --t9-slate-600:#475569; --t9-slate-700:#334155; --t9-slate-800:#1e293b; --t9-slate-900:#0f172a;

  /* Soft hues for notices and soft buttons */
  --t9-red-50:#fef2f2; --t9-red-100:#fee2e2; --t9-red-200:#fecaca; --t9-red-600:#dc2626; --t9-red-700:#b91c1c;
  --t9-amber-50:#fffbeb; --t9-amber-200:#fde68a; --t9-amber-300:#fcd34d; --t9-amber-500:#f59e0b; --t9-amber-700:#b45309;
  --t9-emerald-50:#ecfdf5; --t9-emerald-100:#d1fae5; --t9-emerald-200:#a7f3d0; --t9-emerald-700:#047857;
  --t9-sky-50:#f0f9ff; --t9-sky-200:#bae6fd; --t9-sky-700:#0369a1;

  /* Roles */
  --t9-bg-page: var(--t9-slate-50);
  --t9-bg-surface: #ffffff;
  --t9-bg-muted: var(--t9-slate-50);
  --t9-bg-sunken: var(--t9-slate-100);
  --t9-border: var(--t9-slate-200);
  --t9-border-control: var(--t9-slate-300);
  --t9-text: var(--t9-slate-900);
  --t9-text-title2: var(--t9-slate-800);
  --t9-text-body: var(--t9-slate-700);
  --t9-text-muted: var(--t9-slate-600);
  --t9-text-secondary: var(--t9-slate-500);
  --t9-text-faint: var(--t9-slate-400);
  --t9-text-ghost: var(--t9-slate-300);
  --t9-primary: var(--t9-brand-600);
  --t9-primary-hover: var(--t9-brand-700);
  --t9-link: var(--t9-brand-600);
  --t9-selected-bg: var(--t9-brand-50);
  --t9-selected-text: var(--t9-brand-700);
  --t9-tab-active: var(--t9-brand-500);
  --t9-focus: var(--t9-accent-500);
  --t9-overlay: rgba(15, 23, 42, .55);

  /* Charts (light UI) */
  --t9-chart-1:#3b82f6; --t9-chart-2:#10b981; --t9-chart-3:#f59e0b; --t9-chart-4:#ef4444; --t9-chart-5:#8b5cf6; --t9-chart-6:#06b6d4; --t9-chart-7:#ec4899;
  --t9-chart-grid: var(--t9-slate-200); --t9-chart-tick: var(--t9-slate-500);

  /* Type */
  --t9-font-sans: 'Montserrat', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --t9-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --t9-fs-10:10px; --t9-fs-11:11px;
  --t9-fs-xs:12px;  --t9-lh-xs:16px;
  --t9-fs-sm:14px;  --t9-lh-sm:20px;
  --t9-fs-base:16px;--t9-lh-base:24px;
  --t9-fs-lg:18px;  --t9-lh-lg:28px;
  --t9-fs-xl:20px;  --t9-lh-xl:28px;
  --t9-fs-2xl:24px; --t9-lh-2xl:32px;
  --t9-fw-regular:400; --t9-fw-medium:500; --t9-fw-semibold:600;
  --t9-tracking-wide:.025em;

  /* Shape / elevation */
  --t9-radius-sm:4px; --t9-radius-md:6px; --t9-radius-lg:8px; --t9-radius-xl:12px; --t9-radius-full:9999px;
  --t9-shadow-card:0 2px 8px rgba(44, 62, 80, .08);
  --t9-shadow-sm:0 1px 2px 0 rgb(0 0 0 / .05);
  --t9-shadow-lg:0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --t9-shadow-xl:0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  --t9-shadow-2xl:0 25px 50px -12px rgb(0 0 0 / .25);
  --t9-ring-focus: 0 0 0 2px var(--t9-accent-500);

  /* Layout */
  --t9-sidebar-w:288px; --t9-bar-h:56px; --t9-content-pad:24px;
  --t9-content-max:1152px; --t9-detail-max:1024px;
  --t9-control-h:34px;
  --t9-ease:cubic-bezier(.4, 0, .2, 1); --t9-dur:150ms;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; font-family: var(--t9-font-sans); }
body { margin: 0; background: var(--t9-bg-page); color: var(--t9-text); font-family: var(--t9-font-sans); font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); -webkit-font-smoothing: antialiased; }
.mono, code, kbd, pre { font-family: var(--t9-font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--t9-focus); outline-offset: 2px; }

/* Icons: lucide stroke icons from the sprite. */
.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.i-xs { width: 12px; height: 12px; } .i-sm { width: 14px; height: 14px; } .i-lg { width: 20px; height: 20px; }
@keyframes t9-spin { to { transform: rotate(360deg); } }
.spin { animation: t9-spin 1s linear infinite; }
@keyframes t9-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .spin, .skeleton { animation: none; } }

/* ---------- App shell ---------- */
.t9-app { height: 100vh; display: flex; background: var(--t9-bg-page); color: var(--t9-text); }
.sidebar { width: var(--t9-sidebar-w); flex-shrink: 0; border-right: 1px solid var(--t9-border); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.sidebar__brand { display: flex; align-items: center; gap: 8px; height: var(--t9-bar-h); padding: 0 16px; border-bottom: 1px solid var(--t9-border); flex-shrink: 0; }
.sidebar__brand img { height: 34px; width: auto; display: block; }
.sidebar__brand-divider { height: 20px; width: 1px; background: var(--t9-border); }
.sidebar__brand-name { font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); font-weight: var(--t9-fw-semibold); color: var(--t9-text); white-space: nowrap; }
.sidebar__scroll { flex: 1; overflow-y: auto; padding: 8px 0; min-height: 0; }
.sidebar__heading { padding: 8px 16px 4px; font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); font-weight: var(--t9-fw-semibold); text-transform: uppercase; letter-spacing: var(--t9-tracking-wide); color: var(--t9-text-secondary); }
.sidebar__heading--spaced { padding-top: 16px; }
.sidebar a, .sidebar button { font: inherit; color: inherit; background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none; }
.sidebar__topLink { display: flex; width: 100%; align-items: center; gap: 8px; padding: 10px 16px; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); border-bottom: 1px solid var(--t9-border) !important; color: var(--t9-text-muted) !important; flex-shrink: 0; }
.sidebar__topLink:hover { background: var(--t9-slate-50) !important; }
.sidebar__topLink--back { color: var(--t9-text-secondary) !important; }
.sidebar__topLink--back:hover { color: var(--t9-text) !important; }
.sidebar__conn { padding: 12px 16px; border-bottom: 1px solid var(--t9-border); flex-shrink: 0; }
.sidebar__conn-name { font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); font-weight: var(--t9-fw-medium); color: var(--t9-text); }
.sidebar__conn .badge { margin-top: 4px; }
.sidebar__row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); color: var(--t9-text-muted) !important; }
.sidebar__row:hover { background: var(--t9-slate-50) !important; color: var(--t9-text) !important; }
.sidebar__row-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar__row-label .i { color: var(--t9-text-faint); }
.sidebar__row--ghost { color: var(--t9-text-secondary) !important; }
.sidebar__group { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 16px; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); font-weight: var(--t9-fw-medium); color: var(--t9-slate-700) !important; }
.sidebar__group .i { color: var(--t9-text-faint); }
.sidebar__group:hover { background: var(--t9-slate-50) !important; }
.sidebar__back { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 16px; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); color: var(--t9-text-secondary) !important; }
.sidebar__back:hover { color: var(--t9-text) !important; background: var(--t9-slate-50) !important; }
.sidebar__groupHead { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; }
.sidebar__groupHead .i { color: var(--t9-text-faint); }
.sidebar__item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); color: var(--t9-text-muted) !important; }
.sidebar__item:hover { background: var(--t9-slate-50) !important; color: var(--t9-text) !important; }
.sidebar__item:disabled, .sidebar__item[aria-disabled="true"] { color: var(--t9-text-faint) !important; cursor: not-allowed; }
.sidebar .is-active { background: var(--t9-selected-bg) !important; color: var(--t9-selected-text) !important; font-weight: var(--t9-fw-medium); }
.sidebar__footer { border-top: 1px solid var(--t9-border); padding: 12px; flex-shrink: 0; }
.sidebar__who { display: flex; align-items: center; gap: 8px; padding: 4px 12px 8px; min-width: 0; }
.sidebar__who-name { font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); font-weight: var(--t9-fw-medium); color: var(--t9-text); }
.sidebar__who-role { font-size: var(--t9-fs-11); line-height: var(--t9-lh-xs); color: var(--t9-text-secondary); }
.sidebar__signout { display: flex; width: 100%; align-items: center; gap: 8px; border-radius: var(--t9-radius-md); padding: 8px 12px; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); color: var(--t9-text-muted) !important; }
.sidebar__signout:hover { background: var(--t9-slate-50) !important; color: var(--t9-text) !important; }

.main-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--t9-bar-h); padding: 0 24px; border-bottom: 1px solid var(--t9-border); background: #fff; flex-shrink: 0; }
.topbar__right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.content { flex: 1; overflow-y: auto; padding: var(--t9-content-pad); }
.container { max-width: var(--t9-content-max); margin: 0 auto; }
.detail { max-width: var(--t9-detail-max); }

/* ---------- Breadcrumbs ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); color: var(--t9-text-secondary); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs .i { width: 12px; height: 12px; color: var(--t9-text-ghost); }
.crumbs a, .crumbs button { color: inherit; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover, .crumbs button:hover { color: var(--t9-text); text-decoration: underline; }
.crumbs__current { font-weight: var(--t9-fw-medium); color: var(--t9-slate-700); overflow: hidden; text-overflow: ellipsis; }

/* ---------- Headings ---------- */
.h1 { margin: 0; font-size: var(--t9-fs-lg); line-height: var(--t9-lh-lg); font-weight: var(--t9-fw-semibold); color: var(--t9-text); display: flex; align-items: center; gap: 8px; }
.h2 { margin: 0; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); font-weight: var(--t9-fw-semibold); color: var(--t9-text-title2); }
.eyebrow { font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); font-weight: var(--t9-fw-semibold); text-transform: uppercase; letter-spacing: var(--t9-tracking-wide); color: var(--t9-text-secondary); }
.desc { margin: 0; font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); color: var(--t9-text-secondary); }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Buttons ---------- */
.t9-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--t9-control-h); border-radius: var(--t9-radius-md); padding: 0 12px; font: inherit; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); font-weight: var(--t9-fw-medium); white-space: nowrap; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: background var(--t9-dur) var(--t9-ease), color var(--t9-dur) var(--t9-ease), border-color var(--t9-dur) var(--t9-ease); }
.t9-btn .i { width: 14px; height: 14px; }
.t9-btn:disabled { opacity: .5; cursor: not-allowed; }
.t9-btn--primary { background: var(--t9-primary); color: #fff; }
.t9-btn--primary:hover:not(:disabled) { background: var(--t9-primary-hover); }
.t9-btn--secondary { background: #fff; color: var(--t9-slate-700); border-color: var(--t9-border-control); }
.t9-btn--secondary:hover:not(:disabled) { background: var(--t9-slate-50); color: var(--t9-text); }
.t9-btn--ghost { background: transparent; color: var(--t9-text-muted); font-weight: var(--t9-fw-regular); }
.t9-btn--ghost:hover:not(:disabled) { background: var(--t9-slate-100); color: var(--t9-text); }
.t9-btn--danger { background: var(--t9-red-600); color: #fff; }
.t9-btn--danger:hover:not(:disabled) { background: var(--t9-red-700); }
.t9-btn--danger-soft { background: var(--t9-red-50); color: var(--t9-red-700); }
.t9-btn--danger-soft:hover:not(:disabled) { background: var(--t9-red-100); }
.t9-btn--sm { height: 28px; padding: 0 8px; font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); gap: 4px; }
.t9-btn--block { width: 100%; height: 38px; }
.icon-btn-t9 { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--t9-radius-md); border: 0; background: transparent; color: var(--t9-text-secondary); cursor: pointer; }
.icon-btn-t9:hover { background: var(--t9-slate-100); color: var(--t9-text); }
.t9-link { color: var(--t9-link); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.t9-link:hover { text-decoration: underline; }

/* ---------- Form controls ---------- */
.t9-label { display: block; margin-bottom: 4px; font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); font-weight: var(--t9-fw-medium); color: var(--t9-text-muted); }
.t9-help { margin-top: 4px; font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); color: var(--t9-text-secondary); }
.t9-input { width: 100%; height: var(--t9-control-h); border-radius: var(--t9-radius-md); background: #fff; border: 1px solid var(--t9-border-control); padding: 0 10px; font: inherit; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); color: var(--t9-text); }
textarea.t9-input { height: auto; padding: 6px 10px; }
.t9-input::placeholder { color: var(--t9-text-faint); }
.t9-input:focus { outline: none; border-color: var(--t9-focus); box-shadow: var(--t9-ring-focus); }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--t9-radius-full); border: 1px solid; padding: 2px 8px; font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); font-weight: var(--t9-fw-medium); white-space: nowrap; }
.badge--success { background: var(--t9-success-50); color: var(--t9-success-700); border-color: var(--t9-success-50); }
.badge--danger  { background: var(--t9-danger-50);  color: var(--t9-danger-700);  border-color: var(--t9-danger-50); }
.badge--warning { background: var(--t9-warning-50); color: var(--t9-warning-700); border-color: var(--t9-warning-50); }
.badge--info    { background: var(--t9-info-50);    color: var(--t9-info-700);    border-color: var(--t9-info-50); }
.badge--neutral { background: var(--t9-slate-100);  color: var(--t9-slate-600);   border-color: var(--t9-slate-100); }

/* ---------- Cards / service cards ---------- */
.t9-card { border: 1px solid var(--t9-border); border-radius: var(--t9-radius-lg); padding: 16px; background: #fff; }
.service-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.service-card { display: flex; align-items: center; gap: 12px; width: 100%; border: 1px solid var(--t9-border); border-radius: var(--t9-radius-lg); background: #fff; padding: 16px; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--t9-dur) var(--t9-ease), box-shadow var(--t9-dur) var(--t9-ease); }
.service-card:hover { border-color: var(--t9-brand-300); box-shadow: var(--t9-shadow-card); }
.service-card__icon { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--t9-radius-md); background: var(--t9-brand-50); color: var(--t9-brand-600); flex-shrink: 0; }
.service-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.service-card__title { font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); font-weight: var(--t9-fw-medium); color: var(--t9-text); }
.service-card__sub { font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); color: var(--t9-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-card__chev { color: var(--t9-text-ghost); }
.service-card:hover .service-card__chev { color: var(--t9-text-faint); }

/* ---------- Tabs / segmented ---------- */
.t9-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--t9-border); overflow-x: auto; }
.t9-tab { padding: 8px 12px; font: inherit; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); white-space: nowrap; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--t9-text-secondary); cursor: pointer; }
.t9-tab:hover { color: var(--t9-slate-800); }
.t9-tab.is-active { border-bottom-color: var(--t9-tab-active); color: var(--t9-brand-700); font-weight: var(--t9-fw-medium); }

/* ---------- Notices / banners / skeleton ---------- */
.notice { font-size: var(--t9-fs-xs); line-height: var(--t9-lh-xs); border: 1px solid; border-radius: var(--t9-radius-md); padding: 6px 10px; }
.notice--error { color: var(--t9-red-700); background: var(--t9-red-50); border-color: var(--t9-red-200); }
.notice--warn { color: var(--t9-amber-700); background: var(--t9-amber-50); border-color: var(--t9-amber-200); }
.notice--success { color: var(--t9-success-700); background: var(--t9-success-50); border-color: var(--t9-emerald-200); }
.notice--info { color: var(--t9-sky-700); background: var(--t9-sky-50); border-color: var(--t9-sky-200); }
.banner { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; border: 1px solid; border-radius: var(--t9-radius-lg); padding: 16px; font-size: var(--t9-fs-sm); line-height: var(--t9-lh-sm); }
.banner--red { background: var(--t9-red-50); border-color: var(--t9-red-200); color: var(--t9-red-700); }
.banner--amber { background: var(--t9-amber-50); border-color: var(--t9-amber-200); color: var(--t9-amber-700); }
.banner--sky { background: var(--t9-sky-50); border-color: var(--t9-sky-200); color: var(--t9-sky-700); }
.skeleton { display: flex; flex-direction: column; gap: 8px; animation: t9-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
.skeleton > div { height: 40px; border-radius: var(--t9-radius-lg); background: rgba(226, 232, 240, .7); }

/* ---------- Modal ---------- */
.t9-overlay { position: fixed; inset: 0; z-index: 650; display: flex; align-items: center; justify-content: center; background: var(--t9-overlay); padding: 16px; }
.t9-modal { width: 100%; max-width: 448px; background: #fff; border: 1px solid var(--t9-border); border-radius: var(--t9-radius-xl); box-shadow: var(--t9-shadow-2xl); }
