/* ============================================================
   Travayoo - Header Actions
   Account menu = preserved legacy styling
   Notification menu = compact 2-column layout + Super Admin reorder
   ============================================================ */

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action-menu {
    position: relative;
}

/* ------------------------------------------------------------
   Header buttons
   ------------------------------------------------------------ */

.header-icon-button,
.account-trigger {
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    cursor: pointer;
}

.header-icon-button {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-icon-button:hover,
.header-icon-button[aria-expanded="true"] {
    background: #f4f7fb;
    border-color: #dce5f0;
    color: var(--primary, var(--trv-primary, #1d4ed8));
}

.header-total-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--menu-icon, #f59e0b);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .12);
}

/* ------------------------------------------------------------
   Account trigger
   ------------------------------------------------------------ */

.account-trigger {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 5px;
    border-radius: 10px;
    text-align: left;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
    background: #f4f7fb;
    border-color: #dce5f0;
}

.account-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        var(--primary, var(--trv-primary, #1d4ed8)),
        var(--secondary, #0f766e)
    );
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
}

.account-trigger-text {
    min-width: 0;
    max-width: 190px;
    display: flex;
    flex-direction: column;
}

.account-trigger-text strong,
.account-trigger-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-trigger-text strong {
    color: #172033;
    font-size: 13px;
    line-height: 1.25;
}

.account-trigger-text small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    text-align: end;
}

.account-chevron {
    color: #94a3b8;
    font-size: 10px;
    transition: transform .16s ease;
}

.account-trigger[aria-expanded="true"] .account-chevron {
    transform: rotate(180deg);
}

/* ------------------------------------------------------------
   Shared dropdown
   ------------------------------------------------------------ */

.header-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 310px;
    border: 1px solid #dde5ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
    overflow: hidden;
    z-index: 1900;
}

.header-dropdown[hidden] {
    display: none !important;
}

.header-dropdown-title {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f5;
    color: #172033;
    font-size: 14px;
    font-weight: 800;
}

/* ------------------------------------------------------------
   Notification dropdown
   ------------------------------------------------------------ */

.notification-dropdown {
    width: min(600px, calc(100vw - 24px));
}

.header-dropdown-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.header-dropdown-head > div:first-child {
    min-width: 0;
}

.header-dropdown-head strong {
    display: block;
    margin: 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.header-dropdown-head small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.25;
}

.notification-head {
    min-height: 56px;
}

.notification-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.notification-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 9px;
    background: #eff6ff;
    color: var(--primary, var(--trv-primary, #1d4ed8));
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.notification-manage-button,
.notification-manager-back,
.notification-save-button {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.notification-manage-button {
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

.notification-manage-button:hover {
    background: #e8eef6;
    color: var(--primary, var(--trv-primary, #1d4ed8));
}

/* 2-column compact notification grid */
.notification-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 366px;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8fafc;
}

.notification-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 62px;
    padding: 9px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease,
        transform .16s ease;
}

.notification-item:hover {
    border-color: #cbd5e1;
    background: #fff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .07);
    transform: translateY(-1px);
}

.notification-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 15px;
}

.notification-danger .notification-icon,
.notification-sort-icon.notification-danger {
    background: #fef2f2;
    color: #dc2626;
}

.notification-warning .notification-icon,
.notification-sort-icon.notification-warning {
    background: #fff7ed;
    color: #d97706;
}

.notification-primary .notification-icon,
.notification-sort-icon.notification-primary {
    background: #eff6ff;
    color: #2563eb;
}

.notification-success .notification-icon,
.notification-sort-icon.notification-success {
    background: #ecfdf5;
    color: #059669;
}

.notification-copy {
    min-width: 0;
    display: block;
}

.notification-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #172033;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* Explicitly hide legacy second-line description if old markup remains */
.notification-copy small {
    display: none !important;
}

.notification-count {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.notification-footer {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border-top: 1px solid #eef2f7;
    background: #fff;
    color: var(--primary, var(--trv-primary, #1d4ed8));
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.notification-footer:hover {
    background: #f8fafc;
}

.notification-empty {
    min-height: 140px;
    padding: 30px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #64748b;
    text-align: center;
}

.notification-empty i {
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: 23px;
}

.notification-empty strong {
    color: #0f172a;
    font-size: 13px;
}

.notification-empty span {
    color: #64748b;
    font-size: 10px;
}

/* ------------------------------------------------------------
   Notification reorder manager
   ------------------------------------------------------------ */

.notification-manager {
    background: #fff;
}

.notification-manager[hidden] {
    display: none !important;
}

.notification-manager-head {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid #eef2f7;
}

.notification-manager-head > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.notification-manager-head strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

.notification-manager-head small {
    color: #64748b;
    font-size: 9px;
}

.notification-manager-back {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
}

.notification-manager-back:hover {
    background: #e8eef6;
    color: var(--primary, var(--trv-primary, #1d4ed8));
}

.notification-sort-list {
    display: grid;
    gap: 7px;
    max-height: 390px;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8fafc;
}

.notification-sort-item {
    display: grid;
    grid-template-columns: 20px 36px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: grab;
    user-select: none;
}

.notification-sort-item:active {
    cursor: grabbing;
}

.notification-sort-item.is-dragging {
    opacity: .45;
}

.notification-sort-item.is-drag-over {
    border-color: var(--primary, var(--trv-primary, #1d4ed8));
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .10);
}

.notification-sort-item strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-drag-handle {
    color: #94a3b8;
    text-align: center;
}

.notification-sort-icon {
    width: 34px;
    height: 34px;
}

.notification-manager-footer {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-top: 1px solid #eef2f7;
    background: #fff;
}

.notification-save-status {
    min-height: 14px;
    color: #64748b;
    font-size: 9px;
}

.notification-save-status.is-error {
    color: #dc2626;
}

.notification-save-status.is-success {
    color: #15803d;
}

.notification-save-button {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--primary, var(--trv-primary, #1d4ed8));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.notification-save-button:disabled {
    opacity: .65;
    cursor: wait;
}

/* ------------------------------------------------------------
   Account dropdown
   Preserve compact original menu layout.
   ------------------------------------------------------------ */

.account-dropdown {
    width: 310px;
}

.account-summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #edf1f5;
}

.account-avatar-large {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    font-size: 14px;
}

.account-summary-copy {
    min-width: 0;
    display: grid;
    align-content: center;
}

.account-summary strong,
.account-summary span,
.account-summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-summary strong {
    color: #172033;
    font-size: 14px;
    font-weight: 600;
}

.account-summary span {
    width: max-content;
    max-width: 100%;
    margin-top: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .09);
    color: var(--primary, var(--trv-primary, #1d4ed8));
    font-size: 10px;
    font-weight: 700;
}

.account-summary small {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
}

.account-company {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 10px 14px 4px;
    padding: 11px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
}

.account-company > i {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
}

.account-company > span {
    min-width: 0;
    display: grid;
}

.account-company small {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.account-company strong {
    overflow: hidden;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-links {
    padding: 8px;
}

.account-link {
    min-height: 42px;
    padding: 0 11px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.account-link:hover {
    background: #f4f7fb;
    color: var(--primary, var(--trv-primary, #1d4ed8));
}

.account-link > i {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
}

.account-link > span {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.account-link strong {
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-link small {
    overflow: hidden;
    color: #64748b;
    font-size: 9px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-link-danger {
    color: #b42318;
}

.account-link-danger:hover {
    background: #fff1f0;
    color: #b42318;
}

.account-link-danger small {
    color: #dc5e5e;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 700px) {
    .account-trigger-text {
        display: none;
    }

    .account-trigger {
        padding: 4px;
    }

    .account-chevron {
        display: none;
    }

    .header-dropdown {
        position: fixed;
        top: calc(var(--app-header-height, 64px) + 6px);
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    .notification-list {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 210px);
    }

    .account-dropdown {
        width: auto;
    }
}

@media (max-width: 420px) {
    .notification-head {
        padding: 10px 11px;
    }

    .notification-list {
        padding: 8px;
        gap: 7px;
    }

    .notification-item {
        min-height: 58px;
        padding: 8px 9px;
    }
}


/* Agent balance / credit menu - legacy parity in compact Core styling. */
.agent-balance-trigger { width:auto; min-width:145px; height:44px; padding:4px 10px 4px 7px; gap:8px; justify-content:flex-start; }
.agent-balance-trigger-icon { width:30px; height:30px; flex:0 0 30px; display:grid; place-items:center; border-radius:9px; background:rgba(14,116,144,.10); color:var(--primary,var(--trv-primary,#1d4ed8)); font-size:14px; }
.agent-balance-trigger-copy { min-width:0; display:flex; flex-direction:column; align-items:flex-start; line-height:1.1; }
.agent-balance-trigger-copy small { color:#64748b; font-size:9px; font-weight:700; white-space:nowrap; }
.agent-balance-trigger-copy strong { margin-top:2px; color:#172033; font-size:11px; font-weight:800; white-space:nowrap; }
.agent-balance-dropdown { width:min(340px,calc(100vw - 24px)); }
.agent-balance-head { display:flex; align-items:center; gap:11px; padding:14px 16px; background:linear-gradient(135deg,rgba(37,99,235,.08),rgba(14,116,144,.08)); border-bottom:1px solid #e5edf6; }
.agent-balance-head > i { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; background:#fff; color:var(--primary,var(--trv-primary,#1d4ed8)); box-shadow:0 3px 10px rgba(15,23,42,.08); }
.agent-balance-head div { min-width:0; display:flex; flex-direction:column; }
.agent-balance-head small { color:#64748b; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.agent-balance-head strong { color:#172033; font-size:15px; }
.agent-balance-list { padding:5px 0; }
.agent-balance-list > div { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:38px; padding:7px 15px; border-bottom:1px solid #f0f3f7; }
.agent-balance-list > div:last-child { border-bottom:0; }
.agent-balance-list span { display:flex; align-items:center; gap:8px; color:#64748b; font-size:11px; }
.agent-balance-list span i { width:15px; text-align:center; color:var(--primary,var(--trv-primary,#1d4ed8)); }
.agent-balance-list strong { color:#172033; font-size:11.5px; white-space:nowrap; }

.header-search-criteria { max-width:min(620px,45vw); display:flex; align-items:center; gap:6px; margin-left:8px; overflow:hidden; color:#64748b; font-size:10.5px; white-space:nowrap; }
.header-search-criteria[hidden] { display:none !important; }
.header-search-criteria .header-search-destination { color:#172033; font-weight:800; overflow:hidden; text-overflow:ellipsis; }
.header-search-criteria .header-search-meta { overflow:hidden; text-overflow:ellipsis; }
@media (max-width:1100px) { .header-search-criteria { display:none !important; } }

.account-avatar {
    width: 32px;
    height: 32px;
    aspect-ratio: 1;
}

.account-avatar-large {
    width: 56px;
    height: 56px;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.account-summary .account-avatar-large {
    width: 56px !important;
    height: 46px !important;
    max-width: none !important;
    padding: 0 !important;
    background: #fff !important;
    border-radius: 50% !important;
}
