/* ==========================================================================
   DESIGN SYSTEM & CUSTOM VARIABLES (Studios OA Space ERP)
   ========================================================================== */
:root {
  /* Royal Blue Color Palette & Dark Theme */
  --bg-primary: #0a0e1a;         /* Base window background (deep navy) */
  --bg-secondary: rgba(19, 28, 56, 0.72);       /* Card and sidebar background (translucent) */
  --bg-tertiary: #1b264f;        /* Inputs, dropdowns, table headers */
  --bg-hover: #24326b;           /* Hover states on interactive elements */
  
  --accent-blue: #2563eb;        /* Royal Blue accent */
  --accent-blue-hover: #1d4ed8;  /* Royal Blue hover */
  --accent-purple: #8b5cf6;      /* Purple accent for status and dots */
  --accent-pink: #ec4899;        /* Pink gradient highlight */
  
  /* Status Colors */
  --color-success: #10b981;      /* Green for Completado, Pagado, Active */
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;      /* Amber for En Proceso, Pendiente, Pausada */
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger: #ef4444;       /* Red for Suspendido, Cancelado, Non-conformity */
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-info: #3b82f6;         /* Blue for Planificación, Info */
  --color-info-bg: rgba(59, 130, 246, 0.15);
  
  /* Text colors */
  --text-white: #ffffff;
  --text-primary: #f8fafc;       /* Off-white */
  --text-secondary: #94a3b8;     /* Slate grey */
  --text-muted: #64748b;         /* Darker slate grey */
  
  /* Borders and Glassmorphism */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-focus: rgba(37, 99, 235, 0.5);
  --glass-bg: rgba(19, 28, 56, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.4);
  
  /* Animations & Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(rgba(6, 10, 26, 0.85), rgba(6, 10, 26, 0.91)), url('bg_milky_way.png') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Glassmorphism Backdrop Blurs */
.metric-card, .chart-card, .details-card, .table-container, .sgc-card, .hr-profile-panel, .modal-box {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Smooth custom scrollbars for table container and content views */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* ==========================================================================
   APP CONTAINER LAYOUT (Highly responsive, full screen)
   ========================================================================== */
.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */
.sidebar {
  background-color: #070b17; /* Extra dark base for sidebar */
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  transition: transform var(--transition-normal);
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px 12px 20px;
}

.logo-svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.sidebar-meta {
  padding: 0 24px 20px 24px;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-meta span {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 700;
}
.sidebar-meta h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
}

.sidebar-nav {
  padding: 20px 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all var(--transition-fast);
}
.nav-item i {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}
.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-white);
}
.nav-item.active {
  background-color: var(--bg-tertiary);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 3px solid var(--accent-blue);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.1);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   MAIN CONTENT & HEADER
   ========================================================================== */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.top-bar {
  height: 70px;
  width: 100%;
  min-width: 0;
  padding: 0 clamp(20px, 2.2vw, 40px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px;
  width: 380px;
  transition: all var(--transition-fast);
}
.search-box i {
  color: var(--text-secondary);
  margin-right: 10px;
  width: 16px;
  height: 16px;
}
.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  outline: none;
}
.search-box input::placeholder {
  color: var(--text-muted);
}
.search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--color-success);
  opacity: 0.6;
  animation: pulse-ring 1.5s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}
.status-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.date-display {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.notification-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.notification-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-white);
}
.notification-btn i {
  width: 18px;
  height: 18px;
}
.notification-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background-color: var(--color-danger);
  color: var(--text-white);
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ==========================================================================
   DYNAMIC VIEWS CONTAINER & TYPOGRAPHY
   ========================================================================== */
.view-container {
  flex-grow: 1;
  width: 100%;
  min-width: 0;
  padding: clamp(20px, 2.2vw, 40px);
  overflow-y: auto;
  position: relative;
}

.app-view {
  display: none;
  width: 100%;
  min-width: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.app-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 16px;
}
.view-category {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.view-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-white);
  margin-top: 4px;
}
.view-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 650px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}
.btn i {
  width: 15px;
  height: 15px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #312e81 100%);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #3b82f6 0%, #312e81 100%);
}
.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-muted);
}
.btn-danger {
  background-color: var(--color-danger);
  color: var(--text-white);
}
.btn-danger:hover {
  background-color: #dc2626;
}

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

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}
.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.metric-icon i {
  width: 18px;
  height: 18px;
}
.bg-blue { background-color: rgba(37, 99, 235, 0.15); color: #60a5fa; }
.bg-green { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.bg-purple { background-color: rgba(139, 92, 246, 0.15); color: #c084fc; }
.bg-red { background-color: rgba(239, 108, 108, 0.15); color: #f87171; }

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 8px;
}
.metric-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}
.metric-footer i {
  width: 14px;
  height: 14px;
}
.text-green { color: var(--color-success); }
.text-red { color: var(--color-danger); }
.text-blue { color: var(--color-info); }
.text-white { color: var(--text-white); }

/* ==========================================================================
   CHARTS & GRAPHS SECTION
   ========================================================================== */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 1200px) {
  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 20px;
}
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

/* ==========================================================================
   DETAILS GRIDS (Activities, critical alerts)
   ========================================================================== */
.dashboard-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .dashboard-details-grid {
    grid-template-columns: 1fr;
  }
}

.details-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child {
  border: none;
  padding-bottom: 0;
}
.activity-status-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-status-icon i {
  width: 15px;
  height: 15px;
}
.activity-content {
  flex-grow: 1;
}
.activity-header-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.activity-details {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* ==========================================================================
   FILTER BAR STYLING
   ========================================================================== */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  padding: 16px 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.search-input-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  flex-grow: 1;
  max-width: 450px;
}
.search-input-wrapper i {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  margin-right: 8px;
}
.search-input-wrapper input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}
.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}
.filter-selects select {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.filter-selects select:focus {
  border-color: var(--accent-blue);
}

/* ==========================================================================
   DATA TABLES STYLING
   ========================================================================== */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

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

.data-table th {
  background-color: rgba(27, 38, 79, 0.5); /* Semi transparent bg-tertiary */
  padding: 16px 20px;
  font-weight: 700;
  color: var(--text-white);
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 1px;
}

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

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

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

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Specific States Badge Colors */
.status-completed, .status-pagado, .status-activo, .status-finalizada, .status-activa {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}
.status-process, .status-pendiente, .status-pausada {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
}
.status-suspended, .status-cancelado, .status-inactivo {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}
.status-plan, .status-planificacion {
  background-color: var(--color-info-bg);
  color: var(--color-info);
}

/* Row Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.btn-icon:hover {
  color: var(--text-white);
  background-color: var(--bg-hover);
  border-color: var(--border-color);
}
.btn-icon-delete:hover {
  color: var(--color-danger);
  background-color: var(--color-danger-bg);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-icon i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   FINANCIAL LAYOUT MODULE
   ========================================================================== */
.financial-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.fin-card {
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.fin-card span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fin-card h3 {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
}
.bg-green-tint {
  background-color: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
  color: #a7f3d0;
}
.bg-red-tint {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.bg-blue-tint {
  background-color: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.15);
  color: #bfdbfe;
}

/* ==========================================================================
   SISTEMAS DE GESTIÓN DE CALIDAD (SGC) MODULE
   ========================================================================== */
.sgc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1024px) {
  .sgc-grid {
    grid-template-columns: 1fr;
  }
  .card-span-2 {
    grid-column: span 1 !important;
  }
}

.sgc-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
}
.sgc-card.card-span-2 {
  grid-column: span 2;
}

.sgc-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sgc-resumen-badges {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sgc-badge {
  background-color: rgba(27, 38, 79, 0.8);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.sgc-responsable-info {
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
}

.sgc-actions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sgc-action-btn {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-align: left;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
}
.sgc-action-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-blue);
  color: var(--text-white);
  transform: translateX(4px);
}
.sgc-action-btn .dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Custom quality control table colors/design matching ERP screenshot style */
.table-sgc-style {
  font-size: 13px;
}
.table-sgc-style th {
  background-color: rgba(27, 38, 79, 0.3);
  border-bottom: 1px solid var(--border-color);
}
.table-sgc-style td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(6, 10, 26, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 600px;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: 16px;
  z-index: 1001;
  display: none;
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  overflow: hidden;
}

.modal-overlay.active, .modal-box.active {
  display: block;
}
/* For transition triggers via JS */
.modal-overlay.show {
  opacity: 1;
}
.modal-box.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(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: 18px;
  font-weight: 700;
  color: var(--text-white);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-white);
}

/* FORM ELEMENTS */
form {
  padding: 24px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group:last-of-type {
  margin-bottom: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
    margin-bottom: 0;
  }
  .form-row .form-group {
    margin-bottom: 20px;
  }
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition-fast);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.modal-footer {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #101b42;
  border: 1px solid var(--border-color-focus);
  border-left: 4px solid var(--accent-blue);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 16px 20px;
  z-index: 9999;
  transform: translateY(120px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s ease;
  pointer-events: none;
  max-width: 380px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toast-icon {
  color: var(--color-success);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.toast-message {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Helper Utilities */
.margin-bottom-sm { margin-bottom: 12px; }
.padding-none { padding: 0 !important; }
.margin-none { margin: 0 !important; }
.border-none { border: none !important; }
.width-100-percent { width: 100% !important; }
.margin-top-sm { margin-top: 16px; }

/* ==========================================================================
   RECURSOS HUMANOS SPLIT LAYOUT
   ========================================================================== */
.hr-layout-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.hr-directory-panel {
  display: flex;
  flex-direction: column;
}

.hr-profile-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  min-height: 550px;
  display: flex;
  flex-direction: column;
}

.hr-profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 450px;
  color: var(--text-secondary);
  gap: 16px;
  padding: 24px;
}
.hr-profile-empty i {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}
.hr-profile-empty h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  margin-top: 8px;
}
.hr-profile-empty p {
  font-size: 13px;
  max-width: 280px;
  line-height: 1.5;
}

/* Profile Card Detail Page */
.hr-profile-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.hr-profile-avatar-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-blue);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hr-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hr-profile-avatar-fallback {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-white);
}

.hr-profile-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hr-profile-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-white);
}
.hr-profile-role {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}
.hr-profile-dept-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background-color: var(--bg-tertiary);
  color: #93c5fd;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tabs inside Profile Card */
.hr-profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
}

.profile-tab-btn {
  background: none;
  border: none;
  padding: 8px 4px 12px 4px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}
.profile-tab-btn:hover {
  color: var(--text-white);
}
.profile-tab-btn.active {
  color: var(--accent-blue);
}
.profile-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-blue);
}

.profile-tab-content {
  display: none;
}
.profile-tab-content.active {
  display: block;
  animation: fade-in 0.2s ease;
}

/* Info List Items */
.profile-info-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.profile-info-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-info-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.profile-info-value {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
}
.profile-info-value.salary-value {
  font-size: 20px;
  font-weight: 800;
  color: #34d399; /* Green salary highlight */
}

/* Skills/Attitudes Tags styling */
.skills-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.skills-tag-chip {
  background-color: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #c084fc;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11.5px;
  font-weight: 600;
}

/* Form Section Title inside modals */
.form-section-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.hr-modal-photo-preview {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.hr-directory-table-row {
  cursor: pointer;
}
.hr-directory-table-row.selected {
  background-color: rgba(37, 99, 235, 0.08) !important;
}


/* ==========================================================================
   PROJECT WORK LOGS & TIMELINE SYSTEM
   ========================================================================== */
.project-table-row {
  cursor: pointer;
  user-select: none;
}
.project-table-row:hover {
  background-color: rgba(37, 99, 235, 0.04) !important;
}

.timeline-wrapper {
  position: relative;
  margin-left: 20px;
  padding-left: 30px;
  border-left: 2px dashed rgba(255, 255, 255, 0.12);
  margin-top: 10px;
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  position: absolute;
  left: -41px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--accent-blue);
  border: 4px solid #111a36; /* Blends with modal background */
  box-shadow: 0 0 10px var(--accent-blue);
  z-index: 2;
  transition: all var(--transition-fast);
}
.timeline-item:hover .timeline-badge {
  transform: scale(1.15);
  box-shadow: 0 0 15px #60a5fa;
  background-color: #60a5fa;
}

.timeline-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.timeline-item:hover .timeline-card {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.timeline-time-span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.timeline-time-span i {
  width: 14px;
  height: 14px;
  stroke-width: 2px;
}

.timeline-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

.timeline-attachments {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.attachment-chip:hover {
  background-color: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.5);
  color: #fff;
  transform: translateY(-1px);
}
.attachment-chip i {
  width: 12px;
  height: 12px;
}

/* Modal form upload preview styles */
.preview-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-primary);
}
.preview-chip span {
  font-weight: 500;
}
.preview-chip button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}
.preview-chip button:hover {
  color: var(--color-danger);
}

/* ==========================================================================
   RESPONSIVE DESIGN (Adaptive layout adjustments)
   ========================================================================== */
@media (max-width: 992px) {
  .app-layout {
    grid-template-columns: 1fr; /* Stack sidebar on top / toggle */
  }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100%;
    transform: translateX(0);
  }
  .sidebar.mobile-open {
    transform: translateX(280px);
  }
  
  .hr-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ANIME & GAMES CREATIVE MODULE STYLES
   ========================================================================== */
body.theme-anime-games {
  background: linear-gradient(rgba(6, 10, 26, 0.82), rgba(6, 10, 26, 0.88)), url('bg_anime_games.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
}

.creative-details-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-top: 15px;
}

@media (max-width: 768px) {
  .creative-details-grid {
    grid-template-columns: 1fr;
  }
}

.creative-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 15px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.creative-card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.creative-field {
  margin-bottom: 14px;
}

.creative-field:last-child {
  margin-bottom: 0;
}

.creative-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.creative-value {
  font-size: 13.5px;
  color: #fff;
  font-weight: 500;
}

.creative-synopsis {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  white-space: pre-wrap;
}

.character-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.character-item {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--color-primary-light);
  padding: 10px 14px;
  border-radius: 6px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.character-name {
  font-weight: 700;
  color: #fff;
  font-size: 13.5px;
  margin-bottom: 4px;
}

.character-role {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ==========================================================================
   MÓDULO DE COTIZACIONES
   ========================================================================== */

/* Expand modal size for large forms */
.modal-box-large {
  max-width: 820px !important;
}

/* Partida Entry Grid inside form */
.partida-entry-grid {
  display: grid;
  grid-template-columns: 2.2fr 0.6fr 1fr auto;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
  background-color: rgba(255, 255, 255, 0.01);
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

@media (max-width: 600px) {
  .partida-entry-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }
  .partida-entry-grid button {
    height: 40px;
    margin-top: 10px;
  }
}

/* Calculations block in modal */
.quotation-calc-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 8px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  font-size: 13.5px;
  max-width: 300px;
  margin-left: auto;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.quotation-calc-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
}

.quotation-calc-row.total-row {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  font-size: 15px;
}

/* Print template override and layout details */
#quotation-pdf-template {
  box-sizing: border-box;
}

#quotation-pdf-template table {
  width: 100%;
  border-collapse: collapse;
}

#quotation-pdf-template th {
  padding: 12px 16px;
  background-color: rgba(37, 99, 235, 0.15);
  border-bottom: 2px solid rgba(37, 99, 235, 0.3);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #ffffff;
}

#quotation-pdf-template td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: #e2e8f0;
}

/* ==========================================================================
   MODULE CONFIGURACION STYLES
   ========================================================================== */
.config-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

.config-directory-panel {
  display: flex;
  flex-direction: column;
}

.config-permissions-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  min-height: 550px;
  display: flex;
  flex-direction: column;
}

.config-permissions-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fade-in 0.25s ease;
}

.config-permissions-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

.config-permissions-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white);
}

.config-permissions-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.permissions-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.permission-item:hover {
  background-color: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.permission-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.permission-item span {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.permission-item-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
}

.config-user-row {
  cursor: pointer;
}

.accounting-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.accounting-warning-card {
  background-color: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.accounting-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.accounting-records-panel {
  min-width: 0;
}

.accounting-filter-selects {
  display: flex;
  gap: 10px;
}

.accounting-chat-panel {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  min-height: 590px;
  max-height: calc(100vh - 110px);
  padding: 22px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
}

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

.accounting-chat-header h3 {
  margin-top: 4px;
  color: var(--text-white);
  font-size: 18px;
}

.accounting-chat-header > i {
  width: 28px;
  height: 28px;
  color: var(--accent-blue);
}

.accounting-comment-form {
  display: grid;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
}

.accounting-comment-form .btn {
  justify-content: center;
}

.accounting-comments-feed {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 160px;
  padding-top: 16px;
  overflow-y: auto;
}

.accounting-comment-card {
  padding: 13px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-blue);
  border-radius: 9px;
}

.accounting-comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.accounting-comment-author {
  color: var(--text-white);
  font-weight: 700;
}

.accounting-comment-message {
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.accounting-comment-link {
  display: block;
  margin-top: 8px;
  color: #93c5fd;
  font-size: 10.5px;
}

button.accounting-comment-link {
  padding: 0;
  background: transparent;
  border: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.accounting-type-label {
  color: var(--text-white);
  font-weight: 700;
}

.accounting-folio-label {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 10.5px;
}

.accounting-document-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
}

.accounting-document-count i {
  width: 13px;
  height: 13px;
}

.modal-box-scroll {
  max-height: 92vh;
  overflow-y: auto;
}

.accounting-amount-row,
.accounting-date-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-help {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 11px;
}

.accounting-files-preview {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.accounting-detail-body {
  display: grid;
  gap: 20px;
  max-height: 55vh;
  padding: 24px;
  overflow-y: auto;
}

.accounting-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.accounting-detail-card {
  padding: 14px;
  background-color: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: 9px;
}

.accounting-detail-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.accounting-detail-card strong {
  color: var(--text-white);
  font-size: 13px;
}

.accounting-detail-section h4 {
  margin-bottom: 10px;
  color: var(--text-white);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.accounting-detail-documents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accounting-detail-comments {
  display: grid;
  gap: 10px;
}

.accounting-detail-comment-form {
  padding: 18px 24px 22px;
  border-top: 1px solid var(--border-color);
}

.accounting-detail-comment-form .form-row {
  grid-template-columns: 0.7fr 1.3fr;
}

.accounting-detail-comment-form .modal-footer {
  margin-top: 14px;
}

@media (max-width: 1200px) {
  .accounting-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounting-layout-grid {
    grid-template-columns: 1fr;
  }

  .accounting-chat-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 700px) {
  .accounting-summary,
  .accounting-detail-grid,
  .accounting-amount-row,
  .accounting-date-row,
  .accounting-detail-comment-form .form-row {
    grid-template-columns: 1fr;
  }

  .accounting-filter-selects {
    width: 100%;
    flex-direction: column;
  }
}
.config-user-row.selected {
  background-color: rgba(37, 99, 235, 0.08) !important;
}

#sidebar-user-selector {
  background-color: transparent;
  color: var(--text-white);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  outline: none;
  width: 100%;
}

#sidebar-user-selector option {
  background-color: var(--bg-primary);
  color: var(--text-white);
}

/* ==========================================================================
   PANTALLA DE LOGIN (REAL & SECURE)
   ========================================================================== */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
              radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent 40%),
              #0B0F19;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
}

.login-container {
  width: 400px;
  max-width: 90%;
  padding: 40px;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.login-logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

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

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

.login-container form .form-group label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-container form .form-group input {
  height: 42px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  transition: all 0.2s ease;
}

.login-container form .form-group input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.sidebar-footer .btn-logout {
  background: none;
  border: none;
  color: #f43f5e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.sidebar-footer .btn-logout:hover {
  background-color: rgba(244, 63, 94, 0.1) !important;
}

/* Styled status select for project table */
select.badge-status {
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 24px 5px 10px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px auto;
  border-radius: 20px;
}
select.badge-status option {
  background-color: #101b42;
  color: #fff;
  font-weight: 500;
}
select.badge-status::before {
  display: none !important;
}

/* Modal z-index safety for multi-modals */
#modal-worklog {
  z-index: 1002;
}

/* Creative Details Libreto Tabs and Styling */
.modal-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab-btn:hover {
  color: #fff;
}
.tab-btn.active {
  color: #fff;
  border-bottom-color: var(--color-primary) !important;
}
.subtabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.2);
  padding: 5px;
  border-radius: 6px;
}
.subtab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.subtab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.subtab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.libreto-box {
  background: rgba(255, 255, 255, 0.02);
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.journal-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.journal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.journal-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}
.journal-meta {
  font-size: 12px;
  color: var(--text-secondary);
}
.journal-body {
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.5;
  white-space: pre-wrap;
}
.journal-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
}
.badge-idea { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-escena { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-dialogo { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-desarrollo { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-dudas { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.char-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  gap: 15px;
  transition: transform 0.2s;
}
.char-card:hover {
  transform: translateY(-2px);
}
.char-portrait {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
}
.char-info {
  flex: 1;
}
.char-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.char-card-role {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 6px;
}
.char-card-bio {
  font-size: 12.5px;
  color: #d1d5db;
  line-height: 1.4;
}

.qa-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
}
.qa-question-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.qa-author {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.qa-text {
  font-size: 13px;
  color: #fff;
  line-height: 1.4;
}
.qa-answer-section {
  padding-left: 15px;
  border-left: 2px solid var(--border-color);
}
.qa-answer-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: 4px;
}
.qa-answer-text {
  font-size: 13px;
  color: #d1d5db;
  font-style: italic;
  line-height: 1.4;
}
