:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --brand: #0f4c81;
  --brand-light: #2f6ba0;
  --accent: #14a089;
  --text: #152033;
  --muted: #627089;
  --danger: #c0392b;
  --border: #dbe4ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background: radial-gradient(circle at top right, #dceeff 0%, var(--bg) 30%, #eef4f9 100%);
  color: var(--text);
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(18, 38, 63, 0.08);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(430px, 92vw);
  padding: 28px;
}

h1,
h2,
h3 {
  margin: 0;
}

.title {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 20px;
}

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

label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
}

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

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-secondary {
  background: #e8f0fa;
  color: var(--brand);
}

.btn-danger {
  background: #fdecec;
  color: var(--danger);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 10px;
}

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

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

.nav {
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(110deg, var(--brand), var(--brand-light));
  border-radius: 14px;
}

.kpi {
  padding: 14px;
}

.kpi .v {
  font-size: 1.2rem;
  font-weight: 700;
}

.section {
  margin-top: 16px;
  padding: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
  font-size: 0.92rem;
}

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

th {
  position: sticky;
  top: 0;
  background: #f7fbff;
  z-index: 1;
}

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

.error {
  color: var(--danger);
  margin-top: 12px;
  min-height: 20px;
}

.success {
  color: #167a5b;
  margin-top: 12px;
  min-height: 20px;
}

.small {
  font-size: 0.86rem;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f6ff;
  color: #0c5274;
  font-size: 0.8rem;
}

@media (max-width: 980px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .row,
  .row-between {
    flex-direction: column;
    align-items: stretch;
  }
}
