/* ============================================================
   IPAC Admin — Brand Stylesheet
   Navy Dark #1B3A4B | Navy Med #1F4C5E | Teal #2B7A78
   ============================================================ */

/* ── Typography ── */

body {
  font-family: "Poppins", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Poppins", sans-serif;
}

.font-mono {
  font-family: "Poppins", sans-serif !important;
}

/* ============================================================
   Drawer layout — replaces DaisyUI drawer component
   (DaisyUI classes not processed by tailwindcss-rails standalone)
   ============================================================ */

/* Base: sidebar hidden on mobile */
.drawer {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.drawer-toggle {
  display: none;
}

.drawer-content {
  flex: 1;
  min-width: 0; /* prevent flex overflow */
}

.drawer-side {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 20;
  transform: translateX(-100%);
  transition: transform 0.2s ease-in-out;
}

/* When checkbox is checked (mobile hamburger), show sidebar */
.drawer-toggle:checked ~ .drawer-side {
  transform: translateX(0);
}

/* Overlay behind sidebar on mobile */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.drawer-toggle:checked ~ .drawer-side .drawer-overlay {
  opacity: 1;
  z-index: 0;
}

/* Desktop: sidebar always visible, push content */
@media (min-width: 1024px) {
  .drawer-side {
    position: sticky;
    top: 0;
    transform: translateX(0);
    flex-shrink: 0;
  }

  .drawer-overlay {
    display: none;
  }
}

/* ── Sidebar nav ── */

.ipac-nav-group {
  color: #3AAFA9;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 12px 4px;
  margin: 0;
}

.ipac-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none !important;
  transition: background-color 0.15s;
  border-left: 3px solid transparent;
  margin: 1px 0;
  line-height: 1.4;
}

.ipac-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: white;
}

.ipac-nav-item.active {
  background-color: rgba(255, 255, 255, 0.08);
  border-left-color: #2B7A78;
  color: white;
  font-weight: 500;
}

/* When another nav item is being hovered, dim the active highlight
   so the hover target reads as the primary visual cue. */
nav:has(.ipac-nav-item:hover) .ipac-nav-item.active:not(:hover) {
  background-color: transparent;
  border-left-color: transparent;
  font-weight: 400;
}

/* ── Page title ── */

.ipac-page-title {
  font-size: 24px;
  font-weight: 600;
  color: #1B3A4B;
  line-height: 1.2;
}

.ipac-page-subtitle {
  font-size: 13px;
  color: #636E72;
  margin-top: 2px;
}

/* ── Cards ── */

.ipac-card {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 0.5rem;
}

.ipac-card-body {
  padding: 20px;
}

.ipac-card-header {
  font-size: 16px;
  font-weight: 600;
  color: #1B3A4B;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #E2E8F0;
}

/* ── Filter card ── */

.ipac-filter-card {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 0.5rem;
  padding: 16px;
  margin-bottom: 16px;
}

/* ── Table ── */

.ipac-table thead tr {
  background-color: #1B3A4B !important;
}

.ipac-table thead th {
  color: #ffffff !important;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #1B3A4B !important;
}

.ipac-table.table-zebra tbody tr:nth-child(even) td,
.ipac-table.table-zebra tbody tr:nth-child(even) th {
  background-color: #F8FAFE !important;
}

.ipac-table tbody tr:hover td,
.ipac-table tbody tr:hover th {
  background-color: #E0F2F1 !important;
}

/* ── Action links ── */

.ipac-action-link {
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
}

.ipac-action-form {
  display: inline;
}

.ipac-action-ver  { color: #2B7A78 !important; }
.ipac-action-editar { color: #1B3A4B !important; }
.ipac-action-excluir { color: #E74C3C !important; }

.ipac-action-link:hover {
  text-decoration: underline;
}

/* ── Field labels & values (show pages) ── */

.ipac-field-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  color: #636E72;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.ipac-field-value {
  font-size: 14px;
  color: #2D3436;
}

/* ── Financial card (teal accent border) ── */

.ipac-financial-card {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 0.5rem;
  padding: 20px;
  border-left: 4px solid #2B7A78;
}

/* ── Metric cards (dashboard) ── */

.ipac-metric-card {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 0.5rem;
  padding: 20px;
  border-left: 4px solid;
}

.ipac-metric-card-teal  { border-left-color: #2B7A78; }
.ipac-metric-card-amber { border-left-color: #F39C12; }
.ipac-metric-card-red   { border-left-color: #E74C3C; }
.ipac-metric-card-cyan  { border-left-color: #3AAFA9; }

.ipac-metric-number {
  font-size: 28px;
  font-weight: 700;
  color: #1B3A4B;
  line-height: 1.2;
}

.ipac-metric-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  color: #636E72;
  letter-spacing: 0.5px;
}

.ipac-metric-sub {
  font-size: 12px;
  color: #636E72;
  margin-top: 4px;
}

/* ── Flash messages ── */

.ipac-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 0.375rem;
  margin-bottom: 16px;
  font-size: 14px;
}

.ipac-flash-success {
  background-color: #D4EDDA;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.ipac-flash-error {
  background-color: #F8D7DA;
  color: #721C24;
  border: 1px solid #f5c6cb;
}

.ipac-flash-notice {
  background-color: #E0F2F1;
  color: #2B7A78;
  border: 1px solid #b2dfdb;
}

.ipac-flash-dismiss {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  opacity: 0.6;
  flex-shrink: 0;
  color: inherit;
}

.ipac-flash-dismiss:hover { opacity: 1; }

/* ── Badge color overrides ── */

.badge.badge-warning {
  background-color: #FFF3CD !important;
  color: #856404 !important;
  border-color: #FFF3CD !important;
}

.badge.badge-info {
  background-color: #D1ECF1 !important;
  color: #0C5460 !important;
  border-color: #D1ECF1 !important;
}

.badge.badge-success {
  background-color: #D4EDDA !important;
  color: #155724 !important;
  border-color: #D4EDDA !important;
}

.badge.badge-neutral {
  background-color: #E2E8F0 !important;
  color: #2D3436 !important;
  border-color: #E2E8F0 !important;
}

.badge.badge-ghost {
  background-color: #E2E8F0 !important;
  color: #636E72 !important;
  border-color: #E2E8F0 !important;
}

.badge.badge-error {
  background-color: #F8D7DA !important;
  color: #721C24 !important;
  border-color: #F8D7DA !important;
}

.badge.badge-primary {
  background-color: #D4EDDA !important;
  color: #155724 !important;
  border-color: #D4EDDA !important;
}

/* ── Button color overrides ── */

.btn.btn-primary {
  background-color: #2B7A78 !important;
  border-color: #2B7A78 !important;
  color: #ffffff !important;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background-color: #3AAFA9 !important;
  border-color: #3AAFA9 !important;
}

.btn.btn-secondary {
  background-color: #2B7A78 !important;
  border-color: #2B7A78 !important;
  color: #ffffff !important;
}

.btn.btn-secondary:hover {
  background-color: #3AAFA9 !important;
  border-color: #3AAFA9 !important;
}

.btn.btn-accent {
  background-color: #3AAFA9 !important;
  border-color: #3AAFA9 !important;
  color: #ffffff !important;
}

.btn.btn-accent:hover {
  background-color: #2B7A78 !important;
  border-color: #2B7A78 !important;
}

/* ── Link overrides ── */

.link.link-primary {
  color: #2B7A78 !important;
}

.link.link-primary:hover {
  color: #3AAFA9 !important;
}

/* ── Checkbox ── */

.checkbox.checkbox-primary,
.checkbox.checkbox-sm {
  border-color: #2B7A78 !important;
}

.checkbox.checkbox-primary:checked,
.checkbox.checkbox-sm:checked {
  background-color: #2B7A78 !important;
  border-color: #2B7A78 !important;
}

/* ── Input / select focus ── */

.input:focus,
.select:focus,
.textarea:focus {
  outline-color: #2B7A78 !important;
  border-color: #2B7A78 !important;
}

/* ── Alert overrides ── */

.alert.alert-success {
  background-color: #D4EDDA;
  color: #155724;
  border-color: #c3e6cb;
}

.alert.alert-error {
  background-color: #F8D7DA;
  color: #721C24;
  border-color: #f5c6cb;
}

.alert.alert-info {
  background-color: #E0F2F1;
  color: #2B7A78;
  border-color: #b2dfdb;
}

/* ── Pagination active page ── */

.join .btn.btn-active,
.join .btn[aria-current="page"] {
  background-color: #2B7A78 !important;
  border-color: #2B7A78 !important;
  color: white !important;
}

/* ── Code pill ── */

.ipac-code {
  background: #F0F4F8;
  color: #1B3A4B;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

/* ── Warning box (internal notes) ── */

.ipac-warning-box {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 0.5rem;
  padding: 12px 16px;
}

/* ── Mobile responsive ── */

@media (max-width: 1023px) {
  .ipac-filter-card .flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .ipac-filter-card .form-control {
    min-width: 0;
  }
}
