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

:root {
  --ink: #0f0f0f;
  --gold: #ffc805;
  --amber: #edb900;
  --paper: #e3e3e3;
  --muted: #6d6d6d;
  --line: #c9c9c9;
  --white: #ffffff;
  --wash: #f6f5f1;
  --wash-deep: #eeece5;
  --success: #287c55;
  --danger: #a83838;
  --shadow-sm: 0 1px 2px rgb(15 15 15 / 7%);
  --shadow-md: 0 10px 28px rgb(15 15 15 / 7%);
  --shadow-lg: 0 24px 70px rgb(15 15 15 / 18%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --ease: 180ms ease;
  --sidebar-width: 256px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--wash);
  color: var(--ink);
  font-family: 'Fira Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, a, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
a { color: inherit; text-decoration: none; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; flex: 0 0 auto; }
.skip-link { position: fixed; z-index: 1000; top: 12px; left: 12px; padding: 10px 14px; border-radius: 8px; background: var(--gold); color: var(--ink); font-weight: 700; transform: translateY(-150%); transition: transform var(--ease); }
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

.app-shell { display: flex; min-height: 100dvh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; width: var(--sidebar-width); flex-direction: column; padding: 28px 18px 20px; background: var(--ink); color: var(--paper); }
.sidebar-brand-row { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 10px 40px; }
.brand-lockup { display: inline-flex; flex-direction: column; gap: 2px; }
.brand-word { color: var(--white); font-family: 'Fira Code', monospace; font-size: 29px; font-weight: 600; letter-spacing: -2.2px; line-height: 1; }
.brand-dot, .title-dot { color: var(--gold); }
.brand-caption { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-close, .menu-trigger { display: none; }
.primary-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.nav-label { margin: 0 10px 10px; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.nav-item { display: flex; min-height: 46px; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; color: #a7a7a7; font-size: 14px; font-weight: 500; transition: background-color var(--ease), color var(--ease); }
.nav-item:hover { background: rgb(255 255 255 / 7%); color: var(--white); }
.nav-item.is-active { background: var(--gold); color: var(--ink); font-weight: 700; }
.nav-item .icon { width: 19px; height: 19px; }
.nav-count, .nav-alert { display: grid; min-width: 22px; height: 22px; margin-left: auto; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 12%); color: var(--paper); font-family: 'Fira Code', monospace; font-size: 10px; }
.nav-alert { background: var(--gold); color: var(--ink); }
.sidebar-footer { display: flex; flex-direction: column; gap: 18px; }
.profile-mini { display: flex; align-items: center; gap: 10px; border-top: 1px solid rgb(255 255 255 / 12%); padding: 18px 10px 0; }
.profile-mini-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.profile-mini-copy strong { overflow: hidden; color: var(--white); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-mini-copy span { color: var(--muted); font-size: 11px; }
.avatar { display: grid; place-items: center; border-radius: 50%; font-family: 'Fira Code', monospace; font-size: 11px; font-weight: 600; }
.avatar-dark { width: 32px; height: 32px; background: var(--gold); color: var(--ink); }
.avatar-top { width: 36px; height: 36px; background: var(--ink); color: var(--gold); }
.icon-button { display: inline-grid; width: 44px; height: 44px; cursor: pointer; place-items: center; border-radius: 10px; background: transparent; color: var(--muted); transition: background-color var(--ease), color var(--ease); }
.icon-button:hover { background: var(--wash-deep); color: var(--ink); }
.icon-button-dark { color: var(--muted); }
.icon-button-dark:hover { background: rgb(255 255 255 / 10%); color: var(--white); }

.page-shell { width: calc(100% - var(--sidebar-width)); min-height: 100dvh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 76px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgb(201 201 201 / 55%); background: rgb(246 245 241 / 88%); padding: 0 44px; backdrop-filter: blur(16px); }
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 16px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.breadcrumbs .icon { width: 14px; height: 14px; }
.breadcrumbs strong { color: var(--ink); font-weight: 600; }
.topbar-actions { gap: 10px; }
.topbar-search { display: flex; min-width: 174px; height: 40px; align-items: center; gap: 8px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: rgb(255 255 255 / 56%); padding: 0 10px; color: var(--muted); font-size: 12px; text-align: left; transition: border-color var(--ease), background-color var(--ease); }
.topbar-search:hover { border-color: var(--muted); background: var(--white); }
.topbar-search .icon { width: 16px; height: 16px; }
kbd { margin-left: auto; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 9px; }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: 11px; right: 10px; width: 6px; height: 6px; border: 1px solid var(--wash); border-radius: 50%; background: var(--gold); }

.content { max-width: 1500px; margin: 0 auto; padding: 48px 44px 30px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 10px; font-weight: 600; letter-spacing: .12em; line-height: 1.35; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-family: 'Fira Code', monospace; font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -2px; line-height: 1.1; }
h2 { margin-bottom: 0; font-family: 'Fira Code', monospace; font-size: 16px; font-weight: 600; letter-spacing: -.5px; }
.welcome-copy { max-width: 540px; margin-bottom: 0; color: var(--muted); font-size: 15px; }
.welcome-actions { display: flex; align-items: center; gap: 18px; }
.demo-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgb(237 185 0 / 14%); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border-radius: 9px; padding: 0 16px; font-size: 13px; font-weight: 600; transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), opacity var(--ease); }
.button-primary { background: var(--ink); color: var(--white); box-shadow: var(--shadow-sm); }
.button-primary:hover { background: #272727; box-shadow: 0 5px 14px rgb(15 15 15 / 16%); }
.button-primary .icon { color: var(--gold); }
.button-secondary { border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.button-secondary:hover { border-color: var(--ink); background: var(--wash); }
.button-small { min-height: 36px; padding: 0 11px; font-size: 11px; }
.button-full { width: 100%; }
.button-quiet { min-height: 40px; background: transparent; color: var(--muted); padding: 0 6px; font-size: 11px; }
.button-quiet:hover { color: var(--ink); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 148px; border: 1px solid rgb(201 201 201 / 72%); border-radius: var(--radius-md); background: var(--white); padding: 19px 20px 17px; box-shadow: var(--shadow-sm); }
.metric-card-highlight { border-color: var(--ink); background: var(--ink); color: var(--white); }
.metric-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-label { color: var(--muted); font-size: 11px; line-height: 1.3; }
.metric-card-highlight .metric-label { color: #b9b9b9; }
.metric-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; }
.metric-icon .icon { width: 16px; height: 16px; }
.metric-icon-gold { background: var(--gold); color: var(--ink); }
.metric-icon-dark { background: rgb(255 255 255 / 10%); color: var(--gold); }
.metric-icon-soft { background: var(--wash-deep); color: var(--ink); }
.metric-value { display: block; margin: 14px 0 8px; font-family: 'Fira Code', monospace; font-size: 31px; font-weight: 500; letter-spacing: -2px; line-height: 1; }
.metric-unit { margin-left: 1px; font-size: 19px; }
.metric-value-currency { font-size: 24px; letter-spacing: -1.5px; }
.metric-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.metric-card-highlight .metric-foot { color: #a9a9a9; }
.trend { font-family: 'Fira Code', monospace; font-size: 10px; font-weight: 600; }
.trend-positive { color: var(--success); }
.metric-card-highlight .trend-positive { color: var(--gold); }
.trend-neutral { color: var(--ink); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .8fr); gap: 18px; margin-bottom: 18px; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .8fr); gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid rgb(201 201 201 / 72%); border-radius: var(--radius-md); background: var(--white); padding: 22px; box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.select-button { display: inline-flex; min-height: 36px; align-items: center; gap: 10px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: var(--white); padding: 0 10px; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 11px; transition: border-color var(--ease), color var(--ease); }
.select-button:hover { border-color: var(--ink); color: var(--ink); }
.select-button .icon { width: 14px; height: 14px; }
.status-pill { display: inline-flex; min-height: 25px; align-items: center; border-radius: 50px; padding: 0 9px; font-family: 'Fira Code', monospace; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-pending { background: rgb(237 185 0 / 17%); color: #7c5f00; }
.status-open { background: rgb(40 124 85 / 13%); color: var(--success); }
.chart-summary { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.chart-summary strong { color: var(--ink); font-family: 'Fira Code', monospace; font-size: 25px; font-weight: 500; letter-spacing: -1px; }
.chart-summary span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.chart-key-gold { background: var(--gold); }
.chart-key-line { width: 12px; height: 2px; border-radius: 0; background: var(--line); }
.chart-wrap { width: 100%; overflow: hidden; }
.progress-chart { display: block; width: 100%; min-width: 600px; height: auto; overflow: visible; }
.chart-grid-lines line { stroke: var(--line); stroke-dasharray: 2 5; stroke-opacity: .55; }
.chart-y-labels text, .chart-x-labels text { fill: var(--muted); font-family: 'Fira Code', monospace; font-size: 10px; }
.chart-target { fill: none; stroke: var(--line); stroke-dasharray: 5 6; stroke-width: 1.5; }
.chart-area { fill: url('#progressFill'); }
.chart-line { fill: none; stroke: var(--gold); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.chart-points circle { fill: var(--white); stroke: var(--gold); stroke-width: 2; }
.chart-points circle:nth-last-child(2) { fill: var(--gold); stroke: var(--ink); stroke-width: 3; }
.chart-callout { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 13px; color: var(--muted); font-size: 11px; }
.callout-marker { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); }
.chart-callout strong { color: var(--ink); font-weight: 600; }
.text-button { display: inline-flex; min-height: 32px; align-items: center; gap: 5px; cursor: pointer; background: transparent; color: var(--ink); padding: 0; font-size: 11px; font-weight: 600; transition: color var(--ease); }
.text-button:hover { color: var(--amber); }
.text-button .icon { width: 14px; height: 14px; }
.chart-callout .text-button { margin-left: auto; white-space: nowrap; }

.connections-panel { min-height: 100%; }
.connection-item { display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--line); padding: 15px 0; }
.connection-item:first-of-type { border-top: 0; padding-top: 0; }
.source-mark { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 11px; font-family: 'Fira Code', monospace; font-size: 11px; font-weight: 700; }
.source-instagram { background: var(--ink); color: var(--gold); }
.source-analytics { background: var(--wash-deep); color: var(--muted); }
.connection-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.connection-copy strong { font-size: 12px; font-weight: 600; }
.connection-copy span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.connection-item-muted { opacity: .72; }
.connection-state { color: var(--muted); font-family: 'Fira Code', monospace; font-size: 9px; white-space: nowrap; }
.connection-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; border-radius: 10px; background: var(--wash); padding: 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.connection-note .icon { width: 15px; height: 15px; flex: 0 0 auto; color: var(--ink); }

.panel-heading-projects { align-items: center; }
.filter-group { display: flex; align-items: center; gap: 4px; border-radius: 8px; background: var(--wash); padding: 3px; }
.filter-button { min-height: 30px; cursor: pointer; border-radius: 6px; background: transparent; padding: 0 9px; color: var(--muted); font-size: 10px; transition: background-color var(--ease), color var(--ease); }
.filter-button:hover { color: var(--ink); }
.filter-button.is-active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.project-list { border-top: 1px solid var(--line); }
.project-row { display: grid; grid-template-columns: 36px minmax(160px, 1.5fr) minmax(135px, .8fr) 36px; align-items: center; gap: 13px; min-height: 80px; border-bottom: 1px solid var(--line); }
.project-row[hidden] { display: none; }
.project-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; font-family: 'Fira Code', monospace; font-size: 10px; font-weight: 700; }
.symbol-gold { background: var(--gold); color: var(--ink); }
.symbol-dark { background: var(--ink); color: var(--gold); }
.symbol-light { background: var(--paper); color: var(--ink); }
.symbol-amber { background: var(--amber); color: var(--ink); }
.project-main { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.project-main strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.project-main span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.project-progress { min-width: 0; }
.progress-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 9px; }
.progress-label span:first-child { color: var(--ink); font-weight: 600; }
.progress-track { height: 5px; overflow: hidden; border-radius: 6px; background: var(--paper); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.project-row:first-child .progress-track span { background: var(--gold); }
.project-open { width: 36px; height: 36px; }
.project-open .icon { width: 16px; height: 16px; }
.outline-link { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; cursor: pointer; background: transparent; color: var(--ink); padding: 0; font-size: 11px; font-weight: 600; transition: color var(--ease); }
.outline-link:hover { color: var(--amber); }
.outline-link .icon { width: 15px; height: 15px; }

.side-stack { display: flex; flex-direction: column; gap: 18px; }
.deliveries-panel, .finance-panel { flex: 1; }
.delivery-list { display: flex; flex-direction: column; }
.delivery-row { display: flex; min-height: 62px; align-items: center; gap: 11px; border-top: 1px solid var(--line); }
.delivery-row:first-child { border-top: 0; }
.delivery-date { display: flex; width: 34px; flex: 0 0 auto; flex-direction: column; align-items: center; border-right: 1px solid var(--line); line-height: 1; }
.delivery-date strong { font-family: 'Fira Code', monospace; font-size: 16px; font-weight: 500; }
.delivery-date small { margin-top: 4px; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 8px; }
.delivery-row > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.delivery-row > div strong { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.delivery-row > div span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.delivery-tag { color: var(--muted); font-family: 'Fira Code', monospace; font-size: 9px; white-space: nowrap; }
.tag-today { color: var(--amber); font-weight: 600; }
.finance-total { border: 1px solid var(--line); border-radius: 11px; background: var(--wash); padding: 15px; }
.finance-total strong { display: block; margin-bottom: 5px; font-family: 'Fira Code', monospace; font-size: 24px; font-weight: 500; letter-spacing: -1px; }
.finance-total span { color: var(--muted); font-size: 10px; }
.finance-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.finance-actions .button-primary { min-height: 38px; padding: 0 13px; font-size: 11px; }

.activity-panel { margin-bottom: 18px; }
.activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.activity-card { display: flex; gap: 11px; border-radius: 11px; background: var(--wash); padding: 14px; }
.activity-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 8px; }
.activity-icon .icon { width: 15px; height: 15px; }
.activity-icon-gold { background: var(--gold); color: var(--ink); }
.activity-icon-dark { background: var(--ink); color: var(--gold); }
.activity-icon-light { background: var(--paper); color: var(--ink); }
.activity-card strong { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; }
.activity-card p { margin-bottom: 7px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.activity-card time { color: var(--muted); font-family: 'Fira Code', monospace; font-size: 9px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 0; color: var(--muted); font-family: 'Fira Code', monospace; font-size: 9px; }

.modal-shell[hidden] { display: none; }
.modal-open { overflow: hidden; }
.modal-shell { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(15 15 15 / 58%); backdrop-filter: blur(5px); }
.modal { position: relative; width: min(100%, 480px); border: 1px solid rgb(255 255 255 / 35%); border-radius: var(--radius-lg); background: var(--white); padding: 26px; box-shadow: var(--shadow-lg); animation: modal-in 180ms ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-topline { display: flex; align-items: center; justify-content: space-between; }
.modal-kicker { color: var(--muted); font-family: 'Fira Code', monospace; font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.modal-source-mark { display: inline-flex; align-items: baseline; gap: 5px; margin: 22px 0 13px; border-radius: 10px; background: var(--ink); padding: 8px 10px; color: var(--gold); font-family: 'Fira Code', monospace; font-size: 13px; font-weight: 600; }
.modal-source-mark span { color: var(--paper); }
.modal h2 { margin-bottom: 9px; font-size: 21px; letter-spacing: -1px; }
.modal > p { margin-bottom: 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.connection-steps { display: flex; flex-direction: column; gap: 11px; margin: 0 0 18px; padding: 0; list-style: none; }
.connection-steps li { display: flex; align-items: center; gap: 11px; }
.connection-steps li > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink); font-family: 'Fira Code', monospace; font-size: 9px; font-weight: 600; }
.connection-steps li > div { display: flex; flex-direction: column; gap: 2px; }
.connection-steps strong { font-size: 12px; font-weight: 600; }
.connection-steps small { color: var(--muted); font-size: 10px; }
.modal-notice { display: flex; align-items: flex-start; gap: 9px; border: 1px solid rgb(237 185 0 / 40%); border-radius: 10px; background: rgb(237 185 0 / 9%); padding: 11px; color: #725700; font-size: 10px; line-height: 1.45; }
.modal-notice .icon { width: 15px; height: 15px; flex: 0 0 auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal-actions .button { min-height: 44px; }
.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: min(390px, calc(100vw - 44px)); border: 1px solid var(--ink); border-radius: 10px; background: var(--ink); padding: 13px 15px; color: var(--white); font-size: 12px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.admin-environment { color: var(--muted); font-family: 'Fira Code', monospace; font-size: 9px; letter-spacing: .08em; }
.admin-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.admin-status { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); padding: 11px 13px; }
.status-orb { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgb(237 185 0 / 13%); }
.admin-status div { display: flex; flex-direction: column; gap: 2px; }
.admin-status strong { font-size: 11px; font-weight: 600; }
.admin-status span:last-child { color: var(--muted); font-size: 10px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); align-items: start; gap: 18px; }
.admin-form-panel { min-width: 0; }
.form-intro { max-width: 680px; margin: -5px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field-full { margin-top: 17px; }
.field > span, .field-title { color: var(--ink); font-size: 11px; font-weight: 600; }
.field b, .field-title b { color: var(--amber); font-weight: 700; }
.field small, .scope-heading small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.field input, .field select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--white); padding: 0 12px; color: var(--ink); font-size: 16px; transition: border-color var(--ease), box-shadow var(--ease); }
.field select { cursor: pointer; font-size: 12px; }
.field input::placeholder { color: #9b9b9b; }
.field input:focus, .field select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(237 185 0 / 20%); }
.secret-input, .copy-input { position: relative; display: flex; align-items: center; }
.secret-input input, .copy-input input { padding-right: 48px; }
.secret-input .icon-button, .copy-input .icon-button { position: absolute; right: 0; width: 43px; height: 43px; }
.secret-input .icon, .copy-input .icon { width: 16px; height: 16px; }
.scope-section { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
.scope-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.scope-heading > div { display: flex; flex-direction: column; gap: 5px; }
.scope-count { color: var(--muted); font-family: 'Fira Code', monospace; font-size: 10px; white-space: nowrap; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.scope-option { display: flex; min-height: 70px; align-items: flex-start; gap: 10px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; padding: 12px; transition: border-color var(--ease), background-color var(--ease); }
.scope-option:hover { border-color: var(--ink); background: var(--wash); }
.scope-option:has(input:checked) { border-color: var(--amber); background: rgb(237 185 0 / 8%); }
.scope-option input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--ink); cursor: pointer; }
.scope-option span { display: flex; flex-direction: column; gap: 3px; }
.scope-option strong { font-size: 11px; font-weight: 600; }
.scope-option small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.form-feedback { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
.form-feedback[data-state="success"] { color: var(--success); }
.form-feedback[data-state="error"] { color: var(--danger); }
.admin-side-column { display: flex; flex-direction: column; gap: 18px; }
.readiness-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.readiness-item { display: flex; min-height: 62px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.readiness-item:first-child { border-top: 0; }
.readiness-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 8px; }
.readiness-icon .icon { width: 15px; height: 15px; }
.readiness-icon-pending { background: rgb(237 185 0 / 16%); color: #8c6d00; }
.readiness-item > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.readiness-item strong { font-size: 11px; font-weight: 600; }
.readiness-item small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.readiness-badge { color: var(--muted); font-family: 'Fira Code', monospace; font-size: 8px; white-space: nowrap; }
.security-callout { display: flex; align-items: flex-start; gap: 10px; border-radius: 10px; background: var(--ink); padding: 13px; color: var(--white); }
.security-callout > .icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--gold); }
.security-callout strong { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; }
.security-callout p { margin: 0; color: #bdbdbd; font-size: 10px; line-height: 1.45; }
.security-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 10px; }
.security-list li { display: flex; align-items: center; gap: 7px; }
.security-list li::before { width: 5px; height: 5px; content: ''; border-radius: 50%; background: var(--gold); }
.preview-copy { margin: -4px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.oauth-preview-panel code { display: block; min-height: 70px; overflow: auto; margin-bottom: 11px; border-radius: 8px; background: var(--ink); padding: 10px; color: var(--paper); font-family: 'Fira Code', monospace; font-size: 9px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.oauth-preview-panel .button { margin-top: 0; }
.page-footer a { display: inline-flex; align-items: center; gap: 6px; transition: color var(--ease); }
.page-footer a:hover { color: var(--ink); }
.page-footer a .icon { width: 14px; height: 14px; }

.sidebar-backdrop[hidden] { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 224px; }
  .topbar, .content { padding-right: 28px; padding-left: 28px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .lower-grid { grid-template-columns: minmax(0, 1fr); }
  .connections-panel { min-height: auto; }
  .side-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-side-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .oauth-preview-panel { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .sidebar { width: min(300px, 84vw); box-shadow: var(--shadow-lg); transform: translateX(-105%); transition: transform 220ms ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .menu-trigger { display: inline-grid; }
  .sidebar-backdrop { position: fixed; z-index: 40; inset: 0; display: block; background: rgb(15 15 15 / 48%); }
  .page-shell { width: 100%; margin-left: 0; }
  .topbar { min-height: 68px; padding: 0 18px; }
  .topbar-leading { gap: 8px; }
  .breadcrumbs span { display: none; }
  .breadcrumbs { font-size: 12px; }
  .topbar-search { min-width: 44px; width: 44px; justify-content: center; padding: 0; }
  .topbar-search span, .topbar-search kbd { display: none; }
  .content { padding: 32px 18px 22px; }
  .welcome-row { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 25px; }
  .welcome-actions { width: 100%; align-items: stretch; flex-direction: column-reverse; gap: 11px; }
  .welcome-actions .button { width: 100%; }
  .demo-badge { justify-content: center; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 137px; padding: 16px 14px; }
  .metric-value { font-size: 26px; }
  .metric-value-currency { font-size: 20px; }
  .metric-foot { align-items: flex-start; flex-direction: column; gap: 1px; }
  .panel { padding: 17px; }
  .chart-callout { align-items: flex-start; flex-wrap: wrap; }
  .chart-callout .text-button { width: 100%; margin-left: 14px; }
  .panel-heading-projects { align-items: flex-start; flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-button { flex: 1; }
  .project-row { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 10px; min-height: 75px; }
  .project-progress { display: none; }
  .side-stack { grid-template-columns: minmax(0, 1fr); }
  .activity-grid { grid-template-columns: minmax(0, 1fr); }
  .page-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .admin-intro { align-items: flex-start; flex-direction: column; }
  .admin-status { width: 100%; }
  .admin-side-column { grid-template-columns: minmax(0, 1fr); }
  .oauth-preview-panel { grid-column: auto; }
  .form-grid, .scope-grid { grid-template-columns: minmax(0, 1fr); }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
}

@media (max-width: 430px) {
  .topbar-actions { gap: 3px; }
  .notification-button { display: none; }
  .metric-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-card { min-height: 125px; }
  .metric-foot { flex-direction: row; gap: 7px; }
  .panel-heading { gap: 10px; }
  .connections-panel .panel-heading { align-items: flex-start; flex-direction: column; }
  .connection-item { align-items: flex-start; flex-wrap: wrap; }
  .connection-item .button { margin-left: 50px; }
  .connection-item-muted .connection-state { margin-left: 50px; }
  .modal { padding: 20px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
