:root {
  --bg-main: #f8fafc;
  --bg-gradient: none;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-input: #ffffff;
  --bg-input-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --placeholder-color: #94a3b8;
  
  /* Las Plumas Palette Integration */
  --primary: #23764c;
  --primary-glow: rgba(35, 118, 76, 0.12);
  --primary-hover: #1b5d3b;
  --accent: #449751;
  --accent-glow: rgba(68, 151, 81, 0.12);
  --accent-hover: #387d43;
  
  --gradient-brand: linear-gradient(135deg, var(--primary), var(--accent));
  --gradient-brand-hover: linear-gradient(135deg, var(--primary-hover), var(--accent-hover));
  
  --green: #23764c;
  --green-glow: rgba(35, 118, 76, 0.12);
  --orange: #f59e0b;
  --orange-glow: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.15);
  
  --font-outfit: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-color-hover);
}

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

body {
  font-family: var(--font-inter);
  background: var(--bg-gradient) no-repeat fixed;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, .brand h1, .value {
  font-family: var(--font-outfit);
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: var(--transition-smooth);
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--gradient-brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-outfit);
  font-size: 20px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
}

.nav-item svg {
  transition: var(--transition-smooth);
}

.nav-item:hover {
  color: var(--text-main);
  background-color: var(--bg-input-hover);
}

.nav-item.active {
  color: var(--primary);
  background-color: rgba(35, 118, 76, 0.08);
  border-left-color: var(--primary);
  box-shadow: none;
}

.nav-item.active svg {
  transform: scale(1.05);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
  border: 1px dashed var(--primary);
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.install-btn:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.status-indicator-offline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 8px;
}

.status-indicator-offline .dot {
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--green);
  transition: var(--transition-smooth);
}

.status-indicator-offline.offline .dot {
  background-color: var(--red);
  box-shadow: 0 0 8px var(--red);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  margin-left: 260px;
  padding: 40px;
  min-width: 0; /* Prevents flex items from breaking grid */
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
}

.header-title h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.date-display {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background-color: var(--bg-input);
  transform: translateY(-2px);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-main);
  animation: pulse 2s infinite;
}

/* Notifications Dropdown */
.notification-wrapper {
  position: relative;
}

.notification-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
  animation: slideDown 0.3s ease;
  backdrop-filter: blur(10px);
}

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

.dropdown-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.dropdown-content {
  max-height: 280px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dropdown-item:hover {
  background-color: var(--bg-input-hover);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-info h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-main);
}

.notif-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.empty-notif {
  padding: 30px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.avatar {
  width: 28px;
  height: 28px;
  background: var(--gradient-brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

/* Helper Buttons & Links */
.text-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.text-link-btn:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Tab contents animation */
.tab-content {
  animation: fadeIn 0.4s ease;
}

.hidden {
  display: none !important;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.stat-header .title {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-header .icon {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-blue { background-color: rgba(139, 61, 255, 0.1); color: var(--primary); }
.bg-green { background-color: rgba(16, 185, 129, 0.1); color: var(--green); }
.bg-orange { background-color: rgba(245, 158, 11, 0.1); color: var(--orange); }
.bg-red { background-color: rgba(239, 68, 68, 0.1); color: var(--red); }

.stat-card .value {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}

.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }

.stat-card .footer {
  font-size: 12px;
  color: var(--text-muted);
}

/* Critical Alerts Container */
.critical-alerts-container {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 32px;
  animation: shake 0.5s ease-in-out;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.critical-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 4px;
}

.alert-item-strip {
  background: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.alert-item-strip .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-item-strip .dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.alert-item-strip .title-bold {
  font-weight: 600;
  color: var(--text-main);
}

.alert-item-strip .exp-date {
  color: var(--red);
  font-weight: 500;
  font-size: 13px;
}

.alert-item-strip .action-btn {
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 6px 12px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.alert-item-strip .action-btn:hover {
  background-color: #dc2626;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* DASHBOARD GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
}

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

.badge-tag {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
}

/* Upcoming Timeline styling */
.upcoming-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  padding-bottom: 8px;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: -20px;
  width: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  z-index: 5;
}

.timeline-badge.badge-red { background-color: var(--red-glow); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.timeline-badge.badge-orange { background-color: var(--orange-glow); color: var(--orange); border: 1px solid rgba(245, 158, 11, 0.3); }
.timeline-badge.badge-green { background-color: var(--green-glow); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); }

.timeline-info {
  flex-grow: 1;
}

.timeline-info .flex-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.timeline-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.timeline-title:hover {
  color: var(--primary);
  text-decoration: underline;
}

.timeline-days {
  font-size: 12px;
  font-weight: 600;
}

.timeline-entity {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Category progress breakdown */
.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.category-stat-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.category-name {
  font-weight: 500;
  color: var(--text-main);
}

.category-count {
  font-weight: 600;
  color: var(--text-muted);
}

.category-progress-container {
  height: 8px;
  width: 100%;
  background-color: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.category-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient-brand);
  transition: width 1s ease-out;
}

.empty-text {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* FILTERS BAR CARD */
.filters-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
}

.filters-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 500px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input,
.search-input-wrapper input[type="text"] {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 16px 12px 48px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filters-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  appearance: none;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 32px 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
}

.select-wrapper select:focus {
  border-color: var(--primary);
}

.select-wrapper::after {
  content: '▼';
  font-size: 8px;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* BUTTONS */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.primary-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.secondary-btn:hover {
  background-color: var(--bg-input-hover);
  border-color: var(--border-color-hover);
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.danger-btn:hover {
  background-color: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 4px 12px var(--red-glow);
}

/* PERMITS GRID */
.permits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.permit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.permit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.permit-card.status-vigente::before { background-color: var(--green); }
.permit-card.status-por-vencer::before { background-color: var(--orange); }
.permit-card.status-vencido::before { background-color: var(--red); }
.permit-card.status-cerrado::before { background-color: #64748b; }

.permit-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

.permit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.permit-category-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.vigente { background-color: var(--green-glow); color: var(--green); }
.status-badge.por-vencer { background-color: var(--orange-glow); color: var(--orange); }
.status-badge.vencido { background-color: var(--red-glow); color: var(--red); }
.status-badge.cerrado { background-color: rgba(100, 116, 139, 0.15); color: #64748b; }

.permit-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
  line-height: 1.3;
}

.permit-card-entity {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.permit-card-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  background-color: rgba(35, 118, 76, 0.08);
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
  border: 1px solid rgba(35, 118, 76, 0.15);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-item .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}

.info-item .val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.permit-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.file-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.file-pill.no-file {
  color: var(--text-muted);
}

.card-view-details {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

.card-view-details:hover {
  color: var(--primary-hover);
}

/* EMPTY STATE */
.empty-state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
}

.empty-icon {
  margin-bottom: 20px;
  color: var(--text-muted);
}

.empty-state-view h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state-view p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  max-width: 400px;
}

/* FORMS */
.form-container-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  backdrop-filter: blur(10px);
}

.form-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.form-header h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-header p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  font-family: var(--font-inter);
  transition: var(--transition-smooth);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* File Dropzone */
.file-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
  background-color: rgba(15, 23, 42, 0.2);
  transition: var(--transition-smooth);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.file-dropzone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-glow);
}

.file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  color: var(--text-muted);
}

.dropzone-content .main-text {
  font-size: 14px;
  font-weight: 500;
}

.dropzone-content .main-text span {
  color: var(--primary);
  font-weight: 600;
}

.dropzone-content .sub-text {
  font-size: 12px;
  color: var(--text-muted);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  width: 100%;
  max-width: 380px;
  z-index: 10;
}

.file-info {
  text-align: left;
  flex-grow: 1;
  overflow: hidden;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 11px;
  color: var(--text-muted);
}

.remove-file-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.remove-file-btn:hover {
  color: var(--red);
}

.existing-file-info {
  font-size: 13px;
  margin-top: 6px;
}

.existing-file-info a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.existing-file-info a:hover {
  text-decoration: underline;
}

.form-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* MODAL OVERLAY & CARD */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal-btn:hover {
  color: var(--red);
  background: none;
  border: none;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Modal Detail items */
.detail-item-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-detail-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background-color: rgba(35, 118, 76, 0.08);
  border: 1px solid rgba(35, 118, 76, 0.15);
  border-radius: var(--border-radius-md);
}

.modal-detail-box.full-width {
  grid-column: span 2;
}

.modal-detail-box .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}

.modal-detail-box .value-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.modal-detail-box .notes-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-main);
  white-space: pre-line;
  line-height: 1.5;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-input-hover);
}

.modal-footer div {
  display: flex;
  gap: 12px;
}

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

.toast {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  color: var(--text-main);
  min-width: 300px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
}

.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
}

.toast.success::before { background-color: var(--green); }
.toast.success svg { color: var(--green); }
.toast.error::before { background-color: var(--red); }
.toast.error svg { color: var(--red); }
.toast.info::before { background-color: var(--primary); }
.toast.info svg { color: var(--primary); }

.toast-message {
  font-size: 13px;
  font-weight: 500;
  flex-grow: 1;
}

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

.toast-close:hover {
  color: var(--text-main);
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* RESPONSIVE LAYOUT (MOBILE FIRST OR BREAKPOINTS) */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 80px;
    padding: 24px 10px;
    align-items: center;
  }
  
  .brand h1 {
    display: none;
  }
  
  .nav-item span {
    display: none;
  }
  
  .nav-item {
    padding: 12px;
    justify-content: center;
  }
  
  .main-content {
    margin-left: 80px;
    padding: 24px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .filters-bar-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .filters-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .select-wrapper select,
  .filters-actions button {
    width: 100%;
  }
  
  .search-input-wrapper {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    position: fixed;
    bottom: 0;
    top: auto;
    border-right: none;
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    padding: 0 10px;
    background-color: var(--bg-sidebar);
  }
  
  .brand {
    display: none;
  }
  
  .nav-menu {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }
  
  .nav-item {
    border-radius: 0;
    flex-grow: 1;
    justify-content: center;
    padding: 15px 0;
  }
  
  .nav-item.active {
    box-shadow: none;
    background-color: transparent;
    color: var(--primary);
    border-top: 3px solid var(--primary);
  }
  
  .main-content {
    margin-left: 0;
    margin-bottom: 60px;
    padding: 16px;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 12px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .modal-card {
    max-width: 90%;
  }
  
  .detail-item-row {
    grid-template-columns: 1fr;
  }
  
  .modal-detail-box.full-width {
    grid-column: span 1;
  }
  
  .sidebar-footer {
    display: none;
  }

  .form-container-card {
    padding: 16px;
  }

  .form-row-group {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
  }

  .modal-footer div {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .modal-footer button, .modal-footer div button {
    width: 100%;
    margin: 0 !important;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* ==========================================
   NUEVOS ESTILOS: LOGIN, USUARIOS Y LOGO
   ========================================== */

.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-gradient);
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-wrapper {
  width: 180px;
  height: 60px;
  background-color: transparent;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: none;
  overflow: hidden;
  padding: 0;
}

.login-logo-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-header p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* TABLA DE USUARIOS */
.users-table td {
  padding: 16px 24px;
  font-size: 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.users-table tr {
  transition: var(--transition-smooth);
}

.users-table tr:hover {
  background-color: var(--bg-input-hover);
}

/* Estilo Premium para Inputs de Archivos (File Inputs) */
input[type="file"]:not(.file-input) {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-main);
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
  font-family: var(--font-inter);
  transition: var(--transition-smooth);
}

input[type="file"]:not(.file-input):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input[type="file"]:not(.file-input)::file-selector-button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 6px 12px;
  margin-right: 12px;
  font-family: var(--font-inter);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px var(--primary-glow);
}

input[type="file"]:not(.file-input)::file-selector-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Global input placeholders styling */
::placeholder {
  color: var(--placeholder-color) !important;
  opacity: 1; /* Firefox */
}

/* Header Headings styling */
.header-title h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
  display: inline-block;
}

.form-header h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Custom Select Dropdowns scrollable styling */
.custom-select-wrapper {
  position: relative;
  flex-grow: 1;
}

.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  min-height: 46px;
}

.custom-select-trigger:hover {
  background-color: var(--bg-input-hover);
  border-color: var(--border-color-hover);
}

.custom-select-panel {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.custom-select-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.custom-select-item:hover {
  background-color: rgba(35, 118, 76, 0.1);
  color: var(--primary);
}

.custom-select-item.disabled {
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.02);
}

.custom-select-item.selected {
  background-color: rgba(35, 118, 76, 0.2);
  color: var(--primary);
  font-weight: 500;
}




/* Configuration Grid of Cards */
.config-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  min-height: 250px;
}

.config-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary); /* Green accent */
}

.config-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(35, 118, 76, 0.3);
}

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

.config-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  background-color: rgba(35, 118, 76, 0.08);
  border: 1px solid rgba(35, 118, 76, 0.15);
  color: var(--primary);
}

.config-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background-color: var(--green-glow);
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.config-card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.config-card-body h4 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--text-main);
  line-height: 1.3;
}

.config-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 12px;
  line-height: 1.4;
}

.config-card-preview {
  margin-top: auto;
  padding: 10px 12px;
  background-color: rgba(35, 118, 76, 0.04);
  border-radius: var(--border-radius-md);
  border: 1px dashed rgba(35, 118, 76, 0.15);
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
  max-height: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.config-card-preview-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.config-card-preview-logo img {
  height: 24px;
  max-width: 75px;
  object-fit: contain;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  border-radius: 2px;
}

.config-card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.config-card-btn {
  background-color: rgba(35, 118, 76, 0.08);
  border: 1px solid rgba(35, 118, 76, 0.15);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.config-card-btn:hover {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(35, 118, 76, 0.2);
}

/* Autocomplete Dropdown styles */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  margin-top: 4px;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bg-input-hover);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: var(--bg-input-hover);
}

.autocomplete-item .bp-name {
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
  font-size: 13px;
}

.autocomplete-item .bp-code {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

/* Custom pill checkbox styles for user registration modal */
.pill-checkbox-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pill-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pill-checkbox-label:hover {
  background: rgba(35, 118, 76, 0.08);
  border-color: rgba(35, 118, 76, 0.3);
}

.pill-checkbox-label.selected,
.pill-checkbox-label:has(input[type="checkbox"]:checked) {
  background: rgba(35, 118, 76, 0.15) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 600;
}

/* PASSWORD EYE TOGGLE STYLES */
.password-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 42px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
  z-index: 5;
}

.password-toggle-btn:hover {
  color: var(--primary);
  background-color: rgba(35, 118, 76, 0.1);
}

