/* Palette sampled visually from the supplied brand board; exact HEX values were not supplied. */
:root {
    --brand-navy: #15182B;
    --brand-ink: #202231;
    --brand-primary: #6236D9;
    --brand-blue: #42238F;
    --brand-cyan: #20C997;
    --brand-mint: #20C997;
    --brand-soft: #F2EEFC;
    --brand-page: #F7F8FC;
    --brand-muted: #667085;
    --brand-border: #E4E7EC;
}

@font-face { font-family: 'Shabnam'; src: url('fonts/Shabnam.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Shabnam'; src: url('fonts/Shabnam-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Shabnam'; src: url('fonts/Shabnam-Bold.woff2') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; }

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Shabnam', Tahoma, sans-serif;
    font-size: 15px;
    background: var(--brand-page);
    color: var(--brand-ink);
    line-height: 1.8;
}

button,
input,
textarea,
select,
option,
dialog {
    font-family: inherit;
    box-sizing: border-box;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
}

body.site-confirm-open { overflow: hidden; }
.site-confirm-modal[hidden] { display: none !important; }
.site-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 22px;
    border: 0;
    background: transparent;
    overflow: hidden;
    box-sizing: border-box;
    place-items: center;
    direction: rtl;
    font-family: 'Shabnam', Tahoma, sans-serif;
}
.site-confirm-modal::backdrop { background: transparent; }
.site-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(21, 24, 43, .58);
    backdrop-filter: blur(4px);
}
.site-confirm-card {
    position: relative;
    width: min(520px, 100%);
    padding: 30px 30px 26px;
    border: 1px solid rgba(98, 54, 217, .18);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(21, 24, 43, .28);
    color: var(--brand-ink);
    text-align: center;
    transform: translateY(12px) scale(.97);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
}
.site-confirm-close { position: absolute; top: 13px; left: 13px; display: grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: #F2EEFC; color: #42238F; font: inherit; font-size: 23px; line-height: 1; cursor: pointer; }
.site-confirm-modal.is-open .site-confirm-card { transform: translateY(0) scale(1); opacity: 1; }
.site-confirm-icon {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 20px;
    background: #F2EEFC;
    color: var(--brand-primary);
    font-size: 30px;
    font-weight: 800;
}
.site-confirm-card h2 { margin: 0 0 8px; color: var(--brand-navy); font-size: 21px; line-height: 1.55; }
.site-confirm-card p { margin: 0 auto; color: var(--brand-muted); font-size: 14px; line-height: 2; white-space: pre-line; }
.site-confirm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}
.site-confirm-actions button {
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .16s ease, filter .16s ease;
}
.site-confirm-actions button:hover { filter: brightness(.96); transform: translateY(-1px); }
.site-confirm-yes { background: #138A68; box-shadow: 0 8px 20px rgba(32, 201, 151, .25); }
.site-confirm-no { background: #D92D4B; box-shadow: 0 8px 20px rgba(217, 45, 75, .2); }
@media (max-width: 520px) {
    .site-confirm-modal { padding: 14px; }
    .site-confirm-card { padding: 24px 18px 20px; border-radius: 19px; }
    .site-confirm-actions { grid-template-columns: 1fr; }
}

/* =========================================================
   AUTH
========================================================= */

.auth-page {
    min-height: 100vh;
}

.auth-header {
    background: linear-gradient(120deg, var(--brand-navy), #42238F);
    color: white;
    padding: 30px 7%;
    text-align: center;
}

.brand {
    font-size: 25px;
    font-weight: 700;
}

.subtitle {
    margin-top: 8px;
    opacity: 0.8;
}

.auth-container {
    max-width: 1000px;
    margin: 50px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 25px;
}

.auth-card {
    background: white;
    padding: 35px;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.07);
}

.card-icon {
    font-size: 35px;
    margin-bottom: 15px;
}

.auth-card h2 {
    color: var(--brand-navy);
    margin-bottom: 10px;
}

.auth-card p {
    color: var(--brand-muted);
    font-size: 13px;
    margin-bottom: 25px;
}


/* =========================================================
   FORMS
========================================================= */

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d5dde3;
    border-radius: 9px;
    outline: none;
    background: white;
    font-size: 14px;
    transition: 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(98,54,217,0.1);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

small {
    color: var(--brand-muted);
    font-size: 11px;
    display: block;
    margin-top: 6px;
}

.required {
    color: #dc2626;
}

.optional {
    font-weight: 500;
    color: var(--brand-muted);
}

.warning-text {
    color: #b45309;
    background: #fff7ed;
    border-right: 3px solid #f59e0b;
    padding: 8px 10px;
    border-radius: 6px;
    margin-top: 8px;
}

.field-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 9px;
    background: var(--brand-primary);
    color: white;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s;
}

.btn:hover {
    background: var(--brand-navy);
    transform: translateY(-1px);
}

.btn.secondary {
    background: var(--brand-soft);
    color: var(--brand-primary);
}

.btn.danger {
    background: #dc2626;
}

.small-btn {
    border: none;
    padding: 9px 15px;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    color: var(--brand-navy);
    font-weight: 700;
}

.table-btn {
    border: none;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    background: var(--brand-soft);
    color: #42238F;
    margin: 2px;
    font-family: inherit;
}

.table-btn.danger {
    background: #fee2e2;
    color: #b91c1c;
}


/* =========================================================
   HEADER
========================================================= */

.main-header {
    background: linear-gradient(120deg, var(--brand-navy), #42238F);
    color: white;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.owner-header {
    background: linear-gradient(135deg,var(--brand-navy),#42238F);
}


/* =========================================================
   MAIN
========================================================= */

.main-container {
    max-width: 1250px;
    margin: auto;
    padding: 30px 20px;
}

.dashboard-nav {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.nav-card {
    background: white;
    border: 2px solid transparent;
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
}

.nav-card:hover,
.nav-card.active {
    border-color: var(--brand-primary);
}

.nav-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.nav-card h3 {
    color: var(--brand-navy);
    margin-bottom: 8px;
}

.nav-card p {
    font-size: 12px;
    color: var(--brand-muted);
}


/* =========================================================
   CONTENT
========================================================= */

.content-box {
    background: white;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.section-title {
    margin-bottom: 25px;
}

.section-title h2 {
    color: var(--brand-navy);
    margin-bottom: 7px;
}

.section-title p {
    color: var(--brand-muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 20px;
}

.full {
    grid-column: 1/-1;
}

.money-input {
    direction: ltr;
    text-align: right;
}


/* =========================================================
   WANTED MEDICINES
========================================================= */

.wanted-medicines-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.wanted-medicine-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wanted-medicine-row input {
    flex: 1;
}

.icon-btn {
    width: 45px;
    min-width: 45px;
    height: 45px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #b91c1c;
    border-radius: 9px;
    cursor: pointer;
    font-size: 17px;
    transition: 0.2s;
}

.icon-btn:hover {
    background: #fee2e2;
    transform: translateY(-1px);
}

.add-medicine-btn {
    margin-top: 12px;
    border: 1px dashed var(--brand-primary);
    background: var(--brand-soft);
    color: var(--brand-primary);
    padding: 10px 16px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: 0.2s;
}

.add-medicine-btn:hover {
    background: #d8f5f0;
}

.add-icon {
    display: inline-flex;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary);
    color: white;
    margin-left: 5px;
    font-size: 18px;
    line-height: 1;
}


/* =========================================================
   TRADE OPTIONS
========================================================= */

.trade-options {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
    margin-top: 14px;
}

.trade-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 85px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.trade-option:hover {
    border-color: #8bd9d6;
    background: #f8fffe;
    transform: translateY(-2px);
}

.trade-option.selected {
    border-color: var(--brand-primary);
    background: var(--brand-soft);
    box-shadow: 0 5px 18px rgba(98,54,217,0.10);
}

.trade-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.trade-option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.trade-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 11px;
    font-size: 20px;
}

.trade-option.selected .trade-icon {
    background: #d8f5f0;
}

.trade-option-text {
    font-size: 13px;
    line-height: 1.7;
    font-weight: 600;
    color: #374151;
}

.trade-check {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #d1d5db;
    color: transparent;
    font-weight: 700;
}

.trade-option.selected .trade-check {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}


/* =========================================================
   CONFIRMATION
========================================================= */

.confirmation-box {
    border-top: 1px solid #e5e7eb;
    margin-top: 30px;
    padding-top: 25px;
}

.confirmation-box h3 {
    color: var(--brand-navy);
    margin-bottom: 10px;
}

.confirmation-box p {
    color: var(--brand-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.confirmation-medicine {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.medicine-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: #42238F;
    font-size: 11px;
    font-weight: 700;
}

.medicine-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    white-space: normal;
    min-width: 150px;
}

.medicine-list-item {
    display: flex;
    align-items: center;
    gap: 7px;
    line-height: 1.6;
}

.medicine-list-item .medicine-number {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 10px;
}

.exchange-medicines-public {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    font-size: 12px;
}

.exchange-medicines-public strong {
    display: block;
    color: var(--brand-navy);
    margin-bottom: 8px;
}


/* =========================================================
   TABLE
========================================================= */

.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--brand-soft);
    color: var(--brand-navy);
    padding: 13px;
    text-align: right;
    font-size: 12px;
    white-space: nowrap;
}

td {
    padding: 13px;
    border-bottom: 1px solid #edf0f2;
    font-size: 12px;
    white-space: nowrap;
}


/* =========================================================
   OFFERS
========================================================= */

.offers-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
}

.offer-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    transition: 0.2s;
}

.offer-card:hover {
    border-color: #a7dfe0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.offer-card h3 {
    color: var(--brand-navy);
    margin-bottom: 12px;
}

.offer-card p {
    font-size: 12px;
    color: var(--brand-muted);
    line-height: 2;
}

.offer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.status {
    background: #dcfce7;
    color: #166534;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 10px;
    white-space: nowrap;
}

.offer-value {
    color: var(--brand-primary);
    font-weight: 700;
    margin: 12px 0;
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.stat-card span {
    display: block;
    font-size: 30px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    color: var(--brand-navy);
    margin: 8px 0;
}

.stat-card small {
    color: var(--brand-muted);
}


/* =========================================================
   ADMIN
========================================================= */

.admin-form {
    margin-top: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}


/* =========================================================
   MODAL
========================================================= */

.modal {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    z-index: 5000;
}

.modal-content {
    box-sizing: border-box;
    min-width: 0;
    background: white;
    width: 100%;
    max-width: 600px;
    padding: 30px;
    border-radius: 15px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

.modal-content h2 {
    color: var(--brand-navy);
    margin-bottom: 20px;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--brand-muted);
}


/* =========================================================
   MESSAGES
========================================================= */

.message {
    margin-top: 15px;
    font-size: 13px;
}

.error {
    color: #dc2626;
}

.success {
    color: #15803d;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width: 1000px) {

    .trade-options {
        grid-template-columns: 1fr;
    }

    .offers-grid {
        grid-template-columns: repeat(2,1fr);
    }

}

@media(max-width: 850px) {

    .auth-container,
    .dashboard-nav,
    .form-grid,
    .offers-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: auto;
    }

    .main-header {
        flex-direction: column;
        gap: 15px;
    }

    .confirm-actions {
        grid-template-columns: 1fr;
    }

}

@media(max-width: 600px) {

    .content-box {
        padding: 20px 15px;
    }

    .wanted-medicine-row {
        align-items: stretch;
    }

    .icon-btn {
        height: auto;
        min-height: 45px;
    }

    .trade-option {
        min-height: 75px;
    }

}

/* Shared response dialogs and admin details */
.modal-overlay { position: absolute; inset: 0; }
.modal-content { position: relative; z-index: 1; }
.modal-large { max-width: 900px; }
.modal-close { border: 0; background: transparent; font-size: 28px; cursor: pointer; float: left; padding: 0 8px; }
.modal-description { color: var(--brand-muted); margin: 14px 0; }
.modal-actions, .response-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.original-offer-box, .private-info-box, .max-amount-box { background: var(--brand-soft); border-radius: 10px; padding: 16px; margin: 12px 0; }
.private-info-title { color: var(--brand-navy); font-weight: 700; }
.exchange-item-row { border: 1px solid #d5dde3; border-radius: 10px; padding: 15px; margin: 15px 0; }
.exchange-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.exchange-item-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.saved-offer-picker-wrap { margin: 16px 0; }
.saved-offer-picker-button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--brand-purple, #6236d9); border-radius: 14px; background: #f5f1ff; color: var(--brand-navy); text-align: right; cursor: pointer; }
.saved-offer-picker-button > span:last-child { display: grid; gap: 3px; }
.saved-offer-picker-button small { color: var(--brand-muted); }
.saved-offer-picker-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; border-radius: 12px; color: #fff; background: #6236d9; }
.saved-offer-picker-icon svg { width: 25px; height: 25px; }
.saved-offer-picker { margin-top: 10px; padding: 12px; border: 1px solid var(--brand-border, #e4e7ec); border-radius: 14px; background: #fff; }
.saved-offer-picker-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--brand-muted); font-size: 13px; }
.saved-offer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 310px; overflow-y: auto; }
.saved-offer-card { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--brand-border, #e4e7ec); border-radius: 11px; background: #fff; color: var(--brand-text, #202231); text-align: right; cursor: pointer; }
.saved-offer-card:hover, .saved-offer-card:focus-visible { border-color: #6236d9; background: #f7f4ff; outline: none; }
.saved-offer-card span { font-size: 12px; color: var(--brand-muted); }
.saved-offer-card .saved-offer-status { color: #42238f; font-weight: 700; }
.selected-saved-offer-note { padding: 10px 12px; margin-bottom: 12px; border-radius: 9px; background: #ecfdf7; color: #147d64; font-size: 13px; }
.expiry-rule-dialog { width: min(92vw, 650px); padding: clamp(24px, 5vw, 44px); text-align: center; border-top: 6px solid #6236d9; }
.expiry-rule-dialog h2 { margin: 12px 0; color: #15182b; font-size: clamp(24px, 4vw, 34px); }
.expiry-rule-dialog > p { color: #667085; line-height: 2; }
.expiry-rule-icon { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto; border-radius: 22px; background: #f2eefc; color: #6236d9; }
.expiry-rule-icon svg { width: 46px; height: 46px; }
.expiry-rule-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.expiry-rule-dates p { display: grid; gap: 7px; margin: 0; padding: 14px; border: 1px solid #e4e7ec; border-radius: 13px; background: #f7f8fc; }
.expiry-rule-dates span { color: #667085; font-size: 12px; }
.expiry-rule-dates strong { color: #42238f; direction: ltr; }
.expiry-rule-note { padding: 10px; border-radius: 9px; background: #fff8e8; color: #8a5b00 !important; }
.removed-offers-archive { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e4e7ec; }
.removed-offers-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.removed-offer-card { padding: 13px; border: 1px dashed #cfd3dc; border-radius: 13px; background: #f8f8fa; }
.removed-offer-card h4 { margin: 0 0 7px; color: #202231; }
.removed-offer-card p { margin: 4px 0; color: #667085; font-size: 12px; }
.removed-offer-card strong { display: block; margin-top: 8px; color: #667085; font-size: 12px; }
.drug-autocomplete { position: relative; }
.drug-suggestions { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 5px); max-height: 340px; overflow-y: auto; padding: 7px; border: 1px solid #d9d2f5; border-radius: 13px; background: #fff; box-shadow: 0 18px 38px #15182b24; }
.drug-suggestion { width: 100%; display: grid; gap: 3px; padding: 10px 11px; border: 0; border-bottom: 1px solid #eef0f4; background: #fff; color: #202231; text-align: right; cursor: pointer; }
.drug-suggestion:last-child { border-bottom: 0; }
.drug-suggestion:hover, .drug-suggestion:focus-visible { border-radius: 9px; background: #f2eefc; outline: none; }
.drug-suggestion strong { direction: ltr; text-align: left; font-size: 13px; }
.drug-suggestion span { direction: ltr; text-align: left; color: #667085; font-size: 11px; }
.drug-suggestion small { color: #6236d9; }
.drug-suggestion-message { padding: 14px; color: #667085; text-align: center; font-size: 13px; }
.drug-suggestion-message.error { color: #b4233b; }
#medicineSelectionStatus { display: block; margin-top: 6px; color: #667085; }
.offer-badges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.match-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.match-badge.match-100 { background: #138a63; }
.match-badge.match-85 { background: #36a269; }
.match-badge.match-70 { background: #78a33d; }
.match-badge.match-55 { background: #c58a18; }
.match-badge.match-40 { background: #dd6f27; }
.match-badge.match-0 { background: #c83950; }
.public-match-card { position: relative; padding-top: 54px; }
.offer-match-corner { position: absolute; top: 14px; left: 14px; z-index: 2; }
.response-choice-btn { padding: 18px; border: 1px solid #8bd9d6; border-radius: 10px; background: var(--brand-soft); color: var(--brand-navy); cursor: pointer; }
.response-choice-icon { display: block; font-size: 28px; }
.form-error { color: #b91c1c; background: #fff5f5; padding: 12px; border-radius: 8px; margin: 10px 0; }
button:disabled { cursor: wait; opacity: .6; }
.loading-state { padding: 24px; text-align: center; color: var(--brand-muted); }
#activityLogsTable td:last-child { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 220px; max-width: 450px; }
@media (max-width: 600px) {
    .modal-content { padding: 20px 15px; }
    .modal-actions, .response-choice-grid, .exchange-item-fields, .saved-offer-list { grid-template-columns: 1fr; }
    .saved-offer-picker-heading { display: grid; }
    .expiry-rule-dates { grid-template-columns: 1fr; }
    .removed-offers-grid { grid-template-columns: 1fr; }
}

.owner-offers-grid { margin-top: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.owner-offers-grid .offer-card { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.owner-offers-grid .offer-card > .btn { margin-top: auto; }
.owner-private-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; background: #fff7ed; border: 1px solid #fed7aa; padding: 14px; border-radius: 10px; margin: 14px 0; font-size: 13px; }
.owner-private-details dt { font-weight: 700; color: var(--brand-navy); }
.owner-private-details dd { margin: 0; overflow-wrap: anywhere; }
.contact-value { direction: ltr; text-align: right; }
.report-help, #exportExcelMessage { margin-top: 12px; font-size: 13px; color: var(--brand-muted); }

.required { color: #dc2626; font-size: 12px; font-weight: 700; vertical-align: middle; margin-inline-start: 3px; }
.required-fields-note { font-size: 12px; color: var(--brand-muted); margin-bottom: 16px; }
.optional-contact-fields { margin-top: 18px; }

/* DrugXchange identity: one visual language across login, user and owner pages. */
.auth-header, .main-header { border-bottom: 4px solid var(--brand-cyan); }
.auth-header { padding-block: 32px; background: radial-gradient(ellipse at 20% 0%, #42238F, transparent 65%), var(--brand-navy); }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand-mark { width: 68px; height: 68px; object-fit: contain; flex-shrink: 0; background: #fff; border-radius: 18px; padding: 5px; }
.brand-copy { display: flex; flex-direction: column; align-items: flex-start; }
.brand-name { font-family: inherit; font-size: clamp(23px, 4vw, 32px); line-height: 1.3; letter-spacing: -1px; font-weight: 400; }
.brand-name b { font-weight: 800; }
.brand-tagline { font-size: 12px; font-weight: 400; color: #d3e7ef; margin-top: 5px; }
.auth-header .brand { flex-direction: column; gap: 12px; }
.auth-header .brand-mark { width: 112px; height: 112px; border-radius: 26px; }
.auth-header .brand-copy { align-items: center; }
.auth-header .brand-name { font-size: clamp(28px, 5vw, 38px); }
.auth-header .subtitle { color: #d3e7ef; opacity: 1; font-size: 12px; }
.owner-header small { color: #d3e7ef; }
.auth-container { margin-top: 28px; }
.auth-container > *, .form-grid > * { min-width: 0; }
.auth-card input, .auth-card select { min-width: 0; max-width: 100%; }
.auth-card, .content-box, .nav-card, .stat-card { box-shadow: 0 8px 28px rgba(21,24,43,.06); }
.nav-card.active { background: var(--brand-soft); }
.btn:not(.danger):not(.secondary) { box-shadow: 0 4px 12px rgba(98,54,217,.13); }
a { color: var(--brand-primary); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brand-cyan); outline-offset: 4px; }
.owner-private-details { background: var(--brand-soft); border-color: #a7dfe0; }
.brand-ui-icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; display: inline-block; color: var(--brand-primary); }
.card-icon, .nav-icon, .trade-icon, .response-choice-icon { color: var(--brand-primary); }
@media (max-width: 600px) {
    .auth-container, .form-grid { grid-template-columns: minmax(0, 1fr); }
    .auth-header { padding: 24px 16px; }
    .auth-card { padding: 24px 20px; }
    .auth-container { margin-top: 12px; padding: 16px; gap: 18px; }
    .brand-mark { width: 56px; height: 56px; border-radius: 14px; }
    .main-header { padding: 16px; }
    .header-user { flex-wrap: wrap; justify-content: center; }
}
.landing-editor-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(290px,1fr)); gap: 18px; margin: 18px 0; }
.landing-editor-section { min-width: 0; padding: 20px; border: 1px solid #E4E7EC; border-radius: 15px; background: #F7F8FC; }
.landing-editor-section h3 { margin: 0 0 18px; color: #42238F; font-size: 18px; }
.landing-editor-section .form-group { margin-bottom: 13px; }
.landing-editor-section input[type="number"] { max-width: 105px; direction: ltr; text-align: center; }
.landing-editor-section textarea { resize: vertical; }
