:root {
  --lima-navy-950: #06101b;
  --lima-navy-900: #0a1726;
  --lima-navy-850: #0e1e31;
  --lima-navy-800: #13283f;
  --lima-ice: #e8eef6;
  --lima-muted: #8ea3bb;
  --lima-line: rgba(232, 238, 246, 0.12);
  --lima-accent: #4d9fff;
  --lima-danger: #f0a0a8;
  --lima-ok: #8fd9b0;
  --lima-side: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body.lima-panel {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 520px at 12% -10%, rgba(77, 159, 255, 0.12), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(80, 200, 140, 0.05), transparent 46%),
    var(--lima-navy-950);
  color: var(--lima-ice);
  min-height: 100vh;
  letter-spacing: 0.01em;
}

/* Unauthenticated shell */
.lima-panel__shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.lima-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--lima-line);
}

.lima-panel__brand,
.lima-side__brand {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lima-panel__brand span,
.lima-side__brand span {
  font-weight: 500;
  color: var(--lima-muted);
}

.lima-panel__logout button {
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--lima-line);
  color: var(--lima-ice);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.lima-panel__main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 16px 64px;
}

.lima-card {
  width: 100%;
  max-width: 420px;
  background: rgba(10, 23, 38, 0.92);
  border: 1px solid var(--lima-line);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.lima-card--wide { max-width: 1080px; }

.lima-panel__nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  margin-right: 16px;
}

.lima-panel__nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--lima-ice);
  text-decoration: none;
  border-radius: 8px;
}

.lima-panel__nav a:hover,
.lima-panel__nav a:focus {
  background: var(--lima-navy-800);
}

/* Authenticated app shell */
.lima-nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lima-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--lima-side) 1fr;
}

.lima-side {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 28px 18px;
  background: rgba(8, 17, 28, 0.92);
  border-right: 1px solid var(--lima-line);
}

.lima-side__tag {
  margin: 6px 0 28px;
  color: var(--lima-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.lima-side__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lima-side__nav a,
.lima-side__soon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--lima-ice);
  text-decoration: none;
}

.lima-side__nav a:hover,
.lima-side__nav a:focus-visible {
  background: var(--lima-navy-800);
}

.lima-side__nav a[aria-current="page"] {
  background: rgba(77, 159, 255, 0.14);
  color: #c7e0ff;
}

.lima-side__soon {
  color: var(--lima-muted);
  cursor: default;
}

.lima-side__soon em {
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
  white-space: nowrap;
  margin-left: auto;
}

.lima-app__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lima-top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--lima-line);
  background: rgba(6, 16, 27, 0.55);
  backdrop-filter: blur(10px);
}

.lima-menu {
  display: none;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--lima-line);
  border-radius: 8px;
  color: var(--lima-ice);
  cursor: pointer;
}

.lima-top__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.lima-top__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--lima-muted);
  font-size: 0.9rem;
}

.lima-top__user form { margin: 0; }

.lima-top__user button {
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--lima-line);
  color: var(--lima-ice);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.lima-content {
  padding: 28px 32px 56px;
}

.lima-dash { max-width: 1180px; }

.lima-kicker {
  margin: 0 0 8px;
  color: var(--lima-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lima-page-title {
  margin: 0 0 8px;
  font-size: 1.85rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.lima-lede {
  margin: 0 0 24px;
  color: var(--lima-muted);
  line-height: 1.5;
  max-width: 68ch;
}

.lima-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.lima-kpi,
.lima-panel-card {
  background: rgba(10, 23, 38, 0.78);
  border: 1px solid var(--lima-line);
  border-radius: 16px;
  padding: 18px 18px 16px;
}

.lima-kpi h3,
.lima-panel-card h2,
.lima-panel-card h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lima-muted);
}

.lima-kpi__value {
  margin: 0;
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.lima-kpi__value--muted {
  font-size: 1.15rem;
  color: var(--lima-muted);
}

.lima-kpi__hint {
  margin: 8px 0 0;
  color: var(--lima-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.lima-kpi--alert {
  border-color: rgba(240, 160, 168, 0.35);
}

.lima-panel-card { margin: 0 0 18px; }

.lima-panel-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lima-text-link,
.lima-row-link {
  color: #c7e0ff;
  text-decoration: none;
  display: inline-block;
  overflow-wrap: anywhere;
}

.lima-text-link:hover,
.lima-row-link:hover {
  text-decoration: underline;
}

.lima-empty {
  padding: 28px 18px;
  border: 1px dashed var(--lima-line);
  border-radius: 12px;
  color: var(--lima-muted);
}

.lima-empty p { margin: 0 0 8px; }
.lima-empty p:last-child { margin-bottom: 0; }

.lima-table-wrap { overflow-x: auto; }

.lima-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.lima-table th,
.lima-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lima-line);
}

.lima-table th:first-child,
.lima-table td:first-child {
  padding-left: 16px;
  min-width: 12rem;
  max-width: 22rem;
}

.lima-table th {
  color: var(--lima-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lima-sub {
  display: block;
  margin-top: 4px;
  color: var(--lima-muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lima-table code {
  font-size: 0.86rem;
}

.lima-pill {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
}

.lima-pill--demo { background: rgba(77, 159, 255, 0.16); color: #9ec8ff; }
.lima-pill--active { background: rgba(80, 200, 140, 0.16); color: var(--lima-ok); }
.lima-pill--offline { background: rgba(142, 163, 187, 0.16); color: var(--lima-muted); }
.lima-pill--alert { background: rgba(240, 160, 168, 0.16); color: var(--lima-danger); }
.lima-pill--pending { background: rgba(232, 196, 96, 0.16); color: #e8c460; }

.lima-row--alert td { box-shadow: none; }
.lima-row--alert td:first-child { border-left: 3px solid var(--lima-danger); }
.lima-row--offline { color: var(--lima-muted); }
.lima-row--demo td:first-child { border-left: 3px solid var(--lima-accent); }

.lima-h2 {
  margin: 28px 0 12px;
  font-size: 1.1rem;
}

.lima-events {
  margin: 0;
  padding: 4px 0 0;
  list-style: none;
}

.lima-events li {
  padding: 16px;
  border-bottom: 1px solid var(--lima-line);
  color: var(--lima-muted);
  font-size: 0.9rem;
}

.lima-event-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  color: inherit;
  text-decoration: none;
  width: 100%;
}

.lima-event-link:hover .lima-event-when {
  color: #c7e0ff;
}

.lima-event-when {
  color: var(--lima-ice);
  min-width: 13rem;
}

.lima-event-code {
  margin-left: auto;
}

.lima-later {
  margin: 24px 0 0;
  color: var(--lima-muted);
  font-size: 0.9rem;
}

.lima-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.lima-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(240, 160, 168, 0.12);
  color: var(--lima-danger);
}

.lima-card label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.lima-card input {
  width: 100%;
  min-height: 44px;
  margin: 0 0 16px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--lima-line);
  background: var(--lima-navy-800);
  color: var(--lima-ice);
  font: inherit;
}

.lima-card button[type="submit"] {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--lima-accent);
  color: var(--lima-navy-950);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lima-soon {
  margin: 16px 0 0;
  padding: 0 0 0 18px;
  color: var(--lima-muted);
}

.lima-follow {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(240, 160, 168, 0.28);
  background: rgba(240, 160, 168, 0.08);
}

.lima-follow p {
  margin: 0 0 8px;
  font-weight: 650;
}

.lima-follow ul {
  margin: 0;
  padding-left: 18px;
  color: var(--lima-danger);
}

.lima-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.lima-panel-card--wide { grid-column: 1 / -1; }

.lima-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 8px 12px;
}

.lima-dl dt {
  color: var(--lima-muted);
  font-size: 0.86rem;
}

.lima-dl dd { margin: 0; }

.lima-mod-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lima-mod-list li {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(77, 159, 255, 0.12);
  color: #c7e0ff;
  font-size: 0.82rem;
}

.lima-muted { color: var(--lima-muted); }

.lima-tech {
  margin: 18px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--lima-line);
  border-radius: 12px;
  color: var(--lima-muted);
  font-size: 0.86rem;
}

.lima-tech summary {
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.lima-tech code {
  color: #b7c6d8;
  font-size: 0.82rem;
}

@media (max-width: 1080px) {
  .lima-kpis { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .lima-app { display: block; }
  .lima-menu { display: inline-flex; align-items: center; }
  .lima-side {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: min(84vw, 280px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.35);
  }
  .lima-nav-toggle:checked ~ .lima-app .lima-side {
    transform: none;
  }
  .lima-nav-toggle:checked ~ .lima-app::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 15;
  }
  .lima-content { padding: 20px 16px 40px; }
  .lima-top { padding: 10px 16px; }
  .lima-detail-grid { grid-template-columns: 1fr; }
  .lima-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .lima-page-title { font-size: 1.5rem; }
}

@media (max-width: 560px) {
  .lima-kpis { grid-template-columns: 1fr; }
  .lima-top__user span {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .lima-panel__top { padding: 0 12px; }
  .lima-card { padding: 20px 16px; }
}
