
/* =========================================================
   CHIRRIPO SUITE
   Plataforma administrativa central - CERBUS

   S095 / WEB-B01
   Sistema visual institucional

   Colores:
   Verde oscuro:   #283F24
   Verde principal: #467235
   Amarillo:        #FFBF00
   Amarillo claro:  #FFF78D

   Este archivo contiene estilos globales.
   Los estilos particulares permanecen en sus
   respectivos archivos .razor.css.
   ========================================================= */


/* =========================================================
   01. VARIABLES DE DISEÑO
   ========================================================= */

:root {
  color-scheme: light;
  --cs-green-950: #1c301a;
  --cs-green-900: #283f24;
  --cs-green-800: #34532d;
  --cs-green-700: #467235;
  --cs-green-600: #568744;
  --cs-green-100: #e8f1e4;
  --cs-green-50: #f0f7ed;
  --cs-gold: #ffbf00;
  --cs-gold-light: #fff78d;
  --cs-gold-surface: #fff9db;
  --cs-background: #f5f8f3;
  --cs-surface: #ffffff;
  --cs-surface-muted: #f8faf7;
  --cs-text: #233322;
  --cs-text-secondary: #5e6c60;
  --cs-text-muted: #718075;
  --cs-border: #dce6da;
  --cs-border-strong: #c5d4c1;
  --cs-success: #287448;
  --cs-success-background: #e8f6ec;
  --cs-warning: #976400;
  --cs-warning-background: #fff5d8;
  --cs-danger: #b42332;
  --cs-danger-background: #fff0f1;
  --cs-info: #285b80;
  --cs-info-background: #edf5fc;
  --cs-radius-sm: 8px;
  --cs-radius-md: 12px;
  --cs-radius-lg: 18px;
  --cs-radius-xl: 24px;
  --cs-shadow-sm: 0 2px 8px rgba(24, 48, 28, 0.04);
  --cs-shadow-md: 0 8px 28px rgba(24, 48, 28, 0.07);
  --cs-shadow-lg: 0 20px 60px rgba(24, 48, 28, 0.11);
  --cs-focus-ring: 0 0 0 4px rgba(70, 114, 53, 0.16);
  --cs-transition: 180ms ease;
  --cs-font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bs-body-bg: var(--cs-surface);
  --bs-body-color: var(--cs-text);
  --bs-primary: var(--cs-green-700);
}


/* =========================================================
   02. BASE GLOBAL
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--cs-background);
  color: var(--cs-text);
  font-family: var(--cs-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--cs-gold-light);
  color: var(--cs-green-950);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--cs-green-900);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

p {
  overflow-wrap: break-word;
}

a {
  color: var(--cs-green-700);
  text-underline-offset: 3px;
}

  a:hover {
    color: var(--cs-green-900);
  }

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

button {
  -webkit-tap-highlight-color: transparent;
}

  button:not(:disabled) {
    cursor: pointer;
  }

  button:disabled,
  input:disabled,
  select:disabled,
  textarea:disabled {
    cursor: not-allowed;
  }

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

:where( a, button, input, select, textarea, [tabindex] ):focus-visible {
  outline: 3px solid var(--cs-green-700);
  outline-offset: 3px;
}

h1:focus {
  outline: none;
}


/* =========================================================
   03. ELEMENTOS REUTILIZABLES
   ========================================================= */

.cs-page {
  width: min(100%, 1600px);
  margin-inline: auto;
  padding: clamp(20px, 3vw, 48px);
}

.cs-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

.cs-page-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.25rem);
  font-weight: 750;
}

.cs-page-description {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--cs-text-secondary);
}

.cs-eyebrow {
  display: inline-block;
  color: var(--cs-green-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cs-card {
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-lg);
  box-shadow: var(--cs-shadow-sm);
}

.cs-card-padded {
  padding: clamp(20px, 2.5vw, 32px);
}

.cs-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.cs-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 750;
}

.cs-card-description {
  margin: 6px 0 0;
  color: var(--cs-text-secondary);
  font-size: 0.9rem;
}


/* =========================================================
   04. BOTONES
   ========================================================= */

.cs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--cs-radius-sm);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--cs-transition), border-color var(--cs-transition), box-shadow var(--cs-transition), transform var(--cs-transition);
}

.cs-button-primary {
  background: var(--cs-green-900);
  border-color: var(--cs-green-900);
  color: #ffffff;
}

  .cs-button-primary:hover {
    background: var(--cs-green-700);
    border-color: var(--cs-green-700);
    color: #ffffff;
    box-shadow: var(--cs-shadow-md);
  }

.cs-button-secondary {
  background: #ffffff;
  border-color: var(--cs-border-strong);
  color: var(--cs-green-900);
}

  .cs-button-secondary:hover {
    background: var(--cs-green-50);
    border-color: var(--cs-green-700);
  }

.cs-button-accent {
  background: var(--cs-gold);
  border-color: var(--cs-gold);
  color: var(--cs-green-950);
}

  .cs-button-accent:hover {
    background: #edb100;
    border-color: #edb100;
    color: var(--cs-green-950);
  }

.cs-button:disabled {
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}


/* =========================================================
   05. FORMULARIOS
   ========================================================= */

.cs-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cs-label {
  color: var(--cs-text);
  font-size: 0.9rem;
  font-weight: 650;
}

.cs-input,
.cs-select,
.cs-textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: #ffffff;
  border: 1px solid var(--cs-border-strong);
  border-radius: var(--cs-radius-sm);
  color: var(--cs-text);
  transition: border-color var(--cs-transition), box-shadow var(--cs-transition);
}

.cs-textarea {
  min-height: 110px;
  resize: vertical;
}

  .cs-input::placeholder,
  .cs-textarea::placeholder {
    color: var(--cs-text-muted);
  }

  .cs-input:focus,
  .cs-select:focus,
  .cs-textarea:focus {
    border-color: var(--cs-green-700);
    box-shadow: var(--cs-focus-ring);
    outline: none;
  }

.cs-field-help {
  color: var(--cs-text-secondary);
  font-size: 0.82rem;
}


/* =========================================================
   06. TABLAS
   ========================================================= */

.cs-table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-md);
}

.cs-table {
  width: 100%;
  border-collapse: collapse;
}

  .cs-table th {
    padding: 14px 18px;
    background: var(--cs-surface-muted);
    border-bottom: 1px solid var(--cs-border);
    color: var(--cs-text-secondary);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.035em;
    text-align: left;
  }

  .cs-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--cs-border);
    color: var(--cs-text);
    vertical-align: middle;
  }

  .cs-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .cs-table tbody tr:hover {
    background: var(--cs-green-50);
  }


/* =========================================================
   07. ESTADOS Y MENSAJES
   ========================================================= */

.cs-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}

.cs-status-success {
  background: var(--cs-success-background);
  color: var(--cs-success);
}

.cs-status-warning {
  background: var(--cs-warning-background);
  color: var(--cs-warning);
}

.cs-status-danger {
  background: var(--cs-danger-background);
  color: var(--cs-danger);
}

.cs-status-info {
  background: var(--cs-info-background);
  color: var(--cs-info);
}

.cs-alert {
  padding: 14px 17px;
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-md);
  background: var(--cs-surface);
  color: var(--cs-text);
}

.cs-alert-success {
  background: var(--cs-success-background);
  border-color: #badfc5;
  color: var(--cs-success);
}

.cs-alert-danger {
  background: var(--cs-danger-background);
  border-color: #f0cbd0;
  color: var(--cs-danger);
}

.cs-alert-warning {
  background: var(--cs-warning-background);
  border-color: #eedb9d;
  color: var(--cs-warning);
}

.cs-empty-state {
  padding: 48px 24px;
  background: var(--cs-surface);
  border: 1px dashed var(--cs-border-strong);
  border-radius: var(--cs-radius-lg);
  color: var(--cs-text-secondary);
  text-align: center;
}


/* =========================================================
   08. VALIDACIÓN BLAZOR
   ========================================================= */

.valid.modified:not([type="checkbox"]) {
  outline: 1px solid var(--cs-success);
}

.invalid {
  outline: 1px solid var(--cs-danger);
}

.validation-message {
  color: var(--cs-danger);
  font-size: 0.85rem;
}

.blazor-error-boundary {
  padding: 16px 20px;
  background: var(--cs-danger-background);
  border: 1px solid #f0cbd0;
  border-left: 4px solid var(--cs-danger);
  border-radius: var(--cs-radius-md);
  color: var(--cs-danger);
  font-weight: 600;
}

  .blazor-error-boundary::after {
    content: "Ocurrió un error inesperado.";
  }

.darker-border-checkbox.form-check-input {
  border-color: var(--cs-border-strong);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--cs-text-muted);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}


/* =========================================================
   09. RESPONSIVE Y ACCESIBILIDAD
   ========================================================= */

@media (max-width: 768px) {
  .cs-page {
    padding: 18px 14px;
  }

  .cs-page-heading {
    flex-direction: column;
    gap: 14px;
  }

  .cs-card-padded {
    padding: 20px;
  }

  .cs-table th,
  .cs-table td {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cs-button,
  .cs-input,
  .cs-select,
  .cs-textarea {
    transition: none;
  }
}
