﻿:root {
    --ni-primary: #17b890;
    --ni-primary-dark: #109c79;
    --ni-primary-soft: #e8f8f3;
    --ni-bg: #ffffff;
    --ni-bg-soft: #f8fbfa;
    --ni-bg-muted: #f3f7f6;
    --ni-border: #dfeae7;
    --ni-border-strong: #cfe1dc;
    --ni-text: #1f2937;
    --ni-text-soft: #6b7280;
    --ni-text-muted: #8a9a96;
    --ni-danger: #ef4444;
    --ni-warning: #f59e0b;
    --ni-info: #38bdf8;
    --ni-shadow-sm: 0 6px 14px rgba(16, 24, 40, 0.06);
    --ni-shadow-md: 0 10px 24px rgba(16, 24, 40, 0.08);
    --ni-shadow-lg: 0 18px 42px rgba(16, 24, 40, 0.12);
    --ni-radius-sm: 10px;
    --ni-radius-md: 14px;
    --ni-radius-lg: 18px;
}

@keyframes toastIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(10px);
        opacity: 0;
    }
}

@keyframes niSearchDrop {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Toast Host ===== */
.toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

/* ===== Floating Button ===== */
.ni-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ni-primary), var(--ni-primary-dark));
    border: none;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(23, 184, 144, 0.28), 0 8px 18px rgba(16, 24, 40, 0.14);
    z-index: 99998;
    display: grid;
    place-items: center;
    color: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

    .ni-fab:hover {
        transform: translateY(-1px);
        filter: brightness(1.02);
    }

    .ni-fab:active {
        transform: translateY(0);
    }

.ni-badge {
    position: absolute;
    right: -2px;
    top: -2px;
    background: var(--ni-danger);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    box-shadow: var(--ni-shadow-md);
    display: none;
    border: 2px solid #fff;
}

/* ===== Panel ===== */
.ni-panel {
    position: fixed;
    right: 16px;
    bottom: 86px;
    width: 410px;
    height: 540px;
    background: var(--ni-bg);
    border-radius: var(--ni-radius-lg);
    overflow: hidden;
    box-shadow: var(--ni-shadow-lg);
    border: 1px solid var(--ni-border);
    z-index: 99998;
    display: none;
    font-family: system-ui, -apple-system, Segoe UI, Roboto;
}

    .ni-panel.open {
        display: block;
    }

.ni-head {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--ni-bg-soft);
    border-bottom: 1px solid var(--ni-border);
    gap: 8px;
}

.ni-title {
    font-weight: 800;
    font-size: 16px;
    color: #16423a;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

    .ni-title::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: var(--ni-primary);
        box-shadow: 0 0 0 4px rgba(23, 184, 144, 0.12);
    }

/* ===== Header Controls ===== */
.ni-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid var(--ni-border);
    background: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #4b5563;
    box-shadow: 0 1px 1px rgba(16,24,40,.03);
    transition: all .18s ease;
}

    .ni-btn:hover {
        background: var(--ni-bg-soft);
        border-color: var(--ni-border-strong);
        color: #1f2937;
    }

    .ni-btn:active {
        transform: scale(.98);
    }

/* ===== Date Bar ===== */
.ni-datebar {
    padding: 10px 12px;
    background: var(--ni-bg-soft);
    border-bottom: 1px solid var(--ni-border);
}

.ni-datebar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ni-date-label {
    font-size: 12px;
    font-weight: 700;
    color: #37534c;
    white-space: nowrap;
}

.ni-date-input {
    flex: 1;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--ni-border);
    background: #fff;
    padding: 0 12px;
    font-size: 13px;
    color: var(--ni-text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

    .ni-date-input:hover {
        border-color: var(--ni-border-strong);
    }

    .ni-date-input:focus {
        border-color: #7dd3c0;
        box-shadow: 0 0 0 3px rgba(23, 184, 144, 0.14);
        background: #fff;
    }

/* ===== Search Popup ===== */
.ni-search-pop {
    display: none;
    padding: 10px 12px;
    background: #f6fbf9;
    border-bottom: 1px solid var(--ni-border);
    animation: niSearchDrop .18s ease;
}

    .ni-search-pop.open {
        display: block;
    }

.ni-search-pop-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ni-search-input {
    flex: 1;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--ni-border);
    background: #fff;
    padding: 0 12px;
    font-size: 13px;
    color: var(--ni-text);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

    .ni-search-input::placeholder {
        color: var(--ni-text-muted);
    }

    .ni-search-input:hover {
        border-color: var(--ni-border-strong);
    }

    .ni-search-input:focus {
        border-color: #7dd3c0;
        box-shadow: 0 0 0 3px rgba(23, 184, 144, 0.14);
        background: #fff;
    }

.ni-search-clear {
    width: 40px;
    height: 40px;
    border: 1px solid var(--ni-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    color: #555;
    transition: all .2s ease;
}

    .ni-search-clear:hover {
        background: var(--ni-bg-soft);
        border-color: var(--ni-border-strong);
    }

/* ===== Switch ===== */
.ni-switch-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 4px;
}

.ni-switch-label {
    font-size: 12px;
    font-weight: 700;
    color: #4b5563;
    white-space: nowrap;
}

.ni-switch {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-block;
}

    .ni-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.ni-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #d7e3df;
    border-radius: 999px;
    transition: all .25s ease;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

    .ni-slider::before {
        content: "";
        position: absolute;
        width: 20px;
        height: 20px;
        left: 3px;
        top: 3px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0,0,0,.16);
        transition: all .25s ease;
    }

.ni-switch input:checked + .ni-slider {
    background: linear-gradient(135deg, var(--ni-primary), var(--ni-primary-dark));
}

    .ni-switch input:checked + .ni-slider::before {
        transform: translateX(20px);
    }

.ni-switch input:focus + .ni-slider {
    box-shadow: 0 0 0 3px rgba(23, 184, 144, .16);
}

/* ===== Body ===== */
.ni-body {
    height: calc(100% - 56px);
    display: flex;
    flex-direction: column;
}

.ni-list {
    overflow: auto;
    padding: 12px;
    flex: 1;
    background: linear-gradient(180deg, #fcfefd 0%, #f8fbfa 100%);
}

/* ===== Inbox Item ===== */
.ni-item {
    background: #fff;
    border: 1px solid var(--ni-border);
    border-left: 4px solid var(--ni-primary);
    border-radius: 16px;
    padding: 12px 13px;
    margin-bottom: 12px;
    box-shadow: var(--ni-shadow-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

    .ni-item:hover {
        transform: translateY(-1px);
        box-shadow: var(--ni-shadow-md);
        border-color: var(--ni-border-strong);
    }

.ni-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.ni-item-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.25;
    color: #1b3b35;
}

.ni-item-time {
    font-size: 12px;
    color: var(--ni-text-soft);
    white-space: nowrap;
    font-weight: 600;
}

.ni-item-msg {
    margin-top: 8px;
    font-size: 13.5px;
    color: #374151;
    white-space: pre-line;
    line-height: 1.45;
}

.ni-pill {
    margin-top: 10px;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #dceee8;
    background: #f4fbf8;
    color: #58726c;
    letter-spacing: .1px;
}

.ni-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--ni-text-soft);
    font-size: 13px;
}

/* ===== Scrollbar ===== */
.ni-list::-webkit-scrollbar {
    width: 10px;
}

.ni-list::-webkit-scrollbar-track {
    background: transparent;
}

.ni-list::-webkit-scrollbar-thumb {
    background: #d5e4df;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

    .ni-list::-webkit-scrollbar-thumb:hover {
        background: #bfd5ce;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .ni-panel {
        right: 10px;
        bottom: 78px;
        width: calc(100vw - 20px);
        max-width: 410px;
        height: 72vh;
    }

    .toast-host {
        right: 10px;
        max-width: calc(100vw - 20px);
    }

    .ni-title {
        font-size: 15px;
    }
}

.ni-toast {
    position: relative;
    background: #fff;
    border: 1px solid var(--ni-border);
    border-left: 4px solid var(--ni-primary);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: var(--ni-shadow-md);
    animation: toastIn .18s ease-out;
    font-family: system-ui, -apple-system, Segoe UI, Roboto;
}

.ni-toast-success {
    border-left-color: var(--ni-primary);
}

.ni-toast-warning {
    border-left-color: var(--ni-warning);
}

.ni-toast-error {
    border-left-color: var(--ni-danger);
}

.ni-toast-info {
    border-left-color: var(--ni-info);
}

.ni-toast-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ni-primary-dark);
    background: var(--ni-primary-soft);
    border: 1px solid #d7efe7;
    border-radius: 999px;
    padding: 3px 8px;
    margin-bottom: 6px;
}

.ni-toast-title {
    font-size: 15px;
    font-weight: 800;
    color: #1b3b35;
    line-height: 1.25;
}

.ni-toast-msg {
    margin-top: 6px;
    font-size: 13.5px;
    color: #374151;
    white-space: pre-line;
    line-height: 1.4;
}

.ni-toast-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    opacity: .75;
}

    .ni-toast-close:hover {
        opacity: 1;
    }

.ni-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.ni-fab svg {
    width: 22px;
    height: 22px;
}

.ni-toast-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
}

.ni-toast-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}