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

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: rgba(16, 20, 30, 0.6);
  --bg-card: rgba(22, 28, 45, 0.4);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(0, 242, 254, 0.5);
  
  --primary: #00f2fe;
  --primary-glow: rgba(0, 242, 254, 0.15);
  --secondary: #4facfe;
  --accent: #7f00ff;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #0a0d14;
  
  --status-active: #10b981;
  --status-inactive: #ef4444;
  --status-abandoned: #6b7280;
  --status-construction: #3b82f6;
  --status-critical: #f59e0b;
  
  --glass-blur: blur(16px);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Login Screen */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at top right, rgba(127, 0, 255, 0.15), transparent 40%),
              radial-gradient(circle at bottom left, rgba(0, 242, 254, 0.15), transparent 40%),
              var(--bg-primary);
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  padding: 40px;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: translateY(0);
  animation: floatIn 0.6s ease-out;
}

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

.login-logo {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  transition: var(--transition);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px var(--primary-glow);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 12px;
  color: var(--text-inverse);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.error-msg {
  color: var(--status-inactive);
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal page-stretching on mobile */
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 40px;
  text-align: center;
}

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

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-muted);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item i {
  margin-right: 12px;
  font-size: 1.2rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.06), transparent);
}

.sidebar-footer {
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.user-info {
  font-size: 0.85rem;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  display: block;
  font-weight: 600;
  color: var(--text-main);
}

.user-info small {
  color: var(--text-muted);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--status-inactive);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  margin-left: 260px;
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Critical flex shrink fix for tables on mobile */
}

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

.header h1 {
  font-size: 2rem;
  font-weight: 600;
}

.selector-panel {
  display: flex;
  gap: 15px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 16px;
}

.select-custom {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  padding-right: 20px;
}

.select-custom option {
  background: var(--bg-primary);
  color: var(--text-main);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(0, 242, 254, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  color: var(--primary);
}

.kpi-details h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 4px;
}

.kpi-details .value {
  font-size: 1.8rem;
  font-weight: 700;
}

/* Sections & Cards */
.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
  width: 100%;
  min-width: 0;
}

.view-section.active {
  display: block;
}

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

.grid-2col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* Keep inner tables contained */
}

.panel-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-card h2 i {
  color: var(--primary);
}

/* Maps */
#map {
  height: 500px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  z-index: 10;
}

/* Alert Lists */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 12px;
}

.alert-item.critical {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.alert-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-inactive);
  box-shadow: 0 0 8px var(--status-inactive);
  flex-shrink: 0;
  animation: pulse 1.5s infinite;
}

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

.alert-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Donut Chart Container */
.chart-container {
  position: relative;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 15px;
}

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

.data-table th {
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.active { background: rgba(16, 185, 129, 0.1); color: var(--status-active); }
.status-badge.inactive { background: rgba(239, 68, 68, 0.1); color: var(--status-inactive); }
.status-badge.abandoned { background: rgba(107, 114, 128, 0.1); color: var(--status-abandoned); }
.status-badge.construction { background: rgba(59, 130, 246, 0.1); color: var(--status-construction); }

/* Buttons */
.btn-action {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  margin-right: 5px;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-action.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--status-inactive);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-success {
  background: var(--status-active);
  color: var(--text-inverse);
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-success:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 13, 20, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  padding: 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: floatIn 0.4s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.form-grid .full-width {
  grid-column: span 2;
}

/* Canvas View for Well & Strata */
.canvas-wrapper {
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 20px;
  overflow: hidden;
}

#wellCanvas, #strataCanvas {
  max-width: 100%;
  background: transparent;
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-list {
  list-style: none;
}

.detail-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

.detail-list li span:first-child {
  color: var(--text-muted);
}

.detail-list li span:last-child {
  font-weight: 500;
}

/* Layout modifications when screen is small */
@media (max-width: 1024px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
  .grid-equal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 80px;
    padding: 20px 10px;
  }
  .sidebar-logo {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }
  .nav-item span, .user-info, .sidebar-footer button span {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .nav-item i {
    margin-right: 0;
  }
  .main-content {
    margin-left: 80px;
    padding: 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full-width {
    grid-column: span 1;
  }
  .detail-columns {
    grid-template-columns: 1fr;
  }
}

/* --- Added Styles for Drawing Tools, Forms, and Map UI --- */

/* Map wrapper relative for floating panels */
.map-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

#map {
  height: 100%;
  width: 100%;
  border-radius: 0;
  border: none;
}

/* Floating Map Toolbar */
.map-toolbar {
  position: absolute;
  top: 10px;
  left: 50px;
  z-index: 1000;
  display: flex;
  gap: 6px;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.map-toolbar-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.map-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
}

.map-toolbar-btn.active {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Map Instruction Banner */
.drawing-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: none; /* Controlled dynamically */
  align-items: center;
  gap: 15px;
  background: rgba(239, 68, 68, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.9rem;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: floatIn 0.3s ease-out;
}

.drawing-banner .btn-banner-action {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.drawing-banner .btn-banner-finish {
  background: #ffffff;
  color: var(--status-inactive);
}

.drawing-banner .btn-banner-cancel {
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  margin-left: 5px;
}

.drawing-banner .btn-banner-finish:hover,
.drawing-banner .btn-banner-cancel:hover {
  filter: brightness(1.1);
}

/* Form Row and Columns */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-column {
  display: flex;
  flex-direction: column;
}

/* Input group with side button (coordinate pickers) */
.input-group-with-btn {
  display: flex;
  gap: 8px;
}

.input-group-with-btn input {
  flex-grow: 1;
}

.btn-icon-map {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-icon-map:hover {
  background: var(--primary);
  color: var(--text-inverse);
}

/* Form Buttons Container */
.btn-submit-container {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Color Picker input */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

/* Tab panels inside Forms */
.form-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
}

.form-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.form-tab-btn:hover {
  color: var(--text-main);
}

.form-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.form-tab-content {
  display: none;
}

.form-tab-content.active {
  display: block;
}

/* Section Separator inside forms */
.form-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin: 15px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

/* Mobile responsive rules */

/* Make canvas scale to container size on mobile */
.canvas-wrapper canvas {
  max-width: 100%;
  height: auto !important;
}

/* Compact header logout styling for mobile */
#btnHeaderLogout {
  display: none;
  border-radius: 8px;
  font-size: 0.85rem;
  padding: 6px 12px;
  width: auto;
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  /* Stack selectors vertically */
  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .selector-panel {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  
  .selector-panel div {
    border-left: none !important;
    padding-left: 0 !important;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  
  .selector-panel div:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .selector-panel select {
    flex-grow: 1;
    text-align: right;
  }

  /* Support horizontal scroll for data tables */
  .table-container {
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table th, .data-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  /* Responsive Modals */
  .modal-content {
    padding: 20px 15px;
    width: 95%;
    max-height: 85vh;
    margin-bottom: 65px; /* Leave space for bottom nav bar */
  }
  
  .detail-columns {
    grid-template-columns: 1fr;
  }
  
  .canvas-wrapper {
    padding: 10px;
  }
}

/* Bottom Tab Bar for Smartphone viewports */
@media (max-width: 500px) {
  /* Show header logout button */
  #btnHeaderLogout {
    display: inline-block;
  }
  
  /* Reposition sidebar to bottom of screen */
  .sidebar {
    width: 100%;
    height: 60px;
    bottom: 0;
    left: 0;
    top: auto;
    flex-direction: row;
    padding: 0 10px;
    border-right: none;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    z-index: 300 !important; /* Stand above modals! */
  }
  
  .sidebar-logo {
    display: none;
  }
  
  .nav-menu {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    gap: 0;
    margin: 0;
  }
  
  .nav-item {
    flex-direction: column;
    padding: 6px 0;
    font-size: 0.62rem; /* Adjusted for 6 items */
    border-left: none !important; /* Remove the vertical border */
    border-bottom: 3px solid transparent;
    flex: 1; /* Distribute space evenly among all items */
    justify-content: center;
    align-items: center;
    border-radius: 0;
    background: transparent !important;
  }
  
  .nav-item i {
    margin-right: 0;
    margin-bottom: 4px;
    font-size: 1.1rem;
  }
  
  .nav-item span {
    display: block !important;
  }
  
  .nav-item.active {
    border-left: none !important; /* Remove active vertical border */
    border-bottom: 3px solid var(--primary);
    background: linear-gradient(0deg, rgba(0, 242, 254, 0.06), transparent) !important;
  }
  
  .sidebar-footer {
    display: none; /* Hide profile info and desktop logout */
  }
  
  /* Shift main content up to leave space for bottom bar */
  .main-content {
    margin-left: 0;
    margin-bottom: 65px;
    padding: 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Estilos personalizados para el Manual de Usuario */
.manual-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.manual-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.manual-card h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.manual-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--secondary);
  margin: 20px 0 10px;
}

.manual-card p {
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.manual-card ul, .manual-card ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

.manual-card li {
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
}

.manual-card strong {
  color: var(--primary);
}

.manual-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed var(--primary);
  transition: var(--transition);
  padding: 0 2px;
  border-radius: 4px;
}

.manual-link:hover {
  background: rgba(0, 242, 254, 0.1);
  color: #fff;
  border-bottom-style: solid;
}

.manual-step {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: flex-start;
}

.manual-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-inverse);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.manual-step-text {
  flex-grow: 1;
}

