/* =========================================================
   Dashboard Specific Styles (Modernized)
   ========================================================= */


body.dashboard-body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page) !important;
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
}

/* --- SIDEBAR (DESKTOP) --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.logo-icon {
    background-color: #fff;
    color: var(--color-brand);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-menu::-webkit-scrollbar { width: 0px; }

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px;
    margin-bottom: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item i {
    font-size: 20px;
}

.menu-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
}

.menu-item.active {
    background-color: var(--color-brand);
    color: #fff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-green { background-color: var(--color-success); }
.dot-yellow { background-color: var(--color-warning); }
.dot-red { background-color: var(--color-danger); }
.dot-blue { background-color: var(--color-brand); }
.dot-gray { background-color: var(--text-secondary); }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.btn-minimize {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    padding: 8px;
    transition: var(--transition);
}
.btn-minimize:hover { color: #fff; }

/* --- MAIN WRAPPER --- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition), width var(--transition);
}

/* --- COLLAPSED STATES --- */
.sidebar.collapsed {
    width: 80px;
}
.sidebar.collapsed .logo-container span,
.sidebar.collapsed .menu-title,
.sidebar.collapsed .menu-item-left span,
.sidebar.collapsed .accordion-header div span,
.sidebar.collapsed .btn-minimize span,
.sidebar.collapsed .accordion-content {
    display: none;
}
.sidebar.collapsed .menu-item-left i,
.sidebar.collapsed .btn-minimize i,
.sidebar.collapsed .accordion-header i {
    margin: 0 auto;
    font-size: 24px;
}
.sidebar.collapsed .btn-minimize i {
    transform: rotate(180deg);
}
.main-wrapper.expanded {
    margin-left: 80px;
    width: calc(100% - 80px);
}


/* --- TOPBAR (DESKTOP) --- */
.topbar {
    height: var(--header-height);
    background-color: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

/* --- TARJETAS DE LOTES (REPORTES) --- */
.lote-label {
    display: block;
    background-color: var(--bg-surface);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.lote-label:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.lote-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-brand);
}

/* --- TOAST NOTIFICATIONS --- */
.msg-toast {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    width: 400px;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.search-bar i {
    color: var(--text-secondary);
    font-size: 20px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.notification-btn:hover {
    background: var(--bg-surface-hover, rgba(0,0,0,0.04));
    color: var(--color-brand);
}

.notification-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-surface-hover, rgba(0,0,0,0.04));
}

.badge-counter {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--color-danger, #EF4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--bg-surface, #fff);
}

.user-profile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- DASHBOARD CONTENT --- */
.content {
    padding: 10px 40px 40px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

.date-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    border: 1px solid var(--border-default);
}

.date-picker i { color: var(--text-secondary); font-size: 18px; }

.dashboard-grid-modern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}





.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.text-red { color: var(--color-danger); }
.text-yellow { color: var(--color-warning); }
.text-blue { color: var(--color-brand); }

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: var(--color-success);
    font-weight: 600;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.icon-red { background-color: var(--bg-danger-subtle); color: var(--color-danger); }
.icon-yellow { background-color: var(--bg-warning-subtle); color: var(--color-warning); }
.icon-blue { background-color: var(--bg-brand-subtle); color: var(--color-brand); }

.card-link {
    margin-top: auto;
    padding-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-brand);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.card-link:hover { text-decoration: underline; }

/* Chart placeholder SVGs */
.chart-container {
    margin-top: 16px;
    width: 100%;
}

/* Task List */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-primary);
}

.task-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- MODALS --- */




.task-badge {
    background-color: var(--bg-danger-subtle);
    color: var(--color-danger);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.task-count {
    font-weight: 700;
    font-size: 13px;
}

/* Bottom Section */
.bottom-section {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.activity-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.activity-text h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-text p {
    font-size: 13px;
    color: var(--text-secondary);
}





/* FAB Chat */
.fab-chat {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background-color: var(--color-brand);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
}

.fab-chat:hover {
    transform: scale(1.05);
    background-color: var(--color-brand-hover);
}

/* --- MOBILE LAYOUT COMPONENTS --- */
.mobile-header, .mobile-nav, .mobile-sidebar {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid-modern { grid-template-columns: repeat(2, 1fr); }
    .search-bar { width: 300px; }
}

@media (max-width: 768px) {
    body.dashboard-body { flex-direction: column; overflow-x: hidden; }
    .sidebar { display: none; }
    
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        padding-bottom: 80px;
        overflow-x: hidden;
    }

    .topbar { display: none; }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 60px;
        padding: 0 16px;
        background-color: var(--bg-surface);
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        position: sticky;
        top: 0;
        z-index: 90;
    }

    .mobile-header .logo-container { color: var(--text-primary); font-size: 14px; }
    .mobile-header .menu-toggle { color: var(--text-primary); }
    .mobile-header .notification-btn { width: 36px; height: 36px; font-size: 20px; }
    .mobile-header .theme-toggle-btn { width: 36px; height: 36px; font-size: 18px; }

    /* Mobile Sidebar / Accordion Menu */
    .mobile-sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px - 70px);
        background-color: var(--bg-page);
        z-index: 95;
        transition: var(--transition);
        overflow-y: auto;
        padding: 16px;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-sidebar.active { left: 0; }

    .accordion-item {
        background: var(--bg-surface);
        border: 1px solid var(--border-default);
        border-radius: 12px;
        margin-bottom: 10px;
        overflow: hidden;
    }

    .accordion-header {
        padding: 14px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
        font-size: 13px;
        cursor: pointer;
    }

    .accordion-header i { transition: transform 0.3s; }
    
    .accordion-item.active .accordion-header {
        color: var(--color-brand);
        border-bottom: 1px solid var(--border-default);
    }
    .accordion-item.active .accordion-header i { transform: rotate(180deg); }
    
    .accordion-item.danger-border { border-color: var(--color-danger); }
    .accordion-item.danger-border .accordion-header { color: var(--color-danger); }

    .accordion-content {
        display: none;
        padding: 6px 0;
    }

    .accordion-item.active .accordion-content { display: block; }

    .accordion-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
    }

    .accordion-link i { font-size: 20px; }
    .acc-icon-green { color: var(--color-success); }
    .acc-icon-orange { color: var(--color-warning); }
    .acc-icon-blue { color: var(--color-brand); }
    .acc-icon-gray { color: var(--text-muted); }

    /* Dashboard Grid on Mobile */
    .content { padding: 10px; overflow-x: hidden; }
    #kanban-board { flex-direction: column; overflow-x: hidden; }
    .k-col { min-width: 100% !important; max-width: 100% !important; }
    .dashboard-grid-modern { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .bottom-section { flex-direction: column; align-items: flex-start; gap: 12px; }

    /* Search bar fix */
    .search-bar { width: 100% !important; max-width: 100%; }

    /* Cards and forms overflow fix */
    .card, .dash-card, .dash-card-modern { 
        max-width: 100% !important; 
        overflow-x: hidden;
        word-break: break-word;
    }
    .reception-container { 
        padding: 0 10px 80px 10px !important; 
        max-width: 100% !important;
    }
    .reception-container::before { display: none; }
    
    /* Form controls on mobile */
    .form-row { flex-direction: column; gap: 10px; }
    .form-row > div { min-width: 100% !important; }
    .acciones-grid, .acciones-grid-fixed { 
        flex-wrap: wrap !important; 
        gap: 8px !important;
    }
    .acciones-grid-fixed select {
        min-width: 100% !important;
        margin-left: 0 !important;
    }

    /* Stat cards on mobile */
    .stat-card { min-width: 100px; }
    .stat-card .num { font-size: 24px; }

    /* Lote labels on mobile */
    .lote-label { padding: 14px !important; }

    /* Tables on mobile */
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Tabs on mobile */
    .tabs { width: 100%; }
    .tab-btn { flex: 1; text-align: center; padding: 8px 10px; font-size: 12px; }

    /* Modals on mobile */
    .modal-overlay .card, .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 85vh !important;
        padding: 20px !important;
    }

    /* Kanban expand on mobile */
    .k-col.expanded .k-body {
        grid-template-columns: 1fr !important;
    }
    
    .fab-chat {
        bottom: 85px;
        right: 16px;
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
    }

    /* Mobile Bottom Nav */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: var(--bg-surface);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
        z-index: 100;
        justify-content: space-around;
        align-items: center;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
    }

    .nav-item i { font-size: 22px; }
    .nav-item.active { color: var(--color-brand); }

    /* Fix inline hardcoded widths */
    [style*="max-width: 1000px"] { max-width: 100% !important; }
    [style*="max-width: 650px"] { max-width: 100% !important; }
    .fechas-grid { grid-template-columns: 1fr !important; }

    /* Fix buttons wrapping */
    .btn-solid-dark, .btn-solid-blue, .btn-solid-gray {
        padding: 10px 14px !important;
        font-size: 13px !important;
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   KANBAN BOARD STYLES
   ========================================================================== */
#kanban-board {
    display: flex;
    gap: 15px;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 10px;
    flex: 1;
    width: 100%;
    min-height: calc(100vh - 200px);
}

.k-col {
    flex: 1;
    min-width: 240px;
    background: var(--bg-surface-hover);
    border-radius: 12px;
    border: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
}

.k-header {
    padding: 12px 15px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-surface);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.k-col.pend .k-header { border-top: 4px solid var(--color-danger); }
.k-col.diag .k-header { border-top: 4px solid var(--color-warning); }
.k-col.rep .k-header { border-top: 4px solid var(--color-info); }
.k-col.listo .k-header { border-top: 4px solid var(--color-success); }

.k-body {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticket {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 5px var(--shadow-card);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    font-size: 13px;
    color: var(--text-secondary);
}

.ticket:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--color-brand);
}

.tkt-id {
    font-weight: 700;
    color: var(--color-brand);
    font-size: 14px;
}

.tkt-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 5px;
}

.ticket p {
    margin: 3px 0;
}

.badge-counter {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--bg-page);
}

/* ==========================================================================
   KANBAN EXPAND STYLES
   ========================================================================== */
.k-col.expanded {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 100% !important;
}

#kanban-board.has-expanded .k-col:not(.expanded) {
    display: none !important;
}

.k-col.expanded .k-body {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 15px !important;
    align-content: start !important;
    width: 100% !important;
}

.k-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.k-header:hover {
    background: var(--bg-surface-hover);
}

.urgente {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.tabs {
    display: flex;
    gap: 10px;
    background: var(--bg-surface-hover);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--color-brand);
    color: white;
}

.tab-btn.inactive {
    background: transparent;
    color: var(--text-secondary);
}

.tab-btn.inactive:hover {
    background: rgba(255,255,255,0.1);
}


/* ==========================================================================
   Logo oficial en sidebar y header (v1.5.3)
   ========================================================================== */
.sidebar-logo {
    height: 30px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: filter 0.2s ease, max-width 0.2s ease;
}

[data-theme="light"] .sidebar-logo {
    filter: none;
}

.sidebar.collapsed .sidebar-logo {
    max-width: 42px;
}

.dot-orange { background-color: #F97316; }

/* ==========================================================================
   PANEL DE NOTIFICACIONES IN-APP (PetuNotif v1.0)
   ========================================================================== */

/* Overlay oscuro */
.pn-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 9998;
    transition: background 0.25s ease;
}
.pn-overlay.pn-overlay-active {
    display: block;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
}

/* Panel lateral */
#petulap-notif-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-default);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}
#petulap-notif-panel.pn-open { right: 0; }

/* Header del panel */
.pn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-surface);
    flex-shrink: 0;
}
.pn-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.pn-header-left i { font-size: 1.3rem; color: var(--color-brand); }
.pn-header-right { display: flex; align-items: center; gap: 8px; }

.pn-mark-all-btn {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-default);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    min-height: 32px;
}
.pn-mark-all-btn:hover { background: var(--bg-brand-subtle); color: var(--color-brand); border-color: var(--color-brand); }

.pn-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.pn-close-btn:hover { background: var(--bg-danger-subtle); color: var(--color-danger); }

/* Cuerpo scrollable */
.pn-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.pn-body::-webkit-scrollbar { width: 4px; }
.pn-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Estado vacío */
.pn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}
.pn-empty i { font-size: 2.5rem; color: var(--color-success); }
.pn-empty p { font-size: 0.9rem; font-weight: 500; }

.pn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* Categorías */
.pn-category { margin-bottom: 4px; }

.pn-cat-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 6px 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}
.pn-cat-count {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
}

.pn-cat-critical .pn-cat-title { color: var(--text-danger); }
.pn-cat-critical .pn-cat-count { background: var(--bg-danger-subtle); color: var(--text-danger); }

.pn-cat-warning .pn-cat-title { color: var(--text-warning); }
.pn-cat-warning .pn-cat-count { background: var(--bg-warning-subtle); color: var(--text-warning); }

.pn-cat-success .pn-cat-title { color: var(--text-success); }
.pn-cat-success .pn-cat-count { background: var(--bg-success-subtle); color: var(--text-success); }

.pn-cat-info .pn-cat-title { color: var(--text-info); }
.pn-cat-info .pn-cat-count { background: var(--bg-info-subtle); color: var(--text-info); }

/* Ítem de notificación — mínimo 52px de alto para touch */
.pn-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    min-height: 52px;
    cursor: pointer;
    transition: background 0.12s ease;
    border-left: 3px solid transparent;
}
.pn-item:hover { background: var(--bg-surface-hover); }
.pn-item:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: -2px;
    background: var(--bg-brand-subtle);
}
.pn-item-read { opacity: 0.55; }

/* Categoría crítica resalta borde izquierdo */
.pn-cat-critical .pn-item:not(.pn-item-read) { border-left-color: var(--color-danger); background: rgba(244, 63, 94, 0.03); }
.pn-cat-warning .pn-item:not(.pn-item-read) { border-left-color: var(--color-warning); background: rgba(245, 158, 11, 0.03); }
.pn-cat-success .pn-item:not(.pn-item-read) { border-left-color: var(--color-success); }

/* Punto indicador de no-leído */
.pn-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    margin-top: 5px;
    transition: background 0.2s;
}
.pn-dot-unread { background: var(--color-brand); }
.pn-cat-critical .pn-dot-unread { background: var(--color-danger); }
.pn-cat-warning .pn-dot-unread { background: var(--color-warning); }
.pn-cat-success .pn-dot-unread { background: var(--color-success); }

/* Contenido del ítem */
.pn-item-content { flex: 1; min-width: 0; }
.pn-item-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.pn-item-msg {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}
.pn-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Accesibilidad — focus-visible global */
button:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

/* Mejora contraste .text-muted en modo claro (WCAG 2.1 AA) */
@media (prefers-color-scheme: light) {
    .pn-item-time { color: #64748B; } /* ratio 4.6:1 sobre blanco */
}

/* Responsive — panel a pantalla completa en mobile */
@media (max-width: 768px) {
    #petulap-notif-panel {
        width: 100%;
        right: -100%;
        border-left: none;
        border-top: 1px solid var(--border-default);
        border-radius: 20px 20px 0 0;
        height: 90vh;
        top: auto;
        bottom: -90vh;
        right: 0;
        transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    #petulap-notif-panel.pn-open { bottom: 0; right: 0; }
    .pn-item { min-height: 56px; padding: 14px 16px; }
}

