@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f5efe6;
  --bg-alt: #e8f0e4;
  --ink: #1a2a2f;
  --muted: #5c6b70;
  --accent: #0f6e6a;
  --accent-warm: #c4662a;
  --card: rgba(255, 255, 255, 0.9);
  --border: #d7cfc1;
  --shadow: 0 20px 40px rgba(20, 30, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fef7ea 0%, #f5efe6 40%, #e8f0e4 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(26, 42, 47, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(26, 42, 47, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3 {
  font-family: "Fraunces", "Georgia", serif;
  margin: 0;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

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

.header h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0.2px;
}

.header p {
  margin: 0;
  color: var(--muted);
}

.header .meta {
  display: flex;
  gap: 16px;
  align-items: center;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 110, 106, 0.12);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}

.logout-form button {
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
}

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

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

input, select {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  background: white;
}

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

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
}

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

.card {
  background: white;
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px rgba(20, 30, 35, 0.08);
  animation: rise 0.6s ease both;
}

.card h3 {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 6px;
}

.card .value {
  font-size: 24px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: white;
}

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

thead th {
  background: #f7f2eb;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #efe7db;
}

.table-total {
  font-weight: 700;
}

.chart {
  height: 220px;
  background: linear-gradient(120deg, rgba(15, 110, 106, 0.12), rgba(196, 102, 42, 0.1));
  border-radius: 18px;
  padding: 16px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.bar {
  flex: 1;
  background: var(--accent);
  border-radius: 10px 10px 4px 4px;
  min-height: 12px;
  transition: height 0.4s ease;
}

.bar.alt {
  background: var(--accent-warm);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  background: white;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid var(--border);
  width: min(420px, 100%);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

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

.login-card .error {
  color: #b2381f;
  background: rgba(178, 56, 31, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.login-card button {
  width: 100%;
  margin-top: 12px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}
