:root {
  --sena: #39a900;
  --sena-dark: #1f2933;
  --danger: #ef233c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #0f172a;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.inline-flex {
  display: inline-flex;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: end;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-5 {
  margin-bottom: 1.25rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.min-w-0 {
  min-width: 0;
}

.w-4 {
  width: 1rem;
}

.h-4 {
  height: 1rem;
}

.w-full {
  width: 100%;
}

.space-y-1 > * + * {
  margin-top: 0.25rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-black {
  font-weight: 900;
}

.leading-tight {
  line-height: 1.25;
}

.uppercase {
  text-transform: uppercase;
}

.text-slate-300 {
  color: #cbd5e1;
}

.text-slate-500 {
  color: #64748b;
}

.text-slate-600 {
  color: #475569;
}

.text-slate-700 {
  color: #334155;
}

.text-slate-900 {
  color: #0f172a;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accent-sena {
  accent-color: var(--sena);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: var(--sena-dark);
  color: #f8fafc;
  padding: 1.25rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--sena);
  font-weight: 900;
}

.nav-button {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border-radius: 8px;
  border: 0;
  background-color: #214d2c !important;
  padding: 0.75rem 0.9rem;
  text-align: left;
  font-weight: 700;
  color: #ffffff !important;
  transition: 160ms ease;
}

.nav-button:hover,
.nav-button:focus,
.nav-button:active,
.active-nav {
  background-color: #214d2c !important;
  color: #ffffff !important;
  outline: none;
}

.content {
  padding: 1.5rem;
  overflow: auto;
}

.content-panel,
.stat-card,
.row-card,
.table-shell,
.empty-state {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.content-panel {
  padding: 1rem;
}

.stat-card {
  padding: 1rem;
}

.stat-card span {
  display: block;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
}

.stat-card strong {
  color: var(--sena-dark);
  font-size: 1.75rem;
  line-height: 1.2;
}

.field,
.file-field {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.6rem 0.75rem;
  outline: none;
}

.field:focus,
.file-field:focus {
  border-color: var(--sena);
  box-shadow: 0 0 0 3px rgba(57, 169, 0, 0.16);
}

.field-label {
  display: grid;
  gap: 0.35rem;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
}

.primary-button,
.danger-button,
.link-button,
.icon-button {
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  min-height: 42px;
  background: var(--sena);
  color: #ffffff;
  padding: 0.65rem 1rem;
}

.danger-button {
  min-height: 42px;
  background: #ffffff;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.65rem 1rem;
}

.danger-button:hover {
  background: var(--danger);
  color: #ffffff;
}

.link-button {
  color: var(--sena);
  padding: 0.35rem 0.5rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #475569;
  background: #f1f5f9;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.8rem;
  vertical-align: top;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 900;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.badge-red {
  background: var(--danger);
  color: #ffffff;
}

.badge-gray {
  background: #e2e8f0;
  color: #334155;
}

.row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}

.calendar-head span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.calendar-day,
.calendar-empty {
  min-height: 92px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.55rem;
}

.calendar-empty {
  background: transparent;
  border-style: dashed;
}

.text-sena {
  color: var(--sena);
}

.empty-state {
  padding: 2rem;
  color: #64748b;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.48);
  padding: 1rem;
}

.modal-panel {
  width: min(620px, 100%);
  border-radius: 8px;
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  transform: translateY(140%);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: #ffffff;
  font-weight: 800;
  transition: transform 180ms ease;
}

.toast-ok,
.toast-error {
  transform: translateY(0);
}

.toast-ok {
  background: var(--sena);
}

.toast-error {
  background: var(--danger);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .nav-button {
    text-align: center;
    font-size: 0.85rem;
  }

  .table-shell {
    overflow-x: auto;
  }

  .calendar-day,
  .calendar-empty {
    min-height: 74px;
    padding: 0.35rem;
  }
}

@media (min-width: 640px) {
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (min-width: 1024px) {
  .lg\:flex-row {
    flex-direction: row;
  }

  .lg\:items-end {
    align-items: end;
  }

  .lg\:justify-between {
    justify-content: space-between;
  }

  .lg\:w-auto {
    width: auto;
  }

  .lg\:pb-3 {
    padding-bottom: 0.75rem;
  }

  .lg\:grid-cols-\[24rem_auto\] {
    grid-template-columns: 24rem auto;
  }

  .lg\:grid-cols-\[1fr_220px_260px\] {
    grid-template-columns: 1fr 220px 260px;
  }

  .lg\:grid-cols-\[260px_180px_1fr_auto_auto\] {
    grid-template-columns: 260px 180px 1fr auto auto;
  }
}
