/* 頁首通知鈴鐺（由 htfl_header_notifications.html partial 載入） */
.htfl-notifications-wrapper {
    position: relative;
}
.htfl-notifications-wrapper.is-reserved {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    vertical-align: middle;
}
.htfl-notifications-wrapper.is-reserved:not(.is-visible) .htfl-notifications-btn {
    visibility: hidden;
    pointer-events: none;
}
.htfl-notifications-wrapper.is-reserved.is-visible.is-pending .htfl-notifications-btn {
    opacity: 0.55;
}
.htfl-notifications-wrapper[hidden] {
    display: none !important;
}
.htfl-notifications-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transition: all 0.25s;
    cursor: pointer;
}
.htfl-notifications-btn:hover,
.htfl-notifications-btn.active {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.55);
}
.htfl-notifications-icon {
    display: block;
    font-size: 18px;
    line-height: 1;
}
.htfl-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.htfl-notifications-badge[hidden] {
    display: none !important;
}
.htfl-notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: min(420px, calc(100vw - 24px));
    z-index: 1001;
    display: none;
    overflow: hidden;
}
.htfl-notifications-dropdown.show {
    display: block;
}
.htfl-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
}
.htfl-notifications-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}
.htfl-notifications-dismiss-all {
    border: 0;
    background: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.htfl-notifications-dismiss-all:hover:not(:disabled) {
    background: #eff6ff;
}
.htfl-notifications-dismiss-all.is-confirm {
    color: #b45309;
    background: #fffbeb;
}
.htfl-notifications-dismiss-all:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.htfl-notifications-feedback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #ecfdf5;
    border-bottom: 1px solid #bbf7d0;
    font-size: 12px;
    color: #166534;
}
.htfl-notifications-feedback[hidden] {
    display: none !important;
}
.htfl-notifications-feedback.is-error {
    background: #fef2f2;
    border-bottom-color: #fecaca;
    color: #b91c1c;
}
.htfl-notifications-feedback-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
}
.htfl-notifications-feedback-undo {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}
.htfl-notifications-feedback-undo:hover {
    background: rgba(37, 99, 235, 0.08);
}
.htfl-notifications-list {
    max-height: min(360px, 50vh);
    overflow-y: auto;
}
.htfl-notifications-section-head,
.htfl-notifications-history-head {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #f0f0f0;
}
.htfl-notifications-section-count {
    font-weight: 600;
    color: #94a3b8;
}
.htfl-notifications-history-head {
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
}
.htfl-notifications-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0f0f0;
}
.htfl-notifications-item:last-child {
    border-bottom: none;
}
.htfl-notifications-item-link {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #2d2f36;
    transition: background 0.2s;
}
.htfl-notifications-item-link:hover {
    background: #f8fafc;
}
.htfl-notifications-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.45;
    margin-bottom: 2px;
    word-break: break-word;
}
.htfl-notifications-status-pill {
    display: inline-block;
    vertical-align: baseline;
    margin: 0 1px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.htfl-notifications-status-pill.is-pending {
    background: #fef3c7;
    color: #b45309;
}
.htfl-notifications-status-pill.is-approved {
    background: #dcfce7;
    color: #15803d;
}
.htfl-notifications-status-pill.is-declined {
    background: #fee2e2;
    color: #b91c1c;
}
.htfl-notifications-item-message {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
}
.htfl-notifications-item-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}
.htfl-notifications-item-dismiss {
    flex: 0 0 auto;
    align-self: center;
    margin-right: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    padding: 6px 8px;
    min-width: 36px;
    text-align: center;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.htfl-notifications-item-dismiss:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}
.htfl-notifications-item-dismiss:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.htfl-notifications-empty,
.htfl-notifications-status {
    padding: 16px 12px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}
.htfl-notifications-item.is-read .htfl-notifications-item-link {
    opacity: 0.88;
}
.htfl-notifications-item-read-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

@media (max-width: 768px) {
    /* 手機定位由 htfl-mobile.css 統一（相對 .header-actions 右貼齊） */
    .htfl-notifications-item-dismiss {
        font-size: 10px;
        padding: 4px 6px;
    }
}
