:root {
  --red: #e50914;
  --red-dark: #9d0710;
  --black: #08090b;
  --ink: #1b1d24;
  --muted: #69707d;
  --line: #e7e9ee;
  --soft: #f6f7f9;
  --green: #17a35b;
  --yellow: #c98300;
  --danger: #c40016;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #fbfbfc;
}
button, input, select, textarea {
  font: inherit;
}
button, a {
  -webkit-tap-highlight-color: transparent;
}
.login-screen {
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 80% 10%, rgba(229, 9, 20, .15), transparent 28%), #101114;
}
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}
.login-card h1 { margin: 0; font-size: 2.3rem; }
.login-card p { margin: 0; color: var(--muted); letter-spacing: .2em; font-size: .75rem; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}
textarea { min-height: 100px; resize: vertical; }
.login-card button,
.primary,
.dialog-actions button,
.sidebar button,
.small-action {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 900;
}
.login-card button,
.primary {
  background: var(--red);
  color: white;
  padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(229,9,20,.18);
}
.brand-mark {
  font-weight: 1000;
  letter-spacing: -.04em;
  color: white;
  font-size: 2rem;
}
.brand-mark span { color: white; }
.brand-mark strong { color: var(--red); }
.login-card .brand-mark span { color: var(--black); }
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 800;
}
.alert.error { background: #fff0f0; color: var(--danger); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 18px;
  color: white;
  background: linear-gradient(180deg, #070708, #131316);
}
.sidebar small {
  color: rgba(255,255,255,.65);
  letter-spacing: .22em;
  margin-top: -20px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar button,
.sidebar a {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: rgba(255,255,255,.86);
  background: transparent;
  text-decoration: none;
}
.sidebar button.active {
  color: white;
  background: linear-gradient(90deg, var(--red-dark), #4b1014);
  box-shadow: inset 3px 0 0 var(--red);
}
.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 18px;
}
.shell {
  margin-left: 280px;
  padding: 32px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.eyebrow:before {
  content: "";
  width: 44px;
  height: 4px;
  background: var(--red);
  display: inline-block;
}
.topbar h1 {
  margin: 8px 0 4px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: .95;
}
.topbar p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}
.admin-chip span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-weight: 1000;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.metric-card,
.panel,
.stack-card,
.product-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 10px 40px rgba(30,35,45,.04);
}
.metric-card {
  padding: 18px;
  display: grid;
  gap: 7px;
}
.metric-card span { color: var(--muted); font-weight: 800; }
.metric-card strong { font-size: 2rem; }
.panel {
  padding: 18px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.panel h2 { margin: 0; font-size: 1.35rem; }
.panel p { margin: 4px 0 0; color: var(--muted); }
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}
.toolbar input { min-width: min(360px, 45vw); }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
th, td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: #f1f2f5;
  color: #3b414d;
  font-size: .86rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .82rem;
}
.pill.active { background: #e8f7ee; color: #117a3c; }
.pill.expiring { background: #fff4dc; color: #8a5700; }
.pill.paused, .pill.expired, .pill.cancelled, .pill.critica { background: #ffe5e8; color: #a40013; }
.pill.prospect, .pill.closed { background: #f0f1f4; color: #59606c; }
.small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  background: var(--black);
  color: white;
  margin: 2px;
  text-decoration: none;
}
.small-action.primary-action {
  background: var(--red);
}
.small-action.ghost {
  background: #eef0f4;
  color: var(--ink);
}
.view { display: none; }
.view.active { display: block; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.product-card,
.stack-card {
  padding: 14px;
}
.product-card h3,
.stack-card h3 {
  margin: 0 0 6px;
}
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f2f3f5;
  color: #424854;
  font-size: .8rem;
  font-weight: 800;
}
.split-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}
.stack-list {
  display: grid;
  gap: 10px;
}
.status-bar {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eef8f2;
  color: #116b39;
  font-weight: 900;
}
.status-bar.error {
  background: #fff0f0;
  color: var(--danger);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.info-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 6px;
}
.info-grid span { color: var(--muted); }
.owner-panel .panel-head {
  align-items: center;
}
.owner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.owner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.owner-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.owner-card h3 {
  margin: 0 0 12px;
}
.owner-card p {
  overflow-wrap: anywhere;
}
.owner-card.span-2 {
  grid-column: 1 / -1;
}
.owner-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.owner-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.owner-control-row .small-action[disabled] {
  cursor: not-allowed;
  opacity: .55;
}
.muted-note {
  color: var(--muted);
  font-size: .9rem;
}
.monitor-alert {
  padding: 10px 12px;
  border-left: 4px solid var(--yellow);
  border-radius: 8px;
  background: #fff7e6;
  color: #6f4700;
  font-weight: 800;
}
.owner-info-grid div,
.owner-row,
.owner-ticket {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.owner-info-grid div {
  display: grid;
  gap: 4px;
  padding: 12px;
}
.owner-info-grid span,
.owner-row small {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}
.owner-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px;
  margin-bottom: 8px;
}
.owner-row small {
  grid-column: 1 / -1;
}
.owner-ticket {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
}
.owner-ticket p {
  margin: 4px 0 0;
}
dialog {
  width: min(760px, calc(100vw - 24px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(0,0,0,.32);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-card {
  padding: 22px;
  position: relative;
}
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}
.dialog-card h2 { margin: 0 44px 16px 0; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .wide { grid-column: 1 / -1; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.dialog-actions button {
  padding: 11px 14px;
}
.dialog-actions button:not(.primary) {
  background: #eef0f4;
  color: var(--ink);
}
@media (max-width: 920px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    padding: 18px;
  }
  .sidebar nav,
  .sidebar-bottom {
    display: flex;
    overflow-x: auto;
  }
  .sidebar button,
  .sidebar a {
    white-space: nowrap;
  }
  .shell {
    margin-left: 0;
    padding: 18px;
  }
  .topbar {
    display: grid;
  }
  .summary-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }
  .panel-head,
  .toolbar {
    display: grid;
    width: 100%;
  }
  .toolbar input { min-width: 0; }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .owner-panel .panel-head,
  .owner-actions {
    display: grid;
    justify-content: stretch;
  }
  .owner-grid,
  .owner-info-grid,
  .owner-ticket {
    grid-template-columns: 1fr;
  }
  .owner-control-row {
    display: grid;
  }
}
