/* ========== VARIABLES DE TEMAS ========== */
:root {
  --sidebar-width: 240px;
  --sidebar-collapsed: 80px;

  /* Tema Claro */
  --primary-blue: #2f5ea8;
  --primary-dark: #1e40af;
  --accent-teal: #14b8a6;
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --hover-bg: #ede9e8;
  --active-bg: #eff6ff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --fondo-item: #fcf9f8;
  --btn-ppaluno: #2563eb;
  --btn-ppaldos: #1e40af;
}

/* Tema Oscuro */
[data-theme="dark"] {
  --primary-blue: #498fe6;
  --primary-dark: #3b82f6;
  --accent-teal: #2dd4bf;
  --bg-main: #0f172a;
  --bg-sidebar: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --hover-bg: #334155;
  --active-bg: #1e3a8a;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}


* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg-main); overflow-x: hidden; transition: var(--transition); }
/* ========== Login =============*/
html {
    margin: 0;
    padding: 0;
    background: #ffffff !important;
    align-items: center;
    justify-content: center;
}

.user_card {
    height: 500px;
    width: 450px;
    margin-top: 100px; /* Agregado: da espacio para el logo */
    margin-bottom: auto;
    background: #b9dcf3;
    position: relative;
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 10px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    -webkit-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    -moz-box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    border-radius: 40px;
}

.brand_logo_container {
    position: absolute;
    height: 170px;
    width: 170px;
    top: -75px;
    border-radius: 30%;
    background: #ffffff;
    padding: 10px;
    text-align: center;
}
.brand_logo {
    height: 150px;
    width: 150px;
    border-radius: 30%;
    border: 2px solid white;
    object-fit: contain;
}

.form_container {
    margin-top: 100px;
}
.login_btn {
    width: 100%;
    background: var(--primary-blue) !important;
    color: white !important;
}
.login_btn:focus {
    box-shadow: none !important;
    outline: 0px !important;
}
.login_container {
    padding: 0 2rem;
}
.input-group-text {
    background: var(--primary-blue) !important;
    color: white !important;
    border: 0 !important;
    border-radius: 0.25rem 0 0 0.25rem !important;
}
.input_user,
.input_pass:focus {
    box-shadow: none !important;
    outline: 0px !important;
}
.custom-checkbox .custom-control-input:checked~.custom-control-label::before {
    background-color: #c0392b !important;
}
<!-- CSS para el menú de usuario --> 
.user-profile { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 12px; border-radius: 8px; transition: background-color 0.2s; position: relative; } 
.user-profile:hover { background-color: rgba(0, 0, 0, 0.05); } [data-theme="dark"] 
.user-profile:hover { background-color: rgba(255, 255, 255, 0.1); } 
.user-menu { position: absolute; top: calc(100% + 8px); right: 20px; background: white; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); min-width: 260px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s ease; z-index: 1000; overflow: hidden; } [data-theme="dark"] 
.user-menu { background: #1e293b; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); } 
.user-menu.active { opacity: 1; visibility: visible; transform: translateY(0); } 
.user-menu-header { display: flex; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; } 
.user-menu-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid white; } 
.user-menu-name { font-weight: 600; font-size: 14px; } 
.user-menu-email { font-size: 12px; opacity: 0.9; } 
.user-menu-divider { height: 1px; background: #e2e8f0; margin: 8px 0; } [data-theme="dark"] 
.user-menu-divider { background: #334155; } 
.user-menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #334155; text-decoration: none; transition: background-color 0.2s; } [data-theme="dark"] 
.user-menu-item { color: #e2e8f0; } .user-menu-item:hover { background-color: #f1f5f9; } [data-theme="dark"] 
.user-menu-item:hover { background-color: #334155; } 
.user-menu-item i { font-size: 18px; width: 20px; } 
.user-menu-item span { font-size: 14px; } 
.user-menu-logout { color: #dc2626; } [data-theme="dark"] 
.user-menu-logout { color: #f87171; } 
.user-menu-logout:hover { background-color: #fee2e2; } [data-theme="dark"] 
.user-menu-logout:hover { background-color: #7f1d1d; }

/* ========== SIDEBAR ========== */
.sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border-color); transition: var(--transition); z-index: 1000; overflow-x: hidden; overflow-y: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sidebar.collapsed { width: var(--sidebar-collapsed); } 
.sidebar::-webkit-scrollbar { width: 6px; } 
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* Logo */
.sidebar-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 1rem; min-height: 80px; }
.sidebar-logo { width: 45px; height: 45px; flex-shrink: 0; transition: var(--transition); }
.sidebar-brand { font-size: 1.12rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; opacity: 1; transition: var(--transition); } 
.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; }

/* Menu Items */
.sidebar-menu { padding: 1rem 0; flex: 1; overflow-y: auto; overflow-x: hidden; } 
.sidebar-menu::-webkit-scrollbar { width: 4px; } 
.sidebar-menu::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; } 
.menu-section { margin-bottom: 1.5rem; } 
.menu-section-title { padding: 0.5rem 1.5rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); white-space: nowrap; opacity: 1; transition: var(--transition); } 
.sidebar.collapsed .menu-section-title { opacity: 0; height: 0; padding: 0; } 
.menu-item { margin: 0.25rem 0.75rem; border-radius: 10px; overflow: visible; position: relative; }
.menu-link { display: flex; align-items: center; padding: 0.5rem 1rem; color: var(--text-secondary); text-decoration: none; transition: var(--transition); border-radius: 10px; font-weight: 500; font-size: 0.95rem; position: relative; }
.menu-link:hover { background: var(--hover-bg); color: var(--text-primary); }
.menu-link.active { background: var(--active-bg); color: var(--primary-blue); }
.menu-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 24px; background: var(--primary-blue); border-radius: 0 4px 4px 0; }
.menu-icon { width: 24px; height: 24px; font-size: 1.25rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.menu-text { margin-left: 1rem; white-space: nowrap; opacity: 1; transition: var(--transition); } 
.sidebar.collapsed .menu-text { opacity: 0; width: 0; margin: 0; } 
.menu-arrow { margin-left: auto; font-size: 0.875rem; transition: var(--transition); opacity: 1; } 
.sidebar.collapsed .menu-arrow { opacity: 0; width: 0; }
.menu-link.expanded .menu-arrow { transform: rotate(180deg); }

/* Submenu */
.submenu { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background: var(--hover-bg); border-radius: 10px; margin: 0.25rem 0.75rem; } 
.submenu.show { max-height: 500px; } 
.submenu-item { padding: 0.75rem 1rem 0.75rem 2.5rem; color: var(--text-secondary); text-decoration: none; display: flex; align-items: center; transition: var(--transition); font-size: 0.9rem; } 
.submenu-item:hover { color: var(--primary-blue); background: rgba(37, 99, 235, 0.05); } 
.submenu-item i { margin-right: 0.75rem; font-size: 0.875rem; } 
.sidebar.collapsed .submenu { display: none; }

/* Popover para menús colapsados */
.collapsed-popover { display: none; position: fixed; left: calc(var(--sidebar-collapsed) + 0.5rem); background: var(--bg-sidebar); border: 1px solid var(--border-color); border-radius: 10px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); min-width: 220px; max-width: 280px; z-index: 10000; padding: 0.5rem; pointer-events: none; opacity: 0; transform: translateX(-10px); transition: opacity 0.2s ease, transform 0.2s ease; }
.sidebar.collapsed .menu-item:hover .collapsed-popover,
.sidebar.collapsed .menu-item.popover-active .collapsed-popover { display: block; pointer-events: auto; opacity: 1; transform: translateX(0); }
.collapsed-popover .popover-title { padding: 0.75rem 1rem; font-weight: 600; color: var(--text-primary); border-bottom: 1px solid var(--border-color); margin-bottom: 0.5rem; } 
.collapsed-popover .submenu-item { padding: 0.75rem 1rem; margin: 0; border-radius: 6px; white-space: nowrap; display: block; color: var(--text-secondary); text-decoration: none; transition: var(--transition); } 
.collapsed-popover .submenu-item:hover { color: var(--primary-blue); background: rgba(37, 99, 235, 0.05); }

/* Toggle Button */
.sidebar-toggle { position: absolute; top: 3rem; right: 0px; width: 30px; height: 30px; background: var(--primary-blue); border: 2px solid var(--bg-main); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); color: white; font-size: 0.875rem; z-index: 10; }
.sidebar-toggle:hover { background: var(--primary-dark); transform: scale(1.1); }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

/* ========== TOPBAR ========== */
.topbar { position: fixed; top: 0; left: var(--sidebar-width); right: 0; height: 80px; background: var(--bg-sidebar); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 2rem; transition: var(--transition); z-index: 999; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.sidebar.collapsed~.topbar { left: var(--sidebar-collapsed); } 
.topbar-search { flex: 1; max-width: 500px; position: relative; } 
.topbar-search input { width: 100%; padding: 0.75rem 1rem 0.75rem 3rem; border: 1px solid var(--border-color); border-radius: 10px; font-size: 0.95rem; transition: var(--transition); background: var(--bg-main); color: var(--text-primary); }
.topbar-search input:focus { outline: none; border-color: var(--primary-blue); background: var(--bg-sidebar); }
.topbar-search i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }
.topbar-actions { display: flex; align-items: center; gap: 1rem; margin-left: auto; } 
.topbar-btn { width: 42px; height: 42px; border-radius: 10px; border: none; background: var(--bg-main); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); font-size: 1.25rem; position: relative; } 
.topbar-btn:hover { background: var(--hover-bg); color: var(--text-primary); } 
.topbar-btn .badge { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; border: 2px solid var(--bg-sidebar); }

/* User Profile */
.user-profile { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1rem; border-radius: 10px; cursor: pointer; transition: var(--transition); background: var(--bg-main); } 
.user-profile:hover { background: var(--hover-bg); } 
.user-avatar { width: 40px; height: 50px; border-radius: 10px; object-fit: cover; border: 2px solid var(--border-color); } 
.user-info { display: flex; flex-direction: column; } 
.user-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); } 
.user-role { font-size: 0.75rem; color: var(--text-secondary); }

/* ========== SELECTOR DE TEMAS ========== */
.theme-selector { position: relative; } 
.theme-selector-btn { width: 42px; height: 42px; border-radius: 10px; border: none; background: var(--bg-main); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); font-size: 1.25rem; } 
.theme-selector-btn:hover { background: var(--hover-bg); color: var(--primary-blue); } 
.theme-menu { position: absolute; top: 55px; right: 0; background: var(--bg-sidebar); border: 1px solid var(--border-color); border-radius: 12px; padding: 0.75rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); min-width: 200px; z-index: 10000; display: none; opacity: 0; transform: translateY(-10px); transition: opacity 0.2s ease, transform 0.2s ease; } 
.theme-menu.active { display: block; opacity: 1; transform: translateY(0); } 
.theme-menu-title { padding: 0.5rem 0.75rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); border-bottom: 1px solid var(--border-color); margin-bottom: 0.5rem; } 
.theme-option { display: flex; align-items: center; padding: 0.75rem; border-radius: 8px; cursor: pointer; transition: var(--transition); margin-bottom: 0.25rem; } 
.theme-option:hover { background: var(--hover-bg); } 
.theme-option.active { background: var(--active-bg); color: var(--primary-blue); } 
.theme-color { width: 24px; height: 24px; border-radius: 50%; margin-right: 12px; border: 2px solid var(--border-color); flex-shrink: 0; } 
.theme-option-text { flex: 1; font-size: 0.9rem; font-weight: 500; color: var(--text-primary); } 
.theme-check { font-size: 1rem; color: var(--primary-blue); display: none; } 
.theme-option.active .theme-check { display: block; }

/* ========== MAIN CONTENT ========== */
.main-content { margin-left: var(--sidebar-width); margin-top: 70px; padding: 2rem; transition: var(--transition); min-height: calc(100vh - 70px); } 
.sidebar.collapsed~.main-content { margin-left: var(--sidebar-collapsed); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); } 
  .sidebar.mobile-open { transform: translateX(0); } 
  .topbar { left: 0; } 
  .main-content { margin-left: 0; } 
  .mobile-toggle { display: flex !important; } 
  .sidebar-toggle { display: none; } 
}

.mobile-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: none; background: var(--bg-main); color: var(--text-secondary); align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); font-size: 1.25rem; margin-right: 1rem; } 
.mobile-toggle:hover { background: var(--hover-bg); } .overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 999; } 
.overlay.show { display: block; } 

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) { 
  .topbar-search { max-width: 200px; } 
  .user-info { display: none; } 
  .main-content { padding: 1rem; } 
}

  /* styleact.css */
  .act-page-container { max-width: 1500px; margin: 0 auto; } 
  .act-page-title { background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue) 100%); border-radius: 16px; padding: 1.3rem 2rem; margin-bottom: 1rem; color: white; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); } 
  .act-page-title h1 { font-size: 1.5rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 0.75rem; } .form-card { background: white; border-radius: 16px; padding: 2rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); } 
  .act-form-section-header { font-size: 1rem; font-weight: 600; color: #0f172a; margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid #e2e8f0; display: flex; align-items: center; gap: 0.5rem; } 
  .act-form-section-header i { color: #2563eb; } 
  .act-btn-action { padding: 0.875rem 2.5rem; border-radius: 10px; font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 0.5rem; } 
  .act-btn-primary-custom { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); color: white; box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3); } 
  .act-btn-primary-custom:hover { transform: translateY(-2px); box-shadow: 0 8px 12px -1px rgba(37, 99, 235, 0.4); } 
  .act-btn-secondary-custom { background: #f1f5f9; color: #475569; } .act-btn-secondary-custom:hover { background: #e2e8f0; } 
  .act-btn-container { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #e2e8f0; }

  @media (max-width: 768px) {
    .act-btn-container { flex-direction: column; } 
    .act-btn-action { width: 100%; justify-content: center; }
  }

/* Estilos para la tabla de listar con diseño moderno */
.loader { border: 8px solid #e5e7eb; border-top: 8px solid #2563eb; border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; }

@keyframes spin {
  0% { transform: rotate(0deg); } 
  100% { transform: rotate(360deg); }
}

@keyframes fade {
  0%, 100% { opacity: 0.4; } 
  50% { opacity: 1; }
}

.table-hover-blue { --bs-table-hover-bg: #e5f8fc; } 
.table-container { background: white; border-radius: 16px; padding: 1rem; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); } 
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; } 
.table-title { font-size: 1.5rem; font-weight: 700; color: #0f172a; align-items: center; gap: 0.75rem; } 
.search-box { position: relative; max-width: 300px; } 
.search-box input { padding: 0.75rem 1rem 0.75rem 3rem; border: 2px solid #e2e8f0; border-radius: 10px; font-size: 0.9rem; width: 100%; transition: all 0.3s ease; } 
.search-box input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); } 
.search-box i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #64748b; } 
.table-wrapper { max-height: calc(15 * 42px + 45px); overflow-y: auto; border-radius: 8px; margin-bottom: 1rem; position: relative; } 
.table-fixed-header { width: 100%; border-collapse: collapse; }

/* 🔹 Hace que solo el cuerpo se desplace y el encabezado quede fijo */
.table-fixed-header thead th { position: sticky; top: 0; background-color: #f8fafc; z-index: 2; } 
.table-fixed-header th, .table-fixed-header td { padding: 0.2rem 0.4rem; vertical-align: middle; }
.table-fixed-header { font-size: 0.9rem;}
.action-btns .btn-icon { width: 30px; height: 30px; font-size: 0.9rem; } 
.action-btns { display: flex; gap: 0.5rem; } 
.btn-icon { width: 36px; height: 32px; border-radius: 8px; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; font-size: 1rem; } 
.btn-hist { background: #eff6ff; color: #073b1b; } 
.btn-hist:hover { background: #073b1b; color: white; transform: translateY(-2px); } 
.btn-edit { background: #eff6ff; color: #2563eb; } 
.btn-edit:hover { background: #2563eb; color: white; transform: translateY(-2px); } 
.btn-invo { background: #f0f9ff; color: #13cc66; } 
.btn-invo:hover { background: #13cc66; color: white; transform: translateY(-2px); } 
.btn-infor { background: #f0f9ff; color: #050505; } 
.btn-infor:hover { background: #0f0f0f; color: white; transform: translateY(-2px); } 
.btn-delete { background: #fef2f2; color: #ef4444; } 
.btn-delete:hover { background: #ef4444; color: white; transform: translateY(-2px); } 
.btn-new { padding: 0.6rem 1rem; background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; } 
.btn-new:hover { transform: translateY(-2px); box-shadow: 0 8px 12px -1px rgba(37, 99, 235, 0.4); color: white; } 
.empty-state { text-align: center; padding: 3rem; color: #64748b; } 
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

#pagination button { min-width: 100px; font-weight: 500; border-radius: 8px; } 
#pagination span { font-weight: 600; color: #334155; }

@media (max-width: 768px) {
  .table-header { flex-direction: column; align-items: stretch; } 
  .search-box { max-width: 100%; } 
  .modern-table { font-size: 0.85rem; } 
  .modern-table thead th, .modern-table tbody td { padding: 0.75rem 0.5rem; }
}


    .page-container { max-width: 1500px;margin: 0 auto; }
    .page-title {background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);border-radius: 16px;padding: 1.5rem 2rem;margin-bottom: 2rem;color: white;box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);}
    .page-title h1 {font-size: 1.5rem;font-weight: 700;margin: 0;display: flex;align-items: center;gap: 0.75rem;}
    .form-card {background: rgb(252, 252, 252);border-radius: 16px;padding: 2rem;box-shadow: 0 2px 30px rgba(0, 0, 0, 0.1);}
    .form-section-header {font-size: 1rem;font-weight: 600;color: #0f172a;margin-bottom: 1.5rem;padding-bottom: 0.75rem;border-bottom: 2px solid #e2e8f0;display: flex;align-items: center;gap: 0.5rem;}
    .form-section-header i {color: #2563eb;}
    .form-label {font-weight: 600;color: #334155;margin-bottom: 0.5rem;font-size: 0.9rem;}
    .form-control, .form-select {padding: 0.75rem 1rem;border: 2px solid #e2e8f0;border-radius: 10px;font-size: 0.95rem;transition: all 0.3s ease;}
    .form-control:focus, .form-select:focus {outline: none;border-color: #2563eb;box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);}
    .btn-action {padding: 0.875rem 2.5rem;border-radius: 10px;font-weight: 600;font-size: 0.95rem;border: none;cursor: pointer;transition: all 0.3s ease;display: inline-flex;align-items: center;gap: 0.5rem;}
    .btn-primary-custom {background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);color: white;box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);}
    .btn-primary-custom:hover {transform: translateY(-2px);box-shadow: 0 8px 12px -1px rgba(37, 99, 235, 0.4);}
    .btn-secondary-custom {background: #f1f5f9;color: #475569;}
    .btn-secondary-custom:hover {background: #e2e8f0;}
    .btn-container {display: flex;gap: 1rem;justify-content: center;margin-top: 2rem;padding-top: 2rem;border-top: 1px solid #e2e8f0;}
    @media (max-width: 768px) {
        .btn-container {flex-direction: column;}
        .btn-action {width: 100%;justify-content: center;}
      }

#dcto::-webkit-outer-spin-button,
#dcto::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#dcto {-moz-appearance: textfield; appearance: textfield; text-align: right;}

.input-group-text {min-width: 110px;}

    /* Estilos para Select2 en el modal */
    .select2-container--default .select2-selection--single {
        height: 45px !important;
        border: 2px solid #E5E7EB !important;
        border-radius: 8px !important;
        display: block !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 36px !important;
        color: #374151 !important;
        padding-left: 1rem !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 47px !important;
    }

    .select2-dropdown {
        border: 2px solid #3B82F6 !important;
        border-radius: 6px !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    }

    .select2-container--default .select2-results__option--highlighted[aria-selected] {
        background-color: #3B82F6 !important;
    }

    .select2-search__field {
        border: 2px solid #E5E7EB !important;
        border-radius: 6px !important;
        padding: 0.5rem !important;
    }

    .select2-search__field:focus {
        border-color: #3B82F6 !important;
        outline: none !important;
    }

    /* Ancho de columnas de la tabla */
    .tabla-procedimientos {
        font-size: 0.95rem;
    }

    .tabla-procedimientos thead th,
    .tabla-procedimientos tbody td {
        padding: 8px 4px;
        vertical-align: middle;
    }

    .tabla-procedimientos .form-control,
    .tabla-procedimientos .form-select {
        font-size: 0.9rem;
        padding: 0.35rem 0.5rem;
    }

    .col-procedimiento {
        width: 48%;
        min-width: 180px;
    }

    .col-cantidad {
        width: 10%;
        min-width: 80px;
    }

    .col-valor-unitario {
        width: 15%;
        min-width: 90px;
    }

    .col-valor-total {
        width: 15%;
        min-width: 90px;
    }

    .col-acciones {
        width: 7%;
        min-width: 45px;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 1.2rem;
        line-height: 1;
    }

    /* Responsive para tablets */
    @media (max-width: 992px) {
        .tabla-procedimientos {
            font-size: 0.85rem;
        }

        .tabla-procedimientos thead th,
        .tabla-procedimientos tbody td {
            padding: 6px 3px;
        }

        .tabla-procedimientos .form-control,
        .tabla-procedimientos .form-select {
            font-size: 0.8rem;
            padding: 0.25rem 0.4rem;
        }

        .col-procedimiento {
            width: 35%;
            min-width: 150px;
        }

        .col-cantidad {
            width: 12%;
            min-width: 70px;
        }

        .col-valor-unitario {
            width: 18%;
            min-width: 75px;
        }

        .col-valor-total {
            width: 18%;
            min-width: 75px;
        }

        .col-acciones {
            width: 12%;
            min-width: 40px;
        }
    }

    /* Responsive para mÃ³viles */
    @media (max-width: 768px) {
        .tabla-procedimientos {
            font-size: 0.75rem;
            display: block;
            overflow-x: auto;
            white-space: nowrap;
        }

        .tabla-procedimientos thead,
        .tabla-procedimientos tbody,
        .tabla-procedimientos th,
        .tabla-procedimientos td,
        .tabla-procedimientos tr {
            display: block;
        }

        .tabla-procedimientos thead th {
            padding: 5px 2px;
            text-align: left;
        }

        .tabla-procedimientos tbody td {
            padding: 5px 2px;
            text-align: left;
            border: none;
            border-bottom: 1px solid #ddd;
        }

        .tabla-procedimientos .form-control,
        .tabla-procedimientos .form-select {
            font-size: 0.75rem;
            padding: 0.25rem 0.3rem;
        }

        .col-procedimiento {
            width: 100%;
            min-width: auto;
            display: block;
        }

        .col-cantidad,
        .col-valor-unitario,
        .col-valor-total,
        .col-acciones {
            width: 48%;
            min-width: auto;
            display: inline-block;
            margin-right: 2%;
        }

        .col-acciones {
            width: auto;
            margin-right: 0;
        }
    }

    /* Sección de laboratorio */
    .seccion-laboratorio {
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        border: 2px solid #3B82F6;
        border-radius: 12px;
        padding: 10px;
        margin-top: 30px;
        margin-bottom: 10px;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
        transition: all 0.3s ease;
    }

    .seccion-laboratorio.activa {
        box-shadow: 0 6px 25px rgba(59, 130, 246, 0.25);
        border-color: #2563EB;
    }

    .header-laboratorio {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 15px;
    }

    .titulo-laboratorio {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.1rem;
        font-weight: 600;
        color: #1F2937;
    }

    .icono-laboratorio {
        width: 28px;
        height: 28px;
        background: #3B82F6;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
    }

    .toggle-laboratorio {
        background: #fff;
        border: 2px solid #E5E7EB;
        border-radius: 8px;
        padding: 6px 12px;
        cursor: pointer;
        font-size: 0.85rem;
        transition: all 0.3s ease;
    }

    .toggle-laboratorio:hover {
        background: #F3F4F6;
        border-color: #3B82F6;
    }

    .toggle-laboratorio.activo {
        background: #3B82F6;
        color: white;
        border-color: #3B82F6;
    }

    .contenido-laboratorio {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.4s ease;
        opacity: 0;
    }

    .contenido-laboratorio.mostrar {
        max-height: 500px;
        opacity: 1;
    }

    .fila-laboratorio {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 10px;
        align-items: flex-end;
    }

    .grupo-laboratorio {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .grupo-laboratorio label {
        font-size: 0.9rem;
        font-weight: 500;
        color: #374151;
    }

    .grupo-laboratorio input {
        padding: 10px 12px;
        border: 2px solid #E5E7EB;
        border-radius: 8px;
        font-size: 0.95rem;
        transition: all 0.2s ease;
    }

    .grupo-laboratorio input:focus {
        border-color: #3B82F6;
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .botones-laboratorio {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }

    .btn-aplicar-laboratorio,
    .btn-limpiar-laboratorio {
        padding: 8px 16px;
        border: none;
        border-radius: 8px;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 500;
    }

    .btn-aplicar-laboratorio {
        background: #3B82F6;
        color: white;
    }

    .btn-aplicar-laboratorio:hover {
        background: #2563EB;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

    .btn-limpiar-laboratorio {
        background: #E5E7EB;
        color: #374151;
    }

    .btn-limpiar-laboratorio:hover {
        background: #D1D5DB;
    }

    .estado-laboratorio {
        background: #DBEAFE;
        border: 1px solid #93C5FD;
        border-radius: 8px;
        padding: 10px 12px;
        font-size: 0.85rem;
        color: #1E40AF;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
    }

    .estado-laboratorio.activo {
        background: #DCFCE7;
        border-color: #86EFAC;
        color: #166534;
    }

    .punto-indicador {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: currentColor;
        animation: pulse 2s infinite;
    }

    @keyframes pulse {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.5;
        }
    }

    /* Tabla de cargos de laboratorio */
    .tabla-cargos-laboratorio {
        margin-top: 15px;
        font-size: 0.85rem;
        background: white;
        border-radius: 8px;
        overflow: hidden;
    }

    .tabla-cargos-laboratorio thead {
        background: #F3F4F6;
    }

    .tabla-cargos-laboratorio thead th {
        padding: 10px;
        font-weight: 600;
        color: #374151;
        border: none;
    }

    .tabla-cargos-laboratorio tbody td {
        padding: 10px;
        border-bottom: 1px solid #E5E7EB;
    }

    .tabla-cargos-laboratorio tbody tr:last-child td {
        border-bottom: none;
    }

    .btn-editar-cargo,
    .btn-eliminar-cargo {
        padding: 4px 8px;
        font-size: 0.75rem;
        margin-right: 4px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-editar-cargo {
        background: #FBBF24;
        color: #78350F;
    }

    .btn-editar-cargo:hover {
        background: #F59E0B;
    }

    .btn-eliminar-cargo {
        background: #EF4444;
        color: white;
    }

    .btn-eliminar-cargo:hover {
        background: #DC2626;
    }

    .lista-vacia {
        text-align: center;
        color: #9CA3AF;
        padding: 15px;
        font-size: 0.9rem;
    }

    /* Responsive para tablets */
    @media (max-width: 992px) {
        .tabla-procedimientos {
            font-size: 0.85rem;
        }

        .tabla-procedimientos thead th,
        .tabla-procedimientos tbody td {
            padding: 6px 3px;
        }

        .tabla-procedimientos .form-control,
        .tabla-procedimientos .form-select {
            font-size: 0.8rem;
            padding: 0.25rem 0.4rem;
        }

        .col-procedimiento {
            width: 35%;
            min-width: 150px;
        }

        .col-cantidad {
            width: 12%;
            min-width: 70px;
        }

        .col-valor-unitario {
            width: 18%;
            min-width: 75px;
        }

        .col-valor-total {
            width: 18%;
            min-width: 75px;
        }

        .col-acciones {
            width: 12%;
            min-width: 40px;
        }

        .fila-laboratorio {
            grid-template-columns: 1fr;
        }

        .botones-laboratorio {
            flex-direction: column;
        }
    }

    /* Responsive para móviles */
    @media (max-width: 768px) {
        .tabla-procedimientos {
            font-size: 0.75rem;
            display: block;
            overflow-x: auto;
            white-space: nowrap;
        }

        .tabla-procedimientos thead,
        .tabla-procedimientos tbody,
        .tabla-procedimientos th,
        .tabla-procedimientos td,
        .tabla-procedimientos tr {
            display: block;
        }

        .tabla-procedimientos thead th {
            padding: 5px 2px;
            text-align: left;
        }

        .tabla-procedimientos tbody td {
            padding: 5px 2px;
            text-align: left;
            border: none;
            border-bottom: 1px solid #ddd;
        }

        .tabla-procedimientos .form-control,
        .tabla-procedimientos .form-select {
            font-size: 0.75rem;
            padding: 0.25rem 0.3rem;
        }

        .col-procedimiento {
            width: 100%;
            min-width: auto;
            display: block;
        }

        .col-cantidad,
        .col-valor-unitario,
        .col-valor-total,
        .col-acciones {
            width: 48%;
            min-width: auto;
            display: inline-block;
            margin-right: 2%;
        }

        .col-acciones {
            width: auto;
            margin-right: 0;
        }

        .seccion-laboratorio {
            padding: 15px;
            margin-top: 20px;
        }

        .fila-laboratorio {
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .botones-laboratorio {
            flex-direction: column;
            gap: 10px;
        }

        .btn-aplicar-laboratorio,
        .btn-limpiar-laboratorio {
            width: 100%;
        }
    }

    /* --- ESTILOS PARA RESALTAR FECHA IMPORTANTE --- */
    .seccion-fecha-importante {
        background-color: #eff6ff;
        /* Un fondo azul muy claro */
        border: 2px solid #3B82F6;
        /* Borde azul (como el de laboratorio) */
        border-radius: 8px;
        /* Bordes redondeados */
        padding: 10px;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
        /* Sombra sutil */
        transition: all 0.3s ease;
    }

    .seccion-fecha-importante label {
        font-weight: 600;
        /* Texto en negrita */
        color: #1E40AF;
        /* Color de texto azul oscuro */
        display: block;
        /* Asegura que ocupe todo el ancho */
        margin-bottom: 5px;
    }

    .seccion-fecha-importante input[type="date"] {
        font-weight: 500;
        border-color: #93C5FD;
        /* Borde del input ligeramente azulado */
    }

    .seccion-fecha-importante input[type="date"]:focus {
        border-color: #2563EB;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        /* Sombra de foco más pronunciada */
    }

    /* Forzar ancho del contenedor Select2 en la tabla */
#tabla-procedimientos .select2-container {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

#tabla-procedimientos .select2-container .select2-selection--single {
    width: 100% !important;
    display: block !important;
    height: 40px !important;
}

/* Asegurar que la celda de la tabla mantenga su ancho */
#tabla-procedimientos td:first-child {
    width: 58%;
}

/* Para el select nativo antes de inicializar Select2 */
#tabla-procedimientos .procedimiento-select {
    width: 100% !important;
    display: block !important;
}

/* 👇 IGUALAR ALTURA DE INPUTS CON SELECT2 */
#tabla-procedimientos .cantidad,
#tabla-procedimientos .valor-unitario,
#tabla-procedimientos .valor-total {
    height: 40px !important;
    padding: 0.35rem 0.5rem !important;
    display: flex !important;
    align-items: center !important;
}

/* Asegurar alineación vertical de todo el contenido */
#tabla-procedimientos tbody td {
    vertical-align: middle !important;
}


/* Estilos para la página de factura */

.form-card { background: white; border-radius: 16px; padding: 2rem; box-shadow: 0 2px 30px rgba(0, 0, 0, 0.08); margin-bottom: 2rem; } 
.section-title { font-size: 1.2rem; font-weight: 600; color: #1e293b; margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid #e2e8f0; display: flex; align-items: center; gap: 0.5rem; } 
.info-grid { display: grid; grid-template-columns: minmax(350px, 2fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; } 
.info-item { background: var(--fondo-item); padding: 1rem; border-radius: 8px; border-left: 4px solid var(--primary-blue); } .info-label { font-size: 0.85rem; color: #64748b; font-weight: 600; margin-bottom: 0.25rem; } 
.info-value { font-size: 1.1rem; color: #1e293b; font-weight: 600; } 
.table-wrapper { overflow-x: auto; margin-bottom: 2rem; } 
.detalles-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; } 
.detalles-table thead { background: var(--primary-blue); color: white; } 
.detalles-table th { padding: 12px; text-align: left; font-weight: 600; } 
.detalles-table td { padding: 12px; border-bottom: 1px solid #e2e8f0; } 
.detalles-table tbody tr:hover { background: #f8fafc; } 
.totales-box { background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue) 100%); color: white; border-radius: 12px; padding: 0rem 1.5rem; } 
.totales-row { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 1rem; } 
.totales-row.total { border-top: 2px solid rgba(255, 255, 255, 0.3); margin-top: 0.5rem; padding-top: 1rem; font-size: 1.5rem; font-weight: 700; } 
.plan-pagos-section { background: #fff7ed; border: 2px solid #fb923c; border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; } 
.checkbox-wrapper { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; } 
.checkbox-wrapper input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; } 
.checkbox-wrapper label { font-size: 1.1rem; font-weight: 600; color: #ea580c; cursor: pointer; } 
.plan-fields { display: none; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; } 
.plan-fields.active { display: grid; } 
.form-group label { display: block; font-weight: 600; color: #475569; margin-bottom: 0.5rem; font-size: 0.9rem; } 
.form-control { width: 100%; padding: 0.75rem; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; transition: all 0.3s; } 
.form-control:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } 
.btn-container { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; } .btn { padding: 0.875rem 2.5rem; border-radius: 10px; font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 0.5rem; } 
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.3); } 
.btn-primary:hover { transform: translateY(-4px); box-shadow: 0 8px 12px -1px rgba(102, 126, 234, 0.4); } 
.btn-secondary { background: #f1f5f9; color: #475569; } .btn-secondary:hover { background: #e2e8f0; }


.card { background: white; border-radius: 12px; padding: 2rem; box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08); margin-bottom: 2rem; } 
.info-factura { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 2px solid #0ea5e9; border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; } 
.info-row { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid #e0f2fe; } 
.info-row:last-child { border-bottom: none; } 
.info-label { font-weight: 600; color: #0c4a6e; } 
.info-value { font-weight: 700; color: #0369a1; } 
.info-value.destacado { font-size: 1.5rem; color: #0ea5e9; } 
.form-group { margin-bottom: 1.5rem; } 
.form-label { display: block; font-weight: 600; color: #1e293b; margin-bottom: 0.5rem; font-size: 0.95rem; } 
.form-label.required::after { content: " *"; color: #ef4444; } .form-control[readonly] { background: #f8fafc; cursor: not-allowed; }
textarea.form-control {resize: vertical; min-height: 100px; }
.metodos-pago { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 1rem; max-width: 900px;} 
.metodo-option { position: relative; } 
.metodo-option input[type="radio"] { display: none; } 
.metodo-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 0.5rem; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; transition: all 0.3s; background: white; height: 95px; width: 100%; text-align: center; } 
.metodo-label i { font-size: 2rem; color: #64748b; margin-bottom: 0.35rem; } 
.metodo-label span { font-size: 0.8rem; font-weight: 600; color: #475569; text-align: center; } 
.metodo-option input[type="radio"]:checked + .metodo-label { border-color:var(--primary-blue); background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); } 
.metodo-option input[type="radio"]:checked + .metodo-label i { color: #0d6ea7; } .metodo-option input[type="radio"]:checked + .metodo-label span { color: #070707; }
.alert { padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; } 
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; } 
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.btn-container { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; } 
.btn { padding: 0.875rem 2.5rem; border-radius: 10px; font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3); } 
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 12px -1px rgba(16, 185, 129, 0.4); } 
.btn-secondary { background: #f1f5f9; color: #475569; } .btn-secondary:hover { background: #e2e8f0; }
.input-with-icon { position: relative; } 
.input-with-icon i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1.2rem; } 
.input-with-icon input { padding-left: 3rem; }