:root {
  --bg: #f2f4f8;
  --panel: #ffffff;
  --text: #152238;
  --muted: #5f708c;
  --primary: #005f73;
  --primary-light: #e7f6f8;
  --danger: #b32134;
  --border: #d7dde8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 5%, #ddeef7 0%, var(--bg) 45%);
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  color: var(--primary);
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.nav a,
.nav .link-button {
  color: var(--text);
  text-decoration: none;
  font-size: 0.94rem;
}

main.container {
  padding: 1.3rem 0 2.5rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.55rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.flash {
  margin-bottom: 1rem;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-weight: 700;
}

.flash-error {
  background: #fce4e7;
  color: #6f1020;
}

.flash-success {
  background: #ddf5e8;
  color: #0f5530;
}

.auth-card,
.form-card {
  width: min(700px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.2rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
}

.value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
}

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

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.section-head a,
.toolbar a,
a {
  color: var(--primary);
}

.filters,
.stack {
  display: grid;
  gap: 0.75rem;
}

.filters {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: var(--primary-light);
  border: 1px solid #cbe5e9;
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}

label {
  display: grid;
  gap: 0.28rem;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  background: #fff;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.link-button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.danger {
  color: var(--danger);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.toolbar-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

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

th,
td {
  text-align: left;
  padding: 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

@media (max-width: 740px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.65rem 0;
  }

  table {
    min-width: 640px;
  }
}
