/* ========================================
   BAXI HITECSA - MAIN STYLESHEET
   ======================================== */

/* ========================================
   TABLE OF CONTENTS
   1. Fonts
   2. CSS Variables
   3. Global Styles & Reset
   4. Typography
   5. Utility Classes
   6. Shared Components
   7. Header
   8. Navigation
   9. Language Selector
   10. Main Content & Layout
   11. Forms & Inputs
   12. Tables
   13. Interventions List Page
   14. Export Modal (Bulk PDF)
   15. Excel Export - Field Selector
   16. Trash / Papelera Page
   17. User Form Page
   18. Auth Pages (Login, Forgot, Reset)
   19. Responsive Design
   ======================================== */

/* ========================================
   1. FONTS
   ======================================== */

@font-face {
  font-family: "Red Hat Display";
  src: url("../fonts/Red_Hat_Display/RedHatDisplay-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Red Hat Display";
  src: url("../fonts/Red_Hat_Display/RedHatDisplay-Italic-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

/* ======================================== */
/* END: FONTS */
/* ======================================== */

/* ========================================
   2. CSS VARIABLES
   ======================================== */

:root {
  /* Colors - Base */
  --white: #ffffff;
  --black: #000000;
  --bg: #f3f2f3;

  /* Colors - Text */
  --ink: #302929;
  --muted: #6e6969;
  --placeholder: #bebebe;

  /* Colors - Greys */
  --grey: #f3f2f3;
  --grey-dark: #6e6969;
  --grey-border: #e9e9e9;

  /* Colors - UI Elements */
  --line: #d5dbe2;
  --light-blue: #f2f7fa;
  --dark-blue: #24366f;

  /* Colors - Brand */
  --brand: #005b99;
  --brand-hover: #004a7a;
  --brand-light: rgba(0, 91, 153, 0.05);
  --brand-border: rgba(0, 91, 153, 0.2);
  --brand-shadow-strong: rgba(0, 91, 153, 0.3);

  /* Colors - Status */
  --success: #388e3c;
  --success-bg: #d4edda;
  --success-border: #c3e6cb;
  --warn: #fbbc04;
  --warn-medium: #f57c00;
  --warn-bg: #fff3cd;
  --warn-border: #ffeaa7;
  --danger: #ea4335;
  --danger-dark: #c62828;
  --danger-bg: #f8d7da;
  --danger-border: #f5c6cb;

  /* Colors - Tables & Cards */
  --table-header-light: #f8f9fa;
  --table-header-dark: #e9ecef;
  --table-row-even: #fafbfc;
  --table-border: #dee2e6;
  --active-bg: #d6ebf3;

  /* Colors - Shadows */
  --shadow-light: rgba(0, 0, 0, 0.06);
  --shadow-strong: rgba(0, 0, 0, 0.15);
  --overlay: rgba(0, 0, 0, 0.5);

  /* Colors - Misc */
  --focus-ring: rgba(0, 123, 255, 0.1);
}

/* ======================================== */
/* END: CSS VARIABLES */
/* ======================================== */

/* ========================================
   3. GLOBAL STYLES & RESET
   ======================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica,
    Arial;
  overflow-x: hidden;
}

/* Font families for specific elements */
h1,
h2,
h3,
h4,
h5,
h6,
a,
button,
.user-info,
.btn {
  font-family: Red Hat Display, ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-weight: 700;
}

/* Link styles */
a {
  color: var(--brand);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--ink);
}

/* Placeholder styles */
input::-moz-placeholder,
textarea::-moz-placeholder {
  opacity: 1;
  color: var(--placeholder);
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: var(--placeholder);
}

/* ======================================== */
/* END: GLOBAL STYLES & RESET */
/* ======================================== */

/* ========================================
   4. TYPOGRAPHY
   ======================================== */

h1 {
  line-height: 3rem;
  font-size: 2rem;
  letter-spacing: -0.01em;
  text-transform: none;
}

h2 {
  line-height: 2rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-transform: none;
}

h3 {
  line-height: 2rem;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-transform: none;
}

h4,
h5 {
  line-height: 1.5rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-transform: none;
}

@media (min-width: 768px) {
  h1 {
    line-height: 3.5rem;
    font-size: 2.5rem;
  }

  h2 {
    line-height: 3rem;
    font-size: 2rem;
  }

  h3 {
    line-height: 2rem;
    font-size: 1.5rem;
  }
}

/* ======================================== */
/* END: TYPOGRAPHY */
/* ======================================== */

/* ========================================
   5. UTILITY CLASSES
   ======================================== */

/* Spacing utilities */
.page-meta {
  margin-left: auto;
  text-align: right;
  color: var(--muted);
  font-size: 0.9em;
}

.no-margin {
  margin: 0;
}

.margin-bottom-m {
  margin-bottom: 12px;
}

.margin-top-sm {
  margin-top: 8px;
}

.margin-top-m {
  margin-top: 12px;
}

.margin-top-lg {
  margin-top: 18px;
}

.margin-top-m {
  margin-top: 12px;
}

.export-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 1rem;
  justify-content: flex-start;
}

.ml-auto {
  margin-left: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
}

.ml-auto a {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  padding: 0 15px;
}

.ml-auto label {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.ml-auto input {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

.ml-10 {
  margin-left: 10px;
}

.pull-right {
  margin-left: auto;
}

/* Display utilities */
.hidden-form {
  display: none;
}

.hidden-textarea {
  display: none;
}

/* Text utilities */
.text-center {
  text-align: center;
}

/* Layout utilities */
.flex-1 {
  flex: 1;
}

.flex-2 {
  flex: 2;
}

/* Grid utilities */
.mail-grid {
  align-items: center;
  gap: 24px;
  grid-template-columns: 2fr 1fr;
}

/* ======================================== */
/* END: UTILITY CLASSES */
/* ======================================== */

/* ========================================
   6. SHARED COMPONENTS
   ======================================== */

/* ----- Buttons ----- */
.btn {
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  font-size: 0.875rem;
}

.btn.secondary {
  border: 1px solid var(--ink);
  color: var(--ink);
  background-color: transparent;
}

.btn.secondary:hover {
  background: var(--grey);
}

.btn.primary {
  background: var(--brand);
  color: var(--white);
  border: 1px solid var(--brand);
}

.btn.primary:hover {
  background: var(--brand-hover);
}

.btn.danger {
  background: var(--danger);
  color: var(--white);
  border: 1px solid var(--danger);
}

.btn.danger:hover {
  background: color-mix(in lch, var(--danger), var(--black) 10%);
}

.btn-logout,
.btn-login {
  padding: 0.5rem 1rem;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

/* ----- Alerts ----- */
.alert {
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-weight: 500;
  position: relative;
}

.alert .close-alert {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.alert .close-alert:hover {
  opacity: 1;
}

.alert.success,
.alert.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.alert.error,
.alert.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.alert.warning,
.alert.alert-warning {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}

.alert.alert-info {
  background: var(--warn-bg);
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  color: var(--warn);
  border-left: 4px solid var(--warn);
}

.alert-container,
.upload-alerts {
  max-width: 800px;
  margin: 0 auto 1rem;
}

/* ----- Status Badges ----- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--white);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-green {
  background-color: var(--success);
}

.badge-orange {
  background-color: var(--warn-medium);
}

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

.badge-gray {
  background-color: var(--grey-dark);
}

.badge-active {
  background-color: var(--success);
}

.badge-inactive {
  background-color: var(--grey-dark);
}

/* ----- Status Dots ----- */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.pending {
  background: var(--warn);
}

.dot.reviewed {
  background: var(--success);
}

.dot.retired {
  background: var(--danger);
}

.dot.active {
  background: var(--success);
}

.dot.inactive {
  background: var(--danger);
}

.status-dot-draft {
  background: var(--muted);
}

/* ----- Pagination ----- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination ul {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
}

.pagination li a {
  font-weight: 600;
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--grey);
  border-radius: 4px;
  color: var(--brand);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination li.active a {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}

.pagination li a:hover {
  background: var(--line);
}

.pagination-info {
  padding: 8px 16px;
  background: var(--grey-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
}

/* ======================================== */
/* END: SHARED COMPONENTS */
/* ======================================== */

/* ========================================
   7. HEADER
   ======================================== */

.site-header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px var(--shadow-light);
}

.header-container {
  padding: 20px 5% 0px 5%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  min-height: 68px;
  margin: 0 auto;
  max-width: 1300px;
  overflow-x: visible;
}

.header-logo {
  flex-shrink: 0;
  width: 100%;
  z-index: 1001;
}

.header-logo a {
  display: block;
  line-height: 0;
  transition: opacity 0.2s ease;
}

.header-logo a:hover {
  opacity: 0.85;
}

.header-logo img {
  max-height: 2rem;
}

.header-banner img {
  width: 100%;
  opacity: 0.35;
}

/* ----- User Info ----- */
.desktop-user-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}

.user-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.user-role {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ======================================== */
/* END: HEADER */
/* ======================================== */

/* ========================================
   8. NAVIGATION
   ======================================== */

/* ----- Desktop Navigation ----- */
.desktop-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: flex-start;
}

.desktop-nav .nav-link {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 0 20px 0;
}

.desktop-nav .nav-link.active,
.desktop-nav .nav-link:hover {
  border-bottom: 2px solid var(--brand);
}

/* Desktop dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-dropdown .dropdown-toggle svg {
  transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-toggle svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 4px 12px var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
  padding: 8px;
}

.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu-right {
  right: 0;
  left: auto;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--light-blue);
  color: var(--brand);
}

.dropdown-item svg {
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.15s ease;
}

.dropdown-item:hover svg {
  color: var(--brand);
}

/* Desktop secondary menu */
.desktop-secondary {
  display: flex;
  gap: 1rem;
  align-items: center;
  height: 100%;
}

.desktop-secondary .btn {
  padding: 0.25rem 0.5rem;
  font-size: 12px;
}

.desktop-secondary .secondary,
.desktop-secondary .primary {
  padding: 0.5rem 1rem;
}

.header-secondary-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-direction: row-reverse;
  height: 100%;
}

/* ----- Mobile Navigation ----- */
.hamburger-btn {
  display: none;
  width: 2rem;
  height: 2rem;
  background: var(--brand);
  border: none;
  border-radius: 4px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1001;
  position: relative;
}

.hamburger-btn:hover {
  background: var(--brand-hover);
}

.hamburger-icon {
  width: 1rem;
  height: 1px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-btn.active .hamburger-icon:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.hamburger-btn.active .hamburger-icon:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-icon:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--white);
  padding: 100px 32px 32px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: var(--light-blue);
  color: var(--brand);
}

.mobile-nav-link svg {
  flex-shrink: 0;
}

.mobile-nav-section {
  margin-top: 8px;
}

.mobile-nav-label {
  display: block;
  padding: 12px 16px 8px;
}

.mobile-nav-sublink {
  padding-left: 32px;
  font-size: 15px;
  font-weight: 500;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.mobile-menu-footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: auto;
}

.mobile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--brand);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mobile-logout-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--brand-shadow-strong);
}

.mobile-logout-btn svg {
  flex-shrink: 0;
}

body.mobile-menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ----- Legacy Navigation (Submenu) ----- */
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}

.main-nav li {
  position: relative;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 4px;
  display: inline-block;
}

.main-nav li.active > a,
.main-nav a:hover {
  color: var(--white);
  background: var(--brand);
}

.has-submenu > .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 220px;
  padding: 8px;
  box-shadow: 0 6px 18px var(--shadow-light);
  z-index: 100;
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  display: block;
}

.submenu li {
  white-space: nowrap;
}

.submenu a {
  display: block;
  padding: 8px 10px;
  color: var(--ink);
  border-radius: 4px;
}

.submenu a:hover {
  background: var(--bg);
}

/* ======================================== */
/* END: NAVIGATION */
/* ======================================== */

/* ========================================
   9. LANGUAGE SELECTOR
   ======================================== */

.language-selector {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  padding: 4px;
  background: var(--brand-light);
  border-radius: 6px;
  flex-shrink: 0;
}

.lang-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
  background: transparent;
  border: 1px solid transparent;
}

.lang-btn:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-border);
}

.lang-btn.active {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
  box-shadow: 0 2px 4px var(--brand-border);
}

.mobile-language-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-language-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mobile-language-btn {
  padding: 12px;
  background: var(--light-blue);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mobile-language-btn:hover {
  background: var(--brand);
  color: var(--white);
  transform: translateY(-2px);
}

.mobile-language-btn.active {
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 2px 8px var(--brand-shadow-strong);
}

/* ======================================== */
/* END: LANGUAGE SELECTOR */
/* ======================================== */

/* ========================================
   10. MAIN CONTENT & LAYOUT
   ======================================== */

.site-main {
  min-height: calc(100vh - 68px);
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 5%;
}

main {
  padding-top: 0;
}

.section {
  background: transparent;
  border: none;
  border-top: 2px solid var(--line);
  padding: 24px 0;
  margin: 0;
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section > h2 {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  font-family: "Red Hat Display", ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Grid layouts */
.grid {
  display: grid;
  gap: 18px;
}

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

.inline-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* ======================================== */
/* END: MAIN CONTENT & LAYOUT */
/* ======================================== */

/* ========================================
   11. FORMS & INPUTS
   ======================================== */

label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.field {
  position: relative;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--grey-border);
  background: var(--white);
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  border-radius: 4px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--grey-border);
}

input[type="date"],
input[type="time"] {
  color: var(--muted);
}

input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  color: var(--muted);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: grayscale(1);
}

/* Radio buttons and checkboxes */
.radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
}

.status {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.status label,
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.status input[type="radio"],
.radio-group input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  margin: 0;
}

[name="firmado-cliente"],
[name="firmado-tecnico"] {
  accent-color: var(--brand);
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* File uploader */
.uploader {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Form actions */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin: 28px 0 8px;
}

.button-group-end {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* Help text */
.help {
  color: var(--muted);
  font-size: 12px;
}

/* Unit suffix */
.unit {
  position: relative;
}

.unit input {
  padding-right: 42px;
}

.unit .suffix {
  position: absolute;
  right: 0;
  bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* Password visibility toggle */
.input-with-toggle {
  position: relative;
  display: block;
}

.input-with-toggle input {
  padding-right: 42px; /* space for the eye button inside the container */
}

.field.has-toggle input[type="password"],
.field.has-toggle input[type="text"] {
  padding-right: 42px; /* leave room for the eye button */
}

.input-with-toggle .password-toggle-btn,
.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle-btn:hover {
  color: var(--ink);
}

.password-toggle-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
  border-radius: 4px;
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.password-toggle-btn .icon-eye-off {
  display: none;
}
.password-toggle-btn[aria-pressed="true"] .icon-eye {
  display: none;
}
.password-toggle-btn[aria-pressed="true"] .icon-eye-off {
  display: inline;
}

/* ======================================== */
/* END: FORMS & INPUTS */
/* ======================================== */

/* ========================================
   12. TABLES
   ======================================== */

.list-table {
  width: max-content;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 1px 3px var(--shadow-light);
  display: block;
  -webkit-overflow-scrolling: touch;
  overflow: hidden;
}

.list-table thead {
  background: linear-gradient(
    180deg,
    var(--table-header-light) 0%,
    var(--table-header-dark) 100%
  );
  border-bottom: 2px solid var(--line);
}

.list-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--table-border);
}

.list-table tbody tr {
  border-bottom: 1px solid var(--grey);
  background: var(--white);
  transition: all 0.15s ease;
}

.list-table tbody tr:nth-child(even) {
  background: var(--table-row-even);
}

.list-table tbody tr:last-child {
  border-bottom: none;
}

.list-table tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink);
  vertical-align: middle;
}

.list-table tr.clickable {
  cursor: pointer;
}

.list-table tr.clickable:hover {
  background: var(--grey) !important;
  box-shadow: inset 0 0 0 1px var(--brand);
  transform: scale(1.002);
}

.list-table tr.clickable:active {
  background: var(--active-bg) !important;
  transform: scale(0.998);
}

.table-list-container {
  max-width: 1300px;
  overflow: auto;
}

/* ======================================== */
/* END: TABLES */
/* ======================================== */

/* ========================================
   13. INTERVENTIONS LIST PAGE
   ======================================== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.page-header .actions {
  margin: 0;
}

.main-section .form {
  background: var(--white);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px var(--shadow-light);
  border: 1px solid var(--line);
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.main-section .form .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.criteria-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 6px;
}

.actions.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
  justify-content: flex-start;
}

.actions.filter-actions2 {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ======================================== */
/* END: INTERVENTIONS LIST PAGE */
/* ======================================== */

/* ========================================
   14. EXPORT MODAL (BULK PDF)
   ======================================== */

#export-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  z-index: 9999;
}

#export-modal.active {
  display: block;
}

.export-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  padding: 32px;
  border-radius: 4px;
  max-width: 480px;
  box-shadow: 0 4px 24px var(--overlay);
  width: 90%;
}

.export-modal-title {
  margin-top: 0;
  color: var(--brand);
}

.progress-container {
  margin: 24px 0;
}

.progress-track {
  background: var(--grey-border);
  height: 28px;
  border-radius: 14px;
  overflow: hidden;
}

#export-progress-bar {
  background: var(--brand);
  height: 100%;
  width: 0%;
  transition: width 0.3s;
}

#export-progress-text {
  text-align: center;
  margin-top: 12px;
  font-weight: bold;
  font-size: 18px;
}

#export-status-text {
  margin-bottom: 0;
}

/* ======================================== */
/* END: EXPORT MODAL */
/* ======================================== */

/* ========================================
   15. EXCEL EXPORT - FIELD SELECTOR
   ======================================== */

.export-excel-selector {
  max-width: 1400px;
  margin: 0 auto;
}

.export-count {
  font-size: 1.5rem;
  font-weight: 700;
}

.export-instructions {
  background: var(--table-header-light);
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 24px;
  border-left: 4px solid var(--brand);
}

.export-instructions p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

#export-all-btn,
#export-excel-btn {
  width: 50%;
}

.field-selector {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: center;
}

.field-column {
  background: var(--white);
  border: 1px solid var(--grey);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  height: 100%;
}

.field-column h3 {
  background: var(--brand);
  color: var(--white);
  margin: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.field-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 350px;
  max-height: 500px;
}

.field-item {
  background: var(--table-header-light);
  border: 1px solid var(--table-border);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.field-item:hover {
  background: var(--table-header-dark);
  border-color: var(--brand);
}

.field-item.selected {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}

.field-item.dragging {
  opacity: 0.5;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  line-height: 1.4;
}

.field-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 50px;
}

.field-controls .btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.field-controls .btn-icon:hover {
  transform: scale(1.1);
}

.field-controls .arrow-icon {
  display: inline-block;
  line-height: 1;
}
.field-controls .double-arrow-icon {
  font-size: 20px;
}
.control-separator {
  height: 24px;
}

/* ======================================== */
/* END: EXCEL EXPORT */
/* ======================================== */

/* ========================================
   16. TRASH / PAPELERA PAGE
   ======================================== */

.trash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

.trash-header-info h1 {
  margin: 0 0 4px 0;
}

.trash-header-info p {
  color: var(--muted);
  margin: 0;
}

.trash-config-info {
  font-size: 0.9em;
  color: var(--grey-dark);
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 8px !important;
  border-left: 3px solid var(--primary);
}

.trash-empty {
  text-align: center;
  padding: 48px;
  color: var(--grey-dark);
}

.trash-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.trash-empty-title {
  font-size: 18px;
  margin-bottom: 8px;
  font-weight: 600;
}

.trash-empty-subtitle {
  margin: 0;
}

.trash-actions {
  display: flex;
  gap: 4px;
}

.days-remaining {
  font-weight: bold;
}

.days-remaining.high {
  color: var(--success);
}

.days-remaining.medium {
  color: var(--warn-medium);
}

.days-remaining.low {
  color: var(--danger-dark);
}

/* ======================================== */
/* END: TRASH PAGE */
/* ======================================== */

/* ========================================
   17. USER FORM PAGE
   ======================================== */

.form-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow-light);
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--grey-border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--ink);
  font-size: 1.2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--grey);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
}

.password-hint {
  color: var(--muted);
  font-size: 0.9em;
  display: block;
  margin-top: 4px;
}

.password-field {
  position: relative;
}

.password-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  padding: 16px;
  background: var(--white);
  border: 2px solid var(--brand);
  border-radius: 6px;
  box-shadow: 0 4px 12px var(--shadow-strong);
  z-index: 1000;
  font-size: 0.9rem;
}

.password-tooltip.show {
  display: block;
  animation: fadeInTooltip 0.2s ease;
}

.password-tooltip strong {
  color: var(--brand);
  display: block;
  margin-bottom: 8px;
}

.password-tooltip ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.password-tooltip li {
  margin: 6px 0;
  line-height: 1.4;
}

@keyframes fadeInTooltip {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================================== */
/* END: USER FORM PAGE */
/* ======================================== */

/* ========================================
   18. AUTH PAGES (LOGIN, FORGOT, RESET)
   ======================================== */

.auth-container {
  max-width: 500px;
  margin-top: 48px;
}

.auth-title {
  text-align: center;
  margin-bottom: 24px;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-message-error {
  padding: 12px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 4px;
  margin-bottom: 16px;
  color: var(--danger-dark);
}

.auth-message-success {
  padding: 12px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 4px;
  margin-bottom: 16px;
  color: var(--success);
}

.auth-forgot-link {
  text-align: right;
  margin-top: 8px;
}

.auth-forgot-link a {
  font-size: 14px;
  color: var(--brand);
  text-decoration: none;
}

.auth-forgot-link a:hover {
  text-decoration: underline;
}

.auth-actions {
  margin-top: 16px;
}

.auth-actions .btn {
  width: 100%;
}

.auth-reset-actions {
  margin-top: 24px;
}

.auth-test-users {
  margin-top: 24px;
  padding: 12px;
  background: var(--grey);
  border-radius: 4px;
}

.auth-test-users summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
}

.auth-test-users ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
}

.auth-test-users p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ======================================== */
/* END: AUTH PAGES */
/* ======================================== */

/* ========================================
   19. RESPONSIVE DESIGN
   ======================================== */

/* ----- Tablet (max-width: 960px) ----- */
@media (max-width: 960px) {
  .cols-2 {
    grid-template-columns: 1fr;
  }

  .inline-3 {
    grid-template-columns: 1fr;
  }

  header .container {
    padding: 18px;
  }

  .status {
    gap: 20px;
  }
}

/* ----- Mobile Landscape (max-width: 989px) ----- */
@media (max-width: 989px) {
  .list-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .list-table thead th,
  .list-table tbody td {
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .main-section {
    padding: 20px 5%;
  }

  .page-header .btn {
    text-align: center;
    font-size: 14px;
  }
  .export-actions {
    justify-content: center;
  }

  #export-all-btn,
  #export-excel-btn {
    font-size: 12px;
  }
}

@media (max-width: 800px) {
  /* Header */
  .header-container {
    padding: 16px 20px;
    align-items: center;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    gap: 0;
    min-height: auto;
  }

  .desktop-nav,
  .desktop-secondary {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .mobile-menu-overlay {
    display: block;
  }

  .header-logo img {
    max-height: 1.75rem;
  }

  .mobile-menu-content {
    max-width: 100%;
    padding: 80px 24px 24px;
  }

  .user-info {
    gap: 0;
  }

  .user-name {
    font-size: 10px;
  }

  .user-role {
    font-size: 8px;
  }

  /* List Table */
  .list-table thead th,
  .list-table tbody td {
    font-size: 12px;
  }

  .main-section {
    padding: 16px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .main-section .form {
    padding: 16px;
  }

  .criteria-row {
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    border-bottom: 0.5px solid var(--line);
    padding-bottom: 0.5rem;
  }

  .criteria-row .field {
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header .actions {
    width: 100%;
  }

  .page-header .btn {
    width: 100%;
  }

  .sig-box {
    height: 140px;
  }

  .label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .label-actions,
  .sig-actions {
    width: 100%;
  }

  .sig-actions .btn {
    flex: 1;
  }

  /* Excel export field selector - mobile */
  .field-selector {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 16px;
  }

  .field-column {
    min-height: 250px;
  }

  .field-list {
    min-height: 200px;
    max-height: 300px;
  }

  .field-controls {
    flex-direction: row;
    justify-content: center;
    padding-top: 0;
    order: 2;
  }

  .field-controls .btn-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .control-separator {
    width: 16px;
    height: auto;
  }

  .available-column {
    order: 1;
  }

  .selected-column {
    order: 3;
  }

  .export-instructions p {
    font-size: 0.9rem;
  }

  #add-field,
  #remove-field,
  #remove-all,
  #add-all {
    transform: rotate(90deg);
  }
}

/* ----- Mobile Small (max-width: 400px) ----- */
@media (max-width: 420px) {
  .export-actions {
    flex-wrap: wrap;
  }

  #export-all-btn,
  #export-excel-btn {
    width: 100%;
  }

  .pagination ul {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }

  .pagination ul li:first-child,
  .pagination ul li:last-child {
    width: 100%;
    text-align: center;
  }

  .actions.filter-actions2 {
    flex-direction: column;
    align-items: stretch !important;
  }
  .actions.filter-actions2 .ml-auto {
    width: 100%;
  }
  .radio-group {
    align-items: flex-start;
    flex-direction: column;
  }
  #export-status-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .field-controls .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
  .field-controls .double-arrow-icon {
    font-size: 14px;
  }
  .control-separator {
    width: 0px;
  }
}
