@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg-0: #e8f7f0;
  --bg-1: #e6f4ff;
  --bg-2: #f2fbff;
  --card: rgba(255, 255, 255, 0.96);
  --card-border: rgba(34, 120, 120, 0.18);
  --text: #0f1d22;
  --muted: #43636a;
  --accent: #2bb46f;
  --accent-2: #33b4ff;
  --danger: #ff6b7a;
  --glow: 0 0 18px rgba(51, 180, 255, 0.25);
  --shadow: 0 14px 36px rgba(12, 32, 36, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  background:
    radial-gradient(800px 420px at 8% -10%, rgba(51, 180, 255, 0.18), transparent 60%),
    radial-gradient(900px 520px at 92% -20%, rgba(43, 180, 111, 0.18), transparent 65%),
    linear-gradient(180deg, var(--bg-0), var(--bg-2));
  color: var(--text);
}
.page {
  max-width: 100%;
  margin: 0;
  padding: 24px 24px 48px;
}
.page:has(.auth-card) {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(15, 28, 24, 0.95), rgba(10, 22, 20, 0.9));
  border: 1px solid rgba(62, 184, 155, 0.3);
  padding: 14px 18px;
  border-radius: 16px;
  margin-bottom: 18px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.logo {
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
}
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
nav a, nav button {
  text-decoration: none;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  transition: all 180ms ease;
  border: 1px solid transparent;
  background: rgba(43, 180, 111, 0.08);
}
nav a:hover, nav button:hover {
  background: rgba(43, 180, 111, 0.2);
  box-shadow: 0 0 16px rgba(43, 180, 111, 0.25);
}
.inline { display: inline; }
.card {
  background: #e9f7ff;
  border: 1px solid rgba(77, 145, 175, 0.25);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.auth-card { width: min(720px, 92vw); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn, button {
  padding: 9px 14px;
  border: 1px solid rgba(42, 167, 201, 0.4);
  background: linear-gradient(135deg, rgba(51, 180, 255, 0.18), rgba(43, 180, 111, 0.14));
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  transition: all 160ms ease;
}
.btn:hover, button:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow);
}
.form { display: grid; gap: 12px; max-width: 720px; }
label { color: var(--muted); font-size: 0.95rem; }
input, select, textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(30, 120, 130, 0.22);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(51, 180, 255, 0.2);
}
.table-wrap { width: 100%; overflow: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; background: rgba(255,255,255,0.7); }
th, td { padding: 10px; border-bottom: 1px solid rgba(30, 120, 130, 0.15); text-align: left; }
thead th { position: sticky; top: 0; background: rgba(15, 80, 110, 0.08); color: var(--muted); font-weight: 600; }
tr:hover td { background: rgba(51, 180, 255, 0.08); }
.card a { color: #0f6d8a; }
.card a:hover { color: #0b5a70; }
.flash {
  background: rgba(51, 180, 255, 0.12);
  border: 1px solid rgba(51, 180, 255, 0.3);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.search {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  align-items: center;
  flex-wrap: wrap;
}
.low { background: rgba(255, 107, 122, 0.12); }
.meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.print-sheet { margin-top: 8px; }
.print-actions { align-items: center; }

main > .card {
  animation: rise 400ms ease both;
}
main > .card:nth-child(2) { animation-delay: 80ms; }
main > .card:nth-child(3) { animation-delay: 160ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .topbar { flex-direction: column; gap: 10px; }
  nav { justify-content: center; }
  .row { flex-direction: column; align-items: flex-start; }
  .search { flex-direction: column; align-items: stretch; }
}

@media print {
  body { background: #ffffff; color: #111827; }
  .topbar, nav, .flash, .actions, .search, .btn, button { display: none !important; }
  .page { max-width: none; padding: 0; }
  .card { border: none; box-shadow: none; background: #ffffff; }
}

.archived { opacity: 0.6; }
