:root {
    --brand-primary: #2563eb;
    --brand-primary-dark: #1d4ed8;
    --brand-secondary: #0f172a;
    --surface-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-subtle: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --radius-lg: 14px;
    --radius-md: 10px;
}

html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--surface-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar moderna con gradiente corporativo */
.navbar-modern {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.8rem 0;
}

.navbar-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff !important;
}

.brand-logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ffffff;
    padding: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.navbar-brand-pill:hover .brand-logo-img {
    transform: scale(1.06);
}

.login-logo-img {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ffffff;
    padding: 3px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.nav-link-modern {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.45rem 0.9rem !important;
    border-radius: 8px;
    transition: all 0.18s ease;
}

.nav-link-modern:hover,
.nav-link-modern.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
}

/* Tarjetas y contenedores */
.card-modern {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-modern-header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.1rem 1.35rem;
}

/* Avatar de cliente */
.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #1d4ed8;
    font-weight: 700;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bfdbfe;
    flex-shrink: 0;
}

.avatar-circle-lg {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    font-size: 1.35rem;
}

/* Drag & Drop Upload Zone */
.upload-dropzone {
    border: 2px dashed #93c5fd;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--brand-primary);
    background: #eff6ff;
    transform: translateY(-1px);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Tarjetas de documentos en galería */
.doc-card {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.doc-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.doc-card.active-doc {
    border: 2px solid var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.doc-preview-thumb {
    height: 150px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-subtle);
}

.doc-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.doc-card:hover .doc-preview-thumb img {
    transform: scale(1.04);
}

.pdf-thumb-badge {
    width: 64px;
    height: 76px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
}

/* Visor integrado de PDF e Imágenes */
.viewer-stage {
    background: #0f172a;
    border-radius: 12px;
    min-height: 540px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #1e293b;
}

.viewer-toolbar {
    background: #1e293b;
    color: #f8fafc;
    padding: 0.75rem 1.1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.viewer-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 18px 18px;
    min-height: 480px;
}

.viewer-canvas iframe {
    width: 100%;
    height: 540px;
    border: none;
    background: #fff;
}

.viewer-canvas img {
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
    transition: transform 0.2s ease;
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* Badges modernos */
.badge-soft-primary {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-weight: 600;
}

.badge-soft-pdf {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-weight: 600;
}

.badge-soft-img {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-weight: 600;
}

.kpi-pill {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.7rem 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}
