/* -------------------------------------------------------------
   DESIGN SYSTEM - VARIABLES & ROOT
------------------------------------------------------------- */
:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Color Palette (Refined HSL) */
  --primary-hue: 243;
  --primary: hsl(var(--primary-hue), 75%, 59%);         /* Indigo 600 */
  --primary-hover: hsl(var(--primary-hue), 75%, 50%);   /* Indigo 700 */
  --primary-light: hsl(var(--primary-hue), 80%, 95%);   /* Indigo 50 */
  
  --success-hue: 160;
  --success: hsl(var(--success-hue), 84%, 39%);         /* Emerald 600 */
  --success-light: hsl(var(--success-hue), 80%, 95%);   /* Emerald 50 */
  
  --warning-hue: 35;
  --warning: hsl(var(--warning-hue), 90%, 50%);         /* Amber 600 */
  --warning-light: hsl(var(--warning-hue), 90%, 95%);   /* Amber 50 */
  
  --danger-hue: 0;
  --danger: hsl(var(--danger-hue), 72%, 50%);           /* Red 600 */
  --danger-light: hsl(var(--danger-hue), 80%, 95%);     /* Red 50 */
  
  --accent-hue: 262;
  --accent: hsl(var(--accent-hue), 80%, 60%);           /* Violet 500 */
  
  /* Neutrals */
  --dark-bg: #0f172a;       /* Slate 900 */
  --dark-sidebar: #1e293b;  /* Slate 800 */
  --body-bg: #f8fafc;       /* Slate 50 */
  --card-bg: #ffffff;
  
  --text-main: #0f172a;     /* Slate 900 */
  --text-muted: #64748b;    /* Slate 500 */
  --text-light: #94a3b8;    /* Slate 400 */
  
  --border-color: #e2e8f0;  /* Slate 200 */
  --border-focus: hsl(var(--primary-hue), 75%, 75%);
  
  /* Layout Metrics */
  --sidebar-width: 260px;
  --header-height: 80px;
  --border-radius: 12px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--body-bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--body-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
}

/* Utility Helpers */
.hidden { display: none !important; }
.col-2 { grid-column: span 2; }
.text-right { text-align: right; }

/* -------------------------------------------------------------
   SIMULATION BAR (TOP DEMO TOOLBAR)
------------------------------------------------------------- */
.sim-bar {
  background: linear-gradient(135deg, var(--dark-bg) 0%, #1e1b4b 100%);
  color: white;
  padding: 10px 20px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  position: relative;
}
.sim-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.sim-select {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
}
.sim-select:focus {
  border-color: var(--accent);
  background-color: rgba(255, 255, 255, 0.15);
}
.sim-select option {
  background-color: var(--dark-bg);
  color: white;
}
.sim-user-label {
  background-color: var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* -------------------------------------------------------------
   BUTTONS SYSTEM
------------------------------------------------------------- */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

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

.btn-secondary {
  background-color: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background-color: var(--body-bg);
  border-color: var(--text-light);
}

.btn-success {
  background-color: var(--success);
  color: white;
}
.btn-success:hover {
  background-color: hsl(var(--success-hue), 84%, 32%);
  transform: translateY(-1px);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}
.btn-danger:hover {
  background-color: hsl(var(--danger-hue), 72%, 42%);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn-clear-filters {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  transition: var(--transition-smooth);
}
.btn-clear-filters:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* -------------------------------------------------------------
   1. LOGIN VIEW
------------------------------------------------------------- */
.view-login {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}
.login-header {
  text-align: center;
  margin-bottom: 30px;
}
.login-logo {
  font-size: 48px;
  margin-bottom: 10px;
}
.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}
.login-form .form-group {
  margin-bottom: 20px;
}
.login-form label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}
.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}
.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.error-msg {
  background-color: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  font-weight: 500;
}
.login-footer {
  margin-top: 25px;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--body-bg);
  padding: 10px;
  border-radius: 8px;
}

/* -------------------------------------------------------------
   2. MAIN WORKSPACE LAYOUT
------------------------------------------------------------- */
.view-workspace {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--dark-sidebar);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}
.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
  font-size: 26px;
}
.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition-smooth);
}
.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: white;
}
.nav-item.active {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
}
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-accent {
  background-color: var(--accent);
  color: white;
}

/* Sidebar User Footer */
.sidebar-user {
  padding: 16px 20px;
  background-color: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.user-avatar {
  width: 36px;
  height: 36px;
  background-color: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13.5px;
  flex-shrink: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}
.btn-logout:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--danger);
}

/* Main Content Workspace */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents flex children from breaking width */
}
.main-header {
  height: var(--header-height);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-title h1 {
  font-size: 20px;
  font-weight: 700;
}
.header-title p {
  font-size: 13px;
  color: var(--text-muted);
}
.header-actions {
  display: flex;
  gap: 12px;
}

/* Workspace Subviews Wrapper */
.workspace-views {
  padding: 40px;
  flex-grow: 1;
  overflow-y: auto;
}

/* -------------------------------------------------------------
   A. DASHBOARD SUBVIEW
------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.stat-icon.purple { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.yellow { background-color: var(--warning-light); color: var(--warning); }
.stat-icon.blue { background-color: #eff6ff; color: #3b82f6; }
.stat-icon.green { background-color: var(--success-light); color: var(--success); }

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}
.stat-footer {
  font-size: 12px;
  color: var(--text-light);
}

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 25px;
  margin-bottom: 30px;
}
.chart-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.chart-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}
.revenue-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-radius: var(--border-radius);
  padding: 30px;
  text-align: center;
  margin-bottom: 15px;
}
.revenue-value {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 4px;
}
.sim-indicator {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  background: var(--body-bg);
  padding: 10px 14px;
  border-radius: 6px;
}

/* Simple distribution chart builder styling */
.bars-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar-label {
  font-size: 13px;
  font-weight: 600;
  width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex-grow: 1;
  background-color: var(--body-bg);
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  background-color: var(--primary);
  width: 0;
  transition: width 1s ease-out;
}
.bar-value {
  font-size: 13px;
  font-weight: 700;
  width: 30px;
  text-align: right;
}

.recent-activity-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.recent-activity-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}
.workflow-steps {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.wf-step {
  flex: 1;
  background: var(--body-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  position: relative;
  border: 1px solid var(--border-color);
}
.wf-icon {
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin: 0 auto 12px auto;
}
.wf-step h4 {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
.wf-step p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* -------------------------------------------------------------
   B. MATRICULAS LIST TABLE VIEW
------------------------------------------------------------- */
.filter-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 25px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}
.filter-col {
  flex: 1;
  min-width: 150px;
}
.filter-col.search-col {
  flex: 2;
  min-width: 250px;
}
.filter-col label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.filter-col input, .filter-col select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  background-color: white;
  transition: var(--transition-smooth);
}
.filter-col input:focus, .filter-col select:focus {
  border-color: var(--primary);
}
.filter-actions-col {
  min-width: unset;
  flex-grow: 0;
  padding-bottom: 4px;
}

/* Tables Styling */
.table-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.table-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.table-title {
  font-size: 16px;
  font-weight: 700;
}
.record-count {
  font-size: 13px;
  color: var(--text-muted);
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table th, .table td {
  padding: 14px 20px;
  font-size: 13.5px;
}
.table th {
  background-color: var(--body-bg);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}
.table td {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover td {
  background-color: var(--body-bg);
}

/* Badges for status */
.badge-status {
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}
.badge-status.PENDIENTE_SECRETARIA { background-color: var(--warning-light); color: var(--warning); }
.badge-status.PENDIENTE_COLECTURIA { background-color: #eff6ff; color: #2563eb; }
.badge-status.APROBADO { background-color: var(--success-light); color: var(--success); }
.badge-status.RECHAZADO { background-color: var(--danger-light); color: var(--danger); }

/* Table cells helpers */
.td-student {
  font-weight: 600;
}
.td-subtext {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.td-badge-files {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.badge-file {
  font-size: 10px;
  background-color: var(--body-bg);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}
.badge-file.has-file {
  background-color: var(--primary-light);
  border-color: var(--border-focus);
  color: var(--primary);
  font-weight: 600;
}

/* Action Links in Tables */
.table-action-btns {
  display: flex;
  gap: 8px;
}
.btn-table-action {
  background-color: white;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition-smooth);
}
.btn-table-action:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-table-action.action-approve:hover {
  background-color: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}
.btn-table-action.action-view:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* -------------------------------------------------------------
   C. WIZARD / STEP-BY-STEP FORM
------------------------------------------------------------- */
.wizard-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.wizard-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}
.wizard-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.wizard-header p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.wizard-progress {
  position: relative;
  margin: 10px 0;
}
.wizard-progress-bar {
  position: absolute;
  top: 16px;
  left: 0;
  height: 4px;
  background-color: var(--primary);
  width: 25%;
  z-index: 1;
  transition: var(--transition-smooth);
}
.wizard-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}
.w-step-btn {
  background-color: white;
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-smooth);
}
.w-step-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.wizard-step-section {
  display: none;
}
.wizard-step-section.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  background-color: white;
  transition: var(--transition-smooth);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.field-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

.wizard-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
}

/* Document Upload Design */
.document-upload-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 20px 0;
}
.upload-box-wrapper h3 {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 4px;
}
.upload-box-wrapper p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 15px;
}
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  background-color: var(--body-bg);
  transition: var(--transition-smooth);
}
.drop-zone:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}
.upload-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}
.dropzone-text {
  font-size: 13px;
  color: var(--text-muted);
}
.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  border-radius: var(--border-radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.file-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.btn-remove-file {
  background-color: var(--danger-light);
  color: var(--danger);
  border: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.btn-remove-file:hover {
  background-color: var(--danger);
  color: white;
}

/* -------------------------------------------------------------
   D. OUTBOX EMAIL SANDBOX VIEW
------------------------------------------------------------- */
.sandbox-layout {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  height: calc(100vh - var(--header-height) - 120px);
  gap: 25px;
}
.sandbox-sidebar {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.sandbox-sidebar h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.sandbox-sidebar p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}
.email-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.email-item {
  background-color: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.email-item:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}
.email-item.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.email-item-to {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-item-subject {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-item-date {
  font-size: 11px;
  color: var(--text-light);
}

.sandbox-viewer {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.empty-viewer-state {
  margin: auto;
  text-align: center;
  color: var(--text-light);
  padding: 40px;
}
.empty-viewer-state span {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}
.email-details-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.email-meta-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--body-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
}
.mail-attachments {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.mail-attachments a {
  background-color: white;
  border: 1px solid var(--border-color);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mail-attachments a:hover {
  background-color: var(--primary-light);
}
.email-body-content {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
  background-color: #f1f5f9;
}

/* -------------------------------------------------------------
   E. SYSTEM CONFIGURATION & USERS
------------------------------------------------------------- */
.action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.action-card-header h3 {
  font-size: 17px;
  font-weight: 700;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
}
.settings-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.settings-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.settings-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.system-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  border-bottom: 1px solid var(--body-bg);
  padding-bottom: 8px;
}
.info-row span {
  font-family: monospace;
  color: var(--primary);
  font-weight: 600;
}

/* -------------------------------------------------------------
   MODALS SYSTEM
------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-card.modal-lg {
  max-width: 1000px;
}
.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: 16.5px;
  font-weight: 700;
}
.btn-close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}
.btn-close-modal:hover {
  color: var(--danger);
}
.modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--body-bg);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Colecturia Modal Grid */
.colecturia-approval-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
}
.col-image-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tab-buttons {
  display: flex;
  background-color: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
}
.tab-buttons .tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-smooth);
}
.tab-buttons .tab-btn.active {
  background-color: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.image-viewer-box {
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.image-viewer-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.no-img-placeholder {
  color: var(--text-light);
  font-size: 13.5px;
  text-align: center;
  padding: 20px;
}
.col-data-panel h4 {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 12px;
}
.student-quick-details {
  background-color: var(--body-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.student-quick-details div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}
.student-quick-details div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.student-quick-details span {
  font-weight: 600;
  color: var(--text-main);
}
.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  gap: 10px;
}

/* Bulk Excel Import Styles */
.import-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.import-drop-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  background-color: var(--body-bg);
  position: relative;
  transition: var(--transition-smooth);
}
.import-drop-area:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}
.import-drop-area span {
  font-size: 44px;
  display: block;
  margin-bottom: 12px;
}
.import-status-bar {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  margin-top: 15px;
}

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

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

/* -------------------------------------------------------------
   RESPONSIVE OVERRIDES
------------------------------------------------------------- */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .view-workspace {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .sidebar-brand {
    padding: 15px 24px;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 24px;
  }
  .nav-item {
    white-space: nowrap;
  }
  .workspace-views {
    padding: 20px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .col-2 {
    grid-column: span 1;
  }
  .document-upload-container {
    grid-template-columns: 1fr;
  }
  .colecturia-approval-layout {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------
   PENSIONES, COBROS, ALERTAS Y FICHA INTEGRAL STYLES
------------------------------------------------------------- */
.promo-alert-banner {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 14px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.promo-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.promo-badge {
  background-color: #fbbf24;
  color: #1e1b4b;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.financial-breakdown-pills {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.fin-pill {
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-dark);
}
.fin-pill strong {
  color: var(--primary);
}

.modal-xl {
  max-width: 960px !important;
  width: 95% !important;
  max-height: 92vh !important;
  overflow-y: auto;
}

.action-card-header {
  background-color: var(--card-bg);
  padding: 18px 24px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}
.header-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}
.table-search-input {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  min-width: 220px;
  outline: none;
}
.filter-select-inline {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  background-color: white;
}

/* 5-MONTH PENSION TRACKER PILLS */
.pension-pills-bar {
  display: flex;
  gap: 4px;
}
.p-pill {
  font-size: 10.5px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-align: center;
  display: inline-block;
  min-width: 44px;
}
.p-pill.pagado {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.p-pill.promo {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.p-pill.regular {
  background-color: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.p-pill.mora {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  animation: pulseMora 2s infinite;
}
.p-pill.pendiente {
  background-color: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

@keyframes pulseMora {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* BUTTONS */
.btn-whatsapp {
  background-color: #25d366;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-whatsapp:hover {
  background-color: #1eb857;
}

.btn-action-icon {
  background: none;
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition-smooth);
}
.btn-action-icon:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.actions-group {
  display: flex;
  gap: 5px;
  align-items: center;
}

/* CARGOS ADICIONALES LAYOUT */
.cargos-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}
.cargos-form-box, .cargos-list-box {
  background: var(--body-bg);
  padding: 16px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}
.cargos-form-box h4, .cargos-list-box h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-dark);
}
.btn-block {
  width: 100%;
}

/* FICHA INTEGRAL VIEW & PRINT STYLING */
.ficha-container {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #1f2937;
  padding: 20px;
  background: white;
}
.ficha-header-official {
  text-align: center;
  border-bottom: 2px solid #4f46e5;
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.ficha-institution {
  font-size: 18px;
  font-weight: 800;
  color: #1e1b4b;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ficha-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}
.ficha-dossier-code {
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  margin-top: 6px;
}

.ficha-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}
.ficha-card-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}
.ficha-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 6px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.ficha-field-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.ficha-field-row strong {
  color: #475569;
}

.ficha-receipts-gallery {
  margin-top: 20px;
}
.ficha-receipts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.ficha-receipt-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: white;
  text-align: center;
}
.ficha-receipt-item h5 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e293b;
}
.ficha-receipt-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  margin-bottom: 6px;
  cursor: pointer;
}
.ficha-receipt-meta {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}

.ficha-signatures-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  text-align: center;
  padding-top: 20px;
}
.ficha-signature-box {
  border-top: 1px dashed #94a3b8;
  padding-top: 8px;
  font-size: 11.5px;
}
.ficha-signature-box strong {
  display: block;
  font-size: 12px;
  color: #1e293b;
}

.pension-student-badge {
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 4px solid var(--primary);
  font-size: 13px;
}

/* PRINT MEDIA QUERY */
@media print {
  body * {
    visibility: hidden;
  }
  .print-hide, .sidebar, .main-header, .btn-close-modal, .modal-header button, .filter-card, .table-header {
    display: none !important;
  }
  #modal-ficha-integral, #modal-ficha-integral * {
    visibility: visible;
  }
  #modal-ficha-integral {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    height: auto !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .modal-card.modal-xl {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .ficha-receipt-img {
    height: 100px !important;
    page-break-inside: avoid;
  }
  .ficha-signatures-grid {
    page-break-inside: avoid;
  }
}

