/* ============================================================================
   <kavo-notification-bell> — design system unificado (Home + Dealer panel)
   ============================================================================
   Isolado via seletor de ancestral kavo-notification-bell. Compativel com
   qualquer layout que adote o Web Component. Mantem tokens proximos ao
   kavo-design-system.css (primario #0F766E, superficie #f8fafc).
   ============================================================================ */

kavo-notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
}

/* ── Button ───────────────────────────────────────────────────────── */
kavo-notification-bell .kavo-notif__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
kavo-notification-bell .kavo-notif__btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}
kavo-notification-bell .kavo-notif__btn:focus-visible {
    outline: 2px solid #0F766E;
    outline-offset: 2px;
}
kavo-notification-bell .kavo-notif__btn-icon {
    width: 18px;
    height: 18px;
}

kavo-notification-bell .kavo-notif__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #F97316;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
kavo-notification-bell .kavo-notif__badge[hidden] {
    display: none !important;
}

/* ── Dropdown panel ───────────────────────────────────────────────── */
kavo-notification-bell .kavo-notif__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: top right;
    animation: kavoNotifPanelIn 160ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
kavo-notification-bell .kavo-notif__panel[hidden] {
    display: none !important;
}

@keyframes kavoNotifPanelIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

kavo-notification-bell .kavo-notif__panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}
kavo-notification-bell .kavo-notif__panel-header strong {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}
kavo-notification-bell .kavo-notif__panel-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    background: #0F766E;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
}
kavo-notification-bell .kavo-notif__panel-count[hidden] {
    display: none !important;
}

/* ── List ─────────────────────────────────────────────────────────── */
kavo-notification-bell .kavo-notif__list {
    overflow-y: auto;
    max-height: 360px;
    padding: 4px 0;
    scrollbar-width: thin;
}
kavo-notification-bell .kavo-notif__list::-webkit-scrollbar {
    width: 6px;
}
kavo-notification-bell .kavo-notif__list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

kavo-notification-bell .kavo-notif__empty {
    padding: 28px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}
kavo-notification-bell .kavo-notif__empty--error {
    color: #b91c1c;
}

/* ── Item ─────────────────────────────────────────────────────────── */
kavo-notification-bell .kavo-notif__item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    gap: 0;
    padding: 0 12px 0 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    transition: background 0.15s;
}
kavo-notification-bell .kavo-notif__item:last-child {
    border-bottom: none;
}
kavo-notification-bell .kavo-notif__item:hover {
    background: #f8fafc;
}
kavo-notification-bell .kavo-notif__item--clickable {
    cursor: pointer;
}

kavo-notification-bell .kavo-notif__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
}
kavo-notification-bell .kavo-notif__item--critical::before { background: #dc2626; }
kavo-notification-bell .kavo-notif__item--high::before     { background: #f97316; }
kavo-notification-bell .kavo-notif__item--medium::before   { background: #0F766E; }
kavo-notification-bell .kavo-notif__item--low::before      { background: #cbd5e1; }

kavo-notification-bell .kavo-notif__item-main {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 8px 12px 0;
    background: none;
    border: none;
    text-align: left;
    cursor: inherit;
    color: inherit;
    font: inherit;
    width: 100%;
}
kavo-notification-bell .kavo-notif__item-main:focus-visible {
    outline: 2px solid #0F766E;
    outline-offset: -2px;
    border-radius: 6px;
}

kavo-notification-bell .kavo-notif__item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #0f172a;
    flex-shrink: 0;
}
kavo-notification-bell .kavo-notif__item--critical .kavo-notif__item-icon { background: #fee2e2; color: #991b1b; }
kavo-notification-bell .kavo-notif__item--high .kavo-notif__item-icon     { background: #ffedd5; color: #9a3412; }
kavo-notification-bell .kavo-notif__item--medium .kavo-notif__item-icon   { background: #ccfbf1; color: #0F766E; }
kavo-notification-bell .kavo-notif__item-icon svg {
    width: 18px;
    height: 18px;
}

kavo-notification-bell .kavo-notif__item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
kavo-notification-bell .kavo-notif__item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    word-break: break-word;
}
kavo-notification-bell .kavo-notif__item-message {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.45;
    word-break: break-word;
}
kavo-notification-bell .kavo-notif__item-time {
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

kavo-notification-bell .kavo-notif__item-dismiss {
    align-self: flex-start;
    margin-top: 12px;
    margin-right: -4px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
kavo-notification-bell .kavo-notif__item-dismiss:hover {
    background: #fef2f2;
    color: #dc2626;
}
kavo-notification-bell .kavo-notif__item-dismiss:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 1px;
}

/* ── Footer ───────────────────────────────────────────────────────── */
kavo-notification-bell .kavo-notif__panel-footer {
    border-top: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: center;
    background: #fafbfc;
}
kavo-notification-bell .kavo-notif__panel-footer button {
    background: none;
    border: none;
    color: #0F766E;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
kavo-notification-bell .kavo-notif__panel-footer button:hover {
    background: #ecfdf5;
}

/* ── Skeleton ─────────────────────────────────────────────────────── */
kavo-notification-bell .kavo-notif__skeleton {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 36px 16px;
}
kavo-notification-bell .kavo-notif__skeleton-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    animation: kavoNotifPulse 900ms ease-in-out infinite;
}
kavo-notification-bell .kavo-notif__skeleton-dot:nth-child(2) { animation-delay: 150ms; }
kavo-notification-bell .kavo-notif__skeleton-dot:nth-child(3) { animation-delay: 300ms; }

@keyframes kavoNotifPulse {
    0%, 100% { opacity: 0.35; transform: scale(0.9); }
    50%      { opacity: 1;    transform: scale(1.15); }
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    kavo-notification-bell .kavo-notif__panel {
        position: fixed;
        top: 72px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(92vw, 360px);
        max-height: calc(100vh - 120px);
    }
    kavo-notification-bell .kavo-notif__list {
        max-height: calc(100vh - 220px);
    }
}
