/* Campana global de notificaciones — siempre visible arriba a la derecha */
.sw-notif-bell-wrap {
    position: fixed;
    top: 12px;
    right: 16px;
    display: inline-block;
    margin-right: 0;
    z-index: 10050;
}

.sw-notif-bell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    position: relative;
    width: 44px;
    height: 44px;
}

.sw-notif-bell-btn:hover {
    opacity: 0.75;
}

.sw-notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    display: none;
}

.sw-notif-badge.visible {
    display: inline-block;
}

.sw-notif-dropdown {
    display: none;
    position: fixed;
    right: 16px;
    top: 62px;
    width: 340px;
    max-height: min(420px, calc(100vh - 80px));
    overflow: hidden;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 10049;
    text-align: left;
}

.sw-notif-dropdown.open {
    display: block;
}

.sw-notif-dropdown-header {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    background: #f8f8f8;
}

.sw-notif-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.sw-notif-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.sw-notif-tab:hover {
    background: #f0f4ff;
    color: #333;
}

.sw-notif-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #fff;
}

.sw-notif-tab-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #374151;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.sw-notif-tab.active .sw-notif-tab-count {
    background: #dbeafe;
    color: #1e40af;
}

.sw-notif-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(280px, calc(100vh - 180px));
    overflow-y: auto;
}

.sw-notif-dropdown-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.sw-notif-dropdown-item:hover {
    background: #f5f8ff;
}

.sw-notif-dropdown-item.unread {
    background: #eef4ff;
}

.sw-notif-dropdown-item strong {
    display: block;
    margin-bottom: 4px;
}

.sw-notif-dropdown-item p {
    margin: 0 0 4px;
    font-size: 13px;
    color: #444;
}

.sw-notif-dropdown-item small {
    color: #888;
    font-size: 12px;
}

.sw-notif-dropdown-footer {
    padding: 8px 14px;
    border-top: 1px solid #eee;
    text-align: center;
    background: #fafafa;
}

.sw-notif-dropdown-footer a {
    font-size: 13px;
}

.sw-notif-empty-msg {
    padding: 20px 14px;
    color: #666;
    text-align: center;
}

.sw-notif-type {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    background: #e0e0e0;
    color: #333;
}

.sw-notif-type-solicitud { background: #dbeafe; color: #1e40af; }
.sw-notif-type-warning   { background: #fef3c7; color: #92400e; }
.sw-notif-type-error     { background: #fee2e2; color: #991b1b; }
.sw-notif-type-aprobacion { background: #d1fae5; color: #065f46; }
.sw-notif-type-conduce    { background: #fef3c7; color: #92400e; }
.sw-notif-type-info      { background: #e0e7ff; color: #3730a3; }

/* Inbox */
.sw-notif-inbox-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.sw-notif-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sw-notif-filters label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 4px;
}

.sw-notif-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.sw-notif-btn:hover {
    background: #f0f0f0;
}

.sw-notif-inbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sw-notif-inbox-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
}

.sw-notif-inbox-item.sw-notif-unread {
    border-left: 4px solid #2563eb;
    background: #f8fbff;
}

.sw-notif-inbox-main p {
    margin: 6px 0;
    color: #444;
}

.sw-notif-inbox-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.sw-notif-pagination {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.sw-notif-empty {
    color: #666;
    padding: 24px;
    text-align: center;
}

/* Toast visual — apilado bajo la campana fija */
.sw-notif-toast-stack {
    position: fixed;
    top: 62px;
    right: 16px;
    z-index: 10048;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(340px, calc(100vw - 32px));
    pointer-events: none;
}

.sw-notif-toast {
    position: relative;
    top: auto;
    right: auto;
    z-index: 1;
    max-width: 340px;
    width: 100%;
    background: #fff3cd;
    border: 1px solid #ffecb5;
    border-left: 4px solid #f39c12;
    border-radius: 6px;
    padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    animation: swNotifSlideIn 0.3s ease-out;
    pointer-events: auto;
}

/* Cuando el dropdown está abierto, los toasts bajan para no taparlo */
body.sw-notif-dropdown-open .sw-notif-toast-stack {
    top: calc(62px + min(420px, calc(100vh - 80px)) + 12px);
}

.sw-notif-toast p {
    margin: 6px 0 4px;
    font-size: 13px;
    color: #333;
}

.sw-notif-toast small {
    color: #666;
    font-size: 12px;
}

.sw-notif-toast-hide {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes swNotifSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
