@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Serif:wght@500;600&display=swap');

:root {
  --bg: #f4f7fb;
  --bg-accent: #e6effa;
  --surface: #ffffff;
  --surface-muted: #f7faff;
  --ink: #0f172a;
  --muted: #5b6b7b;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --accent-soft: #e3edff;
  --success: #1f8f5f;
  --success-soft: #e2f5ea;
  --danger: #c03a2b;
  --danger-soft: #fde9e7;
  --border: #d5dfeb;
  --shadow: rgba(15, 23, 42, 0.08);
  --shadow-strong: rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px circle at 12% -10%, #e3ecff 0, transparent 55%),
    radial-gradient(900px circle at 90% 0, #e7f7f1 0, transparent 55%),
    linear-gradient(120deg, #f7fbff, #eff4fb 45%, #f7fbff);
  min-height: 100vh;
}

a {
  color: var(--accent-strong);
}

a:hover {
  color: var(--accent);
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 10px;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .brand {
  font-family: 'IBM Plex Serif', serif;
  font-size: 22px;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.main-nav {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 6px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.nav-link:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #c6d9f5;
}

.nav-link.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.3);
}

.nav-link.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f3b7b2;
}

.nav-link.danger:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.container {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 32px 40px 60px;
}

.hero {
  background: linear-gradient(120deg, #ffffff 0%, #f2f7ff 100%);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px var(--shadow);
  border-radius: 18px;
  padding: 28px 32px;
  display: grid;
  gap: 16px;
  animation: rise 0.5s ease both;
}

.hero h1 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 34px;
  margin: 0;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 14px 36px var(--shadow);
  animation: rise 0.55s ease both;
}

.grid .card:nth-child(2) {
  animation-delay: 0.08s;
}

.card h3 {
  margin-top: 0;
  font-family: 'IBM Plex Serif', serif;
}

button,
.btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(29, 78, 216, 0.24);
}

button.secondary,
.btn.secondary {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid #c6d9f5;
  box-shadow: none;
}

button.secondary:hover,
.btn.secondary:hover {
  background: #d8e6ff;
}

button.danger,
.btn.danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
  box-shadow: 0 12px 24px rgba(192, 58, 43, 0.25);
}

button.danger:hover,
.btn.danger:hover {
  background: #a93226;
}

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

.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.table-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-controls input[type='text'] {
  min-width: 240px;
  flex: 1;
}

input[type='text'],
input[type='file'] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

input[type='text']:focus,
input[type='file']:focus {
  outline: none;
  border-color: #9cb8e5;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
  margin: 20px 0 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 32px var(--shadow);
  animation: rise 0.55s ease both;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.table-wrap thead {
  background: #e8f0fb;
  text-align: left;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tbody tr:hover {
  background: #f2f7ff;
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  border: 1px solid #c6d9f5;
}

.table-pagination {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.text-negative {
  color: var(--danger);
  font-weight: 600;
}

.text-positive {
  color: var(--success);
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}

.modal-backdrop.is-visible {
  display: flex;
}

.modal {
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 28px 68px var(--shadow-strong);
}

.modal h4 {
  margin: 0 0 8px;
  font-family: 'IBM Plex Serif', serif;
  font-size: 18px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

@media (max-width: 768px) {
  header {
    gap: 12px;
    padding: 18px 24px;
  }
  .container {
    padding: 24px;
  }
  .table-wrap {
    width: 100%;
  }
  .hero h1 {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
