/* styles.css - GCB ChangeGuard ITIL RFC System Stylesheet */
:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Color Palette - Modern ITIL Premium Dark/Light */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass: rgba(17, 24, 39, 0.65);
  --bg-input: #1f2937;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Brand Accents */
  --brand-primary: #3b82f6;
  --brand-primary-hover: #2563eb;
  --brand-glow: rgba(59, 130, 246, 0.25);
  
  /* ITIL Semantic Colors */
  --itil-standard: #10b981;
  --itil-standard-bg: rgba(16, 185, 129, 0.12);
  --itil-normal: #6366f1;
  --itil-normal-bg: rgba(99, 102, 241, 0.12);
  --itil-emergency: #ef4444;
  --itil-emergency-bg: rgba(239, 68, 68, 0.15);
  --itil-warning: #f59e0b;
  --itil-warning-bg: rgba(245, 158, 11, 0.12);
  --itil-info: #0ea5e9;
  --itil-info-bg: rgba(14, 165, 233, 0.12);
  
  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
body.light-theme {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-input: #f9fafb;
  --border-color: #e5e7eb;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* CSS Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Dedicated Full-Screen Login Portal */
.auth-portal-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-image: 
    radial-gradient(at 20% 20%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 80%, rgba(99, 102, 241, 0.15) 0px, transparent 50%);
}

.auth-portal-card {
  max-width: 500px;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(59, 130, 246, 0.1);
  animation: fadeIn 0.35s ease;
}

.auth-portal-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-brand-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1rem;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.auth-portal-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.auth-portal-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.quick-login-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.quick-login-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.quick-login-item .role-title {
  font-size: 0.725rem;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
}

.quick-login-item .user-title {
  font-size: 0.775rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Top Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  flex-wrap: nowrap !important;
  gap: 1rem;
  box-sizing: border-box;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

body.light-theme .brand-text h1 {
  background: linear-gradient(to right, #111827, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.brand-tag .itil-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Nav Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 1;
  max-width: 100%;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2;
}

.nav-item:hover {
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

/* Right Navigation Tools */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* User Profile in Header */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.user-profile-badge:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-primary);
  box-shadow: 0 0 12px var(--brand-glow);
}

.user-avatar-container {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  flex-shrink: 0;
  font-size: 1.15rem;
}

.avatar-img-circle {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

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

.user-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.profile-avatar-upload-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.profile-avatar-preview-box {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-input);
  border: 2.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: var(--shadow-md);
}

.profile-avatar-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.avatar-upload-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--brand-primary);
}

/* User Role Simulator Selector */
.role-simulator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
}

.role-simulator label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.role-simulator select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.role-simulator select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

/* Main Container */
.main-content {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 2rem;
  flex: 1;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out forwards;
}

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

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

/* Dashboard Header & KPI Grid */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-primary);
}

.kpi-card.kpi-success::before { background: var(--itil-standard); }
.kpi-card.kpi-warning::before { background: var(--itil-warning); }
.kpi-card.kpi-danger::before { background: var(--itil-emergency); }
.kpi-card.kpi-purple::before { background: var(--itil-normal); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.06);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.5rem 0 0.25rem;
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Alert Banner */
.collision-alert-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
}

.collision-alert-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.collision-alert-icon {
  font-size: 1.5rem;
}

.collision-alert-text h4 {
  font-size: 0.925rem;
  color: #fca5a5;
  font-weight: 700;
}

.collision-alert-text p {
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* Data Table & Filter Bar */
.table-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.search-input-wrap input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.filter-select {
  padding: 0.55rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.filter-select option {
  background: var(--bg-secondary);
}

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

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

.data-table th {
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-standard { background: var(--itil-standard-bg); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-normal { background: var(--itil-normal-bg); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-emergency { 
  background: var(--itil-emergency-bg); 
  color: #f87171; 
  border: 1px solid rgba(239, 68, 68, 0.4); 
  animation: pulseBadge 1.5s infinite alternate;
}

@keyframes pulseBadge {
  0% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.7); }
}

.badge-risk-low { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-risk-med { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-risk-high { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.badge-risk-crit { background: rgba(239, 68, 68, 0.2); color: #f87171; font-weight: 700; }

.badge-status {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.775rem;
}

.status-borrador { background: #374151; color: #9ca3af; }
.status-revision { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-cab { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.status-aprobado { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-ejecucion { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.status-pruebas { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.status-exitoso { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid #10b981; }
.status-rollback { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; }
.status-rechazado { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid #4b5563; }
.status-aclaraciones { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px dashed #f59e0b; }

/* Wizard Form Styling */
.wizard-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.wizard-steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition);
}

.step-indicator.active {
  opacity: 1;
}

.step-indicator.completed .step-number {
  background: var(--itil-standard);
  color: #ffffff;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
}

.step-indicator.active .step-number {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.step-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.wizard-body {
  padding: 2rem;
}

.wizard-step-content {
  display: none;
}

.wizard-step-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group label .required {
  color: var(--itil-emergency);
  margin-left: 2px;
}

.form-control {
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Category Checkbox Grid */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.category-pill-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.category-pill-label:hover {
  background: var(--bg-card-hover);
}

.category-pill-label input[type="checkbox"]:checked + span {
  color: var(--brand-primary);
  font-weight: 600;
}

.category-pill-label:has(input[type="checkbox"]:checked) {
  border-color: var(--brand-primary);
  background: rgba(59, 130, 246, 0.15);
}

/* Risk Live Calculator Meter */
.risk-calc-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0;
}

.risk-score-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.risk-level-badge-large {
  font-size: 1.25rem;
  font-weight: 800;
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dynamic Tables inside Wizard */
.dynamic-subtable {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.dynamic-subtable th {
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.dynamic-subtable td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

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

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

.modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

/* Detail Modal Sections */
.detail-tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.detail-tab-btn {
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.detail-tab-btn:hover {
  color: var(--text-primary);
}

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

/* FSC Calendar */
.calendar-view {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  min-width: 680px;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 0.4rem;
}

.calendar-day-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 105px;
  max-height: 150px;
  overflow-y: auto;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.calendar-day-cell.today {
  border-color: var(--brand-primary);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.15);
}

.day-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  align-self: flex-end;
}

.cal-event-pill {
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  font-size: 0.725rem;
  font-weight: 700;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  max-width: 100%;
  user-select: none;
}

.cal-event-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.25);
  box-shadow: var(--shadow-sm);
}

.cal-pill-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.cal-pill-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}

/* Digital Signature Box */
.signature-box {
  border: 1px dashed rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.04);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
}

/* Execution Timer */
.live-chronometer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.chrono-time {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #34d399;
  font-family: monospace;
}

/* Timeline component */
.audit-timeline {
  position: relative;
  padding-left: 2rem;
}

.audit-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 3px solid var(--bg-secondary);
}

.timeline-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
}

/* ========================================================================= */
/* PRINTABLE PDF REPORT (ACTA OFICIAL DE CAMBIO ITIL v4) */
/* ========================================================================= */

.rfc-print-report {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 10mm 12mm 10mm;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 8.5pt !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar toda la interfaz web e interactiva */
  .navbar,
  .mobile-bottom-nav,
  .main-content,
  .modal-backdrop,
  .role-simulator,
  .btn,
  .theme-toggle-btn,
  body > *:not(#rfcPrintContainer) {
    display: none !important;
  }

  /* Mostrar exclusivamente el contenedor del Acta */
  .rfc-print-report {
    display: block !important;
    width: 100% !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }

  .acta-document {
    padding: 0;
    margin: 0;
    width: 100%;
  }

  .acta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2.5px solid #1e293b;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .acta-logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .acta-logo-box {
    font-size: 24pt;
    line-height: 1;
  }

  .acta-org-title {
    font-size: 10.5pt;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
  }

  .acta-sub-title {
    font-size: 7.5pt;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
  }

  .acta-meta-box {
    text-align: right;
    font-size: 7.8pt;
  }

  .acta-code-box {
    font-size: 13pt;
    font-weight: 900;
    color: #1d4ed8;
    letter-spacing: 0.05em;
  }

  .acta-meta-row {
    color: #334155;
    margin-top: 2px;
  }

  .acta-main-title {
    background: #1e293b !important;
    color: #ffffff !important;
    text-align: center;
    padding: 5px 8px;
    font-size: 9.5pt;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-radius: 3px;
    margin-bottom: 12px;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .acta-section {
    margin-bottom: 11px;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .acta-section-header {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    font-size: 8.2pt;
    font-weight: 800;
    padding: 4px 8px;
    border-left: 4px solid #2563eb;
    margin-bottom: 5px;
    text-transform: uppercase;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .acta-sub-section-title {
    font-size: 7.8pt;
    font-weight: 700;
    color: #334155;
    margin: 5px 0 3px 0;
  }

  .acta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7.8pt;
    margin-bottom: 5px;
  }

  .acta-table th, .acta-table td {
    border: 1px solid #cbd5e1;
    padding: 4px 6px;
    text-align: left;
    vertical-align: middle;
  }

  .acta-table th {
    background: #f1f5f9 !important;
    color: #0f172a;
    font-weight: 700;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .acta-table-kv td.kv-label {
    background: #f8fafc !important;
    font-weight: 700;
    color: #334155;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .kv-long-text {
    white-space: pre-wrap;
    line-height: 1.35;
  }

  .acta-callout-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 7.8pt;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .acta-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 7.2pt;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
  }

  .acta-badge-success { background: #dcfce7 !important; color: #166534 !important; border-color: #86efac !important; }
  .acta-badge-danger { background: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
  .acta-badge-warning { background: #fef3c7 !important; color: #92400e !important; border-color: #fde68a !important; }

  .acta-risk-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 7.8pt;
    font-weight: 800;
    display: inline-block;
  }
  .acta-risk-bajo { background: #dcfce7 !important; color: #166534 !important; }
  .acta-risk-medio { background: #fef3c7 !important; color: #92400e !important; }
  .acta-risk-alto { background: #ffedd5 !important; color: #c2410c !important; }
  .acta-risk-crítico, .acta-risk-critico { background: #fee2e2 !important; color: #991b1b !important; }

  .acta-signatures-box {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .acta-sig-col {
    flex: 1;
    text-align: center;
    border: 1px solid #cbd5e1;
    padding: 6px 4px;
    border-radius: 3px;
    background: #fdfdfd;
  }

  .acta-sig-line {
    height: 34px;
    border-bottom: 1px solid #475569;
    margin-bottom: 5px;
  }

  .acta-sig-name {
    font-size: 7.8pt;
    font-weight: 800;
    color: #0f172a;
  }

  .acta-sig-role {
    font-size: 7.2pt;
    color: #475569;
    font-weight: 600;
  }

  .acta-sig-meta {
    font-size: 6.8pt;
    color: #94a3b8;
    margin-top: 2px;
  }

  .acta-footer-legal {
    margin-top: 12px;
    font-size: 6.5pt;
    color: #64748b;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 5px;
  }
}

/* ========================================================================= */
/* COMPREHENSIVE RESPONSIVE DESIGN (Mobile, Tablet & Desktop Adaptations) */
/* ========================================================================= */

@media (max-width: 1024px) {
  .navbar {
    padding: 0 1rem;
    gap: 0.75rem;
    flex-wrap: nowrap !important;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
  }

  .nav-links {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .search-input-wrap {
    width: 100%;
  }

  .filter-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .filter-select {
    flex: 1 1 140px;
  }
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Compact Native Top App Bar */
  .navbar {
    height: 60px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 120;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
  }

  body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.95);
  }

  .nav-links {
    display: none !important;
  }

  .nav-brand .brand-tag {
    display: none;
  }

  .nav-brand h1 {
    font-size: 1.05rem;
    font-weight: 800;
  }

  .nav-brand .brand-icon {
    font-size: 1.35rem;
  }

  .nav-actions {
    gap: 0.5rem;
    align-items: center;
  }

  .nav-actions .btn-secondary {
    display: none; /* Accessible from mobile drawer */
  }

  .user-profile-badge {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .user-profile-badge .user-info {
    display: none;
  }

  .user-avatar-container {
    width: 36px;
    height: 36px;
    border: 2px solid var(--brand-primary);
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }

  /* Main View Container */
  .main-content {
    padding: 0.85rem 0.85rem 90px 0.85rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .page-title {
    font-size: 1.2rem;
  }

  /* Mobile 2x2 Clean KPI Grid (iOS/Android Native Card Style) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
  }

  .kpi-card {
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius-md);
  }

  .kpi-header h4 {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
  }

  .kpi-icon {
    font-size: 1.15rem;
  }

  .kpi-value {
    font-size: 1.45rem;
    margin: 0.35rem 0 0.15rem 0;
  }

  .kpi-subtext {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  /* Native Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(17, 24, 39, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 180;
    padding: 0 0.5rem env(safe-area-inset-bottom, 0) 0.5rem;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.45);
  }

  body.light-theme .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
  }

  .mobile-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    gap: 2px;
    flex: 1;
    height: 100%;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
  }

  .mobile-nav-tab.active {
    color: var(--brand-primary);
  }

  .mobile-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .mobile-nav-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
    cursor: pointer;
    margin-top: -22px;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    touch-action: manipulation;
  }

  .mobile-nav-fab:active {
    transform: scale(0.92);
  }

  .mobile-fab-icon {
    font-size: 1.35rem;
    line-height: 1;
  }

  /* Mobile Drawer Bottom Sheet */
  .mobile-drawer-card {
    margin-top: auto;
    border-radius: 24px 24px 0 0 !important;
    max-width: 100% !important;
    max-height: 85vh !important;
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .mobile-sheet-drag-handle {
    width: 38px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 0.65rem auto 0.25rem auto;
  }

  body.light-theme .mobile-sheet-drag-handle {
    background: rgba(0, 0, 0, 0.2);
  }

  .mobile-drawer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .mobile-drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
  }

  .mobile-drawer-item:active {
    background: var(--bg-card-hover);
    border-color: var(--brand-primary);
    transform: scale(0.97);
  }

  .drawer-item-icon {
    font-size: 1.5rem;
  }

  /* Forms & Wizard */
  .wizard-card {
    padding: 1rem 0.85rem;
  }

  .wizard-steps-header {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  .step-indicator {
    min-width: 120px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .wizard-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem 0.85rem;
  }

  .wizard-footer > div {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .wizard-footer button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Modals Mobile Bottom Sheet Style */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    margin-top: auto;
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-body {
    padding: 1rem 1.25rem;
  }

  .modal-footer {
    padding: 0.85rem 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-footer button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .live-chronometer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .calendar-view {
    padding: 0.75rem;
  }
}

/* ========================================================================= */
/* AI COPILOT & CONVERSATIONAL ASSISTANT STYLES */
/* ========================================================================= */

.btn-ai {
  background: linear-gradient(135deg, #6366f1, #9333ea);
  color: #ffffff;
  border: 1px solid rgba(192, 132, 252, 0.3);
  box-shadow: 0 4px 15px rgba(147, 51, 234, 0.35);
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-ai:hover {
  background: linear-gradient(135deg, #4f46e5, #7e22ce);
  box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5);
  transform: translateY(-1px);
}

.ai-sparkle-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.ai-sparkle-icon-sm {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.ai-loading-glow {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top-color: #c084fc;
  animation: spinGlow 0.9s linear infinite;
}

@keyframes spinGlow {
  to { transform: rotate(360deg); }
}

/* Floating AI Assistant Widget */
.floating-ai-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
}

.floating-ai-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  background: linear-gradient(135deg, #6366f1, #9333ea);
  color: #ffffff;
  border: 1px solid rgba(192, 132, 252, 0.4);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(147, 51, 234, 0.45);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-ai-toggle:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(147, 51, 234, 0.6);
}

.ai-toggle-icon {
  font-size: 1.1rem;
  animation: sparklePulse 2s ease-in-out infinite;
}

@keyframes sparklePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(10deg); }
}

/* Floating Chat Window */
.ai-chat-window {
  display: none;
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 500px;
  max-height: 75vh;
  background: var(--bg-card);
  border: 1px solid rgba(147, 51, 234, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  overflow: hidden;
  animation: slideUpAi 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.active {
  display: flex;
}

@keyframes slideUpAi {
  from { opacity: 0; transform: translateY(15px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-header {
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #4f46e5, #7e22ce);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chat-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.ai-chat-close:hover {
  opacity: 1;
}

.ai-chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ai-message {
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  line-height: 1.45;
  max-width: 90%;
  word-wrap: break-word;
}

.ai-message-system {
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(147, 51, 234, 0.25);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.ai-message-user {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ai-message-loading {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-chat-input-box {
  padding: 0.75rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.ai-chat-input-box input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  color: var(--text-primary);
  outline: none;
}

.ai-chat-input-box input:focus {
  border-color: #a855f7;
}

@media (max-width: 768px) {
  .floating-ai-widget {
    bottom: 74px; /* Above mobile bottom bar */
    right: 14px;
  }
  .ai-chat-window {
    width: calc(100vw - 28px);
    right: 0;
    bottom: 56px;
    height: 440px;
  }
}
