:root {
  --daintree: #02272f;
  --orange: #fe5823;
  --half-baked: #8ac4c7;
  --yellow: #eebe41;
  --light-blue: #cfdfdc;
  --light-yellow: #eae4d2;
  --white: #ffffff;
  --text: #0b1e23;
  --muted: #51686d;
  --border: #d6e2e1;
  --shadow: 0 8px 24px rgba(2, 39, 47, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--light-yellow);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.topbar {
  background: var(--daintree);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 0 rgba(2, 39, 47, 0.1);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
}

.brand-logo {
  width: 44px;
  height: 44px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-name { font-weight: 600; }
.user-role { font-size: 12px; color: rgba(255, 255, 255, 0.7); }

.topbar .button.secondary {
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.app-body .app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}

.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--daintree);
  font-weight: 500;
  background: transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
  background: var(--light-blue);
}

.app-content {
  min-width: 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-title {
  font-size: 28px;
  margin: 0;
  color: var(--daintree);
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card.soft {
  background: var(--light-blue);
}

.card + .card { margin-top: 16px; }

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--daintree);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

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

@media (max-width: 900px) {
  .app-body .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .form-grid { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--daintree);
  margin-bottom: 10px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 6px;
  font-size: 14px;
  background: var(--white);
}

textarea { min-height: 110px; }

input:focus, select:focus, textarea:focus, button:focus, .button:focus {
  outline: 2px solid rgba(254, 88, 35, 0.4);
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--orange);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--daintree);
  border-color: var(--daintree);
}

.button.danger {
  background: transparent;
  color: #b42318;
  border-color: #b42318;
}

.button.primary { background: var(--orange); }

.link {
  color: var(--daintree);
  font-weight: 500;
}

.alert-stack { margin-bottom: 14px; display: grid; gap: 8px; }
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 14px;
}
.alert-error { border-color: #f4b4a6; color: #7a271a; background: #fff2ef; }
.alert-success { border-color: #98d7b8; color: #05603a; background: #ecfdf3; }
.alert-warning { border-color: #f8e0a1; color: #7a4c0e; background: #fff9e8; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table thead th {
  background: var(--light-blue);
  color: var(--daintree);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr:hover { background: rgba(138, 196, 199, 0.15); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--light-blue);
  color: var(--daintree);
}

.badge.ok { background: rgba(2, 39, 47, 0.1); color: var(--daintree); }
.badge.pending { background: rgba(238, 190, 65, 0.2); color: #7a4c0e; }
.badge.warning { background: rgba(238, 190, 65, 0.25); color: #7a4c0e; }
.badge.danger { background: rgba(254, 88, 35, 0.15); color: #7a271a; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--daintree); margin-top: 6px; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.small { font-size: 12px; }

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--light-blue);
  color: var(--daintree);
  font-size: 12px;
  font-weight: 600;
}

.auth-body {
  background: linear-gradient(140deg, var(--light-blue), var(--light-yellow));
  min-height: 100vh;
}

.auth-card {
  max-width: 420px;
  margin: 40px auto 0;
  text-align: center;
}

.auth-logo {
  width: 64px;
  margin: 0 auto 12px;
}

.auth-title { margin: 0; font-size: 24px; color: var(--daintree); }
.auth-subtitle { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

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

.empty-state {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--light-blue);
  color: var(--daintree);
  text-align: center;
}

.footer-note { margin-top: 18px; color: var(--muted); font-size: 12px; }
