@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-modal: rgba(15, 21, 33, 0.96);
  --border-color: rgba(51, 65, 85, 0.6);
  --border-highlight: rgba(250, 160, 47, 0.4);
  
  /* Identidad & Colores Corporativos IopGPS Paraguay (sistemas.iopgps.com.py) */
  --iopgps-orange: #FAA02F;
  --iopgps-orange-light: #FFC170;
  --iopgps-orange-dark: #D4850F;
  --iopgps-black: #190E01;
  --iopgps-black-light: #3D2E1A;
  --iopgps-bg-warm: #FFF8F0;
  --iopgps-bg-cream: #FFF3E0;

  --primary-orange: #FAA02F;
  --primary-cyan: #FAA02F; /* Mapeado a color corporativo naranja IopGPS */
  --primary-indigo: #D4850F;
  --primary-purple: #EA580C;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-glow: 0 0 25px rgba(250, 160, 47, 0.22);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(250, 160, 47, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(212, 133, 15, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar corporativo idéntico a sistemas.iopgps.com.py */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(250, 160, 47, 0.35);
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 160, 47, 0.65);
}

/* ==========================================
   AUTHENTICATION OVERLAY / MODAL
   ========================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: var(--transition);
}

.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(250, 160, 47, 0.35);
  box-shadow: 0 0 35px rgba(250, 160, 47, 0.2), var(--shadow-card);
  border-radius: var(--radius-lg);
  padding: 38px 34px 34px 34px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FAA02F, #FFC170, #D4850F);
}

.auth-logo-badge {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px auto;
  border-radius: 22px;
  background: rgba(25, 14, 1, 0.7);
  border: 2px solid rgba(250, 160, 47, 0.45);
  box-shadow: 0 0 25px rgba(250, 160, 47, 0.25), inset 0 0 15px rgba(250, 160, 47, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.auth-logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(250, 160, 47, 0.3));
}

.auth-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.auth-logo span {
  color: var(--iopgps-orange);
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 26px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--iopgps-orange);
  box-shadow: 0 0 0 3px rgba(250, 160, 47, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #FAA02F 0%, #D4850F 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #190E01;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(250, 160, 47, 0.35);
  transition: var(--transition);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FFB247 0%, #E08C12 100%);
  box-shadow: 0 6px 22px rgba(250, 160, 47, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 10px 18px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--text-muted);
}

.quick-users {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.quick-users p {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.quick-btn-group {
  display: flex;
  gap: 8px;
}

.quick-btn {
  flex: 1;
  padding: 8px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.quick-btn:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* ==========================================
/* ==========================================
   APP LAYOUT & COLLAPSIBLE SIDEBAR
   ========================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.app-sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  background: rgba(11, 17, 32, 0.96);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 150;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
  height: 70px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  transition: padding 0.25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(250, 160, 47, 0.4));
  border-radius: 8px;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: -0.5px;
  transition: opacity 0.2s ease;
}

.brand-name span {
  color: var(--iopgps-orange);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-tab {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  position: relative;
  white-space: nowrap;
}

.nav-icon {
  font-size: 18px;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav-badge {
  background: #F59E0B;
  color: #0F172A;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.4);
}

.nav-tab.active {
  background: linear-gradient(90deg, rgba(250, 160, 47, 0.16) 0%, rgba(212, 133, 15, 0.08) 100%);
  color: var(--iopgps-orange);
  border-color: rgba(250, 160, 47, 0.4);
  box-shadow: 0 2px 12px rgba(250, 160, 47, 0.15);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(8, 12, 20, 0.4);
}

.sidebar-collapse-btn {
  width: 100%;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.sidebar-collapse-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

.collapse-icon {
  font-size: 12px;
  transition: transform 0.25s ease;
}

/* SIDEBAR COLLAPSED STATE */
.app-sidebar.collapsed {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
}

.app-sidebar.collapsed .sidebar-header {
  padding: 0;
  justify-content: center;
}

.app-sidebar.collapsed .brand-name {
  display: none;
}

.app-sidebar.collapsed .nav-tab {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}

.app-sidebar.collapsed .nav-label {
  display: none;
}

.app-sidebar.collapsed .nav-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  padding: 1px 4px;
  font-size: 9px;
}

.app-sidebar.collapsed .collapse-label {
  display: none;
}

.app-sidebar.collapsed .collapse-icon {
  transform: rotate(180deg);
}

.app-sidebar.collapsed .sidebar-footer {
  padding: 10px 6px;
}

/* Tooltip on collapsed hover */
.app-sidebar.collapsed .nav-tab:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  z-index: 9999;
  pointer-events: none;
  animation: fadeIn 0.15s ease-out forwards;
}

/* MAIN CONTENT WRAPPER */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 70px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-toggle-btn {
  width: 36px;
  height: 36px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.header-toggle-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

.header-view-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* INTERACTIVE USER PROFILE BADGE & DROPDOWN */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.6);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: var(--transition);
}

.user-profile-badge:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(250, 160, 47, 0.45);
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #FAA02F, #D4850F);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #190E01;
  box-shadow: 0 2px 8px rgba(250, 160, 47, 0.4);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-role {
  font-size: 11px;
  color: var(--primary-cyan);
  line-height: 1.2;
}

.dropdown-caret {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: fadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-menu.show {
  display: flex;
}

.dropdown-header {
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.dropdown-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.dropdown-user-email {
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
  margin-top: 3px;
}

.dropdown-user-role {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dropdown-icon {
  font-size: 15px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-cyan);
}

.dropdown-item-danger {
  color: var(--accent-rose);
}

.dropdown-item-danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #ff6b81;
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: -260px;
    z-index: 200;
  }

  .app-sidebar.mobile-open {
    left: 0;
  }
}

/* ==========================================
   MAIN CONTENT & TABS
   ========================================== */
.main-content {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   CARDS & STATS GRID
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon {
  font-size: 20px;
  opacity: 0.8;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
}

.stat-sub {
  font-size: 12px;
  color: var(--accent-emerald);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================
   TABLES & PANELS
   ========================================== */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  background: rgba(30, 41, 59, 0.5);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  color: var(--text-main);
}

.data-table tr:hover {
  background: rgba(30, 41, 59, 0.4);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-disabled {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-role {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-indigo);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(51, 65, 85, 0.8);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-cyan);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================
   MODALS & TOAST NOTIFICATIONS
   ========================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-glow), var(--shadow-card);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--accent-rose);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--primary-cyan);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glow);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Preset Cards */
.preset-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-card:hover {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
}

.preset-card.active {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.perm-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 14px;
}

.perm-title {
  font-size: 13px;
  font-weight: 600;
  color: #F8FAFC;
}

.perm-desc {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 2px;
}

/* ==========================================
   GOOGLE MAPS PARSER & MULTI-LOCATION STYLES
   ========================================== */
.maps-parser-box {
  transition: all 0.2s ease;
}

.maps-parser-box:focus-within {
  border-color: #38BDF8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
}

.maps-feedback-banner {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.maps-feedback-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  color: #34D399;
}

.maps-feedback-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #F87171;
}

.maps-feedback-loading {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38BDF8;
  color: #38BDF8;
}

/* Branch Tags & Badges */
.branch-count-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38BDF8;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.branch-count-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38BDF8;
  transform: translateY(-1px);
}

.customer-commercial-name {
  color: #F8FAFC;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.customer-legal-name {
  color: #94A3B8;
  font-size: 11px;
}

.badge-city {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #A5B4FC;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-coords {
  display: inline-block;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid #334155;
  color: #E2E8F0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: monospace;
}

.branch-main-tag {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FBBF24;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Route Assignment Cards */
.route-branch-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.4);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.route-branch-card:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
}

.route-branch-card.selected {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38BDF8;
}

.route-branch-checkbox {
  accent-color: #38BDF8;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ==========================================================================
   TRACKING & SHIFT DETAILS STYLES
   ========================================================================== */
.tracking-subtab-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tracking-subtab-btn:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.03);
}

.tracking-subtab-btn.active {
  color: #FAA02F;
  border-bottom: 2px solid #FAA02F;
  background: rgba(250, 160, 47, 0.08);
}

.photo-thumb-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #334155;
  background: #0F172A;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.photo-thumb-card:hover {
  transform: scale(1.03);
  border-color: #38BDF8;
}

.photo-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.9));
  padding: 4px 8px;
  font-size: 10px;
  color: #F8FAFC;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Map Custom Popups */
.leaflet-popup-content-wrapper {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border: 1px solid #334155 !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-tip {
  background: #1E293B !important;
}

.custom-marker-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  font-size: 14px;
}

/* ==========================================================================
   PRINT STYLES FOR VISIT REPORT / ACTA
   ========================================================================== */
@media print {
  body * {
    visibility: hidden !important;
  }

  #visitReportModal,
  #visitReportModal * {
    visibility: visible !important;
  }

  #visitReportModal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #FFFFFF !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  .modal-card {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .printable-report {
    background: #FFFFFF !important;
    color: #1E293B !important;
    padding: 20px !important;
    border: none !important;
  }

  .printable-report strong,
  .printable-report div {
    color: #0F172A !important;
  }

  .printable-report span {
    color: #475569 !important;
  }

  .printable-report div[style*="background: rgba"] {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
  }

  #reportSignatureContainer {
    background: #FFFFFF !important;
    border: 1px solid #94A3B8 !important;
  }
}

/* ==========================================================================
   ESTILOS DE GESTIÓN MULTI-TENANT DE ORGANIZACIONES Y EMPRESAS
   ========================================================================== */

/* Badges de Planes de Empresa */
.badge-plan-enterprise {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #C084FC !important;
  border: 1px solid rgba(192, 132, 252, 0.35) !important;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.12);
}

.badge-plan-pro {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.badge-plan-standard {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
  border: 1px solid rgba(52, 211, 153, 0.35) !important;
}

.badge-plan-trial {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #FBBF24 !important;
  border: 1px solid rgba(251, 191, 36, 0.35) !important;
}

/* Barra de progreso de cupos de licencias de usuarios */
.license-progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.license-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}

.license-progress-track {
  height: 6px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.license-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.license-progress-bar.low {
  background: linear-gradient(90deg, #10B981, #34D399);
}

.license-progress-bar.medium {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.license-progress-bar.high {
  background: linear-gradient(90deg, #F43F5E, #FB7185);
}

/* Radio buttons estilizados */
.radio-tile-group {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.radio-tile-label {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.radio-tile-label:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--primary-cyan);
}

.radio-tile-label.selected {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}


