:root {
  --orange: #f97316;
  --orange-strong: #ea580c;
  --orange-dark: #9a3412;
  --orange-soft: #fff7ed;
  --amber: #f59e0b;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #ffffff;
  --soft: #f6f7fb;
  --night: #111827;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #2563eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  background: radial-gradient(circle at 18% 18%, rgba(249, 115, 22, .32), transparent 32%), linear-gradient(135deg, #0f172a 0%, #431407 100%);
}

.login-visual {
  position: relative;
  display: grid;
  align-content: end;
  gap: 22px;
  padding: 48px;
  color: #fff;
  overflow: hidden;
}

.login-visual:after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 420px;
  height: 420px;
  border: 64px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.client-logo {
  width: min(280px, 82vw);
  height: auto;
  display: block;
}

.login-visual h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 7vw, 78px);
  line-height: .94;
}

.login-visual p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: 18px;
  line-height: 1.55;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
}

.login-card {
  width: min(100%, 440px);
  padding: 30px;
  background: #fff;
  border: 1px solid rgba(249, 115, 22, .18);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .18);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.credentials {
  display: grid;
  gap: 6px;
  padding: 13px;
  margin-bottom: 18px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  border: 1px solid #fed7aa;
  border-radius: 10px;
  font-size: 14px;
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

input, select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
}

.field { margin-bottom: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  min-height: 46px;
  color: #fff;
  background: var(--orange);
}

.btn-outline { border-color: var(--line); }
.btn-dark { color: #fff; background: var(--night); }

.login-error {
  display: none;
  margin-top: 12px;
  color: var(--bad);
  font-size: 14px;
  font-weight: 700;
}

.app-shell {
  display: none;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(180deg, rgba(154, 52, 18, .38), rgba(15, 23, 42, .96)), linear-gradient(135deg, var(--orange), #7c2d12);
}

.sidebar .client-logo { width: 210px; }

.product-name {
  padding: 14px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
}

.product-name strong {
  display: block;
  font-size: 17px;
}

.product-name span {
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-btn {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  color: rgba(255, 255, 255, .82);
  background: transparent;
  border-color: transparent;
}

.nav-btn.active, .nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .18);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
}

.logout {
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .2);
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.14;
}

h1 { font-size: clamp(28px, 4vw, 42px); }

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.view { display: none; }
.view.active { display: block; }

.grid {
  display: grid;
  gap: 16px;
}

.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-wide { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); }

.panel {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 38px rgba(15, 23, 42, .045);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.trend {
  font-size: 13px;
  font-weight: 800;
}

.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.info { color: var(--info); }

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.pill.ok { color: #166534; background: #dcfce7; }
.pill.warn { color: #92400e; background: #fef3c7; }
.pill.bad { color: #991b1b; background: #fee2e2; }
.pill.info { color: #1e40af; background: #dbeafe; }
.pill.orange { color: var(--orange-dark); background: var(--orange-soft); }

.chart {
  height: 280px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 9px;
  padding-top: 18px;
}

.bar {
  position: relative;
  min-height: 34px;
  border-radius: 9px 9px 4px 4px;
  background: linear-gradient(180deg, #fdba74, var(--orange));
}

.bar:after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.list {
  display: grid;
  gap: 12px;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.progress {
  height: 9px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--amber));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full { grid-column: 1 / -1; }

.kanban {
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  overflow-x: auto;
  padding-bottom: 4px;
}

.column {
  min-width: 240px;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.column h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
}

.task {
  display: grid;
  gap: 10px;
  padding: 13px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.task strong { line-height: 1.28; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
}

.event {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
}

.event time {
  color: var(--orange-dark);
  font-weight: 900;
}

.event div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.event p {
  margin: 4px 0 0;
  color: var(--muted);
}

.service-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.service-row:last-child { border-bottom: 0; }

.service-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(22, 163, 74, .1);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(217, 119, 6, .1);
}

.dot.bad {
  background: var(--bad);
  box-shadow: 0 0 0 6px rgba(220, 38, 38, .1);
}

.log-line {
  display: grid;
  grid-template-columns: 90px 112px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.log-line:last-child { border-bottom: 0; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-radius: 0; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .login-screen, .cols-2, .cols-3, .cols-4, .cols-wide { grid-template-columns: 1fr; }
  .login-visual { min-height: 46vh; padding: 32px; }
  .topbar { display: block; }
  .top-actions { justify-content: flex-start; margin-top: 14px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main { padding: 18px 14px; }
  .login-panel { padding: 20px; }
  .login-card { padding: 22px; }
  .side-nav { grid-template-columns: 1fr; }
  .chart { height: 220px; gap: 5px; }
  .log-line, .event { grid-template-columns: 1fr; }
}
