/**
 * Plataforma de Convenios FES Acatlán - UNAM
 * Sistema de Diseño Estilo macOS (Sonoma / Sequoia UI)
 */

:root {
  /* Tipografía y fuentes */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Paleta macOS */
  --mac-blue: #007AFF;
  --mac-blue-hover: #0063D1;
  --mac-blue-light: rgba(0, 122, 255, 0.12);
  --mac-focus: rgba(0, 122, 255, 0.35);

  /* Traffic lights */
  --traffic-red: #FF5F56;
  --traffic-yellow: #FFBD2E;
  --traffic-green: #27C93F;
  --traffic-border: rgba(0, 0, 0, 0.12);

  /* Colores institucionales FES Acatlán / UNAM discretos */
  --unam-blue: #002B7A;
  --unam-gold: #C69214;
  --unam-gold-soft: rgba(198, 146, 20, 0.15);

  /* Fondos y superficies (Modo Claro / Cristal Esmerilado) */
  --surface-window: rgba(255, 255, 255, 0.82);
  --surface-window-border: rgba(255, 255, 255, 0.65);
  --surface-sidebar: rgba(246, 246, 248, 0.75);
  --surface-card: rgba(255, 255, 255, 0.68);
  --surface-card-hover: rgba(255, 255, 255, 0.88);
  --surface-input: rgba(255, 255, 255, 0.85);

  /* Sombras y elevaciones nativas de macOS */
  --shadow-window: 0 25px 60px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);

  /* Textos */
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  --text-inverted: #FFFFFF;

  /* Bordes y divisores */
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  /* Estados de convenios */
  --status-vigente-bg: #E8F8EE;
  --status-vigente-text: #137333;
  --status-vigente-dot: #1E8E3E;

  --status-revision-bg: #FEF7E0;
  --status-revision-text: #B06000;
  --status-revision-dot: #F29900;

  --status-vencer-bg: #FCE8E6;
  --status-vencer-text: #C5221F;
  --status-vencer-dot: #D93025;

  --status-concluido-bg: #F1F3F4;
  --status-concluido-text: #5F6368;
  --status-concluido-dot: #80868B;

  /* Radios de curvatura macOS */
  --radius-window: 18px;
  --radius-card: 14px;
  --radius-btn: 8px;
  --radius-pill: 999px;
  --radius-input: 10px;
}

/* Modo oscuro opcional según preferencia del sistema */
@media (prefers-color-scheme: dark) {
  :root {
    --surface-window: rgba(30, 30, 32, 0.85);
    --surface-window-border: rgba(255, 255, 255, 0.15);
    --surface-sidebar: rgba(22, 22, 24, 0.78);
    --surface-card: rgba(45, 45, 48, 0.65);
    --surface-card-hover: rgba(55, 55, 60, 0.82);
    --surface-input: rgba(40, 40, 44, 0.9);

    --text-primary: #F5F5F7;
    --text-secondary: #A1A1A6;
    --text-tertiary: #6E6E73;

    --border-subtle: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);
    --shadow-window: 0 25px 65px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);

    --status-vigente-bg: rgba(39, 201, 63, 0.16);
    --status-vigente-text: #4ADE80;
    --status-vigente-dot: #27C93F;

    --status-revision-bg: rgba(255, 189, 46, 0.16);
    --status-revision-text: #FBBF24;
    --status-revision-dot: #FFBD2E;

    --status-vencer-bg: rgba(255, 95, 86, 0.16);
    --status-vencer-text: #F87171;
    --status-vencer-dot: #FF5F56;

    --status-concluido-bg: rgba(255, 255, 255, 0.08);
    --status-concluido-text: #9CA3AF;
    --status-concluido-dot: #9CA3AF;
  }
}

/* Reset y base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-system);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #0E1626;
  background-image:
    radial-gradient(at 15% 15%, rgba(0, 43, 122, 0.65) 0px, transparent 50%),
    radial-gradient(at 85% 20%, rgba(198, 146, 20, 0.35) 0px, transparent 45%),
    radial-gradient(at 50% 80%, rgba(0, 122, 255, 0.4) 0px, transparent 55%),
    linear-gradient(135deg, #09101d 0%, #152238 50%, #0d1728 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ==========================================================
   BARRA SUPERIOR NATIVA (ESTILO MENÚ DE MACOS)
   ========================================================== */
.mac-menubar {
  height: 32px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  user-select: none;
  z-index: 1000;
  position: sticky;
  top: 0;
}

.mac-menubar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mac-apple-logo {
  font-size: 14px;
  opacity: 0.95;
  cursor: pointer;
}

.mac-app-name {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.mac-menu-item {
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.mac-menu-item:hover {
  opacity: 0.7;
}

.mac-menubar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mac-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
}

.mac-status-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27C93F;
  box-shadow: 0 0 6px #27C93F;
}

/* ==========================================================
   VENTANA MACOS (APP WINDOW CONTAINER)
   ========================================================== */
.mac-window-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mac-window {
  background: var(--surface-window);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--surface-window-border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: macWindowPop 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

@keyframes macWindowPop {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Barra de título y Traffic Lights */
.mac-titlebar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
}

.mac-traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 70px;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--traffic-border);
  display: inline-block;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.mac-dot:hover {
  filter: brightness(0.9);
}

.mac-dot-red { background-color: var(--traffic-red); }
.mac-dot-yellow { background-color: var(--traffic-yellow); }
.mac-dot-green { background-color: var(--traffic-green); }

.mac-window-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.1px;
}

.mac-title-badge {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--unam-gold-soft);
  color: var(--unam-gold);
  border: 1px solid rgba(198, 146, 20, 0.3);
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-transform: uppercase;
}

.mac-window-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 70px;
  justify-content: flex-end;
}

/* ==========================================================
   PANTALLA DE LOGIN ESTILO MACOS
   ========================================================== */
.login-container {
  width: 100%;
  max-width: 440px;
}

.login-window {
  width: 100%;
}

.login-content {
  padding: 36px 32px 32px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-avatar-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #002B7A 0%, #154298 60%, #C69214 100%);
  padding: 3px;
  box-shadow: 0 10px 24px rgba(0, 43, 122, 0.35);
  margin-bottom: 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface-window);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-avatar-svg {
  width: 52px;
  height: 52px;
  fill: var(--unam-blue);
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 320px;
  line-height: 1.4;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mac-input-group {
  position: relative;
  text-align: left;
}

.mac-input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  padding-left: 2px;
}

.mac-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.mac-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.mac-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 13.5px;
  font-family: var(--font-system);
  color: var(--text-primary);
  background: var(--surface-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.mac-input:focus {
  border-color: var(--mac-blue);
  box-shadow: 0 0 0 3px var(--mac-focus);
  background: #FFFFFF;
}

.mac-btn-enter {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--mac-blue);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mac-btn-enter:hover {
  background: var(--mac-blue-hover);
  transform: scale(1.05);
}

.mac-btn-enter:active {
  transform: scale(0.95);
}

.mac-btn-submit {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(180deg, #0084FF 0%, #006ADC 100%);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
  transition: all 0.15s ease;
  margin-top: 6px;
}

.mac-btn-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.mac-btn-submit:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.mac-alert {
  padding: 10px 14px;
  border-radius: var(--radius-btn);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  margin-bottom: 14px;
  width: 100%;
  animation: macShake 0.35s ease;
}

.mac-alert-error {
  background: rgba(255, 95, 86, 0.12);
  color: #C5221F;
  border: 1px solid rgba(255, 95, 86, 0.28);
}

.mac-alert-info {
  background: rgba(0, 122, 255, 0.1);
  color: #006ADC;
  border: 1px solid rgba(0, 122, 255, 0.25);
}

@keyframes macShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-credentials-hint {
  margin-top: 20px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  border: 1px dashed var(--border-subtle);
  width: 100%;
  line-height: 1.5;
}

.login-credentials-hint strong {
  color: var(--text-primary);
}

/* ==========================================================
   DASHBOARD MACOS (SPLIT VIEW & SIDEBAR)
   ========================================================== */
.dashboard-window {
  width: 100%;
  max-width: 1280px;
  height: 86vh;
  min-height: 640px;
}

.dashboard-split-view {
  display: flex;
  flex: 1;
  height: calc(100% - 48px);
  overflow: hidden;
}

/* Barra lateral translúcida tipo macOS Sonoma */
.mac-sidebar {
  width: 250px;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  user-select: none;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 8px 12px 6px 12px;
  letter-spacing: 0.4px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  cursor: pointer;
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.sidebar-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-link.active {
  background: var(--mac-blue);
  color: #FFFFFF;
}

.sidebar-link.active .sidebar-icon {
  color: #FFFFFF;
}

.sidebar-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-secondary);
}

.sidebar-link.active .sidebar-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.user-profile-badge:hover {
  background: rgba(0, 0, 0, 0.04);
}

.user-avatar-small {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #002B7A, #C69214);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-logout:hover {
  color: var(--traffic-red);
  background: rgba(255, 95, 86, 0.1);
}

/* ==========================================================
   ÁREA DE CONTENIDO PRINCIPAL
   ========================================================== */
.mac-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.35);
}

/* Toolbar superior de acciones */
.mac-toolbar {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.4);
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-title h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.toolbar-title p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mac-searchbox {
  position: relative;
  width: 240px;
}

.mac-searchbox input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  font-size: 13px;
  background: var(--surface-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  outline: none;
  font-family: var(--font-system);
}

.mac-searchbox input:focus {
  border-color: var(--mac-blue);
  box-shadow: 0 0 0 3px var(--mac-focus);
}

.mac-searchbox svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.mac-segmented-control {
  display: inline-flex;
  padding: 2px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  gap: 2px;
}

.mac-segment-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mac-segment-btn.active {
  background: #FFFFFF;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mac-btn-primary {
  padding: 7px 14px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(0,0,0,0.1);
  background: linear-gradient(180deg, #0084FF 0%, #006ADC 100%);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.25);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.mac-btn-primary:hover {
  filter: brightness(1.06);
}

.mac-btn-primary:active {
  transform: scale(0.98);
}

/* Área de trabajo y widgets */
.dashboard-workspace {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================
   MÉTRICAS KPI EN TARJETAS DE CRISTAL
   ========================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  background: var(--surface-card-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrap.blue { background: rgba(0, 122, 255, 0.12); color: var(--mac-blue); }
.stat-icon-wrap.green { background: rgba(39, 201, 63, 0.14); color: var(--traffic-green); }
.stat-icon-wrap.yellow { background: rgba(255, 189, 46, 0.16); color: #B06000; }
.stat-icon-wrap.purple { background: rgba(175, 82, 222, 0.14); color: #AF52DE; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-subtext {
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================
   TABLA DE CONVENIOS ESTILO MACOS
   ========================================================== */
.table-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.table-card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-counter {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.06);
  color: var(--text-secondary);
  font-weight: 600;
}

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

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

.mac-table th {
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.02);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

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

.mac-table tbody tr {
  transition: background-color 0.12s ease;
}

.mac-table tbody tr:hover {
  background-color: rgba(0, 122, 255, 0.04);
}

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

.table-folio {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--unam-blue);
  background: rgba(0, 43, 122, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.table-convenio-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.table-convenio-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.table-institution {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inst-name {
  font-weight: 500;
}

.inst-type-badge {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

/* Badges de Estado */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-vigente {
  background: var(--status-vigente-bg);
  color: var(--status-vigente-text);
}
.status-vigente .status-dot {
  background: var(--status-vigente-dot);
}

.status-revision {
  background: var(--status-revision-bg);
  color: var(--status-revision-text);
}
.status-revision .status-dot {
  background: var(--status-revision-dot);
}

.status-vencer {
  background: var(--status-vencer-bg);
  color: var(--status-vencer-text);
}
.status-vencer .status-dot {
  background: var(--status-vencer-dot);
}

.status-concluido {
  background: var(--status-concluido-bg);
  color: var(--status-concluido-text);
}
.status-concluido .status-dot {
  background: var(--status-concluido-dot);
}

/* Botones de acción en fila */
.table-action-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
  text-decoration: none;
}

.table-action-btn:hover {
  background: #FFFFFF;
  color: var(--mac-blue);
  border-color: var(--mac-blue);
}

/* ==========================================================
   MODAL ESTILO MACOS
   ========================================================== */
.mac-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.mac-modal {
  width: 90%;
  max-width: 520px;
  background: var(--surface-window);
  border: 1px solid var(--surface-window-border);
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: macWindowPop 0.25s ease;
}

.mac-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mac-modal-footer {
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.03);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mac-btn-secondary {
  padding: 6px 14px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-strong);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 860px) {
  .dashboard-split-view {
    flex-direction: column;
  }
  .mac-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    height: auto;
  }
  .dashboard-window {
    height: 95vh;
  }
}
