:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f3f0ec;
  --text: #28251d;
  --muted: #6f6a63;
  --border: #ddd7cf;
  --primary: #01696f;
  --primary-soft: #dceceb;
  --danger-soft: #f5dede;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow: hidden;
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 72px 1fr;
  height: 100dvh;
}

.sidebar {
  grid-row: 1 / -1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  overflow-y: auto;
}

.brand h2 {
  margin: 0;
  font-size: 1.25rem;
}

.brand p {
  margin: 4px 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.nav a.active,
.nav a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.header {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(247, 246, 242, 0.92);
}

.header h1 {
  font-size: 1.4rem;
  margin: 0;
}

.header-right {
  color: var(--muted);
  font-size: 0.95rem;
}

.main {
  grid-column: 2;
  overflow-y: auto;
  padding: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2, .card h3 {
  margin-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: #01696f;
  color: white;
}

.btn-danger {
  background: #9f4a4a;
  color: white;
}

.btn-secondary {
  background: #ece9e4;
  color: #2b2926;
}

.label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

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

th {
  color: var(--muted);
  font-weight: 600;
}

.stack-form {
  display: grid;
  gap: 12px;
  max-width: 600px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

button {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #8f4a4a;
}

button.ghost {
  background: #e9ecef;
  color: #333;
}

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

.login-body {
  overflow: auto;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.error-text {
  color: #a12c2c;
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.cards-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    height: auto;
    min-height: 100dvh;
  }

  .sidebar {
    grid-row: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .header,
  .main {
    grid-column: 1;
  }

  .cards-2,
  .cards-3 {
    grid-template-columns: 1fr;
  }
}