:root {
  --bg: #f7f7f8;
  --bg-2: #f0f1f3;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --ink: #111827;
  --muted: #6b7280;
  --brand: #10a37f;
  --brand-2: #0b8b6b;
  --ok-bg: #ecfdf3;
  --ok-line: #abefc6;
  --ok-ink: #067647;
  --err-bg: #fef3f2;
  --err-line: #fecdca;
  --err-ink: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  overflow-x: auto;
  background:
    radial-gradient(1000px 500px at -10% -20%, rgba(16, 163, 127, 0.08), transparent 65%),
    radial-gradient(700px 350px at 110% 0%, rgba(17, 24, 39, 0.04), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.shell {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 16px 14px 24px;
}

.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.main-pane {
  min-width: 0;
  overflow: visible;
  animation: pane-in 0.24s ease;
}

@keyframes pane-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff, #fafafa);
  border-color: var(--line-strong);
}

.sidebar-logo {
  color: #0f172a;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

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

.sidebar-link {
  text-decoration: none;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  padding: 11px 12px;
  font-weight: 700;
  transition: all 0.16s ease;
}

.sidebar-link:hover {
  border-color: #d1d5db;
  background: #f3f4f6;
  transform: translateX(2px);
}

.sidebar-link.active {
  color: #065f46;
  border-color: #a7f3d0;
  background: linear-gradient(120deg, #ecfdf5, #d1fae5);
}

.sidebar-user {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  display: grid;
  gap: 8px;
  color: #0f172a;
}

.sidebar-user-meta {
  color: #667085;
  font-size: 13px;
}

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

.brand h1 {
  margin: 0;
  font-size: clamp(27px, 3.2vw, 40px);
  letter-spacing: -0.04em;
  color: #0f172a;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d1d5db;
  background: linear-gradient(180deg, #ffffff, #f3f4f6);
  color: #1f2937;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.btn:hover { filter: brightness(0.98); }

.btn-danger {
  background: linear-gradient(180deg, #fff6f5, #ffefec);
  border-color: #fecaca;
  color: #b42318;
}

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

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.kpi { padding: 18px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.form-wrap {
  max-width: 460px;
  margin: 10vh auto;
  padding: 22px;
}

.input, select, textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: #ffffff;
}

.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #6ee7b7;
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.14);
}

label { display: block; font-size: 13px; color: #344054; }
label + label { margin-top: 10px; }

.alert {
  padding: 12px 13px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert.success { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.alert.error { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
}
.table th { color: #374151; background: #f9fafb; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #065f46;
}

.helper {
  color: #6b7280;
  font-size: 12px;
}

.user-link {
  color: #0b8b6b;
  text-decoration: none;
  font-weight: 700;
}

.user-link:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 700px) {
  .shell { padding: 14px 8px 24px; }
  .brand h1 { font-size: 28px; }
}
