:root {
  --navy-950: #07111f;
  --navy-900: #0b1727;
  --navy-800: #122238;
  --ink: #152033;
  --muted: #667085;
  --muted-light: #98a2b3;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --line: #e7eaf0;
  --line-strong: #d8dde6;
  --accent: #b9f227;
  --accent-dark: #77a600;
  --green: #109761;
  --green-soft: #eafaf2;
  --amber: #d97706;
  --red: #d14343;
  --red-soft: #fff0f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, .07);
  --shadow-lg: 0 28px 70px rgba(2, 10, 23, .18);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  background: radial-gradient(circle at 18% 0%, rgba(185, 242, 39, .11), transparent 28%), var(--navy-950);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; color: #fff; text-decoration: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: var(--navy-950);
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 0 0 5px rgba(185, 242, 39, .08);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 4px; color: #7f90a6; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nav-label { margin: 42px 12px 10px; color: #5f7188; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 13px;
  border-radius: 12px;
  color: #9faec0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; transform: translateX(2px); }
.nav-item.active { background: rgba(185, 242, 39, .1); color: #efffc8; }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-icon { width: 22px; text-align: center; color: inherit; font-size: 17px; }
.sidebar-spacer { flex: 1; }
.sidebar-status { margin: 18px 4px; padding: 15px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.035); }
.sidebar-status span { display: flex; align-items: center; gap: 8px; color: #d9e2ec; font-size: 12px; font-weight: 700; }
.sidebar-status span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(185,242,39,.1); }
.sidebar-status small { display: block; margin-top: 7px; color: #708198; font-size: 10px; line-height: 1.5; }
.logout-form { margin: 0; }
.logout-button { width: 100%; border: 0; background: none; cursor: pointer; }
.workspace { min-width: 0; }
.mobile-header { display: none; }
.container { width: min(100%, 1320px); margin: 0 auto; padding: 48px clamp(24px, 4vw, 64px) 88px; }

.eyebrow { color: var(--accent-dark); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.hero-row, .page-heading, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.hero-row { margin-bottom: 30px; }
.hero-row h1, .page-heading h1 { margin: 8px 0 8px; color: #101828; font-size: clamp(34px, 4vw, 48px); line-height: 1.06; letter-spacing: -.045em; }
.hero-row p, .page-heading p, .section-heading p { margin: 0; color: var(--muted); }
.hero-row p { max-width: 660px; font-size: 16px; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(32px, 3.8vw, 44px); }
.section-heading { margin: 42px 0 17px; }
.section-heading h2 { margin: 0 0 3px; font-size: 19px; letter-spacing: -.02em; }
.section-heading > a { color: #46670a; font-size: 13px; font-weight: 750; text-decoration: none; }
.section-heading > a:hover { text-decoration: underline; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.back:hover { color: var(--ink); }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--navy-950); color: #fff; box-shadow: 0 7px 18px rgba(7, 17, 31, .16); }
.button.primary:hover { background: var(--navy-800); box-shadow: 0 9px 22px rgba(7, 17, 31, .2); }
.button.primary .plus { color: var(--accent); font-size: 20px; line-height: 0; }
.button.secondary { background: #fff; border-color: var(--line-strong); color: #344054; box-shadow: var(--shadow-sm); }
.button.secondary:hover { border-color: #b8c0cd; }
.button.ghost { color: #4e700d; background: #f4f9e8; }
.button.danger { color: var(--red); background: var(--red-soft); border-color: #f5caca; }
button:disabled { opacity: .48; cursor: not-allowed; transform: none !important; }

.card, .table-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.status-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 15px; margin-bottom: 18px; padding: 18px 20px; background: linear-gradient(115deg, #f0fbf5, #f8fcf4); border: 1px solid #d8eee1; border-radius: 16px; }
.status-card::after { content: ""; position: absolute; right: -28px; top: -60px; width: 150px; height: 150px; border: 22px solid rgba(16,151,97,.045); border-radius: 50%; }
.status-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.status-copy strong { font-size: 14px; }
.status-copy span { color: var(--muted); font-size: 12px; }
.status-card > a { position: relative; z-index: 1; color: #34710c; font-size: 13px; font-weight: 800; text-decoration: none; }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(16,151,97,.11); }
.status-session_expired, .status-blocked { background: linear-gradient(115deg, #fff7e9, #fffaf2); border-color: #f0dfbd; }
.status-session_expired .status-dot, .status-blocked .status-dot { background: var(--amber); box-shadow: 0 0 0 6px rgba(217,119,6,.1); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-card { display: flex; align-items: center; gap: 15px; padding: 19px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: #f0f4f8; color: #46576d; font-size: 18px; font-weight: 800; }
.metric-card:nth-child(2) .metric-icon { background: var(--green-soft); color: var(--green); }
.metric-card:nth-child(3) .metric-icon { background: #f3f8e7; color: #658d0a; }
.metric-copy { min-width: 0; }
.metric-copy span, .metric-copy strong { display: block; }
.metric-copy span { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.metric-copy strong { margin-top: 1px; color: #101828; font-size: 22px; line-height: 1.25; letter-spacing: -.03em; }

.monitor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.monitor-card { position: relative; overflow: hidden; padding: 22px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.monitor-card:hover { transform: translateY(-2px); border-color: #d7dde6; box-shadow: var(--shadow-md); }
.monitor-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.monitor-card.paused { opacity: .68; }
.monitor-card.paused::before { background: #b7bfca; }
.card-topline, .actions { display: flex; align-items: center; gap: 9px; }
.card-topline { justify-content: space-between; }
.pill, .state-label { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; background: #f1f3f6; color: #536174; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .075em; }
.state-label { background: var(--green-soft); color: #087448; }
.paused .state-label { background: #f1f3f5; color: #747f8e; }
.monitor-card h3 { margin: 17px 0 4px; color: #101828; font-size: 19px; letter-spacing: -.025em; }
.monitor-filter { min-height: 22px; margin: 0; color: var(--muted); font-size: 13px; }
.event-state { display: flex; flex-direction: column; gap: 3px; margin: 18px 0; padding: 15px 16px; background: #f7f9fb; border: 1px solid #edf0f4; border-radius: 13px; }
.event-state > span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.event-state strong { font-size: 23px; letter-spacing: -.03em; }
.event-state small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.availability-available { color: var(--green); }
.availability-unavailable, .availability-closed { color: var(--red); }
.details { margin: 0 0 17px; font-size: 12px; }
.details div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-top: 1px solid var(--line); }
.details dt { color: var(--muted); }
.details dd { margin: 0; color: #344054; text-align: right; }
.error-text dd { color: var(--red); }
.actions { flex-wrap: wrap; }
.actions form { margin: 0; }
.actions .button { min-height: 38px; padding: 8px 13px; }
.actions.end { justify-content: flex-end; margin-top: 28px; }

.empty-state { position: relative; overflow: hidden; padding: 58px 30px; text-align: center; }
.empty-state::before, .empty-state::after { content: ""; position: absolute; border: 1px solid rgba(119,166,0,.13); border-radius: 50%; }
.empty-state::before { width: 250px; height: 250px; left: calc(50% - 125px); top: calc(50% - 125px); }
.empty-state::after { width: 150px; height: 150px; left: calc(50% - 75px); top: calc(50% - 75px); }
.empty-content { position: relative; z-index: 1; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 17px; background: var(--navy-950); color: var(--accent); font-size: 24px; box-shadow: 0 12px 30px rgba(7,17,31,.18); }
.empty-state h3 { margin: 0 0 5px; font-size: 19px; }
.empty-state p { margin: 0 auto 19px; color: var(--muted); }

.table-card { overflow: auto; }
.table-card table { width: 100%; min-width: 700px; border-collapse: collapse; }
.table-card th, .table-card td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; text-align: left; }
.table-card th { background: #fafbfc; color: #7a8699; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.table-card td { color: #475467; }
.table-card tbody tr:hover { background: #fbfcfd; }
.table-card tbody tr:last-child td { border-bottom: 0; }

.editor { padding: 28px; }
.editor h2 { margin: 0 0 15px; color: #101828; font-size: 16px; letter-spacing: -.015em; }
.field-group { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 7px; color: #344054; font-size: 12px; font-weight: 750; }
label small, .muted { color: var(--muted); font-weight: 400; }
input, select { width: 100%; height: 46px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 11px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
input::placeholder { color: #a8b0bd; }
input:focus, select:focus { border-color: #9bc735; box-shadow: 0 0 0 4px rgba(185,242,39,.15); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.settings-grid p { color: var(--muted); }
.settings-grid form + form { margin-top: 11px; }
.card-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 12px; background: #f0f4f8; color: #344054; font-size: 18px; }
.connection-state { display: flex; flex-direction: column; gap: 2px; padding: 14px 15px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; }
.connection-state strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.connection-state span { color: var(--muted); font-size: 12px; }
.guidance { margin-top: 17px; padding: 26px 28px; }
.guidance ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.guidance li { position: relative; padding-left: 37px; color: var(--muted); font-size: 12px; counter-increment: steps; }
.guidance li::before { content: counter(steps); position: absolute; left: 0; top: -3px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: #eff4e5; color: #5f820f; font-size: 11px; font-weight: 850; }

.login-body { background: var(--navy-950); }
.login-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 76% 12%, rgba(185,242,39,.11), transparent 26%), var(--navy-950); }
.login-top { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0; }
.login-container { width: min(1180px, calc(100% - 40px)); flex: 1; display: grid; align-items: center; margin: 0 auto; padding: 22px 0 64px; }
.login-layout { display: grid; grid-template-columns: 1.1fr .8fr; gap: clamp(44px, 8vw, 120px); align-items: center; }
.login-showcase { color: #fff; }
.login-kicker { display: inline-flex; align-items: center; gap: 9px; padding: 7px 11px; color: #dfffa0; background: rgba(185,242,39,.08); border: 1px solid rgba(185,242,39,.18); border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.login-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(185,242,39,.09); }
.login-showcase h2 { max-width: 610px; margin: 22px 0 17px; font-size: clamp(43px, 5.5vw, 72px); line-height: .98; letter-spacing: -.06em; }
.login-showcase h2 em { color: var(--accent); font-style: normal; }
.login-showcase > p { max-width: 530px; margin: 0; color: #92a2b5; font-size: 17px; }
.login-features { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 35px; }
.login-feature { display: flex; align-items: center; gap: 9px; color: #c4ceda; font-size: 12px; font-weight: 650; }
.login-feature::before { content: "✓"; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(185,242,39,.11); color: var(--accent); font-size: 10px; }
.login-card { padding: 34px; background: rgba(255,255,255,.985); border: 1px solid rgba(255,255,255,.7); border-radius: 22px; box-shadow: var(--shadow-lg); }
.login-card .login-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; background: var(--navy-950); color: var(--accent); font-size: 19px; }
.login-card h1 { margin: 20px 0 7px; color: #101828; font-size: 27px; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.login-card .button { width: 100%; margin-top: 2px; }
.login-card .security-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 17px 0 0; color: #8b95a5; font-size: 10px; }
.login-card .security-note::before { content: "●"; color: var(--green); font-size: 7px; }
.flash { margin-bottom: 18px; padding: 13px 15px; color: #087448; background: var(--green-soft); border: 1px solid #ccefdc; border-radius: 12px; font-size: 12px; font-weight: 700; }
.flash.error { color: var(--red); background: var(--red-soft); border-color: #f2cccc; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .monitor-grid { grid-template-columns: 1fr; }
  .guidance ol { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 16px; background: var(--navy-950); }
  .sidebar > .brand, .nav-label, .sidebar-spacer, .sidebar-status { display: none; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; min-height: 42px; padding: 0 12px; }
  .nav-item.active::before { inset: auto 10px 0; width: auto; height: 2px; }
  .logout-form { margin-left: auto; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 0; }
  .mobile-header .brand-copy strong { color: var(--ink); }
  .mobile-header .brand-copy small { color: var(--muted-light); }
  .container { padding: 28px 16px 64px; }
  .hero-row, .page-heading { align-items: flex-start; flex-direction: column; }
  .hero-row h1, .page-heading h1 { font-size: 35px; }
  .hero-row .button { width: 100%; }
  .metrics, .settings-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .status-card { align-items: flex-start; }
  .status-card > a { margin-left: auto; }
  .editor { padding: 21px; }
  .actions.end { align-items: stretch; flex-direction: column-reverse; }
  .actions.end .button { width: 100%; }
  .guidance ol { grid-template-columns: 1fr; }
  .login-top { padding: 20px 0; }
  .login-layout { grid-template-columns: 1fr; gap: 34px; }
  .login-showcase h2 { font-size: 43px; }
  .login-showcase > p { font-size: 15px; }
  .login-features { display: none; }
  .login-card { padding: 27px 22px; }
}
