/* ==========================================================================
   DESIGN SYSTEM & VARIABLES - 14soles® Gestión
   ========================================================================== */
:root {
    --font-sans: 'DM Sans', sans-serif;
    --font-header: 'DM Sans', sans-serif;

    /* Color Palette - Premium Light Mode */
    --bg-main: #f8fafc; /* Fondo gris pizarra claro */
    --bg-sidebar: #ffffff; /* Sidebar blanco limpio */
    --border-glass: #e2e8f0; /* Bordes suaves claros */
    --bg-glass: #ffffff; /* Tarjetas blancas limpias sólidas */
    --bg-glass-hover: #f8fafc;
    
    --color-primary: #fccc2c; /* Amarillo Mostaza exacto corporativo de 14soles */
    --color-primary-glow: rgba(252, 204, 44, 0.12);
    --color-secondary: #64748b;
    --color-accent: #0f172a; /* Slate negro/gris oscuro */
    --color-accent-glow: rgba(15, 23, 42, 0.06);
    
    --color-success: #10b981; /* Verde éxito vibrante */
    --color-success-glow: rgba(16, 185, 129, 0.08);
    --color-warning: #f59e0b; /* Ámbar advertencia */
    --color-warning-glow: rgba(245, 158, 11, 0.08);
    --color-danger: #ef4444; /* Rojo peligro */
    --color-danger-glow: rgba(239, 68, 68, 0.08);

    --text-main: #0f172a; /* Texto oscuro principal */
    --text-muted: #64748b; /* Texto secundario gris */
    --text-dark: #0f172a;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 16px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(29, 78, 216, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(234, 88, 12, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, .font-header {
    font-family: var(--font-header);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover {
    color: #60a5fa;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-layout {
    display: flex;
    flex-direction: row; /* Horizontal split: Sidebar left, Main window right */
    min-height: 100vh;
    width: 100vw;
}

.top-navbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    transition: var(--transition-normal);
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar.hidden {
    display: none;
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    font-family: var(--font-header);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(15, 23, 42, 0.04);
}

.nav-item.active {
    background-color: var(--color-primary) !important;
    color: #000000 !important;
    font-weight: 700;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-glass);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--text-main);
    font-weight: 700;
    font-family: var(--font-header);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
}
.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
}
.profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Content Area */
.content-viewport {
    flex: 1;
    padding: 32px 24px;
    overflow-y: auto;
}

.view-section {
    animation: fade-in 0.3s ease-out;
}

.view-section.hidden {
    display: none !important;
}

.view-header {
    margin-bottom: 28px;
}
.view-header h1 {
    font-size: 1.75rem;
    margin-bottom: 6px;
}

/* ==========================================================================
   COMPONENTS: GLASS CARDS, BUTTONS & FORM ELEMENTS
   ========================================================================== */
.glass-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 10px 30px -15px rgba(15, 23, 42, 0.04), 0 4px 12px -5px rgba(15, 23, 42, 0.02);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card.card-hover:hover {
    border-color: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.08);
}

/* Buttons */
.btn {
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 14px 28px;
    border-radius: 30px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--color-primary);
    color: #000000 !important;
    box-shadow: none;
}
.btn-primary:hover {
    background-color: #ffbb00;
    box-shadow: none;
}

.btn-secondary {
    background-color: rgba(15, 23, 42, 0.05);
    color: var(--text-main);
    border-color: var(--border-glass);
}
.btn-secondary:hover {
    background-color: rgba(15, 23, 42, 0.08);
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(185, 28, 28, 0.2);
}
.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--color-success);
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    background-color: #059669;
}

.btn-info {
    background-color: #6366f1;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.2);
}
.btn-info:hover {
    background-color: #4f46e5;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}
.btn-xs {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 26px;
}
.w-full {
    width: 100%;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.input-field, .select-field {
    background-color: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: var(--text-main);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.input-field:focus, .select-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.select-field option {
    background-color: #ffffff;
    color: var(--text-main);
}

/* ==========================================================================
   DASHBOARD STATS & GRIDS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 12px rgba(255,255,255,0.05);
}

.bg-blue-glow { background: rgba(15, 23, 42, 0.04); color: #0f172a; }
.bg-orange-glow { background: rgba(15, 23, 42, 0.04); color: #0f172a; }
.bg-purple-glow { background: rgba(15, 23, 42, 0.04); color: #0f172a; }
.bg-green-glow { background: rgba(15, 23, 42, 0.04); color: #0f172a; }

.stat-details {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2px;
}

.stat-trend {
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}
.trend-up {
    color: #10b981;
}
.trend-down {
    color: #ef4444;
}
.trend-meta {
    color: var(--text-muted);
    font-weight: 400;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media(min-width: 992px) {
    .grid-2col {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.grid-3col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media(min-width: 992px) {
    .grid-3col {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .col-span-2 {
        grid-column: span 2;
    }
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th, .data-table td {
    padding: 20px 18px;
    border-bottom: 1px solid var(--border-glass);
}

.data-table th {
    font-family: var(--font-header);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background-color: rgba(15, 23, 42, 0.02);
}

.data-table tbody tr {
    transition: var(--transition-fast);
}
.data-table tbody tr:hover {
    background-color: rgba(15, 23, 42, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-info { background-color: var(--color-primary-glow); color: var(--color-primary); }
.badge-warning { background-color: var(--color-warning-glow); color: var(--color-warning); }
.badge-success { background-color: var(--color-success-glow); color: var(--color-success); }
.badge-danger { background-color: var(--color-danger-glow); color: var(--color-danger); }
.badge-neutral { background-color: rgba(15, 23, 42, 0.05); color: var(--text-muted); }

/* ==========================================================================
   TIMELINE PROGRESS TRACKER (PACKAGE TRACKING)
   ========================================================================== */
.tracking-timeline-container {
    padding: 20px 0;
    overflow-x: auto;
}

.tracking-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-width: 700px;
    padding: 0 40px;
}

.tracking-timeline::before {
    display: none;
}

.tracking-timeline-lines {
    position: absolute;
    top: 50px; /* Vertically centered relative to 100px circle */
    left: 90px; /* Starting from center of first step circle: 40px padding + 50px half of circle */
    right: 90px; /* Ending at center of last step circle */
    height: 3px;
    display: flex;
    z-index: 1;
}

.line-segment {
    flex: 1;
    height: 100%;
    background-color: #e2e8f0;
    transition: background-color var(--transition-normal);
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    cursor: pointer;
    flex: 1;
}

.step-node-container {
    position: relative;
    display: inline-block;
    z-index: 4;
}

.step-node {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: #94a3b8;
    box-shadow: 0 0 0 5px var(--bg-main);
    transition: all var(--transition-normal);
}

.step-label {
    margin-top: 12px;
    text-align: center;
    display: flex;
    padding: 20px;
    flex-direction: column;
    align-items: center;
}

/* Timeline status styling */
.timeline-step.completed .step-node {
    background-color: var(--color-success);
    border-color: var(--color-success);
    color: #ffffff;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 0 5px var(--bg-main), 0 0 4px rgba(252, 204, 44, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 5px var(--bg-main), 0 0 24px rgba(252, 204, 44, 0.9);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 0 0 5px var(--bg-main), 0 0 4px rgba(252, 204, 44, 0.4);
        transform: scale(1);
    }
}

.timeline-step.active .step-node {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #000000;
    animation: glow-pulse 2.4s infinite ease-in-out;
}

.timeline-step.selected .step-node {
    box-shadow: 0 0 0 5px var(--bg-main), 0 0 15px rgba(15, 23, 42, 0.18);
    border-color: #ffffff;
}

/* ==========================================================================
   TABS, COMMENTS AND ACTIVITIES
   ========================================================================== */
.tabs-nav-bar {
    display: flex;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.tab-button, .client-tab-button {
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    border-bottom: 2px solid transparent;
}
.tab-button:hover, .client-tab-button:hover {
    color: var(--text-main);
}
.tab-button.active, .client-tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* iOS Toggle Switch Slider */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .3s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
input:checked + .slider {
    background-color: var(--color-primary);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

.tab-content, .client-tab-content {
    display: none;
    animation: fade-in 0.2s ease-out;
}
.tab-content.active, .client-tab-content.active {
    display: block;
}

.divide-y > * {
    border-bottom: 1px solid var(--border-glass);
}
.divide-y > *:last-child {
    border-bottom: none;
}

/* Checklist Row */
.checklist-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.checklist-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checklist-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
}
.checklist-circle.checked {
    background-color: var(--color-success);
    border-color: var(--color-success);
    color: var(--text-dark);
}

.checklist-text {
    display: flex;
    flex-direction: column;
}
.checklist-title {
    font-size: 0.85rem;
    font-weight: 500;
}
.checklist-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Activity Feeds */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-item {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
}

.activity-icon-container {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-details {
    display: flex;
    flex-direction: column;
}
.activity-desc {
    color: var(--text-main);
}
.activity-time {
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-top: 2px;
}

/* Comments */
.comment-box {
    padding: 12px 16px;
    border-radius: 10px;
    background-color: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--border-glass);
}
.comment-box.internal {
    background-color: rgba(234, 88, 12, 0.03);
    border-color: rgba(234, 88, 12, 0.15);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
}
.comment-time {
    color: var(--text-muted);
}
.comment-body {
    font-size: 0.8rem;
    color: var(--text-main);
    white-space: pre-wrap;
}

/* ==========================================================================
   MODAL WINDOWS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.2s ease-out;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-container {
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    border-color: rgba(255, 255, 255, 0.12);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding-top: 16px;
}

/* ==========================================================================
   UTILITY & HELPER CLASSES
   ========================================================================== */
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pt-4 { padding-top: 1rem; }
.pr-2 { padding-right: 0.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.min-w-0 { min-width: 0px; }
.w-full { width: 100%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.hidden { display: none !important; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-main) !important; }
.opacity-70 { opacity: 0.7; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.bg-dark-card { background-color: rgba(15, 23, 42, 0.03); }
.p-3 { padding: 0.75rem; }
.rounded { border-radius: 8px; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wider { tracking: 0.05em; }
.max-h-\[300px\] { max-height: 300px; }
.overflow-y-auto { overflow-y: auto; }
.border-t { border-top: 1px solid var(--border-glass); }

.form-error {
    font-size: 0.75rem;
    color: var(--color-danger);
    background-color: var(--color-danger-glow);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
}

/* Login View Styling */
#view-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 36px;
}
.login-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo-sun {
    font-size: 3rem;
    display: inline-block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px var(--color-accent));
}

.portal-welcome-banner {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.08) 0%, rgba(234, 88, 12, 0.04) 100%);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    from { filter: drop-shadow(0 0 6px var(--color-accent)); }
    to { filter: drop-shadow(0 0 14px var(--color-accent)); }
}

/* ==========================================================================
   UX/UI CLEAN INTERFACE OVERRIDES (IMAGE INSPIRED)
   ========================================================================== */
.client-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-primary-glow);
    color: var(--color-primary);
    font-weight: 700;
    font-family: var(--font-header);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.data-table tbody tr.selected-row {
    background-color: rgba(0, 102, 255, 0.04) !important;
    border-left: 3px solid var(--color-primary);
}

.data-table tbody tr {
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

/* ==========================================================================
   SIDE DRAWERS (PANELES LATERALES DESLIZANTES)
   ========================================================================== */
.side-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: none;
}
.side-drawer-overlay.open {
    display: block;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: -460px; /* Oculto por defecto */
    width: 440px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -8px 0 24px -4px rgba(15, 23, 42, 0.08);
    border-left: 1px solid var(--border-glass);
    z-index: 1100;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.side-drawer.open {
    right: 0;
}

.side-drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.side-drawer-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.side-drawer-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.side-drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
    background-color: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Extras and Utilities */
.w-32 { width: 8rem; }
.h-2 { height: 0.5rem; }
.h-1.5 { height: 0.375rem; }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.cursor-pointer { cursor: pointer; }
.w-16 { width: 4rem; }
.gap-1\.5 { gap: 0.375rem; }

.empty-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed rgba(15, 23, 42, 0.08);
    border-radius: 12px;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 72px !important;
}
.sidebar.collapsed .profile-info,
.sidebar.collapsed .profile-role,
.sidebar.collapsed .profile-name,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .logo-text,
.sidebar.collapsed #collapse-text {
    display: none !important;
}
.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 24px 10px !important;
}
.sidebar.collapsed .admin-profile {
    justify-content: center;
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}
.sidebar.collapsed .sidebar-footer {
    padding: 12px 6px;
}

#collapse-arrow-svg {
    transition: transform var(--transition-fast);
}
.sidebar.collapsed #collapse-arrow-svg {
    transform: rotate(180deg);
}

.next-step-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f8f8f8;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 12px 16px;
    color: #161616;
    font-size: 0.8rem;
    font-weight: 300;
    width: 100%;
}
.next-step-banner span {
    color: #525252;
    margin-left: 4px;
}

.portal-welcome-banner {
    background: white;
    border: 1px solid #ffffff;
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #64748b;
}
.breadcrumbs a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}
.breadcrumbs .breadcrumb-separator {
    color: #94a3b8;
}
.breadcrumbs .breadcrumb-current {
    color: #64748b;
    font-weight: 500;
}

/* ==========================================================================
   PROJECT TITLE ROW
   ========================================================================== */
.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.project-title-row h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.project-title-row .progress-block {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.project-title-row .progress-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.progress-bar-mini {
    width: 80px;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-mini .fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 99px;
    transition: width var(--transition-normal);
}

/* ==========================================================================
   PROJECT 7-TAB NAVIGATION BAR
   ========================================================================== */
.project-tabs-bar {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
}
.project-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.project-tab:hover {
    color: #3b82f6;
}
.project-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Project tab content panels */
.project-tab-content {
    display: none;
}
.project-tab-content.active {
    display: block;
}

/* ==========================================================================
   RESUMEN GRID (2-column layout for summary tab)
   ========================================================================== */
.project-resumen-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Three-dot menu button */
.three-dot-menu {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 1.2rem;
    letter-spacing: 1px;
    transition: background 0.15s;
    position: relative;
    flex-shrink: 0;
}
.three-dot-menu:hover {
    background: #f1f5f9;
}

/* Dropdown for three-dot menu */
.three-dot-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 100;
    display: none;
    padding: 4px 0;
}
.three-dot-dropdown.open {
    display: block;
}
.three-dot-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    font-size: 0.8rem;
    color: #334155;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}
.three-dot-dropdown button:hover {
    background: #f1f5f9;
}

/* ==========================================================================
   WHATSAPP FLOATING ACTION BUTTON
   ========================================================================== */
.whatsapp-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}
.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

/* ==========================================================================
   CLIENT PORTAL — UNIFIED PHASE PANEL
   ========================================================================== */
.client-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.15s;
    margin-bottom: 8px;
}
.client-action-card:hover {
    border-color: #93c5fd;
}
.client-action-card.completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* ==========================================================================
   BLOCK EDIT SYSTEM & SPLIT CHAT SIDEBAR
   ========================================================================== */
.project-two-col {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    width: 100%;
}
.project-main-area {
    flex: 1;
    min-width: 0;
}
.project-chat-sidebar {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 130px);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Chat bubble styling */
.chat-bubble-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-bubble-meta {
    font-size: 0.68rem;
    color: #94a3b8;
    margin: 0 4px;
}
.chat-bubble-wrapper.mine {
    align-self: flex-end;
    align-items: flex-end;
}
.chat-bubble-wrapper.other {
    align-self: flex-start;
    align-items: flex-start;
}
.chat-bubble-wrapper.internal {
    align-self: center;
    align-items: center;
    width: 100%;
}
.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    max-width: 85%;
    line-height: 1.4;
}
.chat-bubble-wrapper.mine .chat-bubble {
    background-color: var(--color-primary);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}
.chat-bubble-wrapper.other .chat-bubble {
    background-color: #f1f5f9;
    color: #0f172a;
    border-bottom-left-radius: 2px;
}
.chat-bubble-wrapper.internal .chat-bubble {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    text-align: center;
    max-width: 95%;
}

/* Dynamic block cards styling */
.block-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.02), 0 2px 6px -1px rgba(15, 23, 42, 0.01);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.block-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06);
}
.block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.block-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.block-desc {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}
.block-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 12px;
}
.block-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.block-badge.pending {
    background-color: #fff7ed;
    color: #c2410c;
}
.block-badge.received {
    background-color: #eff6ff;
    color: #1d4ed8;
}
.block-badge.approved {
    background-color: #f0fdf4;
    color: #15803d;
}
.block-badge.correction {
    background-color: #fef2f2;
    color: #b91c1c;
}

.client-action-card .action-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.client-action-card .action-status-dot.pending {
    background-color: #f97316;
}
.client-action-card .action-status-dot.received {
    background-color: #22c55e;
}
.client-action-card .action-status-dot.review {
    background-color: #3b82f6;
}

/* Empty state for client portal */
.client-empty-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #15803d;
}

@media (max-width: 1024px) {
    .project-two-col {
        flex-direction: column;
        align-items: stretch;
    }
    .project-chat-sidebar {
        width: 100%;
        position: static;
        height: 500px;
    }
}

