/* ---------- Price Alerts: bell ---------- */
.alert-bell-mount {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
}

.alert-bell {
    position: relative;
}

.alert-bell__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    flex: 0 0 auto;
    transition: border-color 0.12s ease, color 0.12s ease;
}

.alert-bell__btn:hover,
.alert-bell.is-open .alert-bell__btn {
    border-color: var(--brand);
    color: var(--brand);
}

.alert-bell__btn svg {
    width: 19px;
    height: 19px;
    display: block;
}

.alert-bell__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-sizing: border-box;
}

.alert-bell__badge.is-triggered {
    background: var(--ask);
}

/* ---------- Price Alerts: panel ---------- */
.alert-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
    z-index: 60;
    overflow: hidden;
}

.alert-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
}

.alert-panel__head a {
    font-size: 12px;
    font-weight: 600;
    color: var(--link);
    text-decoration: none;
}

.alert-panel__body {
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
}

.alert-panel__empty {
    padding: 22px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
}

.alert-item + .alert-item {
    border-top: 1px solid var(--border);
}

.alert-item.is-triggered {
    background: rgba(240, 185, 11, 0.08);
}

.alert-item__main {
    flex: 1;
    min-width: 0;
}

.alert-item__sym {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.alert-item__cond {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.alert-item__cond b {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.alert-item__actions {
    display: flex;
    gap: 4px;
}

.alert-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
}

.alert-icon-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.alert-icon-btn svg {
    width: 14px;
    height: 14px;
}

.alert-status {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alert-status.active {
    color: var(--bid);
    background: rgba(14, 203, 129, 0.12);
}

.alert-status.triggered {
    color: #b98900;
    background: rgba(240, 185, 11, 0.16);
}

.alert-status.paused {
    color: var(--text-muted);
    background: var(--bg-soft);
}

/* ---------- Price Alerts: add form ---------- */
.alert-panel__form {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.alert-form-row {
    display: flex;
    gap: 8px;
}

.alert-form-row + .alert-form-row {
    margin-top: 8px;
}

.alert-dir {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
}

.alert-dir button {
    padding: 0 12px;
    height: 36px;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.alert-dir button.is-active[data-dir="above"] {
    background: rgba(14, 203, 129, 0.14);
    color: var(--bid);
}

.alert-dir button.is-active[data-dir="below"] {
    background: rgba(246, 70, 93, 0.14);
    color: var(--ask);
}

.alert-input {
    flex: 1;
    height: 36px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.alert-input:focus {
    outline: none;
    border-color: var(--brand);
}

.alert-add-btn {
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: var(--brand);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.alert-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alert-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.alert-notify-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.alert-link-btn {
    border: none;
    background: none;
    color: var(--link);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

/* ---------- Toasts ---------- */
.alert-toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}

.alert-toast {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: 10px;
    background: var(--bg);
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.22);
    animation: alert-toast-in 0.18s ease;
}

.alert-toast.up {
    border-left-color: var(--bid);
}

.alert-toast.down {
    border-left-color: var(--ask);
}

.alert-toast__icon {
    font-size: 18px;
    line-height: 1.2;
}

.alert-toast.up .alert-toast__icon {
    color: var(--bid);
}

.alert-toast.down .alert-toast__icon {
    color: var(--ask);
}

.alert-toast__body {
    min-width: 0;
}

.alert-toast__title {
    font-size: 13px;
    font-weight: 700;
}

.alert-toast__text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

@keyframes alert-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Alerts page ---------- */
.alert-form-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 18px;
}

.alert-form-card__grid {
    display: grid;
    grid-template-columns: 260px 160px 1fr auto;
    gap: 12px;
    align-items: end;
}

.alert-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.alert-field > span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.alert-field .alert-input {
    flex: none;
    height: 40px;
}

.alert-field .sym-picker__toggle {
    height: 40px;
}

.alert-dir--lg button {
    height: 40px;
}

.alert-form-card .alert-add-btn {
    height: 40px;
    padding: 0 22px;
}

.alert-form-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.alert-table .col-actions {
    text-align: right;
    white-space: nowrap;
}

.alert-note {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.alert-distance.up {
    color: var(--bid);
}

.alert-distance.down {
    color: var(--ask);
}

.alert-perm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.alert-perm__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
}

.alert-perm__dot.granted {
    background: var(--bid);
}

.alert-perm__dot.denied {
    background: var(--ask);
}

@media (max-width: 860px) {
    .alert-form-card__grid {
        grid-template-columns: 1fr;
    }

    .alert-panel {
        position: fixed;
        top: 64px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}
