/* ============================================================
   Portal LEG Technologies — CSS Principal
   Mismo lenguaje visual que CRM e Inventario LEG
   Bootstrap 5.3 + Bootstrap Icons
   ============================================================ */

/* ── Variables de diseño ──────────────────────────────────── */
:root {
    --sidebar-width:    240px;
    --sidebar-bg:       #1a2035;
    --sidebar-hover:    rgba(255,255,255,.08);
    --sidebar-active:   rgba(255,255,255,.14);
    --sidebar-text:     rgba(255,255,255,.75);
    --sidebar-text-dim: rgba(255,255,255,.40);
    --sidebar-border:   rgba(255,255,255,.10);

    --topbar-height:    60px;
    --topbar-bg:        #ffffff;
    --topbar-shadow:    0 1px 0 #e5e7eb;

    --body-bg:          #f3f4f6;
    --card-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --card-radius:      10px;
    --card-border:      #e5e7eb;

    --primary:          #1a56db;
    --primary-dark:     #1347c0;
    --primary-light:    #eff3ff;
    --success:          #057a55;
    --warning:          #c27803;
    --danger:           #e02424;
    --info:             #0284c7;
    --secondary:        #6b7280;

    --transition:       .18s ease;
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
    background: var(--body-bg);
    font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
}

/* ── Layout principal ─────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}
.main-content { flex: 1; }
.main-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--card-border);
    background: #fff;
    text-align: center;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.sidebar-brand {
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.brand-link { display: block; text-decoration: none; }
.brand-logo { height: 32px; max-width: 160px; }
.brand-text { color: #fff; font-size: 1.1rem; font-weight: 700; letter-spacing: -.3px; }

/* Info de empresa en sidebar */
.sidebar-company {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.company-icon {
    width: 32px; height: 32px;
    background: rgba(255,255,255,.12);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.8);
    font-size: .9rem;
    flex-shrink: 0;
}
.company-name { font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.9); line-height: 1.3; }
.company-label { font-size: .68rem; color: var(--sidebar-text-dim); margin-top: 1px; }

/* Nav */
.sidebar-nav-wrapper { flex: 1; padding: 8px 0; }
.sidebar-nav { list-style: none; margin: 0; padding: 0; }

.nav-section-title {
    padding: 14px 20px 4px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--sidebar-text-dim);
    text-transform: uppercase;
}

.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 1rem; opacity: .9; flex-shrink: 0; width: 18px; text-align: center; }

/* Footer sidebar */
.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    padding: 8px 0;
    transition: color var(--transition);
}
.sidebar-logout:hover { color: #f87171; }

/* Overlay móvil */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
}

/* ── Banner de impersonación ──────────────────────────────── */
.impersonate-banner {
    background: #7c3aed;
    color: #fff;
    text-align: center;
    padding: 7px 16px;
    font-size: .85rem;
    position: sticky;
    top: 0;
    z-index: 110;
}
.impersonate-banner strong { font-weight: 700; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    box-shadow: var(--topbar-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
    background: none; border: none;
    padding: 6px 8px;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    display: none;          /* visible solo en móvil */
    transition: background var(--transition);
}
.sidebar-toggle:hover { background: #f3f4f6; color: #111; }

.topbar-breadcrumb .breadcrumb {
    font-size: .85rem;
    margin: 0;
}
.topbar-breadcrumb .breadcrumb-item a { color: var(--primary); text-decoration: none; }
.topbar-breadcrumb .breadcrumb-item.active { color: #6b7280; }

/* Avatar usuario */
.topbar-user-btn {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition);
}
.topbar-user-btn:hover { background: #f3f4f6; }
.topbar-avatar {
    width: 34px; height: 34px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .875rem;
    font-weight: 700;
    flex-shrink: 0;
}
.topbar-user-name { font-size: .875rem; font-weight: 600; color: #111; line-height: 1.3; }
.topbar-user-role { font-size: .72rem; color: #6b7280; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background: #fff;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    padding: 14px 20px;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}
.card-title { font-size: .875rem; font-weight: 600; color: #374151; }
.card-footer {
    background: #fafafa;
    border-top: 1px solid var(--card-border);
    padding: 14px 20px;
}

/* ── Badges personalizados ────────────────────────────────── */
.badge-activo    { background: #d1fae5; color: #065f46; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #e0f2fe; color: #0c4a6e; }
.badge-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 2px; color: #111827; }
.page-subtitle { font-size: .875rem; margin-bottom: 0; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* ── Stat cards (Dashboard) ───────────────────────────────── */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--card-radius);
    border: 1px solid var(--card-border);
    background: #fff;
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
    color: inherit;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); transform: translateY(-1px); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: #111; }
.stat-label { font-size: .78rem; color: #6b7280; margin-top: 2px; }
.stat-badge { position: absolute; bottom: 10px; right: 12px; }

.stat-card-primary .stat-icon { background: #eff3ff; color: var(--primary); }
.stat-card-info    .stat-icon { background: #e0f2fe; color: var(--info); }
.stat-card-success .stat-icon { background: #d1fae5; color: var(--success); }
.stat-card-warning .stat-icon { background: #fef3c7; color: var(--warning); }
.stat-card-secondary .stat-icon { background: #f3f4f6; color: var(--secondary); }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--card-border);
    transition: all var(--transition);
}
.filter-tab:hover { color: var(--primary); border-color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Contrato cards ───────────────────────────────────────── */
.contract-card {
    border: 1px solid var(--card-border);
    transition: box-shadow var(--transition), transform var(--transition);
    color: inherit;
}
.contract-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-2px); }
.contract-number { font-size: .75rem; color: #9ca3af; font-family: monospace; }
.contract-title { font-size: .9rem; font-weight: 600; color: #111; }
.contract-meta { display: flex; flex-direction: column; gap: 4px; }
.contract-meta-item { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #4b5563; }
.contract-card-footer { padding: 10px 16px; border-top: 1px solid var(--card-border); }

/* ── Asset cards ──────────────────────────────────────────── */
.asset-card {
    border: 1px solid var(--card-border);
    transition: box-shadow var(--transition), transform var(--transition);
    color: inherit;
}
.asset-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-2px); }
.asset-type-icon {
    width: 40px; height: 40px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: var(--primary);
    flex-shrink: 0;
}
.asset-detail-icon {
    width: 52px; height: 52px;
    background: #eff3ff;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
    flex-shrink: 0;
}
.asset-name { font-size: .875rem; font-weight: 600; }
.asset-meta { display: flex; flex-direction: column; gap: 3px; }
.asset-meta-item { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: #6b7280; }

/* ── Tipo chips ───────────────────────────────────────────── */
.tipo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tipo-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    font-size: .78rem;
    color: #374151;
    box-shadow: var(--card-shadow);
}
.tipo-count { background: var(--primary-light); color: var(--primary); padding: 0 6px; border-radius: 10px; font-weight: 600; font-size: .7rem; }

/* ── Service cards ────────────────────────────────────────── */
.service-card {
    border: 1px solid var(--card-border);
    transition: box-shadow var(--transition), transform var(--transition);
    color: inherit;
}
.service-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-2px); }
.service-type-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.service-icon-internet  { background: #e0f2fe; color: #0284c7; }
.service-icon-vpn       { background: #f0fdf4; color: #16a34a; }
.service-icon-hosting   { background: #fef3c7; color: #d97706; }
.service-icon-email     { background: #eff3ff; color: var(--primary); }
.service-icon-cloud     { background: #e0f2fe; color: #0284c7; }
.service-icon-soporte   { background: #fdf4ff; color: #9333ea; }
.service-icon-seguridad { background: #f0fdf4; color: #16a34a; }
.service-icon-telefonia { background: #fef9c3; color: #ca8a04; }
.service-icon-otro      { background: #f3f4f6; color: #6b7280; }
.service-meta { display: flex; flex-direction: column; gap: 3px; }
.service-meta-item { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: #6b7280; }

/* ── Detail grid ──────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item.col-span-2 { grid-column: span 2; }
.detail-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; }
.detail-value { font-size: .875rem; color: #111827; }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
    content: ''; position: absolute; left: 5px; top: 0; bottom: 0;
    width: 2px; background: #e5e7eb;
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute; left: -19px; top: 3px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e5e7eb;
}
.timeline-content { padding-left: 4px; }

/* ── Relation direction ───────────────────────────────────── */
.relation-direction {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
    flex-shrink: 0;
}
.relation-direction.out { background: #eff3ff; color: var(--primary); }
.relation-direction.in  { background: #f0fdf4; color: var(--success); }

/* ── Ticket items ─────────────────────────────────────────── */
.ticket-item { transition: background var(--transition); }
.ticket-status-indicator {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}
.ticket-status-indicator.open   { background: var(--success); box-shadow: 0 0 0 3px #d1fae5; }
.ticket-status-indicator.closed { background: #9ca3af; }
.ticket-title { font-size: .9rem; }

/* Mensaje en ticket */
.message-bubble {
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
}
.message-bubble:last-child { border-bottom: none; }
.message-customer { background: #f9fafb; }
.message-agent    { background: #eff3ff; }
.message-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.message-sender { font-size: .85rem; }
.message-body { font-size: .9rem; line-height: 1.6; color: #374151; }

/* ── Quote totals ─────────────────────────────────────────── */
.quote-totals { display: flex; flex-direction: column; gap: 6px; }
.quote-total-row { display: flex; justify-content: space-between; align-items: center; font-size: .875rem; }
.quote-total-final {
    padding-top: 10px;
    border-top: 2px solid var(--card-border);
    font-weight: 700;
    font-size: 1rem;
    margin-top: 4px;
}

/* ── Profile / Company ────────────────────────────────────── */
.company-profile-header { display: flex; align-items: center; gap: 16px; }
.company-logo-img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; border: 1px solid var(--card-border); }
.company-logo-placeholder {
    width: 56px; height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    flex-shrink: 0;
}
.contact-card { background: #f9fafb; border: 1px solid var(--card-border); border-radius: 8px; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-card {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}
.empty-card > i { font-size: 2.5rem; color: #d1d5db; display: block; margin-bottom: 12px; }
.empty-card h5 { color: #374151; margin-bottom: 6px; }
.empty-state { text-align: center; }

/* ── Quick actions ────────────────────────────────────────── */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-action-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #374151;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
}
.quick-action-btn:hover { background: var(--primary-light); color: var(--primary); border-color: #c7d7ff; }
.quick-action-btn i { font-size: 1rem; }

/* ── Asset mini icon ──────────────────────────────────────── */
.asset-mini-icon {
    width: 32px; height: 32px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: .9rem;
    flex-shrink: 0;
}

/* ── Priority selector (tickets) ─────────────────────────── */
.priority-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.priority-selector .btn { font-size: .85rem; }

/* ── Contact alt ──────────────────────────────────────────── */
.contact-alt { display: flex; align-items: center; gap: 10px; }
.contact-alt > div { line-height: 1.4; }

/* ── Upload zone (adjuntos en ticket) ─────────────────────── */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--card-radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: #f9fafb;
}
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upload-zone-icon {
    font-size: 2rem;
    color: #9ca3af;
    display: block;
    margin-bottom: 8px;
    pointer-events: none;
}
.upload-zone:hover .upload-zone-icon,
.upload-zone.dragover .upload-zone-icon { color: var(--primary); }
.upload-zone-text { font-size: .9rem; color: #374151; pointer-events: none; }
.upload-zone-text .btn { pointer-events: all; }
.upload-zone-hint { font-size: .78rem; color: #9ca3af; margin-top: 4px; pointer-events: none; }

/* ── File chips ───────────────────────────────────────────── */
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #eff3ff;
    border: 1px solid #c7d7fa;
    border-radius: 20px;
    font-size: .8rem;
    color: #1e40af;
    max-width: 280px;
}
.file-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}
.file-chip-size { font-size: .72rem; color: #6b7280; }
.file-chip-remove {
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.file-chip-remove:hover { color: var(--danger); }

/* ── Ticket sidebar: SLA & tips ───────────────────────────── */
.ticket-sla-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
}
.ticket-sla-item:last-child { border-bottom: none; }
.ticket-sla-icon { font-size: 1.1rem; flex-shrink: 0; }

.ticket-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--card-border);
    font-size: .85rem;
    color: #374151;
    line-height: 1.5;
}
.ticket-tip i { flex-shrink: 0; margin-top: 2px; }

/* ── Tipo-btn activo (selector de recurso en ticket) ──────── */
.tipo-btn.btn-primary { color: #fff; }
.bg-primary-subtle    { background: var(--primary-light) !important; }

/* ── Prose (HTML del CRM) ─────────────────────────────────── */
.prose { font-size: .9rem; line-height: 1.7; color: #374151; }
.prose p:last-child { margin-bottom: 0; }

/* ── Auth layout — estilo corporativo LEG ─────────────────── */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    /* Degradado corporativo LEG: azul → verde (igual al CRM) */
    background: linear-gradient(135deg, #1a8fd1 0%, #16b89e 50%, #2ecc71 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.auth-card {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    padding: 40px 40px 36px;
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}
.auth-logo-img {
    height: 56px;
    max-width: 200px;
    object-fit: contain;
}
.auth-logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a3a5c;
    letter-spacing: -.5px;
}

/* Título del sistema */
.auth-header {
    text-align: center;
    margin-bottom: 28px;
}
.auth-system-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2035;
    margin-bottom: 3px;
}
.auth-system-subtitle {
    font-size: .9rem;
    color: #6b7280;
    margin: 0;
}

/* Campos */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field label {
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: .01em;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-icon {
    position: absolute;
    left: 13px;
    color: #9ca3af;
    font-size: .95rem;
    pointer-events: none;
    z-index: 1;
}
.auth-input {
    width: 100%;
    padding: 10px 40px 10px 38px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    color: #111827;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    appearance: none;
}
.auth-input:focus {
    border-color: #1a8fd1;
    box-shadow: 0 0 0 3px rgba(26,143,209,.12);
}
.auth-input::placeholder { color: #9ca3af; }

.auth-eye-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: .95rem;
    transition: color .15s;
}
.auth-eye-btn:hover { color: #374151; }

/* ¿Olvidaste? */
.auth-forgot {
    text-align: right;
    margin-top: -6px;
}
.auth-forgot a {
    font-size: .8rem;
    color: #1a8fd1;
    text-decoration: none;
}
.auth-forgot a:hover { text-decoration: underline; }

/* Botón principal */
.auth-btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #1a8fd1, #16b89e);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: .01em;
    cursor: pointer;
    transition: opacity .15s, box-shadow .15s;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(26,143,209,.35);
}
.auth-btn-primary:hover {
    opacity: .92;
    box-shadow: 0 6px 18px rgba(26,143,209,.45);
}
.auth-btn-primary:active { opacity: .85; transform: translateY(1px); }

/* Divisor */
.auth-divider {
    text-align: center;
    position: relative;
    margin: 18px 0 14px;
    color: #9ca3af;
    font-size: .8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 50px);
    height: 1px;
    background: #e5e7eb;
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* Contacto */
.auth-contact {
    text-align: center;
    font-size: .82rem;
    color: #6b7280;
}
.auth-contact a { color: #1a8fd1; text-decoration: none; }
.auth-contact a:hover { text-decoration: underline; }

/* Volver */
.auth-back-link {
    text-align: center;
    margin-top: 20px;
}
.auth-back-link a {
    font-size: .85rem;
    color: #6b7280;
    text-decoration: none;
}
.auth-back-link a:hover { color: #1a8fd1; }

/* Alerta dentro del card */
.alert-auth {
    border-radius: 8px;
    font-size: .875rem;
    padding: 10px 14px;
    margin-bottom: 16px;
}

/* Footer bajo el card */
.auth-footer {
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    text-align: center;
}
.auth-footer a { color: rgba(255,255,255,.85); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary { background: var(--primary); border-color: var(--primary); font-weight: 500; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

/* ── Tables ───────────────────────────────────────────────── */
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; font-weight: 600; }
.table td { font-size: .875rem; }

/* ── Scrollbar global ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* min-w-0 utility */
.min-w-0 { min-width: 0; }

/* ── Responsive — móvil ────────────────────────────────────── */
@media (max-width: 768px) {
    .main-wrapper { margin-left: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle { display: flex; }

    .auth-card { padding: 28px 24px; }
    .detail-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.4rem; }
}

@media (max-width: 576px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .quick-actions .quick-action-btn { flex: 1 1 calc(50% - 5px); justify-content: center; }
}
