/* ============================================================
   NEXUS by Hermatix — Estilos Globales
   Sistema de Gestión Comercial
   ============================================================ */

:root {
    --primary-blue: #013c74;
    --secondary-blue: #015bb5;
    --tech-green: #30A068;
    --green-hover: #268555;
    --white: #FFFFFF;
    --bg-gray: #F5F5F5;
    --text-dark: #1A1A1A;
    --text-muted: #555555;
    --text-secondary: #A1A1AA;
    --dark-bg: #0a1628;
    --darker-bg: #0a2540;
    --card-border: rgba(7, 128, 238, 0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(16, 48, 80, 0.12);
    --shadow-lg: 0 8px 30px rgba(16, 48, 80, 0.18);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--bg-gray);
    min-height: 100vh;
}

a { color: var(--secondary-blue); text-decoration: none; }
a:hover { color: var(--primary-blue); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.app-sidebar .sidebar-logo {
    padding: 1.25rem 1.5rem;
    background: rgba(0,0,0,0.2);
    text-align: center;
}

.app-sidebar .sidebar-logo img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.app-sidebar .sidebar-logo .app-title {
    font-size: 0.7rem;
    color: var(--tech-green);
    font-weight: 600;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* NEXUS Branding */
.nexus-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.nexus-logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(90deg, #30A068 0%, #4ade80 25%, #86efac 50%, #4ade80 75%, #30A068 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: nexusShine 3s ease-in-out infinite;
    position: relative;
}

@keyframes nexusShine {
    0%, 100% { background-position: 200% center; }
    50% { background-position: 0% center; }
}

.nexus-tagline {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nexus-logo-mobile {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #30A068 0%, #4ade80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0 1.5rem 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Sección colapsable */
.nav-group {
    position: relative;
    margin: 0.25rem 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-group:hover {
    background: rgba(255,255,255,0.02);
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.nav-group-header:hover {
    background: rgba(255,255,255,0.05);
}

.nav-group-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

/* Colores por módulo */
.nav-group[data-module="inicio"] .nav-group-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.nav-group[data-module="cotizaciones"] .nav-group-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.nav-group[data-module="ordenes"] .nav-group-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.nav-group[data-module="crm"] .nav-group-icon { background: linear-gradient(135deg, #ec4899, #be185d); }
.nav-group[data-module="compras"] .nav-group-icon { background: linear-gradient(135deg, #10b981, #059669); }
.nav-group[data-module="bodega"] .nav-group-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.nav-group[data-module="legal"] .nav-group-icon { background: linear-gradient(135deg, #f97316, #ea580c); }
.nav-group[data-module="operaciones"] .nav-group-icon { background: linear-gradient(135deg, #eab308, #ca8a04); }
.nav-group[data-module="procesos"] .nav-group-icon { background: linear-gradient(135deg, #a855f7, #9333ea); }
.nav-group[data-module="admin"] .nav-group-icon { background: linear-gradient(135deg, #64748b, #475569); }

.nav-group-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.3px;
}

.nav-group-arrow {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    transition: transform 0.3s ease;
}

.nav-group.expanded .nav-group-arrow {
    transform: rotate(180deg);
}

.nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 0.5rem;
}

.nav-group.expanded .nav-group-items {
    max-height: 500px;
}

.nav-subsection {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem 0.35rem 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-group-items a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem 0.6rem 3.25rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 0.5rem 2px 0;
    position: relative;
}

.nav-group-items a::before {
    content: '';
    position: absolute;
    left: 1.75rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

.nav-group-items a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.nav-group-items a:hover::before {
    background: var(--tech-green);
    box-shadow: 0 0 8px var(--tech-green);
}

.nav-group-items a.active {
    background: rgba(48, 160, 104, 0.15);
    color: var(--tech-green);
    font-weight: 600;
}

.nav-group-items a.active::before {
    background: var(--tech-green);
    box-shadow: 0 0 10px var(--tech-green);
    width: 8px;
    height: 8px;
}

.nav-group-items a .nav-icon {
    display: none;
}

/* Link directo (sin submenú) */
.nav-direct-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin: 0.25rem 0.75rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-direct-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.nav-direct-link.active {
    background: rgba(48, 160, 104, 0.15);
    color: var(--tech-green);
}

.nav-direct-link .nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tech-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--white);
}

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

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

.sidebar-user .user-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.app-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

/* ============================================================
   TOP BAR (mobile)
   ============================================================ */
.app-topbar {
    display: none;
    background: var(--dark-bg);
    color: var(--white);
    padding: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 99;
}

.app-topbar .menu-toggle {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.page-header .breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: var(--bg-gray);
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue { background: rgba(1, 60, 116, 0.1); color: var(--primary-blue); }
.stat-card .stat-icon.green { background: rgba(48, 160, 104, 0.1); color: var(--tech-green); }
.stat-card .stat-icon.orange { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card .stat-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}
.btn-primary:hover:not(:disabled) {
    background: var(--secondary-blue);
    border-color: var(--secondary-blue);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--tech-green);
    color: var(--white);
    border-color: var(--tech-green);
}
.btn-success:hover:not(:disabled) {
    background: var(--green-hover);
    border-color: var(--green-hover);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}
.btn-outline:hover:not(:disabled) {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.form-group label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    font-family: var(--font-family);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text-dark);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(1, 91, 181, 0.1);
}

.form-control:disabled, .form-control[readonly] {
    background: var(--bg-gray);
    color: var(--text-muted);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tech-green);
    cursor: pointer;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-gray);
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(1, 91, 181, 0.02);
}

.table .actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-neutral { background: rgba(0,0,0,0.05); color: var(--text-muted); }
.badge-ganada { background: rgba(255, 215, 0, 0.15); color: #b8860b; font-weight: 700; }

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background: rgba(16, 185, 129, 0.1); color: #065f46; border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger { background: rgba(239, 68, 68, 0.1); color: #991b1b; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #92400e; border: 1px solid rgba(245, 158, 11, 0.2); }
.alert-info { background: rgba(59, 130, 246, 0.1); color: #1e40af; border: 1px solid rgba(59, 130, 246, 0.2); }

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* ============================================================
   LOADING
   ============================================================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

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

    .app-topbar {
        display: flex;
    }

    .app-main {
        margin-left: 0;
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   BOTÓN ATRÁS ESTÁNDAR
   ============================================================ */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-back:hover {
    background: var(--bg-gray);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateX(-2px);
}

.btn-back .back-icon {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.btn-back:hover .back-icon {
    transform: translateX(-3px);
}

.btn-back .back-text {
    display: inline;
}

@media (max-width: 768px) {
    .btn-back .back-text {
        display: none;
    }
    .btn-back {
        padding: 0.5rem 0.75rem;
    }
}

/* Page actions container */
.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   TOOLTIPS GLOBALES
   ============================================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1e293b;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    white-space: normal;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    min-width: 100px;
    max-width: 200px;
    word-wrap: break-word;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Tooltip posicionado a la izquierda para elementos al borde derecho */
[data-tooltip-left]::after {
    left: auto;
    right: 0;
    transform: none;
}

[data-tooltip-left]::before {
    left: auto;
    right: 10px;
    transform: none;
}
