/* =========================================================
   MARKER NORTH DRIVER INBOX
   Official platform notifications only
   ========================================================= */

.inbox-main {
    width: 100%;
    min-width: 0;
    padding: 24px 32px 20px;
    background: radial-gradient( circle at 85% 12%, rgba(30, 115, 190, 0.07), transparent 30% ), var(--page-bg);
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.inbox-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 4px 20px;
    background: transparent;
    border: 0;
}

    .inbox-page-header h1 {
        margin: 0;
        color: var(--text);
        font-size: 34px;
        line-height: 1.1;
    }

    .inbox-page-header p {
        margin: 7px 0 0;
        color: var(--muted);
        font-size: 16px;
        font-style: italic;
    }

.inbox-header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

    .inbox-header-actions > strong {
        color: var(--accent);
        font-size: 18px;
    }

.inbox-mark-read {
    min-height: 46px;
    padding: 0 24px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: rgba(255, 189, 25, 0.06);
    color: var(--accent);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

    .inbox-mark-read i {
        margin-right: 9px;
    }

    .inbox-mark-read:hover {
        background: var(--accent);
        color: #08101a;
        box-shadow: 0 0 22px rgba(255, 189, 25, 0.2);
    }


/* =========================================================
   OFFICIAL INBOX NOTICE
   ========================================================= */

.inbox-safety-notice {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 18px;
    padding: 18px 24px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: linear-gradient( 90deg, rgba(30, 115, 190, 0.08), rgba(7, 17, 28, 0.96) 38% );
}

.inbox-safety-icon {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 58px;
    place-items: center;
    color: #55a5ff;
    font-size: 34px;
}

.inbox-safety-notice strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
}

.inbox-safety-notice p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-style: italic;
}


/* =========================================================
   FILTERS AND SEARCH
   ========================================================= */

.inbox-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.inbox-filters {
    display: flex;
    align-items: center;
    gap: 4px;
}

    .inbox-filters button {
        min-height: 42px;
        padding: 0 24px;
        border: 1px solid var(--panel-border);
        border-radius: 7px;
        background: rgba(7, 17, 28, 0.92);
        color: var(--muted);
        font: inherit;
        font-size: 14px;
        cursor: pointer;
        transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    }

        .inbox-filters button:hover {
            border-color: #36536f;
            color: var(--text);
        }

        .inbox-filters button.active {
            border-color: var(--accent);
            background: rgba(255, 189, 25, 0.09);
            color: var(--accent);
            font-weight: 700;
        }

.inbox-filter-count {
    display: inline-grid;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    place-items: center;
    border: 1px solid rgba(255, 189, 25, 0.48);
    border-radius: 50%;
    background: rgba(255, 189, 25, 0.12);
    font-size: 12px;
}

.inbox-search {
    position: relative;
    flex: 0 0 260px;
}

    .inbox-search i {
        position: absolute;
        top: 50%;
        left: 17px;
        color: #d3dde6;
        transform: translateY(-50%);
        pointer-events: none;
    }

    .inbox-search input {
        width: 100%;
        height: 44px;
        padding: 0 16px 0 46px;
        border: 1px solid var(--panel-border);
        border-radius: 7px;
        outline: none;
        background: rgba(7, 17, 28, 0.96);
        color: var(--text);
        font: inherit;
        font-size: 14px;
    }

        .inbox-search input::placeholder {
            color: #7f8e9b;
        }

        .inbox-search input:focus {
            border-color: var(--brand-blue);
            box-shadow: 0 0 0 2px rgba(30, 115, 190, 0.13);
        }


/* =========================================================
   INBOX WORKSPACE
   ========================================================= */

.inbox-workspace {
    display: grid;
    grid-template-columns: minmax(600px, 1.65fr) minmax(390px, 1fr);
    gap: 16px;
    min-width: 0;
}


/* =========================================================
   MESSAGE LIST
   ========================================================= */

.inbox-message-list {
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: var(--panel-bg);
}

.inbox-message {
    position: relative;
    display: grid;
    grid-template-columns: 58px 188px minmax(240px, 1fr) 92px 12px;
    align-items: center;
    width: 100%;
    min-height: 76px;
    padding: 10px 18px;
    border: 0;
    border-bottom: 1px solid rgba(34, 54, 74, 0.7);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    .inbox-message:last-child {
        border-bottom: 0;
    }

    .inbox-message:hover {
        background: rgba(30, 115, 190, 0.07);
    }

    .inbox-message.selected {
        background: linear-gradient( 90deg, rgba(30, 122, 86, 0.22), rgba(8, 30, 32, 0.82) );
        box-shadow: inset 4px 0 0 #4ed477, inset 0 0 0 1px rgba(255, 189, 25, 0.6);
    }

.inbox-message-icon {
    display: grid;
    width: 44px;
    height: 50px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 10px;
    font-size: 20px;
    clip-path: polygon( 50% 0, 93% 20%, 93% 76%, 50% 100%, 7% 76%, 7% 20% );
}

    .inbox-message-icon.security {
        color: #ff4f42;
        background: rgba(255, 79, 66, 0.1);
    }

    .inbox-message-icon.caps {
        color: #4ed477;
        background: rgba(78, 212, 119, 0.1);
    }

    .inbox-message-icon.client {
        color: #438ff6;
        background: rgba(67, 143, 246, 0.1);
    }

    .inbox-message-icon.trip {
        color: var(--accent);
        background: rgba(255, 189, 25, 0.08);
    }

    .inbox-message-icon.achievement {
        color: #b760f5;
        background: rgba(183, 96, 245, 0.1);
    }

    .inbox-message-icon.support {
        color: #42dbe8;
        background: rgba(66, 219, 232, 0.1);
    }

.inbox-message-sender {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #d2dbe4;
    font-size: 13px;
    font-weight: 600;
}

    .inbox-message-sender i {
        color: #58d47b;
        font-size: 14px;
    }

.inbox-message-copy {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 0 18px;
}

    .inbox-message-copy strong,
    .inbox-message-copy small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .inbox-message-copy strong {
        color: #eef4fa;
        font-size: 15px;
        font-weight: 650;
    }

    .inbox-message-copy small {
        color: var(--muted);
        font-size: 12px;
    }

.inbox-message.unread .inbox-message-copy strong {
    color: #ffffff;
    font-weight: 750;
}

.inbox-message-time {
    justify-self: end;
    color: #c4cdd6;
    font-size: 12px;
    white-space: nowrap;
}

.inbox-unread-dot {
    justify-self: end;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 9px rgba(255, 189, 25, 0.6);
}


/* =========================================================
   SELECTED MESSAGE DETAILS
   ========================================================= */

.inbox-message-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: linear-gradient( 145deg, rgba(9, 29, 45, 0.98), rgba(5, 15, 25, 0.98) );
}

.inbox-detail-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 22px 16px;
    border: 0;
    background: transparent;
}

.inbox-detail-icon {
    display: grid;
    flex: 0 0 62px;
    width: 62px;
    height: 70px;
    place-items: center;
    clip-path: polygon( 50% 0, 94% 21%, 94% 76%, 50% 100%, 6% 76%, 6% 21% );
    border: 3px solid #4ed477;
    background: radial-gradient( circle, rgba(78, 212, 119, 0.22), rgba(78, 212, 119, 0.04) );
    color: #4ed477;
    font-size: 27px;
    box-shadow: inset 0 0 18px rgba(78, 212, 119, 0.12);
}

.inbox-detail-header h2 {
    margin: 2px 0 7px;
    padding-right: 75px;
    color: var(--text);
    font-size: 22px;
    line-height: 1.2;
}

.inbox-detail-sender {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: #d7e1ea;
    font-size: 14px;
}

    .inbox-detail-sender i {
        color: #58d47b;
    }

.inbox-detail-header time {
    color: var(--muted);
    font-size: 13px;
}

.inbox-message-category {
    position: absolute;
    top: 22px;
    right: 20px;
    padding: 5px 9px;
    border: 1px solid rgba(78, 212, 119, 0.45);
    border-radius: 5px;
    background: rgba(78, 212, 119, 0.1);
    color: #75e292;
    font-size: 11px;
    font-weight: 700;
}

.inbox-detail-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 4px 22px 18px;
}

    .inbox-detail-body > p {
        margin: 0 0 18px;
        color: #e0e7ed;
        font-size: 14px;
        line-height: 1.55;
        white-space: pre-line;
    }

    .inbox-detail-body > p a {
        color: #57baff;
        font-weight: 700;
    }

.inbox-status-list {
    margin: 0 0 16px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(5, 14, 24, 0.55);
}

    .inbox-status-list > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 47px;
        padding: 0 17px;
        border-bottom: 1px solid rgba(34, 54, 74, 0.65);
    }

        .inbox-status-list > div:last-child {
            border-bottom: 0;
        }

    .inbox-status-list dt {
        display: flex;
        align-items: center;
        gap: 14px;
        color: #c5d0db;
        font-size: 14px;
    }

        .inbox-status-list dt i {
            width: 20px;
            color: #d2dce5;
            font-size: 18px;
            text-align: center;
        }

    .inbox-status-list dd {
        margin: 0;
        color: var(--text);
        font-size: 14px;
        font-weight: 700;
    }

        .inbox-status-list dd.online {
            color: #52da75;
        }

.inbox-client-status-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    gap: 10px;
    margin-top: auto;
    border: 1px solid var(--accent);
    border-radius: 7px;
    background: rgba(255, 189, 25, 0.06);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

    .inbox-client-status-button:hover {
        background: var(--accent);
        color: #06101a;
    }

/* =========================================================
   STAFF ROLE INVITATION
   ========================================================= */

.inbox-staff-invitation {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding: 17px;
    border: 1px solid rgba(255, 189, 25, 0.55);
    border-radius: 8px;
    background: linear-gradient( 135deg, rgba(255, 189, 25, 0.09), rgba(7, 17, 28, 0.88));
}

    .inbox-staff-invitation h2 {
        margin: 0;
        color: var(--accent);
        font-size: 16px;
    }

    .inbox-staff-invitation > p {
        margin: 0;
        color: #cbd6df;
        font-size: 13px;
        line-height: 1.5;
    }

.inbox-invitation-actions {
    display: flex;
    gap: 10px;
}

    .inbox-invitation-actions button {
        min-height: 42px;
        padding: 0 18px;
        border-radius: 7px;
        font: inherit;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    }

.inbox-invitation-accept {
    flex: 1;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #07111c;
}

    .inbox-invitation-accept:hover:not(:disabled) {
        background: #ffd15c;
        border-color: #ffd15c;
    }

.inbox-invitation-decline {
    border: 1px solid #45627c;
    background: rgba(7, 17, 28, 0.7);
    color: #b9c8d5;
}

    .inbox-invitation-decline:hover:not(:disabled) {
        border-color: #7892a9;
        color: var(--text);
    }

.inbox-invitation-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.inbox-invitation-actions button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.inbox-invitation-status {
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: rgba(5, 14, 24, 0.75);
    color: #cbd6df;
    font-size: 12px;
}

    .inbox-invitation-status.is-success {
        border-color: rgba(78, 212, 119, 0.55);
        background: rgba(78, 212, 119, 0.1);
        color: #75e292;
    }

    .inbox-invitation-status.is-error {
        border-color: rgba(255, 104, 104, 0.55);
        background: rgba(255, 104, 104, 0.08);
        color: #ff9d9d;
    }

.inbox-staff-invitation.is-accepted {
    border-color: rgba(78, 212, 119, 0.55);
    background: rgba(78, 212, 119, 0.08);
}

    .inbox-staff-invitation.is-accepted h2 {
        color: #75e292;
    }


.inbox-staff-invitation.is-canceled {
    border-color: rgba(255, 189, 25, 0.55);
    background: rgba(255, 189, 25, 0.07);
}

    .inbox-staff-invitation.is-canceled h2 {
        color: var(--accent);
    }

.inbox-staff-invitation.is-declined {
    border-color: #3a5064;
    background: rgba(7, 17, 28, 0.72);
}

    .inbox-staff-invitation.is-declined h2 {
        color: #aab9c5;
    }


.inbox-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border: 0;
    border-top: 1px solid rgba(34, 54, 74, 0.7);
    background: rgba(3, 10, 18, 0.3);
    color: #778793;
    font-size: 12px;
    font-style: italic;
}

.inbox-detail-status {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.inbox-remove-message {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(119, 135, 147, 0.65);
    border-radius: 6px;
    padding: 7px 10px;
    background: transparent;
    color: #b8c6d0;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

    .inbox-remove-message:hover {
        border-color: rgba(255, 111, 111, 0.8);
        background: rgba(150, 39, 50, 0.18);
        color: #ffb0b0;
    }

    .inbox-remove-message:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }


/* =========================================================
   QUICK LINKS
   ========================================================= */

.inbox-quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    margin-top: 16px;
    border: 1px solid var(--panel-border);
    border-radius: 9px;
    background: var(--panel-bg);
}

    .inbox-quick-links a {
        display: flex;
        align-items: center;
        min-height: 72px;
        gap: 17px;
        padding: 14px 32px;
        border-right: 1px solid var(--panel-border);
        color: #70b8ff;
        text-decoration: none;
        transition: background 0.2s ease;
    }

        .inbox-quick-links a:last-child {
            border-right: 0;
        }

        .inbox-quick-links a:hover {
            background: rgba(30, 115, 190, 0.08);
        }

    .inbox-quick-links > a > i {
        width: 34px;
        color: #9acaff;
        font-size: 30px;
        text-align: center;
    }

    .inbox-quick-links a span {
        display: grid;
        gap: 5px;
    }

    .inbox-quick-links strong {
        font-size: 14px;
    }

    .inbox-quick-links small {
        color: var(--muted);
        font-size: 12px;
    }


/* =========================================================
   CAPS SIGNATURE
   ========================================================= */

.inbox-caps-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 18px 0 3px;
    border: 0;
    background: transparent;
}

.inbox-caps-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid var(--brand-blue);
    border-radius: 50%;
    color: #4ca2f6;
    font-size: 20px;
}

.inbox-caps-signature > div:last-child {
    display: grid;
    gap: 4px;
}

.inbox-caps-signature strong {
    color: #dce5ed;
    font-size: 14px;
    font-weight: 600;
}

    .inbox-caps-signature strong span {
        color: var(--accent);
        font-weight: 800;
    }

.inbox-caps-signature small {
    color: #80909e;
    font-size: 11px;
    font-style: italic;
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.inbox-message:focus-visible,
.inbox-filters button:focus-visible,
.inbox-mark-read:focus-visible,
.inbox-client-status-button:focus-visible,
.inbox-quick-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* =========================================================
   RESPONSIVE LAYOUT
   ========================================================= */

@media (max-width: 1500px) {

    .inbox-main {
        padding-right: 22px;
        padding-left: 22px;
    }

    .inbox-workspace {
        grid-template-columns: minmax(540px, 1.45fr) minmax(350px, 1fr);
    }

    .inbox-message {
        grid-template-columns: 54px 160px minmax(200px, 1fr) 82px 10px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .inbox-filters button {
        padding-right: 17px;
        padding-left: 17px;
    }
}

@media (max-width: 1260px) {

    .inbox-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .inbox-search {
        flex-basis: auto;
        width: 100%;
    }

    .inbox-workspace {
        grid-template-columns: 1fr;
    }

    .inbox-message-details {
        min-height: 520px;
    }
}

@media (max-width: 900px) {

    .inbox-main {
        padding: 20px 16px;
    }

    .inbox-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inbox-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .inbox-filters {
        overflow-x: auto;
        padding-bottom: 4px;
    }

        .inbox-filters button {
            flex: 0 0 auto;
        }

    .inbox-message {
        grid-template-columns: 50px minmax(0, 1fr) 76px 10px;
    }

    .inbox-message-sender {
        display: none;
    }

    .inbox-message-copy {
        padding-right: 10px;
        padding-left: 8px;
    }

    .inbox-quick-links {
        grid-template-columns: 1fr;
    }

        .inbox-quick-links a {
            border-right: 0;
            border-bottom: 1px solid var(--panel-border);
        }

            .inbox-quick-links a:last-child {
                border-bottom: 0;
            }
}

@media (max-width: 620px) {

    .inbox-page-header h1 {
        font-size: 29px;
    }

    .inbox-header-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .inbox-safety-notice {
        align-items: flex-start;
        padding: 16px;
    }

    .inbox-safety-icon {
        flex-basis: 40px;
        width: 40px;
        height: 45px;
        font-size: 26px;
    }

    .inbox-message {
        grid-template-columns: 46px minmax(0, 1fr) 8px;
    }

    .inbox-message-time {
        display: none;
    }

    .inbox-detail-header {
        padding-right: 16px;
        padding-left: 16px;
    }

    .inbox-detail-icon {
        flex-basis: 52px;
        width: 52px;
        height: 59px;
        font-size: 22px;
    }

    .inbox-detail-header h2 {
        padding-right: 0;
        font-size: 18px;
    }

    .inbox-message-category {
        display: none;
    }

    .inbox-detail-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .inbox-status-list > div {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .inbox-quick-links a {
        padding-right: 20px;
        padding-left: 20px;
    }
}
