/* ==========================================================================
   ATXO API DOCUMENTACIÓN — TEMA MODERNO (Modo Oscuro & Modo Claro)
   Tipografía Poppins & JetBrains Mono (Idénticas a CRM7)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

/* ==========================================================================
   VARIABLES DE TEMA (MODO OSCURO POR DEFECTO)
   ========================================================================== */
:root,
[data-theme="dark"] {
    --bg-canvas: #0b0f19;
    --bg-surface: #111827;
    --bg-elevated: #1a2336;
    --bg-hover: rgba(30, 41, 59, 0.65);
    --bg-input: #0d1321;
    --bg-topbar: rgba(11, 15, 25, 0.88);
    --bg-sidebar: #0e1422;
    --bg-thead: rgba(15, 23, 42, 0.85);
    --bg-code: #0b1120;
    --bg-auth-card: rgba(17, 24, 39, 0.92);

    --border-subtle: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.28);
    --border-focus: #6366f1;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.32);
    --accent-subtle: rgba(99, 102, 241, 0.15);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.14);
    --success-border: rgba(16, 185, 129, 0.35);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.14);
    --warning-border: rgba(245, 158, 11, 0.35);

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.14);
    --danger-border: rgba(239, 68, 68, 0.35);

    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.14);
    --info-border: rgba(14, 165, 233, 0.35);

    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --sidebar-width: 275px;
    --header-height: 64px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 16px 36px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-subtle);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   VARIABLES MODO CLARO
   ========================================================================== */
[data-theme="light"] {
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #f1f5f9;
    --bg-hover: rgba(241, 245, 249, 0.9);
    --bg-input: #f8fafc;
    --bg-topbar: rgba(255, 255, 255, 0.92);
    --bg-sidebar: #ffffff;
    --bg-thead: #f8fafc;
    --bg-code: #0b1120;
    --bg-auth-card: rgba(255, 255, 255, 0.95);

    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-focus: #4f46e5;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --accent-primary: #4f46e5;
    --accent-primary-hover: #4338ca;
    --accent-glow: rgba(79, 70, 229, 0.22);
    --accent-subtle: rgba(79, 70, 229, 0.08);

    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 10px 25px -8px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--border-subtle);
    --shadow-glow: 0 0 25px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   RESET & BASE GLOBAL
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent-primary-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-top: 0;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    margin-top: 0;
    margin-bottom: 0.85rem;
    color: var(--text-secondary);
}

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--accent-subtle);
    color: var(--accent-primary);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--border-subtle);
}

[data-theme="dark"] code {
    color: #a5b4fc;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    margin: 1.5rem 0;
}

/* ==========================================================================
   SEPARACIÓN DE ICONOS Y TÍTULOS (REGLA OBLIGATORIA)
   ========================================================================== */
.card-title,
.page-hero-title,
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title i,
.page-hero-title i,
.card-header h1 i,
.card-header h2 i,
.card-header h3 i,
.card-header h4 i,
.card-header h5 i {
    margin-right: 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-subtle);
    color: var(--accent-primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-canvas);
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s ease;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-sidebar);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.5);
    flex-shrink: 0;
}

.brand-icon-box img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.brand-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.brand-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 1px 6px;
    background: var(--accent-subtle);
    color: var(--accent-primary);
    border-radius: 4px;
    font-weight: 600;
    width: fit-content;
    margin-top: 2px;
}

.btn-sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.btn-sidebar-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Buscador de endpoints en Sidebar */
.sidebar-search-box {
    padding: 0.85rem 1rem 0.5rem;
}

.sidebar-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-search-input-wrap svg {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.sidebar-search-input {
    width: 100%;
    height: 36px;
    padding: 0 10px 0 34px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12.5px;
    font-family: var(--font-sans);
    transition: var(--transition);
}

.sidebar-search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.sidebar-search-input::placeholder {
    color: var(--text-muted);
}

/* Navegación Sidebar */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 1rem 0.65rem 0.35rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

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

.nav-link-item.active {
    color: var(--accent-primary);
    background: var(--accent-subtle);
    font-weight: 600;
}

[data-theme="dark"] .nav-link-item.active {
    color: #a5b4fc;
}

.nav-link-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-primary);
}

.nav-link-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.nav-link-item:hover .nav-link-icon,
.nav-link-item.active .nav-link-icon {
    color: var(--accent-primary);
}

.nav-link-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-admin-tag {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* Pie de Sidebar: Perfil de usuario */
.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-sidebar);
}

.user-profile-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-profile-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--border-subtle);
}

.user-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.user-info-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-sidebar-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-sidebar-logout:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* ==========================================================================
   MAIN CONTENT AREA & TOPBAR
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--header-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-toggle-sidebar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-toggle-sidebar:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.topbar-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topbar-breadcrumbs a {
    color: var(--text-muted);
}
.topbar-breadcrumbs a:hover {
    color: var(--text-primary);
}

.topbar-breadcrumbs .sep {
    font-size: 0.75rem;
    opacity: 0.5;
}

.topbar-breadcrumbs .current {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.env-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.btn-theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 9999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.user-menu-btn:hover {
    border-color: var(--border-strong);
}

.user-menu-btn span {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==========================================================================
   CONTENIDO DE LA PÁGINA
   ========================================================================== */
.page-container {
    padding: 1.75rem 2rem 4rem;
    max-width: 1280px;
    width: 100%;
}

.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.page-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-hero-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   CARDS & CONTENEDORES
   ========================================================================== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-strong);
}

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

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* ==========================================================================
   CONTRASTE DE PARTES OSCURAS (SIEMPRE 100% LEGIBLES EN CUALQUIER TEMA)
   ========================================================================== */

/* Banner de Endpoints: Fondo oscuro terminal con texto siempre brillante */
.endpoint-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: #0b1120 !important; /* Azul oscuro profundo consistente */
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.method-badge.get {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

.method-badge.post {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.45) !important;
}

.method-badge.put {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
}

.method-badge.delete {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
}

/* Texto de la URL SIEMPRE brillante y contrastado */
.endpoint-url-code {
    font-family: var(--font-mono) !important;
    font-size: 0.92rem !important;
    color: #38bdf8 !important; /* Cyan eléctrico súper legible sobre fondo oscuro */
    flex: 1;
    word-break: break-all;
    font-weight: 500;
}

.btn-copy-endpoint {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy-endpoint:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* ==========================================================================
   REDiseño DE PARÁMETROS (MUCHO MÁS CHULO Y PROFESIONAL)
   ========================================================================== */
.params-container {
    margin: 1.5rem 0;
}

.params-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.params-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.param-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
}

.param-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.param-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.param-name {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: var(--accent-subtle);
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .param-name {
    color: #a5b4fc;
}

.param-badge-req {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.param-badge-req.required {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.param-badge-req.required::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--danger);
}

.param-badge-req.optional {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.param-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.param-values {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.param-value-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 1px 7px;
    border-radius: 4px;
}

/* Compatibilidad ul.ul2 si no se procesa por JS */
ul.ul2 {
    list-style: none;
    padding-left: 0;
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

ul.ul2 li {
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

ul.ul2 li:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

ul.ul2 li strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.88rem;
}

/* ==========================================================================
   BLOQUES DE CÓDIGO (TERMINAL MAC STYLE)
   ========================================================================== */
.code-container {
    position: relative;
    border-radius: var(--radius-md);
    background: #0b1120 !important; /* Siempre oscuro terminal */
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    margin: 1.25rem 0;
    overflow: hidden;
    box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.5);
}

.code-header {
    height: 38px;
    padding: 0 16px;
    background: #070d19 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-header-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}

.code-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.code-dot.red { background: #ef4444; }
.code-dot.yellow { background: #f59e0b; }
.code-dot.green { background: #10b981; }

.code-header-lang {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.copy-button {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.74rem;
    font-family: var(--font-sans);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

pre {
    margin: 0;
    padding: 1.25rem 1.4rem;
    overflow-x: auto;
    background: transparent !important;
}

pre code {
    font-family: var(--font-mono) !important;
    font-size: 0.86rem !important;
    line-height: 1.65 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #f8fafc !important; /* Texto siempre brillante */
}

/* ==========================================================================
   TOAST FLOTANTE DE AVISO AL COPIAR
   ========================================================================== */
.docs-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.docs-toast {
    pointer-events: auto;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--success);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 14px 38px -6px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.docs-toast-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.docs-toast-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.docs-toast-title {
    font-weight: 600;
    color: var(--text-primary);
}

.docs-toast-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
}

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

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

/* ==========================================================================
   TABLAS (DATATABLES & GENERAL)
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-thead);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

/* Botones de acción en tablas (.act-btn) */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.act-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.act-btn:hover.edit {
    color: #0284c7;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.act-btn:hover.del {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

/* Badges pequeños y compactos */
.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}

.bg-warning {
    background: var(--warning-bg) !important;
    color: var(--warning) !important;
    border: 1px solid var(--warning-border);
}

.bg-success {
    background: var(--success-bg) !important;
    color: var(--success) !important;
    border: 1px solid var(--success-border);
}

.bg-info {
    background: var(--info-bg) !important;
    color: var(--info) !important;
    border: 1px solid var(--info-border);
}

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-floating {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-control,
.form-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition);
}

.form-floating > .form-control {
    height: 52px;
    padding-top: 1.4rem;
    padding-bottom: 0.4rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 0.95rem 14px;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out;
    color: var(--text-muted);
    font-size: 13.5px;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: .85;
    transform: scale(.85) translateY(-0.75rem) translateX(0.15rem);
    color: var(--accent-primary);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

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

/* ==========================================================================
   MODO RESPONSIVE (MÓVILES Y TABLETS)
   ========================================================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .btn-sidebar-close {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .page-container {
        padding: 1.25rem 1rem 3rem;
    }
}
