/* style.css - Core Design System & UI Styling for ZERO WMS */

/* Import Google Fonts for fallback premium look */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* Main CSS Variables */
:root {
  --nav-bg: #506ee5;
  --sidebar-bg: #1B0642;
  --theme-text-color: #FCFBFF;
  --theme-font-family: 'Aptos', 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --zero-build-version: 2026052503;
  
  --bg-dark: #090314;
  --bg-panel: rgba(27, 6, 66, 0.4);
  --bg-card: rgba(255, 255, 255, 0.03);
  
  --accent-blue: #3E6D9C;
  --accent-purple: #8B5CF6;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-yellow: #F59E0B;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-focus: rgba(83, 20, 205, 0.4);
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, input, select, button, textarea {
  font-family: var(--theme-font-family);
}

input, select, button, textarea {
  font-family: inherit;
}

body {
  font-size: 11px;
  font-weight: 400;
  color: #D1D5DB;
  background-color: var(--bg-dark);
  height: 100vh;
  overflow: hidden;
  user-select: text;
}

/* Titles and Headers can be bold */
h1, h2, h3, h4, h5, h6, th, .bold-text {
  font-weight: 700;
  color: #F9FAFB;
}

h1 { font-size: 18px; }
h2 { font-size: 14px; }
h3 { font-size: 12px; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: var(--sidebar-bg);
  border-radius: 3px;
  min-height: 28px;
  min-width: 28px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--nav-bg);
}
::-webkit-scrollbar-thumb:active {
  background: var(--nav-bg);
}
/* Firefox uses the native thin control; Chromium keeps the 5px control above. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; }
}

/* Login Background & Glassmorphic Container */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  /* perspective disabled to prevent mouse mismatch */
  background-image: url('login-terminal-maritimo.jpg');
  background-color: #0e0b16; /* Slate/dark theme fallback */
  background-size: cover;
  background-position: center;
  transition: background-image 0.5s ease;
}

/* Background Dimmer Overlay */
.login-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(9, 3, 20, 0.7); /* Slightly dimmed backdrop */
  backdrop-filter: blur(8px);
  z-index: 1;
}

/* 3D Glass Box */
.login-box {
  position: relative;
  width: 380px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.36); /* Acrylic white glass */
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1), 
              inset 0 0 20px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 2;
  transition: box-shadow 0.3s ease;
}

.login-box:hover {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), 
              0 0 30px rgba(255, 255, 255, 0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo img {
  filter: contrast(1.18) saturate(1.08) drop-shadow(0 1px 1px rgba(13, 37, 116, 0.22));
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.login-logo h1 {
  font-size: 26px;
  letter-spacing: 0.15em;
  color: #1B0642; /* Changed to dark purple for high contrast */
  display: inline-block;
  font-weight: 900;
  font-style: normal;
}

.login-logo p {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #4B5563; /* Changed to slate gray */
  margin-top: 5px;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

/* Form Controls */
#login-form {
  /* empty */
}

.form-group {
  position: relative;
  margin-bottom: 20px;
}

/* Sliding transitions for admin user site hiding */
#login-site-group {
  max-height: 80px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 20px;
  transition: max-height 0.4s ease, opacity 0.4s ease, transform 0.4s ease, margin-bottom 0.4s ease;
  overflow: visible; /* Changed to visible when expanded to show custom select options */
}

#login-site-group.hidden-admin {
  max-height: 0;
  opacity: 0;
  transform: translateY(-20px);
  margin-bottom: 0 !important;
  pointer-events: none;
  overflow: hidden; /* Keep hidden when collapsed */
}

#login-panel-group {
  max-height: 0;
  opacity: 0;
  transform: translateY(20px);
  margin-bottom: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease, transform 0.4s ease, margin-bottom 0.4s ease;
  overflow: hidden;
  pointer-events: none;
}

#login-panel-group.show-admin {
  max-height: 80px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 20px !important;
  overflow: visible; /* Changed to visible when expanded to show custom select options */
}

.form-group label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  margin-bottom: 6px;
}

.login-box .form-group label {
  color: #1B0642 !important; /* Enforce dark label inside login box for high contrast */
  font-weight: 600 !important;
}

.input-wrapper {
  position: relative;
}

.vessel-search { margin-bottom: 6px; }
.vessel-catalog-tools { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin-top:6px; }
.vessel-catalog-tools span { font-size:10px; line-height:1.4; color:var(--text-muted, #64748b); font-weight:400; }
.vessel-catalog-tools button { flex-shrink:0; padding:4px 7px; font-size:10px; font-weight:400; white-space:nowrap; }
.vessel-catalog-tools button:disabled { opacity:.5; cursor:default; }
.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 6px;
  color: #F9FAFB;
  font-family: var(--theme-font-family);
  font-size: 11px;
  transition: all 0.3s ease;
}

.login-box .form-input {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #1F2937;
}

.form-input:focus {
  outline: none;
  border-color: var(--nav-bg);
  box-shadow: 0 0 10px var(--input-focus);
  background: rgba(255, 255, 255, 0.08);
}

.login-box .form-input:focus {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--nav-bg);
}

.input-wrapper .form-input {
  padding-right: 36px;
}

/* Password Eye Icon */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #9CA3AF;
  transition: color 0.3s;
  z-index: 20;
  pointer-events: auto;
}

.login-box .password-toggle {
  color: #4B5563;
}

.password-toggle:hover {
  color: var(--accent-blue);
}

.login-btn {
  width: 100%;
  background: #1693a5;
  border: none;
  padding: 13px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 10px;
  letter-spacing: 0.12em;
  text-shadow: none;
  box-shadow: none;
}

.login-btn:hover:not(:disabled) {
  background: #1693a5;
  box-shadow: 0 0 0 3px rgba(22, 147, 165, 0.28);
  transform: none;
}

.login-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

/* Vivo siempre: el estado deshabilitado no apaga el botón (el script y el HTML le aplican opacity .5 en línea). */
.login-btn,
.login-btn:disabled {
  opacity: 1 !important;
}
.login-btn:disabled:not(.is-loading) {
  cursor: not-allowed;
}

/* Login button while the server validates the session: blue, spinner instead of label. */
.login-btn { position: relative; min-height: 40px; }
.login-btn.is-loading,
.login-btn.is-loading:hover,
.login-btn.is-loading:disabled {
  background: #4258cf !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  /* Al iniciar sesión se oculta por completo el texto: queda solo el círculo de carga. */
  font-size: 0 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  cursor: progress;
  transform: none;
  box-shadow: 0 4px 14px rgba(66, 88, 207, 0.45);
}
.login-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: login-spin 0.7s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .login-btn.is-loading::after { animation-duration: 2.4s; }
}

/* Executive Dashboard */
.dashboard-view {
  min-height: 100%;
  padding: 20px;
  background: #f6f8fb;
  color: #0f172a;
  overflow-x: hidden;
  overflow-y: visible;
  box-sizing: border-box;
  container-type: inline-size;
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 11px;
  width: 100%;
}

.content-area .dashboard-view,
.content-area .dashboard-view * {
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 11px;
  text-shadow: none;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 20px 22px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(46, 151, 183, 0.9) 62%, rgba(14, 165, 233, 0.88) 140%),
    url("login-terminal-maritimo.jpg") center/cover no-repeat;
  border-radius: 8px;
  color: #fff !important;
  box-shadow: 0 16px 36px rgba(31, 6, 91, 0.18);
}

.dashboard-hero h2 {
  color: #fff !important;
  font-size: 22px;
  line-height: 1.1;
  margin: 5px 0 6px;
}

.dashboard-hero p {
  color: rgba(255, 255, 255, 0.88) !important;
  max-width: 620px;
  font-size: 12px;
}

.dashboard-kicker {
  color: #a5f3fc !important;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
}

.dashboard-hero .dashboard-live-chip,
.dashboard-hero .dashboard-live-chip span {
  color: #f8fafc !important;
}

.dashboard-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
}

.dashboard-view .dashboard-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-view .dashboard-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.dashboard-view .dashboard-currency-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
  min-width: 0; /* Prevent grid item horizontal overflow */
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  min-width: 0;
}

.kpi-card span,
.currency-card span {
  display: block;
  color: #334155 !important;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.kpi-card strong,
.currency-card strong {
  display: block;
  color: #0f172a !important;
  font-size: 26px;
  line-height: 1;
  margin-top: 5px;
}

.kpi-card small,
.currency-card small {
  display: block;
  color: #475569 !important;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 600;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  flex: 0 0 auto;
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
}

.kpi-blue { background: linear-gradient(135deg, #0284c7, #22d3ee); }
.kpi-purple { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.kpi-teal { background: linear-gradient(135deg, #2e97b7, #6cc3dd); }
.kpi-emerald { background: linear-gradient(135deg, #059669, #34d399); }
.kpi-amber { background: linear-gradient(135deg, #d97706, #f59e0b); }

.currency-card {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 15px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.currency-card > div:last-child {
  min-width: 0;
}

.currency-card::after {
  content: none;
}

.currency-icon {
  align-items: center;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  flex: 0 0 auto;
  height: 42px;
  place-items: center;
  position: relative;
  width: 42px;
}

.currency-icon svg {
  height: 20px;
  width: 20px;
}

.currency-mark {
  background: rgba(15, 23, 42, 0.82);
  border-radius: 999px;
  bottom: 3px;
  color: #ffffff !important;
  font-size: 8px !important;
  font-weight: 900;
  line-height: 1;
  padding: 2px 3px;
  position: absolute;
  right: 3px;
}

.currency-usd .currency-icon { background: linear-gradient(135deg, #047857, #22c55e); }
.currency-eur .currency-icon { background: linear-gradient(135deg, #1d4ed8, #38bdf8); }
.currency-brl .currency-icon { background: linear-gradient(135deg, #ca8a04, #facc15); }

.dashboard-view .dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.chart-card {
  padding: 15px;
  min-height: 310px;
  position: relative;
}

.chart-card-wide {
  min-height: 360px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-title {
  align-items: flex-start;
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
}

.chart-header-icon {
  align-items: center;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  flex: 0 0 auto;
  height: 32px;
  place-items: center;
  width: 32px;
}

.chart-header-icon svg {
  height: 16px;
  width: 16px;
}

.chart-icon-activity { background: linear-gradient(135deg, #0284c7, #22d3ee); }
.chart-icon-status { background: linear-gradient(135deg, #2e97b7, #6cc3dd); }
.chart-icon-month { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.chart-icon-clients { background: linear-gradient(135deg, #660000, #990000); }

.chart-header h3 {
  color: #0f172a !important;
  font-size: 13px;
  margin-bottom: 3px;
}

.chart-header p {
  color: #475569 !important;
  font-size: 10px;
}

.chart-header > span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #5314cd !important;
  font-size: 9px;
  font-weight: 800;
}

.chart-card canvas {
  width: 100%;
  display: block;
  cursor: crosshair;
}

.dashboard-chart-tooltip {
  position: absolute;
  z-index: 25;
  display: none;
  min-width: 132px;
  max-width: 240px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.26);
  pointer-events: none;
  font-size: 10px;
  line-height: 1.45;
}

.dashboard-chart-tooltip strong,
.dashboard-chart-tooltip span,
.dashboard-chart-tooltip div {
  color: #f8fafc !important;
}

.dashboard-chart-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.dashboard-chart-tooltip .tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  white-space: nowrap;
}

.dashboard-chart-tooltip .tooltip-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 999px;
}

.dashboard-session-card {
  padding: 15px;
  margin-bottom: 18px;
}

.dashboard-session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-session-header > span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfeff;
  color: #2e97b7 !important;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-session-list {
  display: grid;
  gap: 8px;
}

.dashboard-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.86);
}

.dashboard-session-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-session-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.dashboard-session-user strong {
  display: block;
  color: #0f172a !important;
  font-size: 12px !important;
  font-weight: 800;
}

.dashboard-session-user small {
  display: block;
  margin-top: 2px;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 600;
}

.dashboard-session-meta {
  flex: 0 0 auto;
  text-align: right;
}

.dashboard-session-meta span {
  display: block;
  color: #64748b !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-session-meta strong {
  display: block;
  margin-top: 2px;
  color: #0f172a !important;
  font-family: "Consolas", "JetBrains Mono", monospace !important;
  font-size: 12px !important;
  font-variant-numeric: tabular-nums;
}

.dashboard-session-empty {
  padding: 14px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b !important;
  font-size: 11px !important;
  text-align: center;
}

@media (max-width: 1180px) {
  .dashboard-view .dashboard-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-view {
    padding: 12px;
  }
  .dashboard-view .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-hero {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .dashboard-view {
    padding: 10px;
  }

  .dashboard-hero {
    gap: 14px;
    padding: 16px;
  }

  .dashboard-hero h2 {
    font-size: 18px;
  }

  .dashboard-hero p {
    font-size: 11px;
  }

  .dashboard-live-chip {
    justify-content: center;
    width: 100%;
  }

  .dashboard-session-header,
  .dashboard-session-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-session-meta {
    text-align: left;
  }

  .dashboard-view .dashboard-kpi-grid,
  .dashboard-view .dashboard-currency-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card,
  .currency-card {
    align-items: flex-start;
    padding: 13px;
  }

  .kpi-icon,
  .currency-icon {
    height: 38px;
    width: 38px;
  }

  .chart-card {
    min-height: 280px;
    padding: 13px;
  }

  .chart-card-wide {
    min-height: 320px;
  }

  .chart-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* WMS Application Workspace Layout */
.wms-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Top Navigation Bar */
.top-bar {
  background-color: var(--nav-bg);
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.top-bar-site {
  color: #FFFFFF !important;
  font-size: 11px;
  font-weight: 500;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  background: none !important;
  min-width: 140px;
  text-align: center;
  display: inline-flex;
  justify-content: center;
}

.system-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #FFFFFF;
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-logo {
  width: 86px;
  height: 34px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
}

.top-bar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.weather-widget-middle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  font-size: 11px;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.weather-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.weather-separator {
  color: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  justify-content: flex-end;
}



.clock-widget {
  font-family: monospace;
  font-size: 11px;
  color: #FCFBFF;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-greeting {
  font-size: 11px;
  color: #FCFBFF;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Main Workspace with Sidebar + Dynamic Panel Content */
.main-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Sidebar Styling - Modified to be a Horizontal Top Bar */
.sidebar {
  background-color: var(--sidebar-bg);
  width: 100%;
  height: 50px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: visible; /* CRITICAL: allow dropdowns to show */
  z-index: 95;
}

.sidebar-menu {
  padding: 0 15px;
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  overflow: visible; /* CRITICAL: allow dropdowns to show */
  height: 100%;
  gap: 5px;
}

/* Sidebar Profile widget - Positioned on the right side of the bar */
.sidebar-profile {
  border-left: 1px solid var(--border-color);
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  user-select: none;
}

.sidebar-profile:hover {
  background: rgba(255, 255, 255, 0.03);
}

.profile-info-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(172, 135, 243, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #AC87F3;
  border: 1px solid rgba(172, 135, 243, 0.3);
  flex-shrink: 0;
}

.profile-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.profile-username {
  font-size: 11px;
  font-weight: bold;
  color: #F5F5F5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-site {
  font-size: 9px;
  color: rgba(252, 251, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.arrow-up-icon {
  color: rgba(252, 251, 255, 0.5);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.sidebar-profile.open .arrow-up-icon {
  transform: rotate(180deg);
}

/* Downward Profile Dropdown Menu */
.profile-dropdown-menu {
  position: absolute;
  top: 100%; /* Dropdown instead of dropup */
  bottom: auto;
  right: 10px;
  left: auto;
  width: 200px;
  background: #171124; /* matches dark theme */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 0;
  margin-top: 5px;
  margin-bottom: 0;
  list-style: none;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 10px rgba(83, 20, 205, 0.15);
  display: flex;
  flex-direction: column;
}

.profile-dropdown-menu li {
  padding: 8px 12px;
  font-size: 10px;
  color: rgba(252, 251, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--theme-font-family);
  text-align: left;
}

.profile-dropdown-menu li:hover {
  background: rgba(172, 135, 243, 0.2);
  color: #F5F5F5;
}

.profile-dropdown-menu li.logout-item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #f87171;
}

.profile-dropdown-menu li.logout-item:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.menu-category {
  font-size: 9px;
  text-transform: uppercase;
  color: rgba(252, 251, 255, 0.45);
  padding: 0 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 145px;
  text-align: center;
}

.menu-item {
  color: rgba(252, 251, 255, 0.75); /* Always light-colored for contrast against dark navbar/sidebar */
  padding: 0 15px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
}

.menu-item:hover, .menu-item.active {
  background: rgba(83, 20, 205, 0.2);
  border-bottom: 3px solid var(--accent-blue);
  color: #FFFFFF;
}

.menu-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

/* Dropdown Submenu layout */
.submenu-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: auto;
  min-width: 200px;
  background-color: rgba(255, 255, 255, 0.45); /* More transparent white */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px rgba(27, 6, 66, 0.12), 0 0 16px rgba(83, 20, 205, 0.08);
  z-index: 1000;
  list-style: none;
  display: flex !important; /* Force flex layout */
  flex-direction: column; /* Vertical alignment inside dropdown */
  align-items: stretch;
  gap: 2px;
  padding: 6px 0;
  border: none; /* Removed borders for transparency */
  border-radius: 6px;
  
  /* Hiding/showing using max-height, opacity & overflow */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.submenu-list.expanded {
  max-height: 500px; /* Large enough to display all components */
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto; /* Enable scroll if height exceeds limit */
}

/* Nested submenus (like panel Maritime Full/Empty selection) */
.submenu-list .submenu-list {
  position: absolute;
  top: 0;
  left: 100%; /* Opens to the right of parent submenu */
  margin-left: 2px;
  width: auto;
  min-width: 160px;
  background-color: rgba(255, 255, 255, 0.55); /* More transparent nested background */
  border: none;
  border-radius: 6px;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 5px 0;
  box-shadow: 0 10px 25px rgba(27, 6, 66, 0.12);
}

.submenu-list .submenu-list.expanded {
  max-height: 400px;
}

/* Specific override for #submenu-maritimo to behave as an inline accordion submenu */
#submenu-maritimo {
  position: static !important;
  width: 100% !important;
  background-color: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

#submenu-maritimo.expanded {
  opacity: 1;
  max-height: 150px;
}

.submenu-list .submenu-list .submenu-item {
  padding: 8px 15px;
}

.submenu-item {
  padding: 8px 16px;
  color: #1B0642;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  font-size: 11px;
}

.submenu-item:hover {
  color: #0988a5;
  background: rgba(9, 136, 165, 0.12); /* Semi-transparent hover selection */
}

.submenu-item.active {
  color: #0d2574 !important;
  background: rgba(13, 37, 116, 0.15) !important; /* Semi-transparent active selection */
  font-weight: bold;
}

/* Slide Up Admin Sites (Emplazamiento) Panel Container */
.slide-up-panel {
  position: absolute;
  bottom: -100%;
  left: 0; /* Full width since left sidebar is now horizontal */
  right: 0;
  height: calc(100vh - 90px); /* 40px top-bar + 50px horizontal sidebar */
  background-color: var(--bg-dark);
  z-index: 90;
  transition: bottom 0.5s cubic-bezier(0.1, 0.76, 0.55, 0.94);
  padding: 30px;
  overflow-y: auto;
  border-top: 2px solid var(--nav-bg);
}

.slide-up-panel.active {
  bottom: 0;
}

/* Content Area */
.content-area {
  flex: 1;
  min-height: 0;
  background-color: var(--bg-dark);
  padding: 25px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* Cards & Layout Panels */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 80px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card-title {
  font-size: 10px;
  text-transform: uppercase;
  color: #9CA3AF;
  letter-spacing: 0.05em;
}

.stat-card-value {
  font-size: 20px;
  color: #F3F4F6;
  margin-top: 5px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.panel-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Forms Grid inside Dashboard */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.form-grid-full {
  grid-column: 1 / -1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--nav-bg);
}
.btn-primary:hover {
  background-color: #661be6;
  box-shadow: 0 0 10px rgba(83, 20, 205, 0.3);
}

.btn-secondary {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-accent {
  background-color: #0284C7;
}
.btn-accent:hover {
  background-color: #0369a1;
}

.btn-danger {
  background-color: var(--accent-red);
}
.btn-danger:hover {
  background-color: #dc2626;
}

.btn-register-inline {
  padding: 8px 12px;
  margin-left: 5px;
  font-size: 10px;
}

/* Tables styling with exact 11px sizes */
.wms-table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 550px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
}

.wms-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 11px;
}

.wms-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #171124; /* matches dark theme bg-card */
  background-image: linear-gradient(rgba(83, 20, 205, 0.25), rgba(83, 20, 205, 0.25)); /* overlay transparency */
  color: #FFFFFF;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.wms-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: #D1D5DB;
  font-weight: 400;
  font-size: 11px;
}

.wms-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.wms-table tr:last-child td {
  border-bottom: none;
}

table.wms-numbered-table > thead > tr > .wms-row-number-header,
table.wms-numbered-table > tbody > tr > .wms-row-number-cell {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  padding-left: 8px !important;
  padding-right: 8px !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.wms-numbered-table > thead > tr > .wms-row-number-header {
  font-weight: 700;
}

table.wms-numbered-table > tbody > tr > .wms-row-number-cell {
  color: inherit;
  font-weight: 600;
  opacity: 0.72;
  user-select: none;
}

#arribo-masiva-preview2 table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #1e3a8a !important;
}

.wms-doc-guia {
  color: var(--accent-blue);
}
.wms-doc-unidad {
  color: #ffffff;
}

/* Action icons inside tables */
.table-actions {
  display: flex;
  gap: 8px;
}
.action-icon {
  cursor: pointer;
  width: 14px;
  height: 14px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.action-icon:hover {
  opacity: 1;
}

/* Modals */
.wms-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(9, 3, 20, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.wms-modal {
  background-color: #171124;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.wms-modal-header {
  background-color: var(--sidebar-bg);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.wms-modal-body {
  padding: 20px;
}

.wms-modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: rgba(0,0,0,0.1);
}

/* Face Scan Camera Simulation Styling */
.biometrics-modal {
  width: 860px;
  max-width: 94%;
}

.biometrics-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(260px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.biometrics-viewport {
  position: relative;
  width: 100%;
  height: 260px;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(62, 109, 156, 0.2);
}

.biometrics-help-text {
  margin-top: 10px;
  font-size: 10px;
  color: #C4B5FD;
  text-align: center;
  line-height: 1.45;
}

.biometrics-form-panel {
  background: rgba(238, 236, 245, 0.08);
  border: 1px solid rgba(252, 251, 255, 0.12);
  border-radius: 8px;
  padding: 14px;
}

.biometrics-form-panel h3 {
  color: #FCFBFF;
  font-size: 12px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.biometrics-form-panel .form-group {
  margin-bottom: 12px;
}

.biometrics-form-panel label {
  color: rgba(252, 251, 255, 0.72);
  font-size: 9px;
}

.biometrics-form-panel .form-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(252, 251, 255, 0.16);
  color: #FFFFFF;
  text-transform: uppercase;
}

.biometrics-rule-box,
.biometrics-match-panel {
  border-radius: 6px;
  padding: 10px;
  font-size: 10px;
  line-height: 1.45;
}

.biometrics-rule-box {
  margin-bottom: 12px;
  background: rgba(13, 37, 116, 0.42);
  border-left: 3px solid #0988a5;
  color: #E0F2FE;
}

.biometrics-match-panel {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(252, 251, 255, 0.12);
  color: #C4B5FD;
}

.biometrics-match-panel.success {
  border-color: rgba(16, 185, 129, 0.55);
  color: #A7F3D0;
}

.biometrics-match-panel.warning {
  border-color: rgba(245, 158, 11, 0.6);
  color: #FDE68A;
}

.biometrics-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror effect */
}

/* Face scanning target overlays */
.biometrics-overlay-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: 
    linear-gradient(rgba(62, 109, 156, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 109, 156, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.biometrics-face-mesh {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 200px;
  border: 2px dashed var(--accent-blue);
  border-radius: 50% 50% 45% 45%;
  animation: pulse-mesh 2s infinite ease-in-out;
}

.biometrics-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to bottom, transparent, var(--accent-blue), transparent);
  animation: scan-line 3s infinite linear;
}

.biometrics-status-pill {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  font-family: monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@keyframes pulse-mesh {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}

@keyframes scan-line {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

@keyframes scanLine {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Professional biometric enrollment and face recognition */
.biometrics-backdrop {
  background:
    radial-gradient(circle at 24% 18%, rgba(62, 109, 156, 0.14), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(111, 66, 193, 0.16), transparent 36%),
    rgba(4, 8, 18, 0.9);
  backdrop-filter: blur(12px);
}

.biometrics-pro {
  position: relative;
  width: min(1180px, 96vw);
  max-width: 96vw;
  max-height: 92vh;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(13, 21, 37, 0.98), rgba(8, 13, 24, 0.98)),
    #0b1020;
  box-shadow: 0 28px 90px rgba(2, 8, 23, 0.82), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  color: #e5eefc;
}

.biometrics-pro::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), transparent 80%);
}

.biometrics-consent-screen {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 38px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 22%, rgba(62, 109, 156, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(10, 16, 30, 0.99), rgba(6, 10, 19, 0.99));
}

.bio-consent-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(62, 109, 156, 0.42);
  border-radius: 18px;
  color: #67e8f9;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 38px rgba(62, 109, 156, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.bio-kicker {
  color: #67e8f9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.biometrics-consent-screen h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 20px;
  font-weight: 700;
}

.biometrics-consent-screen p {
  max-width: 520px;
  margin: 0;
  color: #b6c4d7;
  font-size: 12px;
  line-height: 1.65;
}

.bio-consent-note {
  color: #8291a8 !important;
  font-size: 11px !important;
}

.bio-consent-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 16px;
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.76);
  color: #dbeafe;
  font-size: 12px;
  cursor: pointer;
}

.bio-consent-check input {
  width: 16px;
  height: 16px;
  accent-color: #3E6D9C;
}

.bio-consent-actions,
.bio-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bio-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.bio-btn:hover {
  transform: translateY(-1px);
}

.bio-btn:active {
  transform: translateY(0) scale(0.99);
}

.bio-btn:focus-visible {
  outline: 2px solid rgba(103, 232, 249, 0.72);
  outline-offset: 2px;
}

.bio-btn-primary {
  border: 1px solid rgba(103, 232, 249, 0.32);
  background: linear-gradient(135deg, #0056b3, #6f42c1);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(0, 86, 179, 0.26);
}

.bio-btn-secondary {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.82);
  color: #aebbd0;
}

.bio-topbar {
  position: relative;
  z-index: 1;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 14px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(4, 8, 18, 0.68);
}

.bio-topbar-title,
.bio-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bio-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12), 0 0 14px rgba(34, 197, 94, 0.65);
  animation: pulse 1.5s infinite;
}

.bio-topbar h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bio-topbar p {
  margin: 2px 0 0;
  color: #7b8ba6;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.bio-live-badge {
  min-width: 56px;
  padding: 5px 11px;
  border: 1px solid rgba(34, 197, 94, 0.34);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.bio-close-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #9aa8bd;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.bio-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(430px, 0.95fr);
  min-height: 620px;
  max-height: calc(92vh - 60px);
}

.bio-camera-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  background: #020617;
}

.bio-viewport {
  flex: 1;
  min-height: 520px;
  height: auto;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 52%, rgba(62, 109, 156, 0.09), transparent 36%),
    #020617;
}

.bio-viewport .biometrics-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bio-viewport #bio-video {
  transform: scaleX(-1);
}

.bio-viewport #bio-canvas {
  pointer-events: none;
  transform: none;
}

.bio-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(103, 232, 249, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.7;
}

.bio-depth-rings {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(52%, 300px);
  aspect-ratio: 1;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: inset 0 0 0 26px rgba(103, 232, 249, 0.02), inset 0 0 0 58px rgba(111, 66, 193, 0.035);
}

.bio-camera-meta {
  position: absolute;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.68);
  color: #67e8f9;
  font-family: "Consolas", "JetBrains Mono", monospace;
  font-size: 9px;
  pointer-events: none;
}

.bio-camera-meta strong {
  color: #dffcff;
  font-size: 10px;
  font-weight: 400;
}

.bio-camera-meta-left {
  left: 14px;
}

.bio-camera-meta-right {
  right: 14px;
  text-align: right;
}

.bio-face-frame {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(46%, 260px);
  height: min(56%, 320px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.bio-face-frame span {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: #67e8f9;
  filter: drop-shadow(0 0 8px rgba(103, 232, 249, 0.65));
}

.bio-face-frame span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 2px solid;
  border-left: 2px solid;
}

.bio-face-frame span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 2px solid;
  border-right: 2px solid;
}

.bio-face-frame span:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.bio-face-frame span:nth-child(4) {
  right: 0;
  bottom: 0;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.bio-viewport .biometrics-scanner-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, #67e8f9, #ffffff, #67e8f9, transparent);
  box-shadow: 0 0 18px rgba(103, 232, 249, 0.95);
  animation: scanLine 2.35s ease-in-out infinite;
}

.bio-scan-summary {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 54px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bio-scan-summary div {
  padding: 9px 10px;
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
}

.bio-scan-summary span {
  display: block;
  color: #8291a8;
  font-size: 9px;
  text-transform: uppercase;
}

.bio-scan-summary strong {
  display: block;
  margin-top: 3px;
  color: #e0faff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.bio-viewport .biometrics-status-pill {
  position: absolute;
  left: 14px;
  bottom: 14px;
  transform: none;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid rgba(103, 232, 249, 0.24);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.82);
  color: #67e8f9;
  font-family: "Consolas", "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bio-camera-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.88);
}

.bio-camera-footer span {
  padding: 6px 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #a9b8cc;
  font-size: 10px;
}

.bio-identity-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.48);
}

.bio-panel-heading h3 {
  margin: 6px 0 4px;
  color: #f8fafc;
  font-size: 19px;
  font-weight: 700;
}

.bio-panel-heading p {
  margin: 0;
  color: #91a0b7;
  font-size: 11px;
  line-height: 1.45;
}

.bio-progress {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.35);
}

.bio-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.bio-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3E6D9C, #6f42c1);
  transition: width 260ms ease;
}

.bio-steps {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin-top: 9px;
}

.bio-steps span {
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  color: #75849a;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.bio-steps span.active {
  background: rgba(62, 109, 156, 0.14);
  color: #a5f3fc;
}

.bio-steps span.done {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.bio-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bio-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #8fa1bb;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bio-span-2 {
  grid-column: span 2;
}

.bio-field .form-input {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.bio-field .form-input:focus {
  border-color: rgba(62, 109, 156, 0.82);
  box-shadow: 0 0 0 3px rgba(62, 109, 156, 0.16);
  background: #ffffff;
}

.bio-plate-input {
  text-align: center;
  letter-spacing: 0.16em;
}

.bio-expression-panel,
.bio-quality-panel,
.biometrics-pro .biometrics-match-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.36);
}

.bio-expression-panel,
.bio-quality-panel {
  padding: 12px;
}

.bio-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bio-section-title span,
.bio-section-title strong {
  color: #dbeafe;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bio-section-title strong {
  color: #67e8f9;
  font-variant-numeric: tabular-nums;
}

.bio-expression-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.bio-expression-grid span {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  color: #8392a8;
  background: rgba(15, 23, 42, 0.62);
  font-size: 10px;
  text-align: center;
}

.bio-expression-grid span.active {
  border-color: rgba(62, 109, 156, 0.5);
  color: #dffcff;
  background: rgba(62, 109, 156, 0.13);
}

.bio-expression-grid span.done {
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.1);
}

.bio-metric {
  display: grid;
  grid-template-columns: 104px 1fr 42px;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  color: #9fb0c8;
  font-size: 10px;
}

.bio-metric i {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.bio-metric i::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--value, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #3E6D9C, #6f42c1);
  transition: width 240ms ease;
}

.bio-metric strong {
  color: #e0f2fe;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.biometrics-pro .biometrics-match-panel {
  min-height: 64px;
  padding: 12px;
  color: #a9b8cc;
  font-family: "Consolas", "JetBrains Mono", monospace;
  font-size: 10px;
}

.biometrics-pro .biometrics-match-panel span {
  display: block;
  margin-bottom: 5px;
  color: #67e8f9;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.biometrics-pro .biometrics-match-panel p {
  margin: 0;
  line-height: 1.5;
}

.biometrics-pro .biometrics-match-panel.success {
  border-color: rgba(34, 197, 94, 0.44);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.08);
}

.biometrics-pro .biometrics-match-panel.warning {
  border-color: rgba(245, 158, 11, 0.46);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.08);
}

.bio-actions {
  margin-top: auto;
  padding-top: 2px;
}

.bio-actions .bio-btn-secondary {
  flex: 0 0 auto;
}

.bio-actions .bio-btn-primary {
  flex: 1 1 auto;
}

@media (max-width: 980px) {
  .biometrics-pro {
    max-height: 96vh;
  }

  .bio-shell {
    grid-template-columns: 1fr;
    max-height: calc(96vh - 60px);
    overflow: auto;
  }

  .bio-camera-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }

  .bio-viewport {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .biometrics-pro {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .bio-topbar {
    padding: 12px;
  }

  .bio-topbar h2 {
    font-size: 11px;
  }

  .bio-shell {
    max-height: calc(100dvh - 56px);
  }

  .bio-identity-panel {
    padding: 14px;
  }

  .bio-form-grid,
  .bio-expression-grid {
    grid-template-columns: 1fr;
  }

  .bio-span-2 {
    grid-column: span 1;
  }

  .bio-steps {
    grid-template-columns: repeat(4, 1fr);
  }

  .bio-scan-summary {
    grid-template-columns: 1fr;
    bottom: 54px;
  }

  .bio-viewport {
    min-height: 360px;
  }

  .bio-actions,
  .bio-consent-actions {
    flex-direction: column;
    align-items: stretch;
  }
}


/* OCR Camera Simulation & Preloaded Mock Selection */
/* OCR Camera Simulation & Preloaded Mock Selection */
.ocr-viewport {
  position: relative;
  width: 100%;
  height: 240px;
  background-color: #0a0512;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(83, 20, 205, 0.4);
}

/* Viewport HUD corner guides */
.ocr-viewport .corner-tl,
.ocr-viewport .corner-tr,
.ocr-viewport .corner-bl,
.ocr-viewport .corner-br {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 10;
}
.ocr-viewport .corner-tl {
  top: 12px;
  left: 12px;
  border-top: 2px solid var(--accent-blue);
  border-left: 2px solid var(--accent-blue);
}
.ocr-viewport .corner-tr {
  top: 12px;
  right: 12px;
  border-top: 2px solid var(--accent-blue);
  border-right: 2px solid var(--accent-blue);
}
.ocr-viewport .corner-bl {
  bottom: 12px;
  left: 12px;
  border-bottom: 2px solid var(--accent-blue);
  border-left: 2px solid var(--accent-blue);
}
.ocr-viewport .corner-br {
  bottom: 12px;
  right: 12px;
  border-bottom: 2px solid var(--accent-blue);
  border-right: 2px solid var(--accent-blue);
}

.ocr-capture-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 60px;
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
  transition: all 0.3s ease;
}

.ocr-capture-frame::before {
  content: 'OCR ALIGN';
  position: absolute;
  top: -15px;
  left: 0;
  font-size: 8px;
  color: var(--accent-yellow);
  font-family: monospace;
}

/* Mode specific alignment frame shapes and colors */
.ocr-mode-barcode .ocr-capture-frame {
  width: 85%;
  height: 40px;
  border: 2px solid var(--accent-red);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}
.ocr-mode-barcode .ocr-capture-frame::before {
  content: 'BARCODE ALIGN';
  color: var(--accent-red);
}
.ocr-mode-seal .ocr-capture-frame {
  width: 60%;
  height: 120px;
  border: 2px solid var(--accent-purple);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}
.ocr-mode-seal .ocr-capture-frame::before {
  content: 'SEAL / PHOTO ALIGN';
  color: var(--accent-purple);
}
.ocr-mode-evidence .ocr-capture-frame {
  width: 75%;
  height: 130px;
  border: 2px solid var(--accent-blue);
  box-shadow: 0 0 20px rgba(62, 109, 156, 0.4);
}
.ocr-mode-evidence .ocr-capture-frame::before {
  content: 'EVIDENCE / OCR ALIGN';
  color: var(--accent-blue);
}
.ocr-mode-container .ocr-capture-frame {
  width: 80%;
  height: 60px;
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}
.ocr-mode-container .ocr-capture-frame::before {
  content: 'OCR ALIGN';
  color: var(--accent-yellow);
}

.ocr-mocks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.ocr-mock-thumb {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px;
  background-color: rgba(255,255,255,0.02);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.ocr-mock-thumb:hover, .ocr-mock-thumb.active {
  border-color: var(--accent-yellow);
  background-color: rgba(245, 158, 11, 0.1);
}

.ocr-mock-thumb img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.ocr-mock-thumb span {
  font-size: 8px;
  color: #9CA3AF;
  display: block;
  margin-top: 3px;
}

/* Yard control 2D and 3D Visualizer */
.yard-visualizer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.yard-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.yard-canvas-container {
  position: relative;
  width: 100%;
  min-height: 400px;
  background-color: #07030e;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.yard-render-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 2D Block Layout */
.yard-grid-2d {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  padding: 20px;
}

.yard-slot-2d {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: all 0.2s;
}

.yard-slot-2d:hover {
  background-color: rgba(83, 20, 205, 0.15);
  border-color: var(--nav-bg);
}

.yard-slot-2d.occupied {
  background: linear-gradient(135deg, rgba(83, 20, 205, 0.4), rgba(27, 6, 66, 0.6));
  border-color: var(--accent-purple);
}

.yard-slot-2d.reefer-connected {
  border-color: var(--accent-blue);
  box-shadow: inset 0 0 5px rgba(62, 109, 156, 0.4);
}

.yard-slot-label {
  font-size: 8px;
  color: #9CA3AF;
  font-family: monospace;
}

.yard-slot-container {
  font-size: 9px;
  font-weight: 700;
  color: #FFFFFF;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Warehouse 3D/2D Architecture Map grid */
.warehouse-architectural-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-top: 15px;
}

.warehouse-slot {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  height: 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.warehouse-slot:hover {
  border-color: var(--accent-blue);
  background-color: rgba(62, 109, 156, 0.05);
}

.warehouse-slot.occupied {
  border-style: solid;
  border-color: var(--accent-green);
  background-color: rgba(16, 185, 129, 0.1);
  color: #FFFFFF;
}

/* Warnings and Indicators */
.reefer-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow);
  padding: 6px 12px;
  border-radius: 4px;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* HTML LaTeX Print Preview container styles */
#pdf-print-container {
  display: none;
}

/* CSS specific for PDF preview modal */
.pdf-preview-box {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #FFFFFF;
  overflow-y: auto;
  padding: 20px;
}

/* Print Overrides */
@media print {
  body * {
    visibility: hidden;
  }
  #pdf-print-container, #pdf-print-container * {
    visibility: visible;
  }
  #pdf-print-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block !important;
  }
  .no-print {
    display: none !important;
  }
}

/* Ensure form groups establish 3D preserve context and float above button when dropdowns are open */
#login-site-group {
  z-index: 5;
}

#login-panel-group {
  z-index: 4;
}

#login-site-group:has(.custom-select.open) {
  z-index: 1020 !important;
}

#login-panel-group:has(.custom-select.open) {
  z-index: 1020 !important;
}

/* Custom Select Dropdown Styles for Login Screen */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 6px;
  color: #F9FAFB;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  user-select: none;
}

.custom-select-trigger:hover {
  border-color: var(--nav-bg);
  background: rgba(255, 255, 255, 0.08);
}

.custom-select-trigger .arrow-icon {
  transition: transform 0.3s ease;
  color: #9CA3AF;
  display: flex;
  align-items: center;
}

.custom-select.open .custom-select-trigger .arrow-icon {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.45) !important; /* White transparent background */
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: none !important; /* Remove borders */
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
  z-index: 1010;
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  padding: 5px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) !important;
}

.custom-select-option {
  padding: 8px 14px;
  color: #1B0642 !important; /* Enforce dark text color for high visibility */
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.custom-select-option:hover {
  background: #B2C3FA !important;
  color: #1B0642 !important;
}

.custom-select-option.active {
  background: #0F3DD1 !important;
  color: #FFFFFF !important;
  font-weight: 600;
}

/* White Theme Overrides for Custom Select inside Login Box */
.login-box .custom-select-trigger {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #1F2937;
}

.login-box .custom-select-trigger:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--nav-bg);
}

.login-box .custom-select-trigger .arrow-icon {
  color: #4B5563;
}

.login-box .custom-select-options {
  background: rgba(255, 255, 255, 0.45) !important; /* Acrylic white transparent background */
  border: none !important; /* Remove borders */
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 30000 !important;
  transform-origin: top center;
}

.login-box .custom-select.open {
  z-index: 30000;
}

.login-box #login-panel-group:has(.custom-select.open) {
  max-height: 360px !important;
  overflow: visible !important;
}

.login-box .custom-select-option {
  color: #1B0642 !important; /* Enforce dark purple color */
}

.login-box .custom-select-option:hover {
  background: #B2C3FA !important;
  color: #1B0642 !important;
}

.login-box .custom-select-option.active {
  background: #0F3DD1 !important;
  color: #FFFFFF !important;
  font-weight: 600;
}

/* ==================== LIGHT INTERFACE AREA OVERRIDES ==================== */
/* We style only the content-area and its children (excluding sidebar and top-bar) */
.content-area {
  background: linear-gradient(135deg, #F3F4F6 0%, #FFFFFF 100%) !important;
}

.content-area h1,
.content-area h2,
.content-area h3,
.content-area h4,
.content-area h5,
.content-area h6 {
  color: #1B0642 !important;
}

/* Light Stat Cards */
.content-area .stat-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
}

.content-area .stat-card-title {
  color: #6B7280 !important;
}

.content-area .stat-card-value {
  color: #1B0642 !important;
}

/* Light Panel Cards */
.content-area .panel-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

.content-area .panel-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* General Text Contrast in Content Area */
.content-area p,
.content-area span,
.content-area label,
.content-area td,
.content-area li,
.content-area option {
  color: #374151; /* Dark gray for general readability */
}

/* Exclude active/primary buttons and badges from dark text override */
.content-area .btn-primary,
.content-area .btn-primary *,
.content-area .btn-accent,
.content-area .btn-accent *,
.content-area .btn-danger,
.content-area .btn-danger *,
.content-area .badge,
.content-area .badge *,
.content-area .user-section-step,
.content-area .user-section-step *,
.content-area .user-card-icon,
.content-area .user-card-icon *,
.content-area .user-header-new-btn,
.content-area .user-header-new-btn *,
.content-area .user-access-mode-badge.badge-inherited,
.content-area .user-btn-save,
.content-area .user-btn-save * {
  color: #FFFFFF !important;
}

.content-area .btn-secondary {
  color: #374151 !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

.content-area .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* Light inputs inside workspace */
.content-area .form-input {
  background-color: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1F2937 !important;
}

.content-area .form-input:focus {
  border-color: var(--nav-bg) !important;
  box-shadow: 0 0 10px rgba(83, 20, 205, 0.1) !important;
}

/* Table styling for light theme */
.content-area .wms-table-container {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}

.content-area .wms-table th {
  background-color: rgba(83, 20, 205, 0.06) !important;
  color: #1B0642 !important;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06) !important;
}

.content-area .wms-table td {
  color: #374151 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.content-area .wms-table tr:hover {
  background-color: rgba(83, 20, 205, 0.02) !important;
}

#view-doc-registro .arribo-records-panel {
  width: 100%;
  margin-left: 0;
  box-sizing: border-box;
  border-radius: 0;
}

#view-doc-registro .arribo-records-panel .wms-table th,
#view-doc-registro .arribo-records-panel .wms-table td {
  border: 1px solid #d9dce3 !important;
}

.movement-audit-actions { display: flex; gap: 16px; flex-wrap: wrap; }

#login-screen button.password-toggle { border: 0; background: transparent; padding: 4px; }
#login-error-reveal-password { margin-bottom: 14px; font-weight: 400; }
#login-error-reveal-password[hidden] { display: none !important; }

.operational-site-control { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; background: #f7fafc; border: 1px solid #cbd5e1; border-left: 4px solid #107184; border-radius: 8px; color: #54575A; }
.operational-site-control[hidden] { display: none !important; }
.operational-site-control label { min-width: 240px; max-width: 100%; flex: 1; }
.operational-site-control p { margin: 0; flex: 2; min-width: 180px; font-size: 12px; }

.content-area .wms-doc-guia,
.content-area .wms-doc-unidad {
  color: #000000 !important;
}

.security-controls-card {
  margin-top: 18px;
  padding: 18px;
  background: rgba(238, 236, 245, 0.55);
  border: 1px solid rgba(27, 6, 66, 0.1);
  border-radius: 6px;
}

.security-controls-card h3 {
  color: #1B0642 !important;
  font-size: 12px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.security-controls-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}

.security-controls-list li {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.48);
  border-left: 3px solid #0d2574;
  border-radius: 6px;
  color: #1B0642;
  line-height: 1.45;
}

.security-controls-list strong {
  color: #0d2574;
}

/* Autocomplete list dropdowns in content area */
.content-area #driver-autocomplete-list {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.content-area #driver-autocomplete-list li {
  color: #374151 !important;
}

.content-area #driver-autocomplete-list li:hover {
  background: rgba(83, 20, 205, 0.08) !important;
  color: #5314CD !important;
}

/* Slide Up Admin Sites (Emplazamiento) Panel Container */
.content-area .slide-up-panel {
  background: rgba(255, 255, 255, 0.75) !important;
  border-top: 2px solid var(--nav-bg) !important;
}

/* Details slot bar inside Yard visualization */
.content-area .yard-control-bar {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

/* White Transparent Glassmorphic Modal */
.modal-white-glass {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.6) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.6) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), inset 0 0 20px rgba(255, 255, 255, 0.15) !important;
}

.modal-white-glass .wms-modal-header {
  background: rgba(255, 255, 255, 0.3) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  padding: 10px 15px !important;
}

.modal-white-glass .wms-modal-header h2 {
  color: #B45309 !important; /* Dark amber/yellow for contrast */
  font-size: 11px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.modal-white-glass .wms-modal-header h2 svg {
  color: #B45309 !important;
}

.modal-white-glass .wms-modal-header .action-icon {
  color: #4B5563 !important; /* Slate gray close button */
  font-size: 12px !important;
}

.modal-white-glass .wms-modal-header .action-icon:hover {
  color: var(--accent-red) !important;
}

.modal-white-glass .wms-modal-body {
  text-align: center !important;
  padding: 20px 15px !important;
}

.modal-white-glass #sys-notification-msg {
  color: #1F2937 !important; /* Dark gray for general readability */
  font-size: 11px !important;
  margin-bottom: 15px !important;
  font-weight: 500 !important;
}

.modal-white-glass .btn-primary {
  background-color: var(--nav-bg) !important;
  color: #FFFFFF !important;
  padding: 5px 15px !important;
  font-size: 10px !important;
  min-width: 70px !important;
  margin: 0 auto !important;
  display: block !important;
  border-radius: 4px !important;
}

.modal-white-glass .btn-primary:hover {
  background-color: #661be6 !important;
  box-shadow: 0 0 10px rgba(83, 20, 205, 0.3) !important;
}

#modal-edit-site .form-input {
  box-sizing: border-box !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 8px 14px !important;
  color: #1f2937 !important;
  font-size: 11px !important;
  line-height: 20px !important;
}

#modal-edit-site select.form-input {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Create Role Modal - Force dark text and visible inputs */
#modal-create-role .form-input,
#modal-create-role select.form-input,
#modal-create-role input.form-input,
#modal-create-role select,
#modal-create-role input {
  background: #FFFFFF !important;
  color: #000000 !important;
  font-weight: 400 !important;
  border: 1px solid rgba(0, 0, 0, 0.25) !important;
  -webkit-appearance: menulist !important;
  appearance: menulist !important;
}
#modal-role-region,
#modal-role-province,
#modal-role-comuna,
#modal-role-site,
#modal-role-name,
#modal-create-role .custom-select-trigger,
.modal-white-glass .custom-select-trigger {
  color: #000000 !important;
  font-weight: 400 !important;
  background-color: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.25) !important;
}

#modal-create-role .custom-select-trigger span,
.modal-white-glass .custom-select-trigger span {
  color: #000000 !important;
  font-weight: 400 !important;
}

#modal-create-role .custom-select-trigger .arrow-icon,
.modal-white-glass .custom-select-trigger .arrow-icon {
  color: #000000 !important;
}
#modal-create-role select.form-input option,
#modal-create-role select option {
  color: #000000 !important;
  font-weight: 400 !important;
  background: #FFFFFF !important;
}
#modal-create-role .form-group label {
  color: #000000 !important;
  font-weight: 700 !important;
}

#modal-create-role .modal-window-actions {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

#modal-create-role .modal-window-action {
  align-items: center;
  background: transparent;
  border: 0;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  padding: 0;
  width: 18px;
}

#modal-create-role .modal-window-action:hover,
#modal-create-role .action-icon:hover {
  color: var(--accent-purple) !important;
  opacity: 1;
}

#modal-create-role .restore-icon,
#modal-create-role.role-modal-maximized .maximize-icon {
  display: none;
}

#modal-create-role.role-modal-maximized .restore-icon {
  display: block;
}

#modal-create-role.role-modal-maximized {
  padding: 16px;
}

#modal-create-role.role-modal-maximized .create-role-modal {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  max-width: calc(100vw - 32px) !important;
  width: min(1180px, calc(100vw - 32px)) !important;
}

#modal-create-role.role-modal-maximized #create-role-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

#modal-create-role .wms-modal-body {
  text-align: left !important;
  max-height: 72vh !important;
  overflow-y: auto !important;
}

#modal-create-role.role-modal-maximized .wms-modal-body {
  flex: 1 1 auto;
  max-height: none !important;
  min-height: 0;
}

#modal-create-role.role-modal-maximized .create-role-permission-list {
  max-height: clamp(260px, 45vh, 430px);
}

#modal-create-role.role-modal-maximized .create-role-permission-panel {
  min-height: 360px;
}
/* Override any content-area color inheritance on modal selects */
.wms-modal-backdrop#modal-create-role select,
.wms-modal-backdrop#modal-create-role input,
body #modal-create-role select.form-input,
body #modal-create-role input.form-input {
  color: #000000 !important;
  font-weight: 400 !important;
}

#modal-create-role input.form-input {
  -webkit-appearance: auto !important;
  appearance: auto !important;
}

.create-role-permission-panel {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 10px;
}

.create-role-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: #111827 !important;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800 !important;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  text-transform: uppercase;
}

.create-role-group-label input,
.create-role-permission-list input {
  accent-color: var(--accent-purple);
}

.create-role-permission-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 165px;
  overflow-y: auto;
  padding-right: 4px;
}

.user-role-summary {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 6px;
  min-height: 30px;
  padding: 7px 8px;
}

.role-quick-tools,
.role-modal-tools {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-left: 3px solid #2e97b7;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 16px;
  padding: 12px;
}

.role-modal-tools {
  border-left-color: #0284c7;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  margin: 0 0 12px 0;
  padding: 10px;
}

.role-quick-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.role-quick-field label {
  color: #334155 !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-quick-control {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.role-quick-control .form-input {
  background: #ffffff !important;
  border: 1px solid rgba(100, 116, 139, 0.26) !important;
  color: #0f172a !important;
  font-size: 10px !important;
  height: 30px !important;
  min-width: 0;
}

.role-quick-btn {
  align-items: center;
  background: #e2e8f0;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 6px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  line-height: 1;
  min-width: 64px;
  padding: 0 10px;
  text-transform: uppercase;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.role-quick-btn.primary {
  background: #2e97b7;
  border-color: #2e97b7;
  color: #ffffff;
}

.role-quick-btn.ghost {
  background: #ffffff;
  color: #64748b;
}

.role-quick-btn:hover:not(:disabled) {
  border-color: rgba(14, 165, 233, 0.5);
  color: #075985;
}

.role-quick-btn.primary:hover:not(:disabled) {
  background: #1f6f89;
  color: #ffffff;
}

.role-quick-btn:disabled {
  cursor: default;
  opacity: 0.48;
}

.role-quick-note {
  align-items: center;
  color: #475569;
  display: flex;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  min-height: 30px;
}

.create-role-group-label span,
#modal-edit-role label span[id^="modal-edit-count"] {
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  margin-left: auto;
}

.role-permission-row[hidden],
.modal-role-permission-row[hidden],
.role-permission-card[hidden],
.create-role-permission-panel[hidden] {
  display: none !important;
}

.role-list-item-custom {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.role-list-item-custom:hover {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.role-list-item-custom.active {
  background: linear-gradient(135deg, #0f172a, #2e97b7);
  border-color: rgba(46, 151, 183, 0.48);
  box-shadow: 0 12px 26px rgba(46, 151, 183, 0.22);
}

.role-list-meta {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.role-list-meta strong {
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-list-meta span {
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.role-list-item-custom.active .role-list-meta strong,
.role-list-item-custom.active .role-list-meta span {
  color: #ffffff;
}

.role-list-actions {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 5px;
}

.role-action-btn {
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-size: 9px;
  font-weight: 800;
  gap: 5px;
  height: 25px;
  justify-content: center;
  line-height: 1;
  min-width: 78px;
  padding: 0 8px;
  text-transform: uppercase;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.role-action-btn svg {
  flex: 0 0 auto;
  height: 12px;
  width: 12px;
}

.role-action-btn.edit {
  background: #e0f2fe;
  color: #075985;
}

.role-action-btn.delete {
  background: #fee2e2;
  color: #991b1b;
}

.role-action-btn.edit:hover {
  background: #bae6fd;
  border-color: rgba(14, 165, 233, 0.38);
}

.role-action-btn.delete:hover {
  background: #fecaca;
  border-color: rgba(220, 38, 38, 0.34);
}

.role-list-item-custom.active .role-action-btn {
  border-color: rgba(255, 255, 255, 0.48);
}

.role-list-item-custom.active .role-action-btn.edit {
  background: #ecfeff;
  color: #2e97b7;
}

.role-list-item-custom.active .role-action-btn.delete {
  background: #fff1f2;
  color: #be123c;
}

.role-permission-summary {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
  padding: 12px;
}

.role-permission-summary > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.role-permission-summary span,
.role-permission-summary small {
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-permission-summary strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-permission-matrix {
  display: grid !important;
  gap: 14px !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.role-permission-card {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-top: 3px solid var(--role-accent);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  min-width: 0;
  padding: 14px;
}

.role-permission-card-head {
  align-items: flex-start;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.role-permission-title {
  align-items: center;
  display: flex;
  gap: 9px;
  min-width: 0;
}

.role-permission-title > span {
  align-items: center;
  background: color-mix(in srgb, var(--role-accent) 12%, #ffffff);
  border-radius: 8px;
  color: var(--role-accent);
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.role-permission-title svg {
  height: 16px;
  width: 16px;
}

.role-permission-title small {
  color: #64748b;
  display: block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-permission-title strong {
  color: #0f172a;
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.role-group-switch {
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  color: #334155;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  padding: 4px 8px;
}

.role-group-switch input,
.role-permission-row input,
.modal-role-permission-row input {
  accent-color: #2e97b7;
}

.role-group-switch span {
  color: #334155 !important;
  font-size: 9px;
  font-weight: 800;
}

.role-permission-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-permission-row,
.modal-role-permission-row {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 8px;
}

.role-permission-row:hover,
.modal-role-permission-row:hover {
  border-color: rgba(14, 165, 233, 0.28);
}

.role-permission-row input,
.modal-role-permission-row input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.role-permission-row span,
.modal-role-permission-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.role-permission-row strong,
.modal-role-permission-row strong {
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.role-permission-row small,
.modal-role-permission-row small {
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
}

.role-permission-submenu {
  margin-left: 12px;
}

.role-permission-function,
.modal-role-permission-function {
  background: #fff7ed;
}

.modal-role-permission-row.disabled {
  cursor: default;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .role-permission-summary {
    grid-template-columns: 1fr;
  }

  .role-quick-control {
    align-items: stretch;
    flex-direction: column;
  }

  .role-quick-btn {
    width: 100%;
  }
}

/* White Transparent Slide Up Panel (Emplazamientos) */
.slide-up-panel {
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
  box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.08) !important;
  border-top: 3px solid var(--nav-bg) !important;
}

/* Light Card inside Slide Up Panel */
.slide-up-panel .panel-card {
  background: rgba(255, 255, 255, 0.45) !important; /* White transparent card */
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.7) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03) !important;
}

.slide-up-panel h2, 
.slide-up-panel h3 {
  color: #1B0642 !important;
}

.slide-up-panel label {
  color: #1B0642 !important; /* Enforce dark label inside slide up panel */
  font-weight: 600 !important;
}

.slide-up-panel .panel-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Inputs and Selects inside Slide Up Panel */
.slide-up-panel .form-input {
  background-color: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #1F2937 !important;
}

.slide-up-panel .form-input::placeholder {
  color: #9CA3AF !important;
}

.slide-up-panel select.form-input {
  background-color: rgba(255, 255, 255, 0.85) !important;
  color: #1F2937 !important;
}

/* Table inside Slide Up Panel */
.slide-up-panel .wms-table-container {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}

.slide-up-panel .wms-table th {
  background-color: rgba(83, 20, 205, 0.08) !important;
  color: #1B0642 !important;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08) !important;
}

.slide-up-panel .wms-table td {
  color: #374151 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.slide-up-panel .wms-table tr:hover {
  background-color: rgba(83, 20, 205, 0.03) !important;
}

/* Buttons in Slide Up Panel */
.slide-up-panel .btn-secondary {
  color: #374151 !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

.slide-up-panel .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.slide-up-panel .action-icon {
  opacity: 0.7 !important;
}

.slide-up-panel .action-icon:hover {
  opacity: 1 !important;
}

/* Premium styling for standard select fields */
select.form-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  padding-right: 32px !important;
  cursor: pointer !important;
}

/* Light content-area select field arrow */
.content-area select.form-input, .slide-up-panel select.form-input {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

/* Option element readability styling */
select.form-input option {
  background-color: #171124 !important; /* matches dark theme */
  color: #F9FAFB !important;
  padding: 8px !important;
}

.content-area select.form-input option, .slide-up-panel select.form-input option {
  background-color: #FFFFFF !important;
  color: #1F2937 !important;
}

/* Modal selects must also have dark text */
#modal-create-role select.form-input option,
.modal-white-glass select.form-input option {
  background-color: #FFFFFF !important;
  color: #000000 !important;
  font-weight: 400 !important;
}

/* Light theme overrides for custom selects in content-area and slide-up panels */
.content-area .custom-select-trigger, 
.slide-up-panel .custom-select-trigger {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1F2937 !important;
  border-radius: 6px !important;
}

.content-area .custom-select-trigger:hover, 
.slide-up-panel .custom-select-trigger:hover {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: var(--nav-bg) !important;
}

.content-area .custom-select-trigger .arrow-icon, 
.slide-up-panel .custom-select-trigger .arrow-icon {
  color: #4B5563 !important;
}

/* Custom Red Header overrides for Deletion Confirmation Modal */
#modal-sys-confirm .wms-modal-header h2 {
  color: var(--accent-red) !important;
}

#modal-sys-confirm .wms-modal-header h2 svg {
  color: var(--accent-red) !important;
}

#modal-sys-confirm #sys-confirm-btn-action {
  margin: 0 !important;
  display: inline-flex !important;
}

/* ==================== PANEL-SPECIFIC SIDEBAR TOGGLING ==================== */
.wms-app.panel-maritimo .sidebar .maritimo-only {
  display: block !important;
}
.wms-app.panel-maritimo li.menu-category.maritimo-only {
  display: flex !important;
}
.wms-app.panel-maritimo li.menu-item.maritimo-only {
  display: flex !important;
}

.wms-app .sidebar .permission-hidden,
.wms-app .sidebar li.permission-hidden,
.wms-app .sidebar ul.permission-hidden,
.wms-app.panel-maritimo .sidebar .permission-hidden,
.wms-app.panel-maritimo .sidebar li.permission-hidden,
.wms-app.panel-maritimo .sidebar ul.permission-hidden {
  display: none !important;
}

.wms-app.panel-maritimo .terrestre-only,
.wms-app:not(.panel-terrestre) .terrestre-only {
  display: none !important;
}

.wms-app.panel-terrestre .maritimo-only {
  display: none !important;
}

.wms-app.panel-terrestre .sidebar li.terrestre-only {
  display: flex !important;
}

.wms-app.panel-terrestre .sidebar .menu-category.terrestre-only {
  display: flex !important;
}

.wms-app.panel-terrestre .sidebar .permission-hidden {
  display: none !important;
}

.wms-app.panel-terrestre .content-area .terrestre-view {
  color: #172033;
}

/* ==================== TERRESTRE INDUSTRIAL PANEL ==================== */
.top-bar-user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 86, 179, 0.08);
  border: 1px solid rgba(0, 86, 179, 0.18);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.top-bar-user-badge * {
  color: #ffffff !important;
}

.terrestre-shell {
  --terr-pad: 16px;
  --terr-gap: 12px;
  min-height: 100%;
  padding: var(--terr-pad);
  display: flex;
  flex-direction: column;
  gap: var(--terr-gap);
  background:
    radial-gradient(circle at top left, rgba(62, 109, 156, 0.11), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 45%, #ffffff 100%);
}

.terrestre-page-head,
.terrestre-hero-panel,
.terrestre-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.terrestre-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
}

.terrestre-page-head h2,
.terrestre-hero-panel h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.terrestre-page-head p,
.terrestre-hero-panel p,
.terrestre-help {
  margin: 6px 0 0;
  color: #526173;
  font-size: 12px;
  line-height: 1.55;
}

.terrestre-eyebrow {
  color: #0056b3;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terrestre-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(62, 109, 156, 0.11);
  color: #2e97b7;
  border: 1px solid rgba(62, 109, 156, 0.25);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.terrestre-welcome-3d {
  padding: 18px 20px;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(0, 86, 179, 0.96), rgba(111, 66, 193, 0.94) 58%, rgba(62, 109, 156, 0.92));
  box-shadow: 0 24px 55px rgba(0, 86, 179, 0.25);
  transform-style: preserve-3d;
  transition: opacity 0.45s ease, transform 0.18s ease, max-height 0.45s ease, padding 0.45s ease;
  overflow: hidden;
}

.terrestre-welcome-3d span {
  display: block;
  font-size: 10px;
  font-weight: 900;
  opacity: 0.78;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.terrestre-welcome-3d h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.terrestre-welcome-3d.is-hidden {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  pointer-events: none;
}

.terrestre-hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.terrestre-hero-status {
  min-width: 210px;
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 86, 179, 0.08), rgba(62, 109, 156, 0.08));
  border: 1px solid rgba(0, 86, 179, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.terrestre-hero-status strong {
  color: #0056b3;
  font-size: 12px;
  word-break: break-word;
}

.terrestre-hero-status span {
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.terrestre-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.terrestre-kpi {
  min-height: 92px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.terrestre-kpi span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.terrestre-kpi strong {
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
  color: #111827;
}

.terrestre-kpi-blue { border-top: 3px solid #0056b3; }
.terrestre-kpi-teal { border-top: 3px solid #3E6D9C; }
.terrestre-kpi-purple { border-top: 3px solid #6f42c1; }
.terrestre-kpi-amber { border-top: 3px solid #f59e0b; }
.terrestre-kpi-red { border-top: 3px solid #dc2626; }

.terrestre-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.terrestre-grid-wide-left {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.terrestre-card {
  padding: 16px;
  min-width: 0;
}

.terrestre-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.terrestre-card-head h3 {
  margin: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.terrestre-card-head span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.terrestre-card-head button,
.terrestre-admin-actions button,
.terrestre-mini-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 179, 0.18);
  background: #ffffff;
  color: #0056b3;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.terrestre-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.terrestre-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.terrestre-form label,
.terrestre-accordion label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.terrestre-form .form-input,
.terrestre-accordion .form-input,
.terrestre-inline-input {
  min-height: 34px;
  border-radius: 6px !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 12px !important;
}

.terrestre-file-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 58px;
  padding: 12px;
  border: 1px dashed rgba(0, 86, 179, 0.3);
  border-radius: 8px;
  background: rgba(0, 86, 179, 0.04);
}

.terrestre-form-grid .terrestre-file-slot.wide {
  grid-column: 1 / -1;
}

.terrestre-file-slot input {
  margin-top: 8px;
}

.terrestre-photo-native-input {
  display: none !important;
}

.terrestre-file-slot span,
.terrestre-file-slot-title {
  color: #0056b3;
  font-size: 10px;
  font-weight: 900;
}

.terrestre-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.terrestre-photo-btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(83, 20, 205, 0.18);
  background: #ffffff;
  color: #1B0642;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
}

.terrestre-photo-btn-camera {
  border-color: rgba(0, 86, 179, 0.2);
  background: #0056b3;
  color: #ffffff;
}

.terrestre-photo-btn:hover,
.terrestre-photo-btn:focus-visible {
  border-color: rgba(83, 20, 205, 0.42);
  box-shadow: 0 0 0 2px rgba(83, 20, 205, 0.08);
  outline: none;
}

.terrestre-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
}

.terrestre-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: #ffffff;
}

.terrestre-table th,
.terrestre-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  color: #1f2937;
  font-size: 11px;
  text-align: left;
  vertical-align: middle;
}

.terrestre-table th {
  color: #64748b;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.terrestre-table small,
.terrestre-muted {
  color: #64748b;
  font-size: 10px;
}

.terrestre-empty {
  padding: 18px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.terrestre-movement-list,
.terrestre-alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terrestre-movement-list div,
.terrestre-alert-list div {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.terrestre-movement-list strong,
.terrestre-alert-list strong {
  display: block;
  color: #111827;
  font-size: 12px;
}

.terrestre-movement-list span,
.terrestre-alert-list span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.terrestre-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terrestre-accordion > button {
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.terrestre-accordion > button.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #0056b3, #6f42c1);
}

.terrestre-accordion-body {
  display: none;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.terrestre-accordion-body.active {
  display: block;
}

.terrestre-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(111, 66, 193, 0.1);
  color: #6f42c1;
  font-size: 9px;
  font-weight: 900;
}

.terrestre-diff {
  display: inline-flex;
  min-width: 42px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 950;
}

.terrestre-diff.positive {
  color: #0056b3;
  background: rgba(0, 86, 179, 0.08);
}

.terrestre-diff.negative {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.terrestre-maint-alert {
  color: #dc2626;
  font-weight: 950;
}

.terrestre-inline-input {
  width: 110px;
  padding: 0 8px;
}

.terrestre-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.terrestre-suggestion-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 12px;
  line-height: 1.7;
}

.terrestre-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.terrestre-settings-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 179, 0.12);
  background: #ffffff;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.terrestre-settings-tabs button.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #0056b3, #6f42c1);
  box-shadow: 0 12px 22px rgba(0, 86, 179, 0.16);
}

.terrestre-settings-mode-list {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.terrestre-settings-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.terrestre-settings-list button {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 179, 0.12);
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.terrestre-settings-list button.active {
  color: #ffffff;
  border-color: transparent;
  background: var(--nav-bg);
}

.terrestre-settings-content {
  min-width: 0;
}

.terrestre-form-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.terrestre-form-grid label.wide {
  grid-column: 1 / -1;
}

.terrestre-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.terrestre-permission-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.terrestre-permission-toolbar button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 179, 0.16);
  background: #ffffff;
  color: #0056b3;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.terrestre-permission-toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.terrestre-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.terrestre-permission-card {
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  overflow: hidden;
}

.terrestre-permission-card header {
  padding: 10px 12px;
  border-top: 3px solid var(--terr-perm-accent, #0056b3);
  background: #f8fafc;
}

.terrestre-permission-card header strong {
  display: block;
  color: #111827;
  font-size: 11px;
  font-weight: 950;
}

.terrestre-permission-card header span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.terrestre-permission-card label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

.terrestre-permission-card label:has(input:checked) {
  background: rgba(0, 86, 179, 0.07);
  color: #0f172a;
}

.terrestre-permission-card label strong {
  display: block;
  color: #1f2937;
  font-size: 11px;
}

.terrestre-permission-card label small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 9px;
}

.terrestre-permission-card label:has(input:checked) strong {
  color: #0f172a;
}

.terrestre-permission-card label:has(input:checked) small {
  color: #334155;
}

.terrestre-actions-cell {
  display: inline-flex;
  gap: 6px;
}

.terrestre-actions-cell button {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 179, 0.14);
  background: #ffffff;
  color: #0056b3;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.terrestre-actions-cell button.danger {
  border-color: rgba(220, 38, 38, 0.18);
  color: #dc2626;
}

.terrestre-actions-cell button:disabled,
.terrestre-form-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.terrestre-param-preview {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(135deg, rgba(0, 86, 179, 0.07), rgba(62, 109, 156, 0.08)),
    #ffffff;
}

.terrestre-param-preview strong {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0;
}

.terrestre-param-preview span {
  font-size: 13px;
  font-weight: 700;
}

.wms-app.panel-terrestre .content-area {
  font-size: 12px;
}

.terrestre-ops,
.terrestre-ops input,
.terrestre-ops select,
.terrestre-ops button,
.terrestre-ops table {
  font-size: 12px !important;
}

.terrestre-form-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.terrestre-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.terrestre-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.terrestre-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.terrestre-toolbar button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 179, 0.18);
  background: #ffffff;
  color: #0056b3;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.terrestre-table-dense {
  min-width: 1320px;
}

.terrestre-table-dense th,
.terrestre-table-dense td {
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.terrestre-filter-row th {
  padding: 6px;
  background: #ffffff;
}

.terrestre-table-filter {
  width: 100%;
  min-width: 92px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #111827;
  font-size: 11px;
  padding: 0 8px;
}

.terrestre-photo-icons {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.terrestre-photo-icons span {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 179, 0.16);
  background: rgba(0, 86, 179, 0.06);
  color: #0056b3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.terrestre-photo-icons svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.wms-app.panel-terrestre .content-area {
  background-color: #f8fafc;
  background-image:
    linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(248, 250, 252, 0.90)),
    var(--active-panel-background-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 25px;
  transition: background-image 0.35s ease, background-color 0.35s ease;
}

.terrestre-shell,
.terrestre-shell *,
.terrestre-ops,
.terrestre-ops input,
.terrestre-ops select,
.terrestre-ops button,
.terrestre-ops table {
  font-size: 11px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

.terrestre-shell {
  padding: 0;
  gap: 20px;
  background: transparent;
  color: #374151;
  font-family: var(--theme-font-family);
}

.terrestre-page-head,
.terrestre-card,
.terrestre-settings-tabs {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

.terrestre-page-head {
  padding: 20px;
}

.terrestre-card {
  padding: 20px;
  margin-bottom: 20px;
}

.terrestre-card-head,
.terrestre-page-head {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.terrestre-page-head h2,
.terrestre-card-head h3,
.terrestre-permission-card header strong,
.terrestre-param-preview strong {
  color: #1B0642 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  text-transform: none !important;
}

.terrestre-page-head p,
.terrestre-card-head span,
.terrestre-eyebrow,
.terrestre-chip,
.terrestre-muted,
.terrestre-empty,
.terrestre-form label,
.terrestre-filter-grid label,
.terrestre-accordion label,
.terrestre-permission-card label,
.terrestre-permission-card label strong,
.terrestre-permission-card label small {
  color: #374151 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  text-transform: none !important;
}

.terrestre-chip {
  min-height: 24px;
  border-radius: 4px;
  background: rgba(83, 20, 205, 0.06);
  border-color: rgba(83, 20, 205, 0.12);
}

.terrestre-form-grid,
.terrestre-form-grid-compact,
.terrestre-filter-grid {
  gap: 15px;
}

.terrestre-form .form-input,
.terrestre-accordion .form-input,
.terrestre-inline-input,
.terrestre-table-filter {
  min-height: 32px;
  border-radius: 4px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}

.wms-app.panel-terrestre .custom-select-trigger,
.wms-app.panel-terrestre .custom-select-trigger span {
  color: #1f2937 !important;
}

.wms-app.panel-terrestre .custom-select-options {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12) !important;
  z-index: 30000 !important;
  pointer-events: auto !important;
}

.wms-app.panel-terrestre .custom-select.open .custom-select-options {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.wms-app.panel-terrestre .custom-select-option {
  color: #1f2937 !important;
  background: #ffffff !important;
  border: 0 !important;
  outline: 0 !important;
}

.wms-app.panel-terrestre .custom-select-option.active {
  color: #1f2937 !important;
  background: #ffffff !important;
  font-weight: 400 !important;
}

.wms-app.panel-terrestre .custom-select-option:hover,
.wms-app.panel-terrestre .custom-select-option.active:hover {
  color: #0f172a !important;
  background: rgba(0, 86, 179, 0.12) !important;
  font-weight: 400 !important;
}

.wms-app.panel-terrestre select.form-input,
.wms-app.panel-terrestre select.form-input option {
  color: #1f2937 !important;
  background: #ffffff !important;
}

.terrestre-card-head button,
.terrestre-admin-actions button,
.terrestre-mini-btn,
.terrestre-toolbar button,
.terrestre-permission-toolbar button,
.terrestre-actions-cell button,
.terrestre-settings-tabs button,
.terrestre-settings-list button {
  min-height: 30px;
  border-radius: 4px;
  color: #1B0642;
  background: #ffffff;
  border: 1px solid rgba(83, 20, 205, 0.14);
  font-size: 11px !important;
  font-weight: 400 !important;
  text-transform: none;
}

.terrestre-settings-tabs button.active {
  color: #ffffff !important;
  background: var(--nav-bg) !important;
  box-shadow: none !important;
}

.terrestre-settings-list button.active {
  color: #ffffff !important;
  background: var(--nav-bg) !important;
  box-shadow: none !important;
}

.wms-app.panel-terrestre .terrestre-settings-list button.active,
.wms-app.panel-terrestre .terrestre-settings-list button.active:hover,
.wms-app.panel-terrestre .terrestre-settings-list button.active:focus,
.wms-app.panel-terrestre .terrestre-settings-list button.active:focus-visible,
.wms-app.panel-terrestre .terrestre-settings-list button[aria-current="page"],
.wms-app.panel-terrestre .terrestre-settings-tabs button.active,
.wms-app.panel-terrestre .terrestre-settings-tabs button.active:hover,
.wms-app.panel-terrestre .terrestre-settings-tabs button.active:focus,
.wms-app.panel-terrestre .terrestre-settings-tabs button.active:focus-visible {
  color: #ffffff !important;
  background: var(--nav-bg) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.wms-app.panel-terrestre .terrestre-settings-list button.active *,
.wms-app.panel-terrestre .terrestre-settings-tabs button.active * {
  color: #ffffff !important;
}

.terrestre-table-wrap {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.terrestre-table th,
.terrestre-table td,
.terrestre-table-dense th,
.terrestre-table-dense td {
  color: #374151 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.terrestre-table th {
  background-color: rgba(83, 20, 205, 0.06) !important;
  color: #1B0642 !important;
  text-transform: none !important;
}

.terrestre-shell strong,
.terrestre-shell b {
  font-weight: 400 !important;
}

.terrestre-file-slot {
  border-radius: 6px;
  border-color: rgba(83, 20, 205, 0.2);
  background: rgba(83, 20, 205, 0.04);
}

.terrestre-photo-icons button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(83, 20, 205, 0.16);
  background: rgba(83, 20, 205, 0.06);
  color: #1B0642;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.terrestre-apk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.terrestre-apk-grid section,
.terrestre-apk-endpoints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  background: #f8fafc;
}

.terrestre-apk-check {
  display: grid !important;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 6px !important;
  text-transform: none !important;
}

@media (max-width: 980px) {
  .terrestre-grid-2,
  .terrestre-grid-wide-left,
  .terrestre-settings-mode-list,
  .terrestre-hero-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .terrestre-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .terrestre-welcome-3d h2 {
    font-size: 20px;
  }
}

/* ==================== RUGGED RF HANDHELD SIMULATOR ==================== */
.rf-handheld-simulator {
  width: 320px;
  flex-shrink: 0;
  perspective: 1000px;
}

.rf-device {
  background: #252830;
  border: 10px solid #f59e0b; /* Rugged industrial yellow/orange */
  border-top-width: 16px;
  border-bottom-width: 24px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.2);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: monospace;
  position: relative;
}

.rf-header {
  background: #11141a;
  color: #8892b0;
  font-size: 9px;
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #333;
}

.rf-wifi {
  color: #34d399;
}

.rf-title {
  font-weight: bold;
  color: #f59e0b;
}

.rf-screen {
  background: #050505;
  border: 3px solid #111;
  border-radius: 6px;
  padding: 8px;
  min-height: 290px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #fbbf24; /* Retro Amber LCD theme */
  font-size: 11px;
  line-height: 1.4;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9);
}

.rf-screen-title {
  color: #000;
  background: #fbbf24;
  font-weight: 900;
  font-size: 10px;
  padding: 4px;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  border-radius: 2px;
  text-transform: uppercase;
}

.rf-label {
  font-size: 10px;
  color: #fbbf24;
  margin-bottom: 3px;
  font-weight: bold;
}

.rf-select-input {
  background: #111;
  border: 1px solid #fbbf24;
  color: #fbbf24;
  padding: 5px;
  font-size: 10px;
  font-family: monospace;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 3px;
  outline: none;
}

.rf-po-items-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 120px;
  border: 1px solid #222;
  padding: 4px;
  background: rgba(0,0,0,0.5);
  border-radius: 4px;
}

.rf-po-item {
  background: #121212;
  border: 1px solid #333;
  padding: 5px;
  border-radius: 3px;
  font-size: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.rf-po-item:hover, .rf-po-item.active {
  border-color: #fbbf24;
  background: #1e1b10;
}

.rf-po-item.completed {
  color: #10b981;
  border-color: #064e3b;
  background: rgba(6, 78, 59, 0.2);
}

.rf-laser-simulator {
  background: #151515;
  border: 1px solid #333;
  height: 32px;
  border-radius: 4px;
  position: relative;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #555;
  overflow: hidden;
  text-transform: uppercase;
}

.laser-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ef4444;
  opacity: 0;
  box-shadow: 0 0 8px #ef4444, 0 0 2px #ef4444;
  pointer-events: none;
}

.laser-beam.active {
  animation: laser-sweep 0.6s infinite alternate;
  opacity: 1;
}

@keyframes laser-sweep {
  from { top: 10%; }
  to { top: 90%; }
}

.rf-btn {
  background: #374151;
  color: #fbbf24;
  border: 1px solid #4b5563;
  font-family: monospace;
  font-size: 10px;
  padding: 6px;
  cursor: pointer;
  border-radius: 4px;
  text-align: center;
  flex: 1;
  font-weight: bold;
  transition: all 0.2s;
}

.rf-btn:hover {
  background: #4b5563;
  border-color: #fbbf24;
}

.rf-btn-accent {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
}
.rf-btn-accent:hover {
  background: #b45309;
}

.rf-btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}
.rf-btn-danger:hover {
  background: #b91c1c;
}

.rf-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-top: 1px solid #3d414a;
  padding-top: 8px;
}

.rf-key {
  background: #1f2229;
  color: #e5e7eb;
  border: 1px solid #374151;
  font-family: monospace;
  font-size: 10px;
  font-weight: bold;
  padding: 8px 0;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.1s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.rf-key:active {
  background: #374151;
  transform: translateY(1px);
}

.rf-key-enter {
  grid-column: span 2;
  background: #059669;
  color: #fff;
  border-color: #047857;
}
.rf-key-enter:active {
  background: #047857;
}

/* Overlays */
.rf-error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #7f1d1d;
  color: #fca5a5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  z-index: 100;
  animation: rf-flash-red 0.5s infinite alternate;
}

@keyframes rf-flash-red {
  from { background: #7f1d1d; }
  to { background: #b91c1c; }
}

.rf-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #064e3b;
  color: #a7f3d0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  z-index: 100;
}

/* ==================== PHYSICAL STORAGE SHELF LAYOUT ==================== */
.grid-terrestre-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.shelf-row {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shelf-row-title {
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  color: #fbbf24;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 4px;
  text-transform: uppercase;
}

.shelf-bins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.shelf-bin {
  height: 28px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.02);
}

.shelf-bin:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: #fbbf24;
}

.shelf-bin.occupied-kraft {
  background: #5314cd;
  color: #fff;
  border-color: #6d28d9;
}
.shelf-bin.occupied-box {
  background: #059669;
  color: #fff;
  border-color: #047857;
}
.shelf-bin.occupied-fierro {
  background: #d97706;
  color: #fff;
  border-color: #b45309;
}
.shelf-bin.occupied-madera {
  background: #7c3aed;
  color: #fff;
  border-color: #6d28d9;
}

.shelf-bin.suggested {
  border-color: #fbbf24;
  border-width: 2px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-weight: bold;
  animation: shelf-blink-border 0.8s infinite alternate;
}

@keyframes shelf-blink-border {
  from { border-color: rgba(255,255,255,0.15); }
  to { border-color: #fbbf24; }
}

/* ==================== PACKING CARTON BOXES ==================== */
.packing-box-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.packing-box {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 12px;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  transition: all 0.3s;
}

.packing-box-title {
  font-size: 11px;
  font-weight: bold;
  color: #fbbf24;
}

.packing-box-status {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
}

.packing-box-status.empty {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.packing-box-status.packing {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
}

.packing-box-status.closed {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.packing-box-items {
  font-size: 9px;
  text-align: left;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  border-top: 1px dashed rgba(255,255,255,0.05);
  padding-top: 6px;
}

.rf-putaway-box, .rf-picking-step-content {
  background: #111;
  border: 1px solid #333;
  padding: 10px;
  border-radius: 5px;
  margin-top: 8px;
}

/* ==================== REAL-TIME TRACKING SYSTEM STYLES ==================== */
#radar-svg {
  background: radial-gradient(circle at center, #0f1c3f 0%, #060a17 100%);
  box-shadow: inset 0 0 30px rgba(0, 200, 255, 0.2);
}

#radar-sweep {
  transform-origin: 200px 150px;
  animation: radar-sweep-anim 4s linear infinite;
}

@keyframes radar-sweep-anim {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#radar-ping {
  animation: radar-ping-anim 2s ease-out infinite;
}

@keyframes radar-ping-anim {
  0% {
    r: 0;
    opacity: 1;
    stroke-width: 3;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    r: 50;
    opacity: 0;
    stroke-width: 0.5;
  }
}

#radar-dot {
  transition: cx 0.5s ease-in-out, cy 0.5s ease-in-out;
}

#cybersec-terminal {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
#cybersec-terminal::-webkit-scrollbar {
  width: 4px;
}
#cybersec-terminal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ==================== NOTIFICATION BELL & DROPDOWN STYLES ==================== */
.notification-bell-container {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.2s ease;
  margin-right: 12px;
  color: rgba(252, 251, 255, 0.75); /* Always light-colored for contrast against dark top-bar */
}

.notification-bell-container:hover {
  background: rgba(255, 255, 255, 0.08);
}

.bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent-red);
  color: #FFFFFF;
  font-size: 8px;
  font-weight: bold;
  border-radius: 50%;
  padding: 1px 4px;
  min-width: 14px;
  height: 14px;
  text-align: center;
  line-height: 12px;
}

.bell-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-radius: 12px;
  z-index: 1000;
  margin-top: 8px;
  padding: 12px;
  color: #0f172a;
  transform: perspective(900px) rotateX(0deg) translateZ(0);
}

.bell-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: bold;
}

.clear-alerts-btn {
  color: #334155;
  text-decoration: underline;
  cursor: pointer;
}

.clear-alerts-btn:hover {
  color: #0f172a;
}

.bell-notifications-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 250px;
  overflow-y: auto;
  font-size: 11px;
}

.bell-notifications-list li {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 7px;
  line-height: 1.4;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
  overflow: hidden;
}

.bell-notifications-list li:hover {
  transform: translateY(-2px) translateZ(8px);
}

.bell-notifications-list li.alert-warning-item {
  background: rgba(255, 255, 255, 0.6);
  border-left: 4px solid var(--accent-yellow);
}
.bell-notifications-list li.alert-warning-item:hover {
  background: rgba(255, 255, 255, 0.8);
}

.bell-notifications-list li.alert-danger-item {
  background: rgba(255, 255, 255, 0.6);
  border-left: 4px solid var(--accent-red);
}
.bell-notifications-list li.alert-danger-item:hover {
  background: rgba(255, 255, 255, 0.8);
}

.bell-notifications-list li.eta-alert-dismissing {
  opacity: 0;
  max-height: 0 !important;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(16px) scale(0.98);
}

.bell-empty-msg {
  text-align: center;
  color: #64748b;
  padding: 20px 0;
}

/* ==================== TRANSPARENT ALERTS TOAST ==================== */
.eta-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.eta-toast {
  background: rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1) !important;
  color: #000000 !important;
  padding: 12px 18px;
  border-radius: 8px;
  width: 280px;
  font-size: 11px !important;
  font-weight: normal !important;
  line-height: 1.4;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  animation: eta-toast-fade-in 0.3s ease-out;
}

@keyframes eta-toast-fade-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.eta-toast-close {
  background: none;
  border: none;
  color: #000;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-left: 10px;
}

/* ==================== SCALES & STYLING FOR NEW VIEWS ==================== */
#view-almacen-eta,
#view-almacen-eta * {
  font-size: 11px !important;
  font-weight: normal !important;
}

#view-ajustes-visualizacion {
  font-family: 'Inter', sans-serif;
}

#view-ajustes-visualizacion .tech-font {
  font-family: 'JetBrains Mono', monospace;
}

/* Fix text and icon color overrides inside sidebar buttons */
#view-ajustes-visualizacion button span,
#view-ajustes-visualizacion button svg,
#view-ajustes-visualizacion button i {
  color: inherit !important;
}

/* Scoped layout view custom light theme styling */
#view-ajustes-visualizacion .panel-card {
  background: #f9fafb !important;
  color: #1f2937 !important;
}

#view-ajustes-visualizacion h2,
#view-ajustes-visualizacion h3 {
  color: #111827 !important;
  text-transform: none !important;
}

#view-ajustes-visualizacion p {
  color: #4b5563 !important;
}

.layout-tier-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.layout-tier-btn.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.icon-preview-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.browser-tab-preview,
.desktop-icon-preview {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.browser-tab-strip {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.45);
}

.browser-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.browser-tab-surface {
  padding: 12px;
  background: rgba(248, 250, 252, 0.92);
}

.browser-tab-active {
  width: min(360px, 100%);
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
}

.browser-tab-active img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 auto;
  transition: width 0.18s ease, height 0.18s ease;
}

.browser-address-preview {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #dbe4f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  border-radius: 0 10px 10px 10px;
}

.browser-favicon-zoom-preview {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 150px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(83, 20, 205, 0.12), rgba(14, 165, 233, 0.08)),
    rgba(255, 255, 255, 0.78);
  border-top: 1px solid #dbe4f0;
  color: #0f172a;
}

.browser-favicon-zoom-preview span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.browser-favicon-zoom-preview img {
  width: 22px;
  height: 22px;
  max-width: none;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 12px 16px rgba(15, 23, 42, 0.22));
  transition: width 0.18s ease, height 0.18s ease;
}

.browser-favicon-zoom-preview strong {
  color: #2563eb;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.desktop-wallpaper-preview {
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(83, 20, 205, 0.28), rgba(14, 165, 233, 0.18)),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.22), transparent 28%),
    #0f172a;
}

.desktop-icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.75);
  font-size: 12px;
  font-weight: 800;
}

.desktop-icon-tile img {
  width: 180px;
  height: 180px;
  max-width: none;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.35));
  transition: width 0.18s ease, height 0.18s ease;
}

.desktop-icon-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.62);
  font-size: 11px;
}

.desktop-icon-meta span {
  color: #93c5fd;
  font-family: "JetBrains Mono", monospace;
}

.desktop-shortcut-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 96, 171, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 96, 171, 0.04) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.desktop-shortcut-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.desktop-shortcut-copy strong {
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
}

.desktop-shortcut-copy span {
  font-size: 12px;
  color: #475569;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .icon-preview-board {
    grid-template-columns: 1fr;
  }

  .desktop-shortcut-panel {
    flex-direction: column;
    align-items: stretch;
  }
}



/* ==================== COMMERCIAL MASTERS (CLIENTS / SUPPLIERS) ==================== */
.commercial-master-view {
  background: #f5f7fb;
  color: #061733;
  height: calc(100vh - 55px);
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
  font-family: Inter, Aptos, sans-serif;
}

.commercial-master-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.commercial-master-header h2 {
  margin: 0;
  color: #061733;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.commercial-master-header p {
  margin: 8px 0 0;
  color: #93a1bd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.commercial-edit-badge {
  background: #ffffff;
  border: 1px solid #dde5f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  color: #061733;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 8px 18px;
}

.commercial-edit-badge span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: #10b981;
}

.commercial-form-card,
.commercial-directory-card,
.supplier-form-card {
  background: #ffffff;
  border: 1px solid #dde5f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.commercial-form-card {
  padding: 36px;
  margin-bottom: 24px;
}

.commercial-form-toolbar,
.commercial-directory-header,
.commercial-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.commercial-form-toolbar {
  padding-bottom: 24px;
  border-bottom: 1px solid #edf1f7;
}

.commercial-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.commercial-title-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  background: #5637ff;
  color: #ffffff;
}

.commercial-title-icon svg,
.commercial-export-btn svg,
.commercial-submit-btn svg,
.commercial-directory-header svg {
  width: 14px;
  height: 14px;
}

.commercial-title-block h3,
.commercial-directory-header h3,
.commercial-section h4 {
  margin: 0;
  color: #061733;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.commercial-title-block p {
  margin: 6px 0 0;
  color: #93a1bd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.commercial-export-btn,
.commercial-submit-btn,
.commercial-clear-btn {
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.22em;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.commercial-export-btn,
.commercial-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0f172a;
  color: #ffffff;
  padding: 14px 24px;
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.15);
}

.commercial-submit-btn {
  min-width: 300px;
}

.commercial-clear-btn {
  background: #eef3fa;
  color: #53647d;
  padding: 14px 20px;
}

.commercial-export-btn:hover,
.commercial-submit-btn:hover,
.commercial-clear-btn:hover {
  transform: translateY(-1px);
}

.commercial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 42px;
  padding-top: 36px;
}

.commercial-section h4 {
  border-left: 3px solid #5637ff;
  padding-left: 10px;
  margin-bottom: 18px;
}

.commercial-two-col,
.supplier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 22px;
}

.commercial-span-2 {
  grid-column: span 2;
}

.commercial-master-view label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #34445d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.commercial-master-view label span {
  color: #94a3b8;
}

.commercial-input {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border: 1px solid #d9e2ef;
  border-radius: 0;
  background: #f8fafc;
  color: #061733;
  font-size: 13px;
  font-weight: 500;
  padding: 0 16px;
  outline: none;
}

.commercial-input:focus {
  border-color: #5637ff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(86, 55, 255, 0.08);
}

.supplier-valid {
  border-color: #34d399;
}

.commercial-actions {
  padding-top: 28px;
  margin-top: 4px;
  border-top: 1px solid #edf1f7;
}

.commercial-actions > span {
  flex: 1;
  color: #8492ad;
  font-size: 10px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.commercial-status-pill {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 9px !important;
  width: fit-content;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #059669 !important;
}

.commercial-action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.commercial-directory-card {
  min-height: 250px;
}

.commercial-directory-header {
  padding: 28px 30px;
  background: #ffffff;
  border-bottom: 1px solid #f0f3f8;
}

.commercial-directory-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.commercial-directory-header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.commercial-directory-header span {
  border: 1px solid #e2e8f0;
  color: #93a1bd;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 900;
}

.commercial-directory-header input {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #061733;
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.commercial-table {
  width: 100%;
  border-collapse: collapse;
}

.commercial-table th {
  color: #93a1bd;
  background: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  padding: 20px 36px;
}

.commercial-table td {
  border-top: 1px solid #f1f5f9;
  color: #334155;
  padding: 18px 36px;
  font-size: 12px;
  vertical-align: top;
}

.commercial-table strong {
  display: block;
  color: #061733;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.commercial-table small {
  color: #8492ad;
}

.commercial-table-actions {
  display: flex;
  gap: 8px;
}

.commercial-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #53647d;
  cursor: pointer;
}

.commercial-icon-btn svg {
  width: 10px;
  height: 10px;
}

.commercial-icon-btn.danger {
  color: #dc2626;
}

#view-ajustes-clientes .commercial-table td,
#view-ajustes-clientes .commercial-table td * {
  font-size: 11px !important;
}

.supplier-form-card {
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.supplier-section-title {
  border-bottom: 1px solid #e8eef6;
  margin-bottom: 26px;
  padding-bottom: 18px;
}

.supplier-section-title h3 {
  margin: 0 0 6px;
  color: #020617;
  font-size: 18px;
  font-weight: 800;
}

.supplier-section-title p,
.supplier-grid small {
  margin: 0;
  color: #49627f;
  font-size: 12px;
}

.supplier-actions {
  margin-top: 30px;
}

@media (max-width: 1100px) {
  .commercial-grid,
  .commercial-two-col,
  .supplier-grid {
    grid-template-columns: 1fr;
  }

  .commercial-span-2 {
    grid-column: span 1;
  }

  .commercial-form-toolbar,
  .commercial-actions,
  .commercial-directory-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .commercial-submit-btn {
    min-width: 0;
    width: 100%;
  }
}

/* Dashboard hero contrast must win over the generic light content overrides. */
.content-area .dashboard-view .dashboard-hero,
.content-area .dashboard-view .dashboard-hero h1,
.content-area .dashboard-view .dashboard-hero h2,
.content-area .dashboard-view .dashboard-hero h3,
.content-area .dashboard-view .dashboard-hero p,
.content-area .dashboard-view .dashboard-hero span,
.content-area .dashboard-view .dashboard-hero small,
.content-area .dashboard-view .dashboard-hero strong,
.content-area .dashboard-view .dashboard-hero .dashboard-kicker,
.content-area .dashboard-view .dashboard-hero .dashboard-live-chip,
.content-area .dashboard-view .dashboard-hero .dashboard-live-chip span {
  color: #ffffff !important;
}

/* Color fixes for Roles & Permisos screen in light card background */
#view-ajustes-roles .panel-card h5 {
  color: #4B5563 !important;
}
#view-ajustes-roles .panel-card label {
  color: #1F2937 !important;
}
#view-ajustes-roles .panel-card label[for^="check-group"] {
  color: #0f172a !important;
  font-weight: 400 !important;
}
#view-ajustes-roles .panel-card div[style*="flex-direction: column"] label {
  color: #1F2937 !important;
  font-weight: 400 !important;
}
#view-ajustes-roles #roles-list-container .role-list-item-custom:not(.active) {
  color: #4B5563 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  background-color: #ffffff !important;
}
#view-ajustes-roles .view-header-row h2 {
  color: #1B0642 !important;
}
#view-ajustes-roles .view-header-row p {
  color: #6B7280 !important;
}
#view-ajustes-roles .panel-card h4 {
  color: #1B0642 !important;
}
#view-ajustes-roles .panel-card p {
  color: #6B7280 !important;
}
#view-almacenaje-dashboard .panel-card p {
  color: #6B7280 !important;
}

/* Almacenaje Table Header Color Customization */
#view-almacenaje-dashboard .wms-table th {
  background-color: #44749d !important;
  color: #ffffff !important;
}

/* Almacen > Reubicaciones y movimientos internos */
.movement-workspace {
  padding: 20px;
  min-height: calc(100vh - 76px);
  background:
    radial-gradient(circle at top left, rgba(62, 109, 156, 0.12), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #0f172a;
}

.movement-hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 16px;
  max-width: 1480px;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.movement-hero span,
.movement-map-head span,
.movement-workspace .form-group label {
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.movement-hero h2 {
  margin: 5px 0 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.15;
}

.movement-hero-meta {
  min-width: 190px;
  padding: 10px 14px;
  border-left: 4px solid #3e6d9c;
  border-radius: 6px;
  background: #eff6ff;
}

.movement-hero-meta strong,
.movement-hero-meta small {
  display: block;
}

.movement-hero-meta strong {
  color: #17324d;
  font-size: 13px;
  font-weight: 850;
}

.movement-hero-meta small {
  margin-top: 2px;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
}

.movement-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 auto 14px;
  max-width: 1480px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #e2e8f0;
}

.movement-tab {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.movement-tab:hover {
  background: rgba(255, 255, 255, 0.68);
}

.movement-tab:active,
.movement-submit:active {
  transform: translateY(1px);
}

.movement-tab.is-active {
  background: #ffffff;
  color: #17324d;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.movement-pane {
  max-width: 1480px;
  margin: 0 auto;
}

.movement-control-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(190px, 1fr) minmax(180px, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.07);
}

.movement-workspace .form-group {
  min-width: 0;
}

.movement-workspace .form-input {
  min-height: 38px;
  border: 1px solid rgba(100, 116, 139, 0.28) !important;
  border-radius: 6px;
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.movement-workspace .form-input:focus {
  border-color: #3e6d9c !important;
  box-shadow: 0 0 0 3px rgba(62, 109, 156, 0.16) !important;
}

.movement-workspace .custom-select-trigger {
  min-height: 38px;
  border: 1px solid rgba(100, 116, 139, 0.28) !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 11px;
  font-weight: 600;
  box-shadow: none !important;
}

.movement-workspace .custom-select-trigger:hover,
.movement-workspace .custom-select.open .custom-select-trigger {
  border-color: #3e6d9c !important;
  box-shadow: 0 0 0 3px rgba(62, 109, 156, 0.12) !important;
}

.movement-workspace .custom-select-options {
  border: 1px solid rgba(100, 116, 139, 0.2) !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14) !important;
}

.movement-workspace .custom-select-option {
  color: #0f172a !important;
  font-size: 11px;
  font-weight: 600;
}

.movement-workspace .custom-select-option:hover,
.movement-workspace .custom-select-option.active {
  background: #eff6ff !important;
  color: #17324d !important;
}

.movement-action-group {
  display: flex;
  align-items: flex-end;
}

.movement-submit {
  width: 100%;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #3e6d9c;
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.movement-submit:hover {
  background: #345f89;
  box-shadow: 0 10px 22px rgba(62, 109, 156, 0.24);
}

.movement-map-panel {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.07);
}

.movement-map-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.movement-map-head h3 {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
}

.movement-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.movement-map-legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.movement-map-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.movement-map-legend .is-free {
  background: #e8f5ee;
  border: 1px solid #86bfa1;
}

.movement-map-legend .is-occupied {
  background: #fff1e6;
  border: 1px solid #f59e0b;
}

.warehouse-architectural-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(86px, 1fr));
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    #dfe5eb;
  background-size: 40px 40px;
  overflow-x: auto;
}

.warehouse-slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(100, 116, 139, 0.24);
  border-left: 4px solid #7bb190;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: #0f172a;
  text-align: left;
}

.warehouse-slot.occupied {
  border-left-color: #f59e0b;
  background: #fff7ed;
}

.warehouse-slot-code {
  color: #64748b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.warehouse-slot strong {
  margin-top: 3px;
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-slot em {
  margin-top: 2px;
  color: #64748b;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
}

.warehouse-slot.occupied em {
  color: #9a3412;
}

@media (max-width: 1180px) {
  .movement-control-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .movement-action-group {
    grid-column: 1 / -1;
  }

  .warehouse-architectural-grid {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
  }
}

@media (max-width: 720px) {
  .movement-workspace {
    padding: 12px;
  }

  .movement-hero,
  .movement-map-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .movement-hero-meta {
    width: 100%;
  }

  .movement-tabs {
    display: grid;
    width: 100%;
  }

  .movement-control-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-architectural-grid {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
  }
}

/* Ajustes > Movimientos audit view */
.movement-audit-view {
  min-height: 100%;
  padding: 20px;
  background: #f6f8fb;
  color: #0f172a;
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 11px;
  overflow: auto;
}

.movement-audit-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(0, 86, 179, 0.88)),
    url("login-terminal-maritimo.jpg") center/cover no-repeat;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.movement-audit-hero span {
  display: block;
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.movement-audit-hero h2 {
  margin: 5px 0 6px;
  color: #ffffff !important;
  font-size: 22px;
  line-height: 1.1;
}

.movement-audit-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86) !important;
  font-size: 12px;
  line-height: 1.45;
}

.movement-audit-clear {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.movement-audit-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.movement-audit-kpis article,
.movement-audit-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.movement-audit-kpis article {
  padding: 13px 14px;
}

.movement-audit-kpis span {
  display: block;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.movement-audit-kpis strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.movement-audit-card {
  padding: 15px;
  margin-bottom: 14px;
}

.movement-audit-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.movement-audit-card-head h3 {
  margin: 0 0 3px;
  color: #0f172a !important;
  font-size: 13px;
}

.movement-audit-card-head p {
  margin: 0;
  color: #64748b !important;
  font-size: 10px;
}

.movement-audit-card-head > span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #5314cd;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.activity-history #aj-mov-result-count {
  background: transparent;
  font-weight: 400;
}

.activity-history .movement-audit-actions .movement-audit-clear {
  font-weight: 400;
}

.activity-history .movement-audit-table { min-width: 1080px; }
.activity-history .movement-audit-table th { background: #edf3f9; color: #254d76; font-weight: 600; }
.activity-history .movement-audit-table td { font-size: 12px; font-weight: 400; }
.activity-history .movement-audit-table td small { display: block; margin-top: 4px; color: #64748b; }
.activity-history .activity-date { white-space: nowrap; }
.activity-history .activity-detail { min-width: 220px; max-width: 400px; overflow-wrap: anywhere; }
.activity-history .movement-audit-table tbody tr:hover { background: #f8fafc; }
.activity-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-top: 14px; font-size: 12px; color: #475569; }
.activity-pagination button:disabled { opacity: .45; cursor: default; }
.activity-history .movement-audit-card .movement-audit-clear { color: #315f8e; background: #f2f6fb; border-color: #cddbea; font-weight: 500; font-size: 12px; }

.movement-audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.movement-audit-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #334155;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.movement-audit-filter-grid .form-input {
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  border-radius: 6px;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}

.movement-audit-filter-grid select.form-input,
.movement-audit-filter-grid select.form-input option {
  font-weight: 400 !important;
}

.movement-audit-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
}

.movement-audit-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
  background: #ffffff;
}

.movement-audit-table th,
.movement-audit-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  color: #334155;
  font-size: 11px;
  text-align: left;
  vertical-align: middle;
}

.movement-audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2ff;
  color: #1B0642;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.movement-audit-table td strong {
  color: #0f172a;
  font-family: "Consolas", "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 800;
}

.movement-status,
.movement-source {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.movement-status.is-dispatched {
  background: rgba(0, 86, 179, 0.1);
  color: #0056b3;
}

.movement-status.is-deleted {
  background: rgba(127, 29, 29, 0.14);
  color: #7f1d1d;
}

.movement-status.is-updated {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.movement-status.is-registered {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.movement-status.is-deposit {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.movement-source {
  background: rgba(111, 66, 193, 0.09);
  color: #5314cd;
}

.movement-audit-empty {
  padding: 24px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 720px) {
  .movement-audit-view {
    padding: 12px;
  }
  .movement-audit-hero,
  .movement-audit-card-head {
    flex-direction: column;
  }
  .movement-audit-clear {
    width: 100%;
  }
}

/* Bodegaje Bobinas - interactive warehouse designer */
.bobina-designer {
  --bobina-ink: #0f172a;
  --bobina-muted: #64748b;
  --bobina-line: #e2e8f0;
  --bobina-soft: #f8fafc;
  --bobina-accent: #d97706;
  --bobina-accent-soft: #fffbeb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto auto 1fr;
  min-height: calc(100vh - 140px);
  background: #f8fafc;
  color: var(--bobina-ink);
  font-family: "Aptos", "Inter", sans-serif;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.bobina-designer-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #ffffff;
  border-bottom: 1px solid var(--bobina-line);
}

.bobina-title-group,
.bobina-header-actions,
.bobina-tabs,
.bobina-status-pill,
.bobina-map-head,
.bobina-legend,
.bobina-table-head {
  display: flex;
  align-items: center;
}

.bobina-title-group {
  gap: 12px;
  min-width: 0;
}

.bobina-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f59e0b;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(217, 119, 6, 0.25);
}

.bobina-mark svg,
.bobina-header-actions svg,
.bobina-tab svg,
.bobina-search svg,
.bobina-drawer-head svg {
  width: 16px;
  height: 16px;
}

.bobina-title-group h2 {
  margin: 0;
  color: var(--bobina-ink);
  font: 800 17px/1.2 "Inter", sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bobina-title-group p {
  margin: 4px 0 0;
  color: var(--bobina-muted);
  font-size: 12px;
}

.bobina-header-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.bobina-soft-button,
.bobina-primary-button,
.bobina-tab,
.bobina-drawer-head button {
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.bobina-soft-button,
.bobina-primary-button {
  height: 34px;
  padding: 0 13px;
  font-size: 11px;
}

.bobina-soft-button {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.bobina-primary-button {
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(217, 119, 6, 0.22);
}

.bobina-soft-button:hover,
.bobina-primary-button:hover,
.bobina-tab:hover {
  transform: translateY(-1px);
}

.bobina-kpi-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 22px;
  background: #ffffff;
  border-bottom: 1px solid var(--bobina-line);
}

.bobina-kpi {
  border: 1px solid var(--bobina-line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafc;
}

.bobina-kpi span {
  display: block;
  color: var(--bobina-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.bobina-kpi strong {
  display: block;
  margin-top: 5px;
  color: var(--bobina-ink);
  font: 900 24px/1 "Inter", sans-serif;
}

.bobina-workspace {
  grid-column: 1;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(300px, 320px) minmax(0, 1fr);
  min-height: 690px;
}

.bobina-control-panel {
  background: #ffffff;
  border-right: 1px solid var(--bobina-line);
  padding: 18px;
  overflow: auto;
}

.bobina-control-section {
  padding: 0 0 18px;
  margin: 0 0 18px;
  border-bottom: 1px solid #edf2f7;
}

.bobina-control-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.bobina-control-section h3,
.bobina-table-head h3 {
  margin: 0 0 12px;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.bobina-section-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.bobina-section-head span {
  color: var(--bobina-accent);
  font-size: 10px;
  font-weight: 900;
}

.bobina-search {
  position: relative;
}

.bobina-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.bobina-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--bobina-line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 12px 0 34px;
  color: var(--bobina-ink);
  font-size: 12px;
  outline: 0;
}

.bobina-search input:focus {
  background: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.bobina-range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  margin: 0 0 14px;
}

.bobina-range-row span {
  color: #475569;
  font-size: 12px;
}

.bobina-range-row strong {
  color: var(--bobina-ink);
  font-size: 12px;
}

.bobina-range-row input {
  grid-column: 1 / -1;
  accent-color: #d97706;
}

.bobina-visual-panel {
  min-width: 0;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
}

.bobina-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--bobina-line);
}

.bobina-tabs {
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #f1f5f9;
}

.bobina-tab {
  height: 32px;
  padding: 0 12px;
  background: transparent;
  color: #64748b;
  font-size: 11px;
}

.bobina-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.bobina-status-pill {
  gap: 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.bobina-status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.bobina-scene-panel,
.bobina-map-panel,
.bobina-table-panel {
  display: none;
  min-height: 640px;
}

.bobina-scene-panel.active,
.bobina-map-panel.active,
.bobina-table-panel.active {
  display: block;
}

.bobina-scene-panel {
  position: relative;
  background: #e9eef5;
  height: clamp(640px, calc(100vh - 285px), 780px);
  overflow: hidden;
}

.bobina-3d-scene {
  width: 100%;
  height: 100%;
  min-height: 640px;
}

.bobina-3d-scene canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: 0;
}

.bobina-3d-fallback {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 64px 18px 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(226, 232, 240, 0.72)),
    repeating-linear-gradient(0deg, rgba(100, 116, 139, 0.12) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(100, 116, 139, 0.1) 0 1px, transparent 1px 32px);
  overflow: hidden;
}

.bobina-fallback-header {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.bobina-fallback-header strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.bobina-fallback-header span {
  color: #64748b;
}

.bobina-fallback-stage {
  position: relative;
  width: min(100%, 1120px);
  height: 100%;
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.8);
  box-shadow: inset 0 1px 14px rgba(15, 23, 42, 0.08), 0 18px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  transform: perspective(1100px) rotateX(3deg);
  transform-origin: center bottom;
}

.bobina-fallback-aisle {
  position: absolute;
  z-index: 1;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

.bobina-fallback-aisle.vertical {
  transform: rotate(-90deg);
  transform-origin: center;
}

.bobina-fallback-slot {
  position: absolute;
  z-index: 2;
  border: 1px solid #0284c7;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0f172a;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 2px;
  box-shadow: 0 7px 0 rgba(2, 132, 199, 0.18), 0 12px 18px rgba(15, 23, 42, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.bobina-fallback-slot:hover,
.bobina-fallback-slot.selected {
  border-color: #7c2d12;
  box-shadow: 0 8px 0 rgba(124, 45, 18, 0.22), 0 18px 28px rgba(15, 23, 42, 0.16);
  transform: translateY(-2px);
}

.bobina-fallback-slot.partial {
  border-color: #d97706;
  background: #fef3c7;
  box-shadow: 0 7px 0 rgba(217, 119, 6, 0.2), 0 12px 18px rgba(15, 23, 42, 0.08);
}

.bobina-fallback-slot.full {
  border-color: #dc2626;
  background: #fee2e2;
  box-shadow: 0 7px 0 rgba(220, 38, 38, 0.18), 0 12px 18px rgba(15, 23, 42, 0.08);
}

.bobina-fallback-slot.inactive {
  border-color: #94a3b8;
  background: #e2e8f0;
  color: #64748b;
}

.bobina-fallback-slot span {
  position: relative;
  z-index: 2;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.bobina-fallback-slot small {
  position: relative;
  z-index: 2;
  font-size: 8px;
  font-weight: 800;
  color: #475569;
}

.bobina-fallback-slot em {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0.36;
  pointer-events: none;
}

.bobina-fallback-slot em i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: inset -2px -2px 0 rgba(15, 23, 42, 0.18);
}

.bobina-fallback-slot em i.ghost {
  background: transparent;
  border: 1px dashed currentColor;
}

.bobina-fallback-slot.vertical span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.bobina-fallback-slot.vertical small {
  display: none;
}

.bobina-scene-help {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 16px;
  max-width: 280px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  color: #475569;
  font-size: 11px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.bobina-scene-help strong,
.bobina-scene-help span {
  display: block;
}

.bobina-scene-help strong {
  color: #0f172a;
  margin-bottom: 3px;
}

.bobina-map-panel {
  padding: 18px;
}

.bobina-map-head {
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}

.bobina-legend {
  gap: 14px;
  flex-wrap: wrap;
}

.bobina-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bobina-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid currentColor;
}

.bobina-legend .available {
  background: #e0f2fe;
  color: #0284c7;
}

.bobina-legend .partial {
  background: #fef3c7;
  color: #d97706;
}

.bobina-legend .full {
  background: #fee2e2;
  color: #dc2626;
}

.bobina-svg-frame {
  height: 520px;
  border: 1px solid var(--bobina-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  overflow: auto;
  box-shadow: inset 0 1px 10px rgba(15, 23, 42, 0.04);
}

#bobina-layout-svg {
  width: 100%;
  height: 100%;
  min-width: 760px;
}

.bobina-table-panel {
  padding: 18px;
}

.bobina-table-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bobina-table-head h3 {
  margin-bottom: 0;
  color: #0f172a;
}

.bobina-table-head .form-input {
  width: 180px;
  height: 32px;
  font-size: 11px;
}

.bobina-table-scroll {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--bobina-line);
  border-radius: 8px;
  background: #ffffff;
}

.bobina-detail-drawer {
  grid-column: 2;
  grid-row: 3;
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  min-height: 690px;
  background: #ffffff;
  border-left: 1px solid var(--bobina-line);
  box-shadow: none;
  transform: none;
  transition: none;
  display: flex;
  flex-direction: column;
}

.bobina-detail-drawer.open {
  transform: none;
}

.bobina-drawer-head {
  padding: 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--bobina-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bobina-drawer-head h3,
.bobina-drawer-head p {
  margin: 0;
}

.bobina-drawer-head h3 {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.bobina-drawer-head p {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.bobina-drawer-head button {
  display: none;
  width: 34px;
  height: 34px;
  background: #ffffff;
  color: #64748b;
  border: 1px solid var(--bobina-line);
}

.bobina-drawer-body {
  padding: 20px;
  overflow: auto;
}

.bobina-drawer-status {
  border: 1px solid var(--bobina-line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 18px;
  text-align: center;
}

.bobina-drawer-status span,
.bobina-drawer-status small,
.bobina-drawer-grid span,
.bobina-drawer-note {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.bobina-drawer-status strong {
  display: block;
  color: #0f172a;
  font-size: 30px;
  font-weight: 900;
  margin: 6px 0;
}

.bobina-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.bobina-drawer-grid > div {
  border: 1px solid var(--bobina-line);
  border-radius: 8px;
  padding: 12px;
}

.bobina-drawer-grid strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 13px;
}

.bobina-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.bobina-drawer-toggle input {
  accent-color: #d97706;
}

.bobina-drawer-toggle em {
  color: #0f172a;
  font-style: normal;
  font-size: 12px;
}

.bobina-drawer-note {
  display: block;
}

.bobina-drawer-note textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--bobina-line);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  color: #0f172a;
  font-size: 12px;
  outline: 0;
}

.bobina-location-link {
  border: 0;
  background: transparent;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 1120px) {
  .bobina-designer {
    grid-template-columns: 1fr;
  }
  .bobina-designer-header,
  .bobina-kpi-row,
  .bobina-workspace,
  .bobina-detail-drawer {
    grid-column: 1;
  }
  .bobina-workspace {
    grid-row: 3;
    grid-template-columns: 1fr;
  }
  .bobina-detail-drawer {
    grid-row: 4;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid var(--bobina-line);
  }
  .bobina-control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--bobina-line);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .bobina-control-section {
    margin: 0;
  }
}

@media (max-width: 760px) {
  .bobina-designer-header,
  .bobina-toolbar,
  .bobina-map-head,
  .bobina-table-head {
    align-items: stretch;
    flex-direction: column;
  }
  .bobina-kpi-row,
  .bobina-control-panel {
    grid-template-columns: 1fr;
  }
  .bobina-header-actions,
  .bobina-tabs {
    width: 100%;
  }
  .bobina-soft-button,
  .bobina-primary-button,
  .bobina-tab {
    flex: 1;
  }
  .bobina-scene-panel,
  .bobina-map-panel,
  .bobina-table-panel {
    min-height: 480px;
  }
  .bobina-scene-panel {
    height: 520px;
  }
  .bobina-3d-scene {
    min-height: 480px;
  }
}

/* Mass Import Desconsolidation Table Header Customization */
#masiva-preview-table th {
  background-color: #1693a5 !important;
  background-image: none !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

.masiva-validation-message {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.masiva-validation-message.is-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(220, 38, 38, 0.22);
  color: #991b1b;
}

.masiva-validation-message.is-success {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(34, 197, 94, 0.22);
  color: #166534;
}

#masiva-preview-body .masiva-preview-row-error {
  background: rgba(254, 242, 242, 0.92);
}

/* Custom styles for transparent panel headers on dark background */
#view-ajustes-materiales .panel-header h2,
#view-ajustes-bobinas .panel-header h2 {
  color: var(--theme-text-color) !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 800 !important;
}

#view-ajustes-materiales .panel-header,
#view-ajustes-bobinas .panel-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Materials / SKU catalog */
#view-ajustes-materiales {
  color: #172033;
  font-family: 'Aptos', var(--theme-font-family);
  font-weight: 400;
}

#view-ajustes-materiales * {
  font-family: 'Aptos', var(--theme-font-family) !important;
  font-weight: 400 !important;
}

.materials-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2px;
}

.materials-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 96px;
  padding: 18px 20px;
  background: #f7fafc;
  border: 1px solid #d9e3ee;
  border-left: 4px solid #1693a5;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.materials-title-block {
  display: grid;
  gap: 6px;
}

.materials-eyebrow,
.materials-card-kicker,
.materials-kpi-label {
  display: block;
  color: #637083;
  font-size: 11px;
  font-weight: 700;
}

.materials-title-block h2 {
  margin: 0;
  color: #102033;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
}

.materials-title-block p {
  max-width: 680px;
  margin: 0;
  color: #536174;
  font-size: 12px;
  line-height: 1.5;
}

.materials-hero-chip {
  display: grid;
  gap: 2px;
  min-width: 138px;
  padding: 11px 13px;
  background: #ffffff;
  border: 1px solid #d9e3ee;
  border-radius: 8px;
  text-align: right;
}

.materials-hero-chip span {
  color: #637083;
  font-size: 11px;
  font-weight: 600;
}

.materials-hero-chip strong {
  color: #0f6f7f;
  font-size: 13px;
  font-weight: 800;
}

.materials-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.materials-kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 92px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #d9e3ee;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.materials-kpi-value {
  display: block;
  margin-top: 8px;
  color: #102033;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.materials-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #0f6f7f;
  background: #e8f6f8;
  border: 1px solid #c6e5ea;
  border-radius: 8px;
}

.materials-kpi-icon.accent {
  color: #465a9f;
  background: #edf1ff;
  border-color: #d6defa;
}

.materials-kpi-icon.success {
  color: #247a55;
  background: #eaf7ef;
  border-color: #cbe8d8;
}

.materials-main-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(460px, 1.45fr);
  gap: 14px;
  align-items: start;
}

.materials-card {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d9e3ee;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.materials-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 15px 16px;
  border-bottom: 1px solid #e5edf5;
  background: #fbfcfe;
}

.materials-card-head.directory {
  align-items: flex-start;
}

.materials-card-head h3 {
  margin: 3px 0 0;
  color: #172033;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
}

.materials-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #0f6f7f;
  background: #e8f6f8;
  border: 1px solid #c6e5ea;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.materials-form {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.materials-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.materials-field {
  display: grid;
  gap: 6px;
  color: #455469;
  font-size: 11px;
  font-weight: 800;
}

#view-ajustes-materiales .materials-input.form-input,
#view-ajustes-materiales .materials-search input {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 11px;
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #c8d4e1 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

#view-ajustes-materiales .materials-input.form-input:focus,
#view-ajustes-materiales .materials-search input:focus {
  border-color: #1693a5 !important;
  box-shadow: 0 0 0 3px rgba(22, 147, 165, 0.16) !important;
}

#view-ajustes-materiales .materials-input.form-input:hover,
#view-ajustes-materiales .materials-search input:hover {
  border-color: #97a8bb !important;
}

#view-ajustes-materiales select.materials-input.form-input {
  appearance: auto;
  cursor: pointer;
}

#view-ajustes-materiales .materials-field .custom-select {
  width: 100%;
  min-height: 40px;
  color: #111827;
}

#view-ajustes-materiales .materials-field .custom-select-trigger {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  color: #111827;
  background: #ffffff;
  border: 1px solid #c8d4e1;
  border-radius: 6px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

#view-ajustes-materiales .materials-field .custom-select.open .custom-select-trigger,
#view-ajustes-materiales .materials-field .custom-select-trigger:hover {
  border-color: #1693a5;
  box-shadow: 0 0 0 3px rgba(22, 147, 165, 0.14);
}

#view-ajustes-materiales .materials-field .custom-select-options {
  color: #111827;
  background: #ffffff;
  border: 1px solid #d9e3ee;
  border-radius: 6px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

#view-ajustes-materiales .materials-field .custom-select-option {
  color: #1f2937;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

#view-ajustes-materiales .materials-field .custom-select-option:hover,
#view-ajustes-materiales .materials-field .custom-select-option.active {
  color: #0f6f7f;
  background: #e8f6f8;
}

.sku-input,
.materials-sku-code {
  font-family: 'Aptos', var(--theme-font-family);
  font-variant-numeric: tabular-nums;
}

.materials-form-feedback {
  margin: 14px 16px 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.materials-form-feedback[hidden] {
  display: none !important;
}

.materials-form-feedback.is-error {
  color: #991b1b;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.materials-form-feedback.is-success {
  color: #166534;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}

.materials-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px dashed #c8d4e1;
  border-radius: 8px;
}

.materials-preview span,
.materials-preview small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.materials-preview strong {
  color: #102033;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 400;
  font-family: 'Aptos', var(--theme-font-family);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.materials-preview small {
  grid-column: 2;
}

.materials-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  color: #ffffff;
  background: #0f6f7f;
  border: 1px solid #0f6f7f;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

#view-ajustes-materiales .materials-submit,
#view-ajustes-materiales .materials-submit * {
  color: #ffffff !important;
}

.materials-submit:hover {
  background: #0c5d6b;
  border-color: #0c5d6b;
  box-shadow: 0 10px 22px rgba(15, 111, 127, 0.22);
  transform: translateY(-1px);
}

.materials-submit:active {
  transform: translateY(0) scale(0.99);
}

.materials-submit:focus-visible,
.materials-row-action:focus-visible {
  outline: 3px solid rgba(22, 147, 165, 0.28);
  outline-offset: 2px;
}

.materials-directory-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.materials-directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 13px;
  background: #ffffff;
  border-bottom: 1px solid #e5edf5;
}

.materials-import-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.materials-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  color: #455469;
  background: #ffffff;
  border: 1px solid #cbd7e3;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.materials-tool-button.primary {
  color: #ffffff;
  background: #0f6f7f;
  border-color: #0f6f7f;
}

#view-ajustes-materiales .materials-tool-button.primary,
#view-ajustes-materiales .materials-tool-button.primary * {
  color: #ffffff !important;
}

.materials-tool-button:hover {
  color: #0f6f7f;
  background: #edf7f9;
  border-color: #87bdc6;
  transform: translateY(-1px);
}

.materials-tool-button.primary:hover {
  color: #ffffff;
  background: #0c5d6b;
  border-color: #0c5d6b;
}

.materials-tool-button:focus-visible,
.materials-clear-filters:focus-visible {
  outline: 3px solid rgba(22, 147, 165, 0.24);
  outline-offset: 2px;
}

.materials-import-feedback {
  margin: 0;
  color: #247a55;
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.materials-import-feedback[hidden] {
  display: none !important;
}

.materials-import-feedback.is-error {
  color: #9f3a32;
}

.materials-import-feedback.is-warning {
  color: #8a5a00;
}

.materials-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  color: #455469;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.materials-search {
  position: relative;
  display: block;
  width: min(280px, 42vw);
  min-width: 220px;
}

.materials-search svg {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  color: #728197;
  transform: translateY(-50%);
}

#view-ajustes-materiales .materials-search input {
  height: 34px;
  padding-left: 34px;
}

.materials-table-wrap {
  width: 100%;
  overflow: auto;
}

.materials-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: #172033;
  font-size: 12px;
}

.materials-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 13px;
  color: #536174;
  background: #f3f7fb;
  border-bottom: 1px solid #d9e3ee;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.materials-table .materials-filter-row th {
  top: 34px;
  padding: 7px 8px;
  background: #f9fbfd;
}

.materials-filter-row input {
  width: 100%;
  min-width: 100px;
  height: 30px;
  padding: 0 9px;
  color: #172033;
  background: #ffffff;
  border: 1px solid #d3deea;
  border-radius: 4px;
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 11px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.materials-filter-row input:focus {
  border-color: #1693a5;
  box-shadow: 0 0 0 3px rgba(22, 147, 165, 0.13);
}

.materials-clear-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.materials-clear-filters:hover {
  color: #0f6f7f;
  background: #e8f6f8;
}

.materials-table th:last-child {
  width: 116px;
  text-align: center;
}

.materials-table td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}

.materials-table-row {
  transition: background 0.16s ease;
}

.materials-table-row:hover {
  background: #f8fbfd;
}

.materials-table-row:focus-visible {
  outline: 2px solid rgba(15, 111, 127, 0.38);
  outline-offset: -2px;
  background: #f8fbfd;
}

.materials-audit-tooltip {
  position: fixed;
  z-index: 1000;
  display: grid;
  gap: 3px;
  min-width: 230px;
  max-width: min(300px, calc(100vw - 20px));
  padding: 11px 13px;
  color: #eaf2f7;
  background: #172533;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24);
  font-family: "Aptos", var(--theme-font-family);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.materials-audit-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.materials-audit-tooltip span {
  color: #9fb3c4;
  font-size: 10px;
  text-transform: uppercase;
}

.materials-audit-tooltip strong {
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.materials-audit-tooltip small {
  color: #c5d3df;
  font-size: 11px;
}

.materials-table td strong {
  display: block;
  color: #172033;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.materials-table td small {
  display: block;
  margin-top: 3px;
  color: #728197;
  font-size: 11px;
}

.materials-sku-code {
  display: inline;
  max-width: 220px;
  padding: 0;
  color: #172033;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.materials-pill,
.materials-unit-pill,
.materials-table-text {
  display: inline;
  align-items: center;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  white-space: nowrap;
}

.materials-pill {
  color: #334155;
  background: transparent;
  border: 0;
}

.materials-pill.type-bobina {
  color: #0f6f7f;
  background: transparent;
  border-color: transparent;
}

.materials-pill.type-caja {
  color: #8a5a00;
  background: transparent;
  border-color: transparent;
}

.materials-pill.type-madera {
  color: #7c4a1e;
  background: transparent;
  border-color: transparent;
}

.materials-pill.type-fierro {
  color: #475569;
  background: transparent;
  border-color: transparent;
}

.materials-pill.type-auto,
.materials-pill.type-camion {
  color: #255f46;
  background: transparent;
  border-color: transparent;
}

.materials-unit-pill {
  color: #374151;
  background: transparent;
  border: 0;
  font-variant-numeric: tabular-nums;
}

.materials-actions-cell {
  text-align: center;
  white-space: nowrap;
}

.materials-actions {
  display: inline-flex;
  justify-content: center;
  gap: 8px;
  vertical-align: middle;
}

.materials-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.materials-row-action:hover {
  transform: translateY(-1px);
}

.materials-row-action.edit:hover {
  color: #0f6f7f;
  background: #edf7f9;
}

.materials-row-action.danger:hover {
  color: #b42318;
  background: #fff1f0;
  border-color: transparent;
}

.materials-empty-row {
  padding: 34px 16px !important;
  text-align: center;
}

.materials-empty-row strong,
.materials-empty-row span {
  display: block;
}

.materials-empty-row strong {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.materials-empty-row span {
  margin-top: 5px;
  color: #728197;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .materials-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .materials-hero,
  .materials-card-head.directory {
    align-items: flex-start;
    flex-direction: column;
  }

  .materials-hero-chip {
    width: 100%;
    text-align: left;
  }

  .materials-kpi-grid {
    grid-template-columns: 1fr;
  }

  .materials-form-row {
    grid-template-columns: 1fr;
  }

  .materials-directory-tools,
  .materials-search {
    width: 100%;
  }

  .materials-directory-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .materials-import-feedback {
    text-align: left;
  }
}

.presence-toast {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 12px; max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px;
  box-shadow: 0 6px 24px rgba(20, 30, 45, 0.14);
  color: #1f2933; font: 400 12.5px/1.25 'Aptos', 'Segoe UI', system-ui, sans-serif;
  opacity: 0; transform: translateY(-8px) scale(.97); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.presence-toast.is-visible { opacity: 1; transform: none; }
.presence-toast .presence-dot { width: 8px; height: 8px; border-radius: 50%; background: #34a853; box-shadow: 0 0 0 4px rgba(52, 168, 83, .18); }
.presence-toast.is-out .presence-dot { background: #ea4335; box-shadow: 0 0 0 4px rgba(234, 67, 53, .16); }
.presence-toast .presence-text { display: grid; gap: 1px; min-width: 0; }
.presence-toast b { font-weight: 500; }
.presence-toast i { font-style: normal; color: #5f6b76; font-size: 11.5px; }
@media (prefers-color-scheme: dark) { .presence-toast { background: rgba(32, 36, 42, .6); border-color: rgba(255,255,255,.12); color: #e8eaed; } .presence-toast i { color: #aab2bb; } }

.system-action-text {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 1500;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: start;
  padding: 18px 16px 20px;
  background: #ffffff;
  color: #17352e;
  border: 1px solid #dce8e2;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(25, 45, 38, 0.12), 0 2px 6px rgba(25, 45, 38, 0.04);
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  overflow: hidden;
}
.system-action-text, .system-action-text * { font-weight: 400 !important; }
.system-action-text::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: #258365;
  transform-origin: left;
}
.system-action-text.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.system-action-text.is-visible::after { animation: action-notice-timeout var(--notice-duration, 5000ms) linear forwards; }
.action-notice-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e9f5ef; color: #217b5c; }
.action-notice-copy { min-width: 0; }
.action-notice-title { display: block; color: #17352e; font-size: 15px; line-height: 1.4; margin-bottom: 4px; }
.action-notice-message { display: block; color: #61716b; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.action-notice-close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #75867d; cursor: pointer; padding: 0; }
.action-notice-close:hover { background: #f0f5f2; color: #17352e; }
.action-notice-close:focus-visible { outline: 2px solid #258365; outline-offset: 2px; }
@keyframes action-notice-timeout { to { transform: scaleX(0); } }
@media (max-width: 600px) { .system-action-text { top: 76px; right: 16px; } }
@media (prefers-reduced-motion: reduce) { .system-action-text { transition: none; transform: none; } .system-action-text.is-visible::after { animation: none; } }

#sys-confirm-btn-cancel:focus,
#sys-confirm-btn-action:focus {
  outline: 3px solid rgba(15, 111, 127, 0.32);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px #0f6f7f;
}

/* Registro Documental: guías de despacho PDF */
.doc-guide-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-guide-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 12px;
  font-weight: 400;
}

.doc-guide-action-cell {
  min-width: 92px;
  text-align: center;
  white-space: nowrap;
}

.doc-guide-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 30px;
  min-height: 30px;
  padding: 4px 6px;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.doc-guide-action:hover,
.doc-guide-action:focus-visible {
  color: #0f6f7f;
  background: #edf7f9;
  outline: none;
}

.doc-guide-action.has-file {
  color: #c62828;
}

.doc-guide-action.has-file:hover,
.doc-guide-action.has-file:focus-visible {
  color: #a31313;
  background: #fff1f0;
}

.dispatch-guide-upload-modal {
  width: 520px;
  max-width: calc(100vw - 32px);
  border-radius: 8px !important;
}

.dispatch-guide-preview-modal {
  width: min(1120px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  border-radius: 8px !important;
}

.dispatch-guide-upload-modal .wms-modal-header h2,
.dispatch-guide-preview-modal .wms-modal-header h2 {
  color: #172033 !important;
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 14px !important;
  font-weight: 400 !important;
  letter-spacing: 0;
}

.dispatch-guide-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.dispatch-guide-close:hover,
.dispatch-guide-close:focus-visible {
  color: #172033;
  background: #eef2f6;
  outline: none;
}

.modal-white-glass .dispatch-guide-upload-body {
  padding: 20px !important;
  text-align: left !important;
}

.dispatch-guide-upload-body .form-group {
  margin-bottom: 16px;
}

.dispatch-guide-upload-body label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-family: 'Aptos', var(--theme-font-family);
  font-size: 12px;
  font-weight: 400;
}

.dispatch-guide-upload-body small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.dispatch-guide-file-input {
  min-height: 42px;
  padding: 8px 10px;
  color: #334155 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

.dispatch-guide-file-input::file-selector-button {
  margin-right: 10px;
  padding: 6px 10px;
  color: #0f6f7f;
  background: #edf7f9;
  border: 0;
  border-radius: 4px;
  font-family: 'Aptos', var(--theme-font-family);
  cursor: pointer;
}

.dispatch-guide-feedback {
  min-height: 18px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.dispatch-guide-feedback.error {
  color: #b42318;
}

.dispatch-guide-feedback.loading {
  color: #0f6f7f;
}

.modal-white-glass .dispatch-guide-preview-body {
  padding: 0 !important;
  background: #dfe5eb;
}

.dispatch-guide-frame {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  min-height: 480px;
  background: #ffffff;
  border: 0;
}

.dispatch-guide-modal-footer {
  align-items: center;
  padding: 12px 16px;
  background: #ffffff;
  border-top-color: #e2e8f0;
}

.modal-white-glass .dispatch-guide-modal-footer .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  margin: 0 !important;
  font-family: 'Aptos', var(--theme-font-family);
  font-weight: 400;
}

.modal-white-glass .dispatch-guide-modal-footer .btn-primary {
  color: #ffffff !important;
  background: #0f6f7f !important;
}

@media (max-width: 720px) {
  .doc-guide-header-actions,
  .doc-guide-upload-button {
    width: 100%;
  }

  .dispatch-guide-preview-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  .dispatch-guide-frame {
    min-height: 60vh;
  }
}

/* Encabezado institucional común para todas las tablas. */
#wms-app table > thead > tr:first-child > th {
  color: #ffffff !important;
  background-color: #0060ab !important;
  background-image: none !important;
  border-bottom-color: #004f8d !important;
}
/* ==========================================================================
   MODERNO MODULO DE GESTIÓN Y CREACIÓN DE USUARIOS (ZERO WMS RBAC)
   ========================================================================== */

.user-management-view {
  background: #f8fafc;
  color: #061733;
  min-height: calc(100vh - 55px);
  padding: 24px 30px;
  box-sizing: border-box;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.user-management-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.user-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.user-breadcrumb-sep {
  color: #cbd5e1;
}

.user-breadcrumb .current {
  color: #0060ab;
}

.user-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.user-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  font-weight: 400;
}

.user-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-status-badge {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 500;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  letter-spacing: 0.04em;
}

.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.user-header-new-btn {
  background: #0060ab;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 96, 171, 0.25);
  transition: all 0.2s ease;
}

.user-header-new-btn span,
.user-header-new-btn * {
  color: #ffffff !important;
}

.user-header-new-btn:hover {
  background: #004f8d;
  transform: translateY(-1px);
}

.user-header-new-btn svg {
  width: 15px;
  height: 15px;
  stroke: #ffffff !important;
  color: #ffffff !important;
}

/* KPIs Bar */
.user-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.user-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.user-kpi-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-kpi-icon-wrap svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
}

.user-kpi-icon-wrap.kpi-blue {
  background: #eff6ff;
  color: #2563eb;
}

.user-kpi-icon-wrap.kpi-emerald {
  background: #ecfdf5;
  color: #059669;
}

.user-kpi-icon-wrap.kpi-purple {
  background: #f5f3ff;
  color: #7c3aed;
}

.user-kpi-icon-wrap.kpi-amber {
  background: #fffbeb;
  color: #d97706;
}

.user-kpi-info {
  display: flex;
  flex-direction: column;
}

.user-kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-kpi-value {
  font-size: 24px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.1;
  margin-top: 2px;
}

/* Card Principal de Formulario */
.user-form-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 26px 30px;
  margin-bottom: 28px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.user-card-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0060ab, #0284c7);
  color: #ffffff !important;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff !important;
  color: #ffffff !important;
}

.user-card-title-block h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.user-card-title-block p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}

.user-edit-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-edit-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  animation: userPulse 1.5s infinite;
}

@keyframes userPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.user-edit-cancel-btn {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.user-edit-cancel-btn:hover {
  background: #dbeafe;
}

/* Secciones del formulario */
.user-form-section {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px dashed #e2e8f0;
}

.user-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 16px;
  padding-bottom: 0;
}

.user-section-header {
  margin-bottom: 18px;
}

.user-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-section-step {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #0060ab;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-section-step span,
.user-section-step * {
  color: #ffffff !important;
}

.user-section-title-wrap h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.user-section-title-wrap p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
}

/* Grids */
.user-form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.user-form-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* Campos de formulario */
.user-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-field-group label {
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.required-star {
  color: #ef4444;
  font-weight: 900;
}

.user-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.user-input-prefix {
  position: absolute;
  left: 12px;
  font-size: 13px;
  font-weight: 800;
  color: #94a3b8;
  pointer-events: none;
}

.user-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.user-input,
.user-select {
  width: 100%;
  height: 42px;
  padding-left: 36px;
  padding-right: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.user-input:focus,
.user-select:focus {
  outline: none;
  border-color: #0060ab;
  box-shadow: 0 0 0 3px rgba(0, 96, 171, 0.14);
}

.user-input:disabled {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.user-password-toggle-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
}

.user-password-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.user-password-toggle-btn:hover {
  color: #0f172a;
}

#user-password {
  padding-right: 44px;
}

.user-password-toggle-btn,
.user-table-password-toggle {
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
}

.user-password-toggle-btn:focus-visible,
.user-table-password-toggle:focus-visible {
  outline: 2px solid #0060ab;
  outline-offset: 2px;
}

.user-password-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 124px;
}

.user-password-value {
  font-family: monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 220px;
}

.user-table-password-toggle {
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #0060ab;
  cursor: pointer;
}

.user-table-password-toggle:disabled {
  color: #94a3b8;
  cursor: help;
}

.user-field-hint {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.3;
}

.user-role-summary-pill {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  padding: 5px 10px;
  border-radius: 6px;
  line-height: 1.4;
}

/* ==================== MATRIZ DE PERMISOS (RBAC) ==================== */
.user-access-editor {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
}

.user-access-heading-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.user-access-title-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-access-title-block strong {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
}

.user-access-mode-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
}

.user-access-mode-badge.badge-inherited {
  background: #0284c7;
  color: #ffffff !important;
  border: 1px solid #0284c7;
}

.user-access-mode-badge.badge-custom {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.user-access-toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-access-custom-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
}

.user-access-custom-switch input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0060ab;
  cursor: pointer;
}

.user-access-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.user-quick-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.user-quick-btn svg {
  width: 13px;
  height: 13px;
}

.user-quick-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.user-access-groups-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.user-access-cat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.user-access-cat-card.cat-maritimo { border-top: 3px solid #0284c7; }
.user-access-cat-card.cat-terrestre { border-top: 3px solid #0056b3; }
.user-access-cat-card.cat-admin { border-top: 3px solid #475569; }
.user-access-cat-card.cat-apk { border-top: 3px solid #d97706; }

.user-access-cat-header {
  padding: 10px 12px;
  background: #fafafa;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-access-cat-title {
  font-size: 12px;
  font-weight: 500;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-access-cat-title svg {
  width: 14px;
  height: 14px;
}

.user-access-cat-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
}

.user-access-cat-toggle {
  font-size: 10px;
  font-weight: 700;
  color: #0060ab;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.user-access-cat-options {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}

.user-access-cat-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  transition: background 0.12s;
  line-height: 1.35;
}

.user-access-cat-options label:hover {
  background: #f8fafc;
}

.user-access-cat-options input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  accent-color: #0060ab;
  cursor: pointer;
}

.user-access-footer-bar {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  flex-wrap: wrap;
  gap: 10px;
}

/* Botones de acción del formulario */
.user-form-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
}

.user-btn-save {
  background: #0060ab;
  color: #ffffff;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 96, 171, 0.25);
  transition: all 0.2s ease;
}

.user-btn-save:hover {
  background: #004f8d;
  transform: translateY(-1px);
}

.user-btn-save svg {
  width: 15px;
  height: 15px;
}

.user-btn-clean {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 10px;
  font-weight: 400;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.user-btn-clean:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.user-btn-clean svg {
  width: 14px;
  height: 14px;
}

/* ==================== DIRECTORIO DE USUARIOS ==================== */
.user-directory-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.user-directory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.user-directory-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-directory-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-directory-icon svg {
  width: 18px;
  height: 18px;
}

.user-directory-title-block h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
}

.user-directory-title-block p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}

.user-count-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
}

.user-table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.user-search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.user-filter-input {
  height: 36px;
  padding-left: 32px;
  padding-right: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  width: 250px;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.15s;
}

.user-filter-input:focus {
  outline: none;
  border-color: #0060ab;
  box-shadow: 0 0 0 3px rgba(0, 96, 171, 0.12);
}

.user-filter-select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
}

.user-filter-select:focus {
  outline: none;
  border-color: #0060ab;
}

/* Tabla de usuarios */
.user-table-responsive {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.user-modern-table {
  width: 100%;
  border-collapse: collapse;
}

.user-modern-table th {
  background: #0060ab !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  padding: 12px 14px !important;
  border: none !important;
}

.user-modern-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.user-modern-table td,
.user-modern-table td * {
  font-weight: 400 !important;
}

.user-modern-table .action-btn-circle {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  padding: 0;
}

.user-modern-table .action-btn-circle svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  pointer-events: none;
}

.user-modern-table .action-btn-circle.action-roles {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.user-modern-table .action-btn-circle.action-edit {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.user-modern-table .action-btn-circle.action-delete {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.user-modern-table .action-btn-circle:focus-visible {
  outline: 2px solid #0060ab;
  outline-offset: 2px;
}

.user-modern-table tbody tr:hover {
  background: #f8fafc;
}

.user-cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0060ab, #0284c7);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-cell-meta {
  display: flex;
  flex-direction: column;
}

.user-cell-login {
  font-weight: 800;
  color: #0f172a;
}

.user-cell-sub {
  font-size: 11px;
  color: #64748b;
}

.badge-role-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.badge-role-admin {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-role-operador {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-role-supervisor {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-role-default {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.user-modern-table .badge-role-pill {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: normal;
}

.badge-apk-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-apk-active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-apk-inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.action-btn-circle {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #475569;
  margin-left: 4px;
}

.action-btn-circle svg {
  width: 14px;
  height: 14px;
}

.action-btn-circle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.action-btn-circle.action-edit:hover {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.action-btn-circle.action-roles:hover {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.action-btn-circle.action-delete:hover {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

@media (max-width: 1200px) {
  .user-kpis-grid { grid-template-columns: repeat(2, 1fr); }
  .user-form-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .user-form-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .user-access-groups-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .user-management-view { padding: 16px; }
  .user-kpis-grid { grid-template-columns: 1fr; }
  .user-form-grid-4 { grid-template-columns: 1fr; }
  .user-form-grid-5 { grid-template-columns: 1fr; }
  .user-access-groups-grid { grid-template-columns: 1fr; }
  .user-card-header { flex-direction: column; align-items: flex-start; }
  .user-table-controls { width: 100%; }
  .user-filter-input { width: 100%; }
}
.user-access-help {
  margin: 12px 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}
.role-inheritance-summary {
  grid-column: 1 / -1;
  min-width: 0;
}
.role-assignment-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  max-width: 620px;
}
.role-assignment-control > select,
.role-assignment-control > .custom-select {
  flex: 0 1 300px;
  min-width: 0;
  max-width: 100%;
}
.role-assignment-control .custom-select-trigger {
  min-height: 36px;
}
.role-assignment-control .custom-select-trigger > span {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
}
.role-assignment-control > .role-quick-btn {
  min-height: 36px;
}
.no-access-notice {
  max-width: 640px;
  margin: 40px auto;
  padding: 28px;
}
.no-access-notice p {
  margin: 14px 0 22px;
  line-height: 1.6;
}

/* Transporte remains a single standby screen until modules are defined. */
.wms-app.panel-transporte .maritimo-only,
.wms-app:not(.panel-transporte) .transporte-only { display: none !important; }
.transporte-standby { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 48px 24px; text-align: center; color: #334155; }
.transporte-standby-icon { width: 56px; height: 56px; color: #64748b; }
.transporte-standby h1 { margin: 0; font-size: 30px; font-weight: 500; }
.transporte-standby-status { padding: 6px 14px; border: 1px solid #cbd5e1; border-radius: 20px; background: #f8fafc; color: #475569; font-size: 13px; }
.transporte-standby p { max-width: 420px; margin: 0; color: #64748b; line-height: 1.6; }

/* Separate operational panels; preserve the maritime shell. */
.wms-app.panel-terrestre .maritimo-only,
.wms-app:not(.panel-terrestre) .terrestre-only {display:none!important;}
@media (min-width:1100px){.user-form-grid-5:has(#user-panel){grid-template-columns:repeat(3,minmax(0,1fr));}}

.user-panel-options { display:flex; flex-wrap:wrap; gap:10px 18px; padding:10px 12px; border:1px solid #d1d5db; border-radius:6px; min-height:38px; background:#fff; }
.user-panel-options label { display:flex !important; align-items:center; gap:7px; margin:0 !important; font-weight:400 !important; cursor:pointer; }
.user-panel-options input { accent-color:#0065ad; width:16px; height:16px; margin:0; }

/* Let the embedded Terrestre shell fill the available page below the top bar. */
.wms-app.panel-terrestre .content-area:has(#view-terrestre-wms[style*="display: block"]) {
  padding: 0;
  overflow: hidden;
}
.wms-app.panel-terrestre #view-terrestre-wms {
  height: 100%;
  margin: 0;
}
.wms-app.panel-terrestre #terrestre-wms-frame {
  display: block;
  height: 100% !important;
  min-height: 0 !important;
}
/* Shared sync and touch layouts */
.mobile-navigation-toggle { display:none; }
@media (max-width: 1024px) {
  .wms-app { height:100dvh; }
  .main-workspace, .content-area { min-height:0; min-width:0; }
  .top-bar { min-height:48px; height:auto; flex-shrink:0; padding:6px 12px; gap:8px; flex-wrap:wrap; }
  .top-bar-center { display:none; }
  .top-bar-left, .top-bar-right { min-width:0; flex:1 1 auto; }
  .top-bar-site { overflow:hidden; text-overflow:ellipsis; max-width:35vw; white-space:nowrap; }
  .sidebar { flex-shrink:0; height:50px; }
  .mobile-navigation-toggle { display:inline-flex; align-items:center; gap:10px; min-height:44px; padding:8px 16px; color:white; background:transparent; border:0; font:inherit; cursor:pointer; }
  .sidebar > .sidebar-menu { display:none !important; position:absolute; top:100%; left:0; width:min(360px,100vw); height:auto; max-height:calc(100dvh - 110px); overflow:auto; flex-direction:column; align-items:stretch; padding:8px; background:var(--sidebar-bg); border:1px solid var(--border-color); }
  .sidebar.mobile-navigation-open > .sidebar-menu { display:flex !important; }
  .sidebar-menu > li { width:100%; }
  .sidebar-menu .menu-item, .sidebar-menu .submenu-item { min-height:44px; white-space:normal; }
  .sidebar-menu .submenu-list, .sidebar-menu .submenu-list .submenu-list { position:static !important; width:100%; min-width:0; margin:0; box-shadow:none; }
  .sidebar-menu .submenu-list.expanded { max-height:none; overflow:visible; }
  .sidebar-profile { margin-left:auto; max-width:55vw; padding:0 12px; }
  .content-area { padding:16px; }
  .content-area .wms-table-container, .user-table-responsive, .table-responsive { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .content-area .form-grid, .content-area .terrestre-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .content-area .dashboard-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .content-area input, .content-area select, .content-area textarea { max-width:100%; min-height:44px; }
  .content-area button, .content-area .btn { min-height:44px; }
  .slide-up-panel { padding:16px; }
}
@media (max-width: 600px) {
  .top-bar { align-items:center; }
  .top-bar-left { flex-basis:100%; }
  .top-bar-right { width:100%; justify-content:space-between; gap:8px; }
  .top-bar-site { max-width:75vw; }
  .clock-widget { font-size:10px; }
  .top-bar-greeting { display:none; }
  .content-area { padding:12px; }
  .content-area .dashboard-grid, .content-area .form-grid, .content-area .terrestre-form-grid, .content-area .terrestre-form-grid-compact { grid-template-columns:minmax(0,1fr); }
  .content-area .panel-header, .content-area .view-header { flex-wrap:wrap; gap:12px; }
  .content-area .panel-card { padding:14px; min-width:0; }
  .login-screen { padding:16px; overflow-y:auto; }
  .login-box { width:100%; max-width:420px; padding:24px 18px; margin:auto; }
  .login-box input, .login-box select { font-size:16px; min-height:44px; }
  .modal-content, .modal-box { max-width:calc(100vw - 24px) !important; max-height:90dvh; overflow:auto; }
  .wms-app input, .wms-app select, .wms-app textarea { font-size:16px; }
}
@media(max-width:600px) {
  .wms-modal { max-width:calc(100vw - 24px) !important; max-height:90dvh; overflow:auto; }
}

/* Requested regular typography for administration and commercial masters. */
#view-ajustes-roles, #view-ajustes-roles *,
#view-ajustes-clientes, #view-ajustes-clientes *,
#view-ajustes-proveedores, #view-ajustes-proveedores * {
  font-weight: 400 !important;
}
/* Activity action keeps its semantic text color without a badge. */
#view-ajustes-movimientos .movement-status {
  display: inline;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  font-weight: 400 !important;
}

/* Login validation must appear above the login screen. */
.permission-module { min-width: 0; margin-bottom: 12px; }
.permission-module[hidden] { display: none !important; }
.permission-module-heading { display: flex; align-items: center; gap: 9px; padding: 11px 10px; background: var(--bg-hover, #f1f5f9); border-bottom: 1px solid rgba(148,163,184,.25); border-radius: 5px 5px 0 0; cursor: pointer; color: var(--text-primary, #1f2937); }
.permission-module-heading input { accent-color: var(--accent-purple); flex-shrink: 0; margin: 0; width: 15px; height: 15px; }
.permission-module-heading span { flex: 1; font-size: 12px; }
.permission-module-heading small { font-size: 11px; color: var(--text-secondary, #64748b); font-variant-numeric: tabular-nums; }
.permission-module > .role-permission-row,
.permission-module > .modal-role-permission-row { margin: 0 0 0 17px; border: 0; border-left: 1px solid rgba(148,163,184,.3); border-radius: 0; background: transparent; padding: 10px 12px; }
.permission-module > .role-permission-row:hover,
.permission-module > .modal-role-permission-row:hover { background: var(--bg-hover, #f8fafc); }
.permission-module-heading:focus-within,
.permission-module > label:focus-within { outline: 2px solid var(--accent-purple); outline-offset: 2px; }
.permission-module .role-permission-row strong,
.permission-module .modal-role-permission-row strong { font-size: 11px; line-height: 1.45; }

#modal-sys-notification { z-index: 1100; }

/* Regular dashboard typography, including dynamic KPIs and charts. */
#view-dashboard, #view-dashboard * { font-weight: 400 !important; }
.segmentation-header { display:flex; justify-content:space-between; gap:20px; align-items:center; margin-bottom:22px; }
.segmentation-header h2, .segmentation-dialog h2 { color:#1B0642; font-size:22px; font-weight:400; margin:6px 0; }
.segmentation-header p, .segmentation-dialog header p { color:#64748b; font-size:12px; }
.segmentation-panel-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:20px; }
.segmentation-panel-tabs button { display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:18px; border:1px solid #dce2ed; border-radius:8px; background:white; color:#334155; cursor:pointer; font-size:14px; font-weight:400; }
.segmentation-panel-tabs button[aria-pressed="true"] { background:#eef4fa; border-color:#0060ab; color:#0060ab; }
.segmentation-panel-tabs small { font-size:11px; }
.segmentation-filters, .segmentation-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.segmentation-filters { margin:20px 0; }
.segmentation-filters label, .segmentation-form-grid label, .segmentation-responsibilities { display:flex; flex-direction:column; gap:7px; color:#475569; font-size:12px; }
.segmentation-site-group { background:white; padding:20px; border:1px solid #e2e8f0; border-radius:8px; margin-bottom:16px; }
.segmentation-site-group h3 { color:#334155; font-size:14px; font-weight:400; margin-bottom:16px; display:flex; justify-content:space-between; gap:12px; }
.segmentation-site-group h3 small { color:#64748b; font-size:11px; }
.segmentation-users { display:flex; flex-direction:column; }
.segmentation-list-heading, .segmentation-user { display:grid; grid-template-columns:minmax(160px,1.4fr) minmax(135px,1fr) minmax(110px,1fr) minmax(100px,.9fr) minmax(145px,1fr); align-items:center; gap:16px; padding:12px 10px; }
.segmentation-list-heading { color:#64748b; font-size:11px; border-bottom:1px solid #e2e8f0; }
.segmentation-user { width:100%; min-height:62px; text-align:left; background:transparent; border:0; border-bottom:1px solid #e2e8f0; border-radius:0; color:#334155; cursor:pointer; font-size:12px; font-weight:400; overflow-wrap:anywhere; }
.segmentation-user:last-child { border-bottom:0; }
.segmentation-user-identity { display:flex; flex-direction:column; gap:4px; font-size:13px; }
.segmentation-user small { color:#64748b; font-size:11px; }
.segmentation-user-action { color:#0060ab; font-size:11px; text-align:right; }
.segmentation-list-heading span:last-child { text-align:right; }
.segmentation-user:hover { background:#f0f6fb; }
@media(max-width:1100px) {
  .segmentation-list-heading, .segmentation-user { grid-template-columns:minmax(130px,1.3fr) minmax(100px,1fr) minmax(85px,1fr) minmax(85px,.9fr) minmax(110px,1fr); gap:10px; padding:12px 6px; }
}
@media(max-width:800px) {
  .segmentation-list-heading { display:none; }
  .segmentation-user { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; padding:14px 0; }
  .segmentation-user-identity { grid-column:1 / -1; }
  .segmentation-user-detail::before { content:attr(data-label); display:block; color:#64748b; font-size:10px; margin-bottom:3px; }
  .segmentation-user-action { align-self:end; }
}
.segmentation-assignment-note, .segmentation-empty { font-size:12px; color:#475569; padding:14px; background:#f1f5f9; border-radius:6px; margin-top:16px; line-height:1.6; }
.user-job-fields { margin-bottom:20px; }
.segmentation-dialog { width:min(820px,calc(100vw - 32px)); max-height:88dvh; margin:auto; padding:24px; border:1px solid #e2e8f0; border-radius:12px; background:white; color:#334155; overflow:auto; z-index:1200; }
.segmentation-dialog::backdrop { background:rgba(15,23,42,.58); }
.segmentation-dialog header, .segmentation-dialog footer { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.segmentation-dialog header { padding-bottom:20px; margin-bottom:20px; border-bottom:1px solid #e2e8f0; }
.segmentation-dialog header button { background:none; border:0; font-size:26px; color:#64748b; cursor:pointer; }
.segmentation-dialog fieldset { border:0; min-width:0; }
.segmentation-dialog .form-input { width:100%; background:#fff; border-color:#cbd5e1; color:#334155; font-size:12px; }
.segmentation-dialog h3 { color:#334155; font-size:14px; font-weight:400; margin-top:22px; }
.segmentation-responsibilities { margin-top:16px; }
.segmentation-help { color:#64748b; font-size:12px; margin:8px 0 16px; }
.segmentation-function-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.segmentation-function-groups section { background:#f8fafc; padding:14px; border-radius:6px; }
.segmentation-function-groups h4 { font-size:12px; font-weight:400; color:#334155; margin-bottom:12px; }
.segmentation-function-groups label { display:flex; align-items:center; gap:8px; margin:10px 0; font-size:12px; }
.segmentation-function-groups input { accent-color:#0060ab; }
.segmentation-dialog footer { justify-content:flex-end; border-top:1px solid #e2e8f0; padding-top:18px; margin-top:20px; }
#segmentation-editor-error { color:#b91c1c; font-size:12px; margin-top:12px; }
.segmentation-user:focus-visible, .segmentation-panel-tabs button:focus-visible { outline:2px solid #0060ab; outline-offset:3px; }
@media(max-width:600px) { .segmentation-panel-tabs, .segmentation-form-grid, .segmentation-filters, .segmentation-function-groups { grid-template-columns:1fr; } .segmentation-dialog { padding:16px; } .segmentation-header { align-items:flex-start; } }
/* Job catalog actions alongside the user assignment field. */
.user-job-editor { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.user-job-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 4px; }
.user-job-actions button { border: 0; background: transparent; color: #0369a1; padding: 3px 0; font: inherit; font-weight: 400; cursor: pointer; }
.user-job-actions #job-title-delete { color: #b91c1c; }
.user-job-actions button:disabled { color: #94a3b8; cursor: default; }
.user-job-actions button:focus-visible { outline: 2px solid #0369a1; outline-offset: 4px; }
.job-title-dialog { width: min(460px, calc(100vw - 32px)); box-sizing: border-box; max-height: calc(100vh - 32px); overflow-y: auto; border: 1px solid #dbe3eb; border-radius: 12px; padding: 24px; color: #334155; background: white; font: 13px/1.5 Calibri, Arial, sans-serif; }
.job-title-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.job-title-dialog { position: fixed; inset: auto; margin: 0; }
.job-title-dialog h2 { cursor: move; touch-action: none; user-select: none; padding: 24px 24px 10px; margin: -24px -24px 0 !important; }
.job-title-dialog input { display: block; min-height: 36px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #334155; padding: 8px 10px; }
.job-title-dialog h2 { margin: 0 0 10px; font-size: 20px; font-weight: 400; color: #0f172a; }
.job-title-dialog label { display: block; margin: 16px 0 6px; font-weight: 400; }
.job-title-dialog input { box-sizing: border-box; width: 100%; }
.job-title-dialog #job-title-error { color: #b91c1c; min-height: 20px; }
.job-title-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 18px; }
.job-title-dialog-actions button { border: 0; background: transparent; color: #0369a1; font: inherit; padding: 5px 0; cursor: pointer; }
.job-title-dialog-actions button:disabled { opacity: .5; cursor: wait; }
/* Parameters: compact, readable workspace settings. */
#view-ajustes-parametros > .panel-card { max-width: 1280px; margin: 0 auto; padding: 32px; border: 1px solid #e5e9ef; border-radius: 14px; box-shadow: none; background: #fff; }
#view-ajustes-parametros, #view-ajustes-parametros * { font-weight: 400; }
#view-ajustes-parametros .panel-header { padding: 0 0 26px; margin-bottom: 0; border-bottom: 1px solid #e5e9ef; }
#view-ajustes-parametros .panel-header h2 { font-size: 27px; letter-spacing: -.7px; line-height: 1.3; margin: 8px 0; color: #162b3c; }
.param-eyebrow { color: #667684; font-size: 11px; letter-spacing: .07em; }
.param-intro { margin: 0; color: #71808d; font-size: 13px; }
.parameters-form { display: flex; flex-direction: column; gap: 0; }
.param-section { padding: 28px 0; border-bottom: 1px solid #e5e9ef; min-width: 0; }
.param-section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.param-section-number { color: #1f6f89; font-size: 12px; padding-top: 4px; font-variant-numeric: tabular-nums; }
#view-ajustes-parametros h3 { font-size: 16px; margin: 0 0 5px; color: #203645; letter-spacing: -.2px; }
.param-section-heading p, .param-shortcut p { margin: 0; color: #788693; font-size: 12px; line-height: 1.6; }
.param-appearance-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
#view-ajustes-parametros label { display: block; text-transform: none; letter-spacing: 0; color: #405564; font-size: 12px; margin-bottom: 9px; line-height: 1.5; }
#view-ajustes-parametros .form-input { border: 1px solid #dce3e9; background: #fff; border-radius: 7px; color: #203645 !important; font: inherit; font-size: 13px; min-height: 42px; padding: 10px 12px; width: 100%; min-width: 0; box-sizing: border-box; box-shadow: none; }
#view-ajustes-parametros .form-input:focus-visible { outline: 2px solid #2e97b7; outline-offset: 2px; }
#view-ajustes-parametros .form-group { margin: 0; min-width: 0; }
#view-ajustes-parametros small { display: block; font-size: 11px; color: #7a8893; line-height: 1.5; margin-top: 8px; }
.param-count { float: right; color: #1f6f89; font-size: 11px; }
#view-ajustes-parametros .param-font-select { margin-top: 10px; height: 176px; padding: 5px; }
.param-font-select option { padding: 8px 10px; border-radius: 4px; }
.param-type-preview { background: #f4f7f7; border-radius: 10px; padding: 19px 23px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.param-preview-top { display: flex; justify-content: space-between; gap: 12px; color: #7a8893; font-size: 11px; }
#param-font-name { color: #1f6f89; }
#param-type-sample { line-height: 1.3; overflow-wrap: anywhere; }
.param-sample-symbol { font-size: 44px; letter-spacing: -2px; display: block; margin: 12px 0 4px; }
#param-type-sample p { font-size: 20px; margin: 0 0 9px; letter-spacing: -.3px; }
#param-type-sample small { color: inherit; opacity: .7; }
.param-sample-numbers { font-size: 12px; margin-top: 9px; opacity: .65; }
.param-color-control { display: flex; align-items: center; gap: 10px; padding-top: 14px; margin-top: 14px; border-top: 1px solid #dde5e5; }
#view-ajustes-parametros .param-color-control label { margin: 0 auto 0 0; }
#view-ajustes-parametros #param-color { width: 34px; min-height: 30px; height: 30px; padding: 3px; cursor: pointer; }
.param-color-control output { font-size: 11px; color: #5c6f7c; font-variant-numeric: tabular-nums; }
.param-fields-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.param-inline-field { display: flex; align-items: center; gap: 12px; }
#view-ajustes-parametros .param-text-action { padding: 7px 0; border: 0; background: none; color: #1f6f89; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; text-transform: none; }
.param-text-action:hover { text-decoration: underline; }
.param-text-action:focus-visible { outline: 2px solid #2e97b7; outline-offset: 4px; }
.param-upload-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
#view-ajustes-parametros input[type=file] { font-size: 11px; padding: 9px; }
#view-ajustes-parametros input[type=file]::file-selector-button { border: 0; background: #eaf2f1; color: #1f6f89; border-radius: 4px; padding: 7px 10px; margin-right: 8px; cursor: pointer; font: inherit; }
.param-size-grid { display: grid; grid-template-columns: 200px 200px minmax(0,1fr); gap: 18px; align-items: end; margin: 24px 0; }
.param-size-grid p { color: #7a8893; font-size: 11px; line-height: 1.6; margin: 0 0 10px; }
.param-preview-heading { font-size: 12px; color: #405564; margin: 24px 0 12px; }
#view-ajustes-parametros .icon-preview-board { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
#view-ajustes-parametros .browser-tab-preview, #view-ajustes-parametros .desktop-icon-preview { border: 1px solid #e3e9ed; border-radius: 9px; box-shadow: none; background: #f4f7f8; min-width: 0; }
#view-ajustes-parametros .browser-tab-strip { background: #dbe4e8; padding: 8px 12px; }
#view-ajustes-parametros .browser-dot { background: #97a9b4; width: 6px; height: 6px; }
#view-ajustes-parametros .browser-tab-active { font-size: 10px; box-shadow: none; width: 100%; padding: 8px; box-sizing: border-box; }
#view-ajustes-parametros .browser-tab-active img { max-width: 48px; max-height: 48px; }
#view-ajustes-parametros .browser-tab-active span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-ajustes-parametros .browser-address-preview { font-size: 9px; overflow: hidden; white-space: nowrap; }
#view-ajustes-parametros .browser-favicon-zoom-preview { background: #f3f7f7; min-height: 99px; padding: 13px; }
#view-ajustes-parametros .browser-favicon-zoom-preview span { font-size: 9px; letter-spacing: 0; text-transform: none; }
#view-ajustes-parametros .desktop-wallpaper-preview { min-height: 228px; height: 228px; padding: 16px; box-sizing: border-box; background: #eef3f4 !important; overflow: hidden; }
#view-ajustes-parametros .desktop-icon-tile { color: #385364; text-shadow: none; font-size: 10px; }
#view-ajustes-parametros .desktop-icon-tile img { max-width: 100%; max-height: 180px; filter: none; }
#view-ajustes-parametros .browser-favicon-zoom-preview img { max-width: 100%; max-height: 90px; filter: none; }
#view-ajustes-parametros .desktop-icon-meta { background: #fff; color: #405564; font-size: 11px; min-height: 43px; box-sizing: border-box; }
#view-ajustes-parametros .desktop-icon-meta span { color: #7a8893; font: inherit; font-size: 10px; }
.param-shortcut { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; }
.param-save-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 20px; border-radius: 9px; background: #f0f5f4; }
.param-save-bar span { font-size: 12px; color: #687c7b; }
#view-ajustes-parametros .param-save-bar button { background: #1f6f89; border: 0; color: #fff; border-radius: 6px; padding: 12px 22px; font-size: 12px; text-transform: none; box-shadow: none; }
#view-ajustes-parametros .security-controls-card { margin-top: 26px; padding: 20px; box-shadow: none; border: 1px solid #e5e9ef; background: #f9fafb; border-radius: 9px; }
#view-ajustes-parametros .security-controls-card h3 { font-size: 14px; }
#view-ajustes-parametros .security-controls-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 24px; }
@media(max-width:1000px) { #view-ajustes-parametros > .panel-card { padding: 22px; } .param-upload-grid, #view-ajustes-parametros .icon-preview-board { grid-template-columns: repeat(2,minmax(0,1fr)); } .param-size-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .param-size-grid p { grid-column: 1/-1; } }
@media(max-width:640px) { #view-ajustes-parametros > .panel-card { padding: 18px; } #view-ajustes-parametros .panel-header h2 { font-size: 23px; } .param-appearance-grid,.param-fields-grid,.param-upload-grid,#view-ajustes-parametros .icon-preview-board,#view-ajustes-parametros .security-controls-list { grid-template-columns: minmax(0,1fr); } .param-shortcut,.param-save-bar { align-items: flex-start; flex-direction: column; } .param-inline-field { flex-wrap: wrap; } .param-section { padding: 24px 0; } .param-size-grid { gap: 12px; } }
#view-ajustes-parametros #param-type-sample, #view-ajustes-parametros #param-type-sample * { color: var(--param-sample-color, #111827) !important; }
#view-ajustes-parametros .param-font-select { appearance: auto; background-image: none; }
.param-font-size-control { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e5e9ef; }
.param-font-size-inputs { display: flex; align-items: center; gap: 12px; }
.param-font-size-inputs input[type=range] { flex: 1; min-width: 40px; accent-color: #1f6f89; cursor: pointer; }
#view-ajustes-parametros #param-font-size { width: 74px; flex: 0 0 74px; }
.param-font-size-inputs span { color: #6b7b87; font-size: 12px; }
#view-ajustes-parametros #param-type-sample p { font-size: calc(var(--param-preview-size, 13px) * 1.55); }
#view-ajustes-parametros #param-type-sample small, #view-ajustes-parametros .param-sample-numbers { font-size: var(--param-preview-size, 13px); }
#view-ajustes-parametros .param-sample-symbol { font-size: calc(var(--param-preview-size, 13px) * 3.4); }

/* Readable navigation with regular type and solid submenu surfaces. */
.sidebar :is(.menu-category, .menu-item, .menu-item-left, .menu-item-left span, .submenu-item, .submenu-item span, .profile-name, .profile-role, .profile-dropdown-menu li) { font-weight: 400 !important; }
.sidebar .menu-item { color: #eeeaf5; font-size: 12px; line-height: 1.5; }
.sidebar .menu-item:hover, .sidebar .menu-item.active { color: #fff; }
.sidebar .submenu-list, .sidebar .submenu-list .submenu-list { background-color: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.sidebar .submenu-item { font-size: 13px; line-height: 1.5; color: #263445; padding: 9px 16px; }
.sidebar .submenu-item:hover, .sidebar .submenu-item.active { color: #145d67; background: #eef5f5; }
.sidebar .submenu-list { min-width: 220px; }

.param-navigation-settings { margin-top:18px; }
.param-navigation-settings .param-font-size-control { margin-top:12px; padding-top:12px; }
.param-navigation-preview { margin-top:14px; border:1px solid #e5e9ef; border-radius:7px; overflow:hidden; }
#view-ajustes-parametros #param-module-size-preview, #view-ajustes-parametros #param-module-size-preview span { font-size:var(--navigation-preview-size,12px) !important; font-weight:400; color:#eeeaf5; background:#1b0642; padding:12px; }
#view-ajustes-parametros #param-submenu-size-preview { font-size:var(--navigation-preview-size,13px) !important; font-weight:400; color:#263445; background:#fff; padding:12px; line-height:1.8; }
/* Mobile administration: enabled by authenticated session, never by login input. */
@media (max-width: 600px) {
  #wms-app.admin-mobile-layout .top-bar { padding: 10px 14px; gap: 8px; background: #fff; border-bottom: 1px solid #e2e8f0; }
  #wms-app.admin-mobile-layout .top-bar-left { width: 100%; gap: 10px; }
  #wms-app.admin-mobile-layout .top-bar-site { max-width: calc(100vw - 105px); font-size: 12px; }
  #wms-app.admin-mobile-layout .top-bar-right { gap: 8px; min-width: 0; }
  #wms-app.admin-mobile-layout .top-bar :is(.system-title,.top-bar-site,.clock-widget,.notification-bell-container) { color: #334155 !important; opacity: 1 !important; }
  #wms-app.admin-mobile-layout .top-bar svg { color: #0369a1 !important; opacity: 1; }
  #wms-app.admin-mobile-layout .sidebar { height: 52px; }
  #wms-app.admin-mobile-layout .sidebar-menu { width: calc(100vw - 16px); left: 8px; padding: 10px; border-radius: 0 0 10px 10px; }
  #wms-app.admin-mobile-layout .sidebar-profile { max-width: 58%; min-width: 0; }
  #wms-app.admin-mobile-layout .sidebar-profile * { min-width: 0; overflow-wrap: anywhere; }
  #wms-app.admin-mobile-layout .content-area { padding: 16px 12px 28px; background: #f5f7fa !important; min-width: 0; }
  #wms-app.admin-mobile-layout .content-area .wms-view { max-width: 100%; min-width: 0; }
  #wms-app.admin-mobile-layout .content-area :is(.panel-header,.view-header,.user-card-header) { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  #wms-app.admin-mobile-layout .content-area :is(h1,h2) { font-size: 22px; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
  #wms-app.admin-mobile-layout .content-area :is(.panel-card,.dashboard-card,.user-management-card) { min-width: 0; max-width: 100%; border-radius: 10px; box-shadow: none; }
  #wms-app.admin-mobile-layout .content-area :is(.dashboard-grid,.form-grid,.user-form-grid-4,.user-form-grid-5,.user-access-groups-grid,.param-fields-grid,.param-appearance-grid) { grid-template-columns: minmax(0,1fr) !important; }
  #wms-app.admin-mobile-layout .content-area :is(.form-group,.form-field,.dashboard-chart-card) { min-width: 0; max-width: 100%; }
  #wms-app.admin-mobile-layout .content-area :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; box-sizing: border-box; }
  #wms-app.admin-mobile-layout .content-area :is(.wms-table-container,.user-table-responsive,.table-responsive) { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  #wms-app.admin-mobile-layout .content-area :is(th,td) { font-size: 12px; }
  #wms-app.admin-mobile-layout .content-area :is(.user-table-controls,.role-assignment-control,.panel-actions,.header-actions) { flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 10px; }
  body.admin-mobile-session :is(.modal-content,.modal-box,.segmentation-dialog) { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; box-sizing: border-box; padding: 18px; max-height: calc(100dvh - 24px); overflow: auto; }
  #wms-app.admin-mobile-layout .bell-dropdown { width: min(320px,calc(100vw - 24px)); position: fixed; top: 92px; right: 12px; }
}

.facial-settings{max-width:860px;padding:28px;margin:0 auto;font-weight:400}.facial-settings h2,.facial-settings h3{font-weight:400}.facial-breadcrumb{font-size:12px;color:#64748b}.facial-settings-form{margin-top:24px;padding:24px;border:1px solid #d5dce5;background:var(--bg-card,#fff)}.facial-settings p,.facial-settings dd{line-height:1.6}.facial-switch{display:flex;align-items:center;gap:12px;padding:18px 0;cursor:pointer}.facial-switch input{width:22px;height:22px;accent-color:#2563eb}.facial-settings dt{margin-top:16px;color:#64748b}.facial-settings dd{margin:4px 0 0}.facial-settings button{margin-top:18px}#bio-capture-button:disabled{opacity:.45;cursor:not-allowed}#bio-video,#bio-canvas{object-fit:contain!important;transform:scaleX(-1)}.bio-face-frame,.bio-depth-rings,.biometrics-scanner-line{display:none!important}@media(max-width:600px){.facial-settings{padding:16px}.facial-settings-form{padding:16px}.bio-quality-panel strong{font-size:10px}}

#modal-pdf-preview .wms-modal-body{max-height:72vh;overflow:auto}#modal-pdf-preview .pdf-preview-box{padding:0}.eir-preview-frame{display:block;width:100%;height:1050px;border:0;background:white}@media(max-width:600px){#modal-pdf-preview .wms-modal-body{padding:10px}#modal-pdf-preview .wms-modal-header h2{font-size:16px}}

.facial-capture-trigger[hidden]{display:none!important}

/* Commercial module: existing application colors and regular typography. */
.commercial-view{padding:24px;min-width:0}.commercial-heading{padding:4px 0 22px;border-bottom:1px solid var(--border-color,#dde3eb);margin-bottom:22px}.commercial-heading p{font-size:12px;margin:0 0 8px;color:var(--text-secondary,#64748b)}.commercial-heading h2{font-weight:400;margin:0 0 10px}.commercial-heading span{font-size:13px}.commercial-body{padding:24px}.commercial-body h3{font-weight:400}.commercial-body p{line-height:1.6;font-size:13px}.commercial-search{display:flex;flex-direction:column;gap:8px;max-width:480px;font-size:13px}.commercial-search input{font:inherit;padding:10px;border:1px solid var(--border-color,#cbd5e1);border-radius:4px;background:var(--bg-card,#fff);color:inherit}.commercial-client-list article{padding:16px 0;border-top:1px solid var(--border-color,#dde3eb)}.commercial-client-list h3{margin:0 0 8px}.commercial-client-list p{margin:3px 0}.commercial-concept{display:grid;grid-template-columns:1fr auto;text-align:left;gap:10px;max-width:520px;width:100%;padding:20px;border:1px solid var(--border-color,#cbd5e1);background:var(--bg-card,#fff);color:inherit;font:inherit;cursor:pointer;border-radius:4px}.commercial-concept small{grid-column:1;font-size:12px}.commercial-concept:focus-visible{outline:2px solid var(--accent-purple,#4f46e5);outline-offset:3px}.commercial-concept:hover{border-color:var(--accent-purple,#4f46e5)}@media(max-width:600px){.commercial-view,.commercial-body{padding:14px}}

/* Site lifecycle follows the shared action-icon sizing controls. */
.table-actions button.site-lifecycle-action { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; padding:0; border:0; background:transparent; color:var(--accent-blue); line-height:1; }
.table-actions button.site-lifecycle-action:focus-visible { outline:2px solid currentColor; outline-offset:3px; }

/* Keep site actions inside a real table cell so each row stays aligned. */
#sites-table-body td.table-actions { display:table-cell; vertical-align:middle; text-align:center; white-space:nowrap; border-bottom:0; }
#sites-table-body .table-actions > .action-icon { display:inline-flex; align-items:center; justify-content:center; vertical-align:middle; width:18px; height:18px; margin:0 5px; }
#sites-table-body .table-actions > .action-icon svg { width:18px; height:18px; }

/* Copying text does not turn controls or drag handles into editable content. */
:where(p,h1,h2,h3,h4,h5,h6,td,th,span,label,small,strong,code,pre,li) { -webkit-user-select:text; user-select:text; }
button,button *,input[type="button"],input[type="submit"],.action-icon,.action-icon *, .zero-window-dragging,.zero-window-dragging * { -webkit-user-select:none; user-select:none; }

#modal-sys-confirm #sys-confirm-title { font-size:12px!important; font-weight:400!important; text-align:center; justify-content:center; flex:1; margin:0; line-height:1.5; }

/* Profile dialogs share the .zw-dialog styles in window-manager.css. */

.weather-location { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.weather-location:not(:empty)::before { content: "· "; }

/* Role editor follows the system's form, card and button layout. */
:is(#modal-create-role,#modal-edit-role) .role-editor-modal { display: flex; flex-direction: column; width: 1040px; max-width: calc(100vw - 40px); max-height: 92dvh; border-radius: 12px; background: #fff; color: #263445; overflow: hidden; }
:is(#modal-create-role,#modal-edit-role) .role-editor-modal > form { display: flex; flex-direction: column; min-height: 0; margin: 0; }
:is(#modal-create-role,#modal-edit-role) .wms-modal-header { padding: 18px 24px; background: #f7f9fc; border-bottom: 1px solid #dce4ed; }
:is(#modal-create-role,#modal-edit-role) .wms-modal-header h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; color: var(--accent-purple); margin: 0; }
:is(#modal-create-role,#modal-edit-role) .role-editor-body { padding: 24px; min-height: 0; max-height: none !important; overflow-y: auto; }
:is(#modal-create-role,#modal-edit-role) .form-group { margin: 0 0 16px; min-width: 0; }
:is(#modal-create-role,#modal-edit-role) .form-group > label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600 !important; color: #475569 !important; text-transform: none; letter-spacing: 0; }
:is(#modal-create-role,#modal-edit-role) .form-input { width: 100%; min-height: 38px; border: 1px solid #cbd5e1 !important; border-radius: 6px; background: #fff !important; color: #263445 !important; font-size: 12px; font-weight: 400 !important; padding: 8px 10px; }
.role-editor-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; }
.role-editor-section-heading { border-top: 1px solid #e2e8f0; margin-top: 8px; padding-top: 20px; }
.role-editor-section-heading h3 { font-size: 14px; font-weight: 600; margin: 0 0 6px; color: #263445 !important; }
.role-editor-section-heading p { margin: 0 0 16px; font-size: 12px; color: #64748b; line-height: 1.6; }
:is(#modal-create-role,#modal-edit-role) .role-modal-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 18px; padding: 16px; margin: 0 0 20px; border: 1px solid #dce4ed; border-radius: 8px; background: #f7f9fc; }
:is(#modal-create-role,#modal-edit-role) .role-quick-field { min-width: 0; }
:is(#modal-create-role,#modal-edit-role) .role-quick-field > label { font-size: 11px !important; font-weight: 600 !important; text-transform: none; letter-spacing: 0; display: block; margin-bottom: 6px; color: #475569; }
:is(#modal-create-role,#modal-edit-role) .role-quick-control { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
:is(#modal-create-role,#modal-edit-role) .role-quick-control .form-input { min-width: 0; flex: 1; }
:is(#modal-create-role,#modal-edit-role) .role-quick-btn { flex-shrink: 0; width: auto; min-height: 38px; padding: 8px 12px; font-size: 11px; white-space: nowrap; }
:is(#modal-create-role,#modal-edit-role) .role-quick-note { align-self: end; padding: 10px 0; font-size: 12px; color: #475569; }
.role-panel-permissions { display: grid; gap: 16px; }
:is(#modal-create-role,#modal-edit-role) .role-panel-section { padding: 0; border: 1px solid #dce4ed; border-radius: 8px; background: #fff; min-height: 0; overflow: hidden; }
.role-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; background: #f7f9fc; border-bottom: 1px solid #e2e8f0; }
.role-panel-header h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #263445; }
.role-panel-header p { margin: 0; font-size: 11px; color: #64748b; }
.role-panel-toggle { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 12px; color: #475569; cursor: pointer; }
.role-panel-toggle input { width: 16px; height: 16px; accent-color: var(--accent-purple); }
.role-panel-state { margin: 0; padding: 10px 18px 0; font-size: 11px; color: #64748b; }
:is(#modal-create-role,#modal-edit-role) .role-panel-content { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 14px 18px 18px; max-height: none; overflow: visible; }
.role-panel-content .permission-module { min-width: 0; margin: 0; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.role-panel-content .permission-module-heading { padding: 10px 12px; margin: 0; background: #f7f9fc; font-size: 12px; }
.role-panel-content .permission-module-heading span { flex: 1; }
.role-panel-content .permission-module > .modal-role-permission-row { margin: 0 10px; border-left: 0; padding: 9px 4px; }
.role-panel-content .modal-role-permission-row strong { font-size: 12px; font-weight: 400; }
.role-panel-content .modal-role-permission-row small { font-size: 10px; font-weight: 400; }
.role-panel-disabled .role-panel-content { display: none !important; }
.role-panel-disabled .role-panel-state { padding-bottom: 12px; }
.role-panel-empty { color: #64748b; font-size: 12px; grid-column: 1/-1; margin: 0; }
.role-editor-footer { display: flex; flex-shrink: 0; justify-content: flex-end; gap: 10px; padding: 14px 24px; margin: 0; border-top: 1px solid #e2e8f0; background: #fff; }
.role-editor-footer .btn { min-width: 100px; min-height: 38px; font-size: 12px; }
.role-editor-footer .btn-secondary { color: #475569 !important; background: #f1f5f9; border: 1px solid #cbd5e1; }
:is(#modal-create-role,#modal-edit-role) .action-icon { cursor: pointer; color: #64748b; }
@media(max-width:700px) {
  :is(#modal-create-role,#modal-edit-role) .role-editor-modal { max-width: calc(100vw - 20px); }
  :is(#modal-create-role,#modal-edit-role) .role-editor-body { padding: 16px; }
  :is(#modal-create-role,#modal-edit-role) .role-panel-content, :is(#modal-create-role,#modal-edit-role) .role-modal-tools, .role-editor-field-grid { grid-template-columns: minmax(0,1fr); }
  .role-panel-header { align-items: flex-start; flex-direction: column; gap: 12px; }
}

/* ==================== LLAMADOS DE PERSONAL ==================== */
#view-ajustes-llamados { padding: 20px 24px 40px; background: #f6f8fb; min-height: calc(100vh - 55px); }
#view-ajustes-llamados, .ll-drawer { --ll-accent: #0891b2; --ll-accent-d: #0e7490; --ll-wa: #25d366; --ll-wa-d: #1da851; --ll-line: #dde5ee; --ll-ink: #17283b; --ll-mute: #62758a; font-family: 'Aptos', 'Segoe UI', system-ui, sans-serif; color: var(--ll-ink); }
.ll-wrap { max-width: 1100px; margin: 0 auto; }
.ll-head h2 { margin: 0 0 2px; font-size: 20px; font-weight: 500; }
.ll-head p { margin: 0 0 14px; color: var(--ll-mute); font-size: 13px; }
.ll-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ll-line); margin-bottom: 16px; overflow-x: auto; }
.ll-tabs button { border: 0; background: none; padding: 10px 16px; font: inherit; font-size: 13px; color: var(--ll-mute); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.ll-tabs button.is-active { color: var(--ll-accent-d); border-bottom-color: var(--ll-accent); font-weight: 500; }
.ll-card { background: #fff; border: 1px solid var(--ll-line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.ll-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 500; }
.ll-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.ll-card-head h3 { margin: 0; }
.ll-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ll-grid label, .ll-field { display: grid; gap: 4px; font-size: 12px; color: var(--ll-mute); }
.ll-span { grid-column: 1 / -1; }
.ll-inline { display: flex !important; align-items: center; gap: 8px; align-self: end; color: var(--ll-ink) !important; }
.ll-wrap input[type=text], .ll-wrap input[type=date], .ll-wrap input[type=time], .ll-wrap input[type=tel], .ll-wrap input[type=url], .ll-wrap input[type=search], .ll-wrap select, .ll-wrap textarea, .ll-panel textarea, .ll-panel select {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--ll-line); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; color: var(--ll-ink); }
.ll-wrap input:focus, .ll-wrap select:focus, .ll-wrap textarea:focus, .ll-panel textarea:focus, .ll-panel select:focus { outline: 2px solid rgba(8, 145, 178, .35); border-color: var(--ll-accent); }
.ll-toolbar { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
.ll-counter { background: #e0f4f8; color: var(--ll-accent-d); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; }
.ll-warn { background: #fff7e6; border: 1px solid #f3d18a; color: #8a5a00; border-radius: 8px; padding: 9px 12px; font-size: 12px; margin-bottom: 10px; }
.ll-table-wrap { overflow-x: auto; }
.ll-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ll-table th { text-align: left; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ll-mute); padding: 8px 10px; border-bottom: 1px solid var(--ll-line); }
.ll-table td { padding: 9px 10px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.ll-table td small { display: block; color: var(--ll-mute); font-size: 11px; }
.ll-table tr.is-selected td { background: #f0fafc; }
.ll-check { width: 36px; }
.ll-row-actions { white-space: nowrap; text-align: right; }
.ll-phone { font-variant-numeric: tabular-nums; }
.ll-empty { color: var(--ll-mute); text-align: center; padding: 22px 10px !important; font-size: 13px; }
.ll-link { border: 0; background: none; color: var(--ll-accent-d); text-decoration: underline; cursor: pointer; font: inherit; }
.ll-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; background: #eef2f6; color: var(--ll-mute); }
.ll-badge-ok { background: #e3f7ea; color: #137a3d; }
.ll-badge-info { background: #e0f4f8; color: var(--ll-accent-d); }
.ll-badge-warn { background: #fff1d6; color: #8a5a00; }
.ll-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ll-actions-end { justify-content: flex-end; }
.ll-btn { border: 1px solid var(--ll-line); background: #fff; color: var(--ll-ink); border-radius: 8px; padding: 9px 16px; font: inherit; font-size: 13px; cursor: pointer; }
.ll-btn:hover:not(:disabled) { border-color: var(--ll-accent); color: var(--ll-accent-d); }
.ll-btn:disabled { opacity: .45; cursor: not-allowed; }
.ll-btn-sm { padding: 5px 10px; font-size: 12px; }
.ll-btn-primary { background: var(--ll-accent); border-color: var(--ll-accent); color: #fff; }
.ll-btn-primary:hover:not(:disabled) { background: var(--ll-accent-d); color: #fff; }
.ll-btn-wa { background: var(--ll-wa); border-color: var(--ll-wa); color: #fff; }
.ll-btn-wa:hover:not(:disabled) { background: var(--ll-wa-d); border-color: var(--ll-wa-d); color: #fff; }
.ll-btn-danger:hover:not(:disabled) { border-color: #d64545; color: #d64545; }
/* Drawer */
.ll-drawer { position: fixed; inset: 0; z-index: 2100; }
.ll-drawer[hidden] { display: none; }
.ll-backdrop { position: absolute; inset: 0; background: rgba(15, 30, 45, .35); opacity: 0; transition: opacity .2s; }
.ll-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: #fff; box-shadow: -10px 0 40px rgba(15, 30, 45, .2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; }
.ll-drawer.is-open .ll-backdrop { opacity: 1; }
.ll-drawer.is-open .ll-panel { transform: none; }
.ll-panel-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.ll-panel-head h3 { margin: 0; font-size: 16px; font-weight: 500; }
.ll-panel-head p { margin: 2px 0 0; font-size: 12px; color: var(--ll-mute); }
.ll-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--ll-mute); align-self: start; }
.ll-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 18px 12px; }
.ll-mode button { text-align: left; border: 1px solid var(--ll-line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; display: grid; gap: 2px; }
.ll-mode button small { color: var(--ll-mute); font-size: 11px; }
.ll-mode button.is-active { border-color: var(--ll-accent); background: #f0fafc; box-shadow: 0 0 0 1px var(--ll-accent) inset; }
.ll-panel-body { flex: 1; overflow-y: auto; padding: 4px 18px 20px; display: grid; gap: 12px; align-content: start; }
.ll-hint { margin: 0; font-size: 11.5px; color: var(--ll-mute); }
.ll-hint code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; }
.ll-preview { background: #e7f8ee; border-radius: 10px; padding: 10px 12px; }
.ll-preview-title { font-size: 11px; color: #137a3d; margin-bottom: 4px; }
.ll-preview pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 12.5px; max-height: 190px; overflow-y: auto; }
.ll-status { font-size: 12px; color: var(--ll-mute); }
.ll-queue-head { display: flex; justify-content: space-between; font-size: 13px; }
.ll-progress { height: 6px; border-radius: 999px; background: #e6edf3; overflow: hidden; }
.ll-progress span { display: block; height: 100%; background: var(--ll-wa); transition: width .25s; }
.ll-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ll-queue li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; border: 1px solid var(--ll-line); border-radius: 10px; padding: 9px 11px; }
.ll-q-who small { display: block; color: var(--ll-mute); font-size: 11px; }
.ll-q-btns { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 720px) {
  #view-ajustes-llamados { padding: 14px 12px 32px; }
  .ll-toolbar { grid-template-columns: 1fr 1fr; }
  .ll-toolbar input { grid-column: 1 / -1; }
  .ll-mode { grid-template-columns: 1fr; }
}
/* ==================== SHELL MÓVIL / TABLET (≤1024px) ==================== */
.mobile-nav-head, #mobile-tabbar, #mobile-scrim { display: none; }
@media (max-width: 1024px) {
  .wms-app { background: #f3f1fa; }
  /* Barra superior compacta de una sola fila */
  .wms-app .top-bar { flex-wrap: nowrap; min-height: 54px; padding: 8px 14px; gap: 10px; align-items: center; }
  .wms-app .top-bar-left { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; }
  .wms-app .top-bar-site { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
  .wms-app .top-bar-right { flex: 0 0 auto; width: auto; margin-left: auto; justify-content: flex-end; gap: 10px; }
  .wms-app .top-bar-greeting { display: none; }
  .wms-app .clock-widget { font-size: 12px; }
  /* La antigua franja "Módulos" desaparece: la navegación vive abajo */
  .wms-app .sidebar { height: 0 !important; min-height: 0; padding: 0; border: 0; background: transparent; overflow: visible; z-index: 2100; }
  .wms-app .sidebar .mobile-navigation-toggle { display: none !important; }
  .wms-app .sidebar > .sidebar-menu { display: none !important; }
  .wms-app .sidebar > .sidebar-profile { display: none !important; }
  .wms-app .content-area { padding: 14px 14px calc(100px + env(safe-area-inset-bottom)) !important; }
  .wms-app.panel-terrestre #view-terrestre-wms, .wms-app.panel-terrestre #terrestre-wms-frame { height: calc(100dvh - 54px - 90px - env(safe-area-inset-bottom)) !important; }

  /* Barra de pestañas inferior flotante */
  #mobile-tabbar {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2000;
    display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 6px; align-items: center; height: 66px; padding: 7px;
    background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid rgba(27,6,66,.08); border-radius: 24px; box-shadow: 0 14px 34px rgba(27,6,66,.26);
  }
  .mobile-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; border-radius: 18px;
    background: transparent; color: #6b6485; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: background .18s ease, color .18s ease, transform .12s ease;
  }
  .mobile-tab:active { transform: scale(.95); }
  .mobile-tab.is-active { color: #5314cd; background: rgba(83,20,205,.1); }
  .mobile-tab-main { color: #fff; background: linear-gradient(135deg, #7c3aed, #4c1d95); box-shadow: 0 8px 18px rgba(83,20,205,.38); }
  .mobile-tab-main.is-active { color: #fff; background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
  body.mobile-sheet-open #mobile-tabbar { opacity: 0; pointer-events: none; }

  /* Cortina y hojas inferiores */
  #mobile-scrim { position: fixed; inset: 0; z-index: 2050; background: rgba(9,3,20,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .22s ease; display: block; }
  body.mobile-sheet-open #mobile-scrim { opacity: 1; pointer-events: auto; }
  @keyframes zw-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

  .wms-app .sidebar.mobile-navigation-open > .sidebar-menu {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; height: 88dvh; max-height: 88dvh; z-index: 2100;
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: min-content; align-content: start; gap: 12px;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    border: 0; border-radius: 28px 28px 0 0; background: linear-gradient(180deg, #ffffff 0%, #e9e6f5 100%); box-shadow: 0 -18px 50px rgba(27,6,66,.3);
    animation: zw-sheet-up .26s ease-out;
  }
  .sidebar.mobile-navigation-open .mobile-nav-head {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 3; margin: 0 -16px 2px; padding: 20px 14px 10px;
    background: linear-gradient(180deg, #ffffff 80%, rgba(255,255,255,0)); width: auto;
  }
  .sidebar.mobile-navigation-open .mobile-nav-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 99px; background: rgba(27,6,66,.22); }
  .mobile-nav-title { flex: 1; text-align: center; color: #1B0642; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
  .mobile-nav-back, .mobile-nav-close { min-width: 44px; min-height: 44px; border: 0; background: rgba(27,6,66,.07); color: #1B0642; font: inherit; font-size: 15px; cursor: pointer; border-radius: 14px; }
  .mobile-nav-back { visibility: hidden; padding: 0 12px; white-space: nowrap; font-size: 14px; }
  .sidebar.mobile-nav-drill .mobile-nav-back { visibility: visible; }
  .sidebar.mobile-navigation-open .menu-category { grid-column: 1 / -1; width: 100%; min-width: 0; height: auto; justify-content: flex-start; padding: 10px 4px 0; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #6b4fc4; background: none; border: 0; }
  .sidebar.mobile-navigation-open .sidebar-menu > .menu-item {
    flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; height: auto; min-height: 104px; padding: 16px 8px;
    border: 1px solid rgba(27,6,66,.08); border-radius: 20px; background: #fff; box-shadow: 0 4px 14px rgba(27,6,66,.08); color: #1B0642; white-space: normal; cursor: pointer;
    transition: transform .12s ease, background .15s ease; -webkit-tap-highlight-color: transparent;
  }
  .sidebar.mobile-navigation-open .sidebar-menu > .menu-item:active { transform: scale(.96); background: #f1edfb; }
  .sidebar.mobile-navigation-open .menu-item-left { flex-direction: column; align-items: center; gap: 9px; width: 100%; }
  .sidebar.mobile-navigation-open .menu-item-left > span:not(.menu-icon) { font-size: 13px !important; font-weight: 600 !important; line-height: 1.25; color: #1B0642; }
  .sidebar.mobile-navigation-open .menu-item-left .menu-icon { display: grid; place-items: center; width: 46px; height: 46px; padding: 11px; font-size: 22px; color: #fff; border-radius: 15px; background: linear-gradient(135deg, #7c3aed, #4f46e5); box-shadow: 0 6px 14px rgba(79,70,229,.4); }
  .sidebar.mobile-navigation-open .menu-item > svg:last-child, .sidebar.mobile-navigation-open .menu-item > span[aria-hidden] { display: none; }
  /* Submenús ocultos en la cuadrícula; visibles solo dentro del módulo elegido */
  .sidebar.mobile-navigation-open .sidebar-menu > .submenu-list { display: none !important; }
  .sidebar.mobile-nav-drill .sidebar-menu > .menu-item, .sidebar.mobile-nav-drill .sidebar-menu > .menu-category { display: none !important; }
  .sidebar.mobile-nav-drill .sidebar-menu > .submenu-list.expanded {
    display: flex !important; flex-direction: column; grid-column: 1 / -1; position: static !important; width: 100%; max-height: none; opacity: 1; pointer-events: auto;
    overflow: visible; padding: 0; gap: 10px; background: transparent; box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .sidebar.mobile-nav-drill .submenu-list.expanded .submenu-item {
    display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 14px 18px; font-size: 15px !important; font-weight: 500 !important; color: #1B0642;
    border: 1px solid rgba(27,6,66,.08); border-radius: 16px; background: #fff; box-shadow: 0 3px 10px rgba(27,6,66,.07);
  }
  .sidebar.mobile-nav-drill .submenu-list.expanded .submenu-item::after { content: "›"; font-size: 22px; line-height: 1; color: #7c3aed; }
  .sidebar.mobile-nav-drill .submenu-list.expanded .submenu-item:active { background: #f1edfb; }
  .sidebar.mobile-nav-drill .submenu-list .submenu-list.expanded { position: static !important; display: flex !important; padding-left: 12px; background: transparent; }

  /* Hoja de perfil */
  .wms-app .sidebar.mobile-profile-open > .sidebar-profile {
    display: block !important; position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; height: auto !important; max-height: 80dvh; overflow-y: auto; margin: 0; z-index: 2100;
    padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: linear-gradient(180deg, #ffffff, #e9e6f5);
    box-shadow: 0 -18px 50px rgba(27,6,66,.3); animation: zw-sheet-up .26s ease-out;
  }
  .sidebar.mobile-profile-open .sidebar-profile::before { content: ""; position: absolute; top: 8px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 99px; background: rgba(27,6,66,.22); }
  .sidebar.mobile-profile-open .profile-info-wrapper { padding: 6px 4px 14px; }
  .sidebar.mobile-profile-open .profile-details span { color: #1B0642 !important; }
  .sidebar.mobile-profile-open .arrow-up-icon { display: none; }
  .sidebar.mobile-profile-open .profile-dropdown-menu { display: flex !important; flex-direction: column; gap: 10px; position: static !important; width: 100%; margin: 0; padding: 0; background: transparent; box-shadow: none; border: 0; transform: none; opacity: 1; }
  .sidebar.mobile-profile-open .profile-dropdown-menu li { display: flex; align-items: center; min-height: 54px; padding: 14px 18px; font-size: 15px !important; color: #1B0642; border: 1px solid rgba(27,6,66,.08); border-radius: 16px; background: #fff; }
  .sidebar.mobile-profile-open .profile-dropdown-menu li.logout-item { color: #b91c1c; border-color: rgba(239,68,68,.3); background: #fff1f1; }



  /* Dashboard y paneles: tarjetas táctiles */
  .wms-app .content-area .panel-card, .wms-app .content-area .dashboard-card { border-radius: 20px; }
  .wms-app .dashboard-hero { padding: 18px 16px; border-radius: 22px; }
  .wms-app .dashboard-hero h2 { font-size: 22px !important; line-height: 1.2; }
  .wms-app .dashboard-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-top: 14px; padding-bottom: 2px; }
  .wms-app .dashboard-nav::-webkit-scrollbar { display: none; }
  .wms-app .dashboard-nav button { flex: 0 0 auto; min-height: 40px; padding: 8px 18px; border-radius: 999px; }
  .wms-app .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .wms-app .dashboard-kpi-grid .kpi-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 124px; }
  .wms-app .dashboard-kpi-grid .kpi-card strong { font-size: 26px; }
  .wms-app .dashboard-currency-grid { display: flex !important; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px 6px; }
  .wms-app .dashboard-currency-grid::-webkit-scrollbar { display: none; }
  .wms-app .dashboard-currency-grid .currency-card { flex: 0 0 74%; scroll-snap-align: center; }
  .wms-app .dashboard-currency-grid .currency-card strong { font-size: 20px !important; line-height: 1.2; }
  .wms-app .dashboard-layout { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
  .wms-app .dashboard-card.chart-card { padding: 16px; }
  .wms-app .dashboard-month-bars { gap: 6px; }
  .wms-app .dashboard-card canvas { max-width: 100%; }
}
@media (min-width: 600px) and (max-width: 1024px) {
  /* Tablet: cuadrícula de módulos más amplia y barra más compacta */
  .wms-app .sidebar.mobile-navigation-open > .sidebar-menu { grid-template-columns: repeat(4, minmax(0, 1fr)); left: 50%; right: auto; width: min(760px, 100%); transform: translateX(-50%); animation: none; }
  #mobile-tabbar { left: 50%; right: auto; width: 420px; transform: translateX(-50%); }
  .wms-app .dashboard-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .wms-app .dashboard-layout { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .wms-app .dashboard-currency-grid .currency-card { flex-basis: 32%; }
  .wms-app .sidebar.mobile-profile-open > .sidebar-profile { left: 50%; right: auto; width: min(520px, 100%); transform: translateX(-50%); animation: none; }
}/* Llamados: adaptación móvil (tarjetas y hoja inferior) */
@media (max-width: 720px) {
  .ll-table thead { display: none; }
  .ll-table, .ll-table tbody, .ll-table tr, .ll-table td { display: block; }
  .ll-table tr { position: relative; border: 1px solid var(--ll-line); border-radius: 12px; padding: 10px 44px 10px 12px; margin-bottom: 8px; background: #fff; }
  .ll-table td { border: 0; padding: 2px 0; }
  .ll-table td.ll-check { position: absolute; right: 12px; top: 12px; width: auto; padding: 0; }
  .ll-table td.ll-check input { width: 22px; height: 22px; }
  .ll-row-actions { text-align: left !important; padding-top: 8px !important; display: flex !important; gap: 6px; flex-wrap: wrap; }
  .ll-btn { min-height: 44px; }
  .ll-btn-sm { min-height: 40px; }
  .ll-actions .ll-btn-primary { width: 100%; }
  .ll-panel { top: auto; width: 100vw; height: 92dvh; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .ll-drawer.is-open .ll-panel { transform: none; }
}
/* Ventana emergente de creación y edición de usuarios (Marítimo full). */
.user-form-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 20, 43, .62); backdrop-filter: blur(3px); box-sizing: border-box; }
.user-form-modal[hidden] { display: none !important; }
body.user-form-modal-open { overflow: hidden; }
@keyframes userModalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.user-form-modal .user-form-card { position: relative; width: min(1000px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; margin: 0; padding: 0; border: 0; border-radius: 16px; background: #f4f7fb; box-shadow: 0 30px 80px rgba(8, 20, 43, .35); outline: none; animation: userModalIn .18s ease-out; }
/* Cabecera destacada */
.user-form-modal .user-card-header { position: sticky; top: 0; z-index: 3; margin: 0; padding: 20px 68px 20px 28px; border: 0; background: linear-gradient(120deg, #06264d 0%, #0060ab 62%, #0a8bd6 100%); flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; }
.user-form-modal .user-card-title-block { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.user-form-modal .user-card-icon { width: 46px; height: 46px; border-radius: 12px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.user-form-modal .user-card-icon svg { width: 22px; height: 22px; }
.user-form-modal #user-form-title { margin: 0; color: #fff !important; font-size: 18px; font-weight: 600; letter-spacing: .04em; }
.user-form-modal #user-form-desc { margin: 2px 0 0; color: rgba(255, 255, 255, .82) !important; font-size: 12px; }
.user-form-modal .user-edit-banner { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .35); color: #fff; }
.user-form-modal .user-edit-banner * { color: #fff !important; }
.user-form-modal .user-edit-pulse { background: #7dd3fc; }
.user-form-modal-close { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff !important; font-size: 24px; line-height: 1; cursor: pointer; transition: background .15s; }
.user-form-modal-close:hover { background: rgba(255, 255, 255, .24); }
.user-form-modal-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* Secciones en tarjetas */
.user-form-modal .user-main-form { padding: 22px 28px 0; }
.user-form-modal .user-form-section, .user-form-modal .user-form-section:last-of-type { margin: 0 0 18px; padding: 20px 22px; background: #fff; border: 1px solid #dfe6ef; border-radius: 14px; box-shadow: 0 1px 3px rgba(15, 23, 42, .05); }
.user-form-modal .user-section-header { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid #edf1f6; }
.user-form-modal .user-section-step { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #0060ab, #0a8bd6); font-size: 13px; box-shadow: 0 4px 10px rgba(0, 96, 171, .28); }
.user-form-modal .user-section-title-wrap h4 { font-size: 14px; font-weight: 600; color: #0b1f3a !important; letter-spacing: .05em; }
.user-form-modal .user-section-title-wrap p { margin: 2px 0 0; font-size: 12px; color: #64748b !important; }
.user-modal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; align-items: start; }
.user-modal-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-modal-wide { grid-column: 1 / -1; }
/* Etiquetas y ayudas */
.user-form-modal .user-field-group { gap: 7px; }
.user-form-modal .user-field-group > label, .user-form-modal label.user-modal-wide { font-size: 11px; font-weight: 600; color: #1e3a5f !important; text-transform: uppercase; letter-spacing: .05em; }
.user-form-modal .user-field-hint { font-size: 11px; color: #64748b !important; line-height: 1.45; }
/* Casillas siempre visibles: fondo blanco, borde definido y foco destacado */
.user-form-modal :is(input[type="text"], input[type="password"], textarea, select.form-input:not([data-custom-converted="true"])),
#user-form-modal .user-form-card .custom-select-trigger { box-sizing: border-box; width: 100%; min-height: 44px; background: #fff !important; border: 1.5px solid #c3cfdd !important; border-radius: 10px !important; color: #0b1f3a !important; font-size: 13px !important; font-weight: 500; box-shadow: 0 1px 2px rgba(15, 23, 42, .05) !important; opacity: 1; transition: border-color .15s, box-shadow .15s; }
#user-form-modal .user-form-card .custom-select-trigger { display: flex; align-items: center; justify-content: space-between; padding: 0 12px !important; cursor: pointer; }
#user-form-modal .user-form-card .custom-select-trigger > span { flex: 1; min-width: 0; text-align: left !important; color: #0b1f3a !important; }
#user-form-modal .user-form-card .custom-select-trigger svg { color: #476282; stroke: #476282; }
.user-form-modal textarea { min-height: 64px; padding: 10px 12px; resize: vertical; }
.user-form-modal :is(input, textarea)::placeholder { color: #9aa9bb !important; font-weight: 400; opacity: 1; }
.user-form-modal :is(input[type="text"], input[type="password"], textarea, select):hover, #user-form-modal .user-form-card .custom-select-trigger:hover { border-color: #8fa6c2 !important; }
.user-form-modal :is(input[type="text"], input[type="password"], textarea, select):focus, #user-form-modal .user-form-card .custom-select-trigger:focus-visible, #user-form-modal .user-form-card .custom-select.open .custom-select-trigger { outline: none; border-color: #0060ab !important; box-shadow: 0 0 0 4px rgba(0, 96, 171, .14) !important; }
.user-form-modal .user-input-wrap .user-input { padding-left: 38px !important; }
#user-form-modal .user-input-wrap .custom-select-trigger { padding-left: 38px !important; }
.user-form-modal .user-input-icon, .user-form-modal .user-input-prefix { z-index: 1; color: #5b7595 !important; }
.user-form-modal .user-password-toggle-btn { z-index: 1; }
.user-document-wrap { display: flex; gap: 8px; }
.user-document-wrap #custom-wrapper-user-document-type, .user-document-wrap select#user-document-type:not([data-custom-converted="true"]) { flex: 0 0 108px; width: 108px; min-width: 0; }
.user-document-wrap #user-rut { flex: 1; min-width: 0; padding-left: 12px !important; letter-spacing: .03em; }
/* Panel asignado como fichas seleccionables */
.user-form-modal .user-panel-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; background: none; }
.user-form-modal .user-panel-options label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1.5px solid #c3cfdd; border-radius: 999px; background: #fff; color: #1e3a5f !important; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; cursor: pointer; transition: all .15s; }
.user-form-modal .user-panel-options label:hover { border-color: #0060ab; }
.user-form-modal .user-panel-options label:has(input:checked) { border-color: #0060ab; background: #e8f2fc; color: #004a85 !important; box-shadow: 0 0 0 3px rgba(0, 96, 171, .1); }
.user-form-modal .user-panel-options input { width: 16px; height: 16px; margin: 0; accent-color: #0060ab; }
/* Cargo */
.user-form-modal .user-job-actions { gap: 6px; margin-top: 2px; }
.user-form-modal .user-job-actions button { min-height: 0 !important; height: auto !important; width: auto !important; line-height: 1.4; padding: 4px 10px; border: 1px solid #cfe0f1; border-radius: 999px; background: #f2f8fe; color: #0060ab; font-size: 11px; font-weight: 600; }
.user-form-modal .user-job-actions button:hover:not(:disabled) { background: #e2effc; }
.user-form-modal .user-job-actions #job-title-delete { border-color: #f5d0d0; background: #fef5f5; color: #b91c1c; }
.user-form-modal .user-job-actions button:disabled { border-color: #e2e8f0; background: #f8fafc; color: #a3b1c2; }
/* Acceso */
.user-form-modal .user-role-summary-pill { margin-top: 2px; }
.user-form-modal .user-site-perm-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 16px; background: #f5f3ff; border: 1.5px solid #ddd6fe; border-radius: 12px; font-size: 12px; color: #3b2a72 !important; cursor: pointer; }
.user-form-modal .user-site-perm-row span { color: #3b2a72 !important; }
.user-form-modal .user-site-perm-row input { accent-color: #7c3aed; width: 18px; height: 18px; flex: none; margin: 0; }
.user-advanced-permissions { margin-top: 14px; border: 1.5px solid #dfe6ef; border-radius: 12px; background: #fbfcfe; overflow: hidden; }
.user-advanced-permissions > summary { cursor: pointer; padding: 12px 16px; font-size: 12px; font-weight: 600; color: #0060ab !important; list-style-position: inside; }
.user-advanced-permissions[open] > summary { border-bottom: 1px solid #dfe6ef; background: #f2f8fe; }
.user-advanced-permissions > .user-access-editor { padding: 16px; }
/* Pie fijo con acciones */
.user-form-modal .user-form-actions-bar { position: sticky; bottom: 0; z-index: 3; margin: 0 -28px; padding: 14px 28px; background: rgba(255, 255, 255, .96); border-top: 1px solid #dfe6ef; box-shadow: 0 -6px 16px rgba(15, 23, 42, .06); }
.user-form-modal .user-btn-clean { min-height: 42px; padding: 0 20px; border: 1.5px solid #c3cfdd; border-radius: 10px; background: #fff; color: #334155 !important; font-weight: 600; }
.user-form-modal .user-btn-clean * { color: #334155 !important; }
.user-form-modal .user-btn-save { min-height: 42px; padding: 0 24px; border: 0; border-radius: 10px; background: linear-gradient(120deg, #0060ab, #0a8bd6); box-shadow: 0 8px 18px rgba(0, 96, 171, .3); font-weight: 600; letter-spacing: .04em; }
.user-form-modal .user-btn-save:hover { filter: brightness(1.06); }
.user-form-modal #user-panel-assignment-summary:empty { display: none; }
@media (max-width: 860px) { .user-modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .user-modal-grid, .user-modal-grid-2 { grid-template-columns: 1fr; }
  .user-form-modal { padding: 8px; }
  .user-form-modal .user-form-card { max-height: calc(100dvh - 16px); }
  .user-form-modal .user-card-header { padding: 16px 60px 16px 16px; }
  .user-form-modal .user-main-form { padding: 14px 12px 0; }
  .user-form-modal .user-form-section, .user-form-modal .user-form-section:last-of-type { padding: 16px 14px; }
  .user-form-modal .user-form-actions-bar { margin: 0 -12px; padding: 12px; }
  .user-form-modal-close { right: 12px; }
}
