/* ============================================================
   CEMR PHARMACY DASHBOARD
   File: wwwroot/css/pharmacy-dashboard.css
   ============================================================ */

:root,
.pharmacy-page,
.pharmacy-bill-dialog,
.pharmacy-suspend-dialog {
    --pharmacy-primary: var(--app-accent, #2a6b82);
    --pharmacy-primary-dark: var(--app-accent-dark, #1f566a);
    --pharmacy-primary-soft: var(--app-accent-soft, #edf6f8);
    --pharmacy-border: #e4e9ef;
    --pharmacy-page-bg: #ffffff;
    --pharmacy-panel-bg: #ffffff;
    --pharmacy-text: #172033;
    --pharmacy-muted: #6b7688;
    --pharmacy-success: #178a57;
    --pharmacy-success-soft: #e9f8f0;
    --pharmacy-warning: #c97608;
    --pharmacy-warning-soft: #fff4df;
    --pharmacy-danger: #d54444;
    --pharmacy-danger-soft: #fff0f0;
}

.pharmacy-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    background: var(--pharmacy-page-bg);
    overflow: visible;
    box-sizing: border-box;
}

    .pharmacy-page *,
    .pharmacy-page *::before,
    .pharmacy-page *::after {
        box-sizing: border-box;
    }

/* ============================================================
   PAGE HEADER
   ============================================================ */

.pharmacy-page-header {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
    border: 1px solid var(--pharmacy-border);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(20, 32, 50, 0.04);
}

.pharmacy-title-group {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pharmacy-title-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--pharmacy-primary-soft);
    color: var(--pharmacy-primary);
    font-size: 24px;
}

.pharmacy-title-group > div:last-child {
    min-width: 0;
}

.pharmacy-title-group h1 {
    margin: 0;
    color: var(--pharmacy-text);
    font-size: 21px;
    font-weight: 750;
    line-height: 1.25;
}

.pharmacy-title-group p {
    margin: 3px 0 0;
    color: var(--pharmacy-muted);
    font-size: 13px;
    line-height: 1.4;
}

.pharmacy-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

.pharmacy-location-dropdown {
    width: 225px;
    min-width: 190px;
}

.pharmacy-btn {
    min-height: 38px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

    .pharmacy-btn i {
        font-size: 18px;
    }

.pharmacy-btn-primary {
    color: #ffffff !important;
    background: #2a6b82;
    background: var(--pharmacy-primary, #2a6b82);
    border-color: #2a6b82;
    border-color: var(--pharmacy-primary, #2a6b82);
}

    .pharmacy-btn-primary:hover {
        color: #ffffff !important;
        background: #1f566a;
        background: var(--pharmacy-primary-dark, #1f566a);
        border-color: #1f566a;
        border-color: var(--pharmacy-primary-dark, #1f566a);
    }

.pharmacy-btn-secondary {
    color: #172033;
    color: var(--pharmacy-text, #172033);
    background: #ffffff;
    border-color: #d1d5db;
    border-color: var(--pharmacy-border, #d1d5db);
}

    .pharmacy-btn-secondary:hover {
        color: #2a6b82;
        color: var(--pharmacy-primary, #2a6b82);
        background: #edf6f8;
        background: var(--pharmacy-primary-soft, #edf6f8);
        border-color: #2a6b82;
        border-color: var(--pharmacy-primary, #2a6b82);
    }

.pharmacy-btn-danger {
    color: #ffffff !important;
    background: #dc2626;
    background: var(--pharmacy-danger, #dc2626);
    border-color: #dc2626;
    border-color: var(--pharmacy-danger, #dc2626);
}

    .pharmacy-btn-danger:hover {
        color: #ffffff !important;
        background: #b91c1c;
        border-color: #b91c1c;
    }

/* ============================================================
   DASHBOARD SCROLL AREA (Clean outer flow)
   ============================================================ */

.pharmacy-dashboard-scroll {
    flex: 1 1 auto;
    min-width: 0;
    min-height: auto;
    padding: 12px 2px 24px;
    overflow: visible;
}

/* ============================================================
   SUMMARY CARDS
   ============================================================ */

.pharmacy-summary-grid {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.pharmacy-summary-card {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 118px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--pharmacy-border);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(23, 32, 51, 0.04);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

    .pharmacy-summary-card::before {
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        content: "";
        background: var(--card-color);
    }

    .pharmacy-summary-card:hover {
        border-color: var(--card-color);
        box-shadow: 0 7px 18px rgba(23, 32, 51, 0.08);
        transform: translateY(-2px);
    }

.card-prescription {
    --card-color: #6157d9;
    --card-soft: #efedff;
}

.card-dispensed {
    --card-color: #159568;
    --card-soft: #e7f7f1;
}

.card-pending {
    --card-color: #e79b1f;
    --card-soft: #fff4df;
}

.card-low-stock {
    --card-color: #d84d58;
    --card-soft: #fff0f1;
}

.card-expiry {
    --card-color: #e76e25;
    --card-soft: #fff0e7;
}

.summary-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--card-color);
    background: var(--card-soft);
    border-radius: 11px;
    font-size: 22px;
}

.summary-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

    .summary-content > span {
        color: var(--pharmacy-muted);
        font-size: 13px;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .summary-content > strong {
        margin-top: 4px;
        color: var(--pharmacy-text);
        font-size: 28px;
        font-weight: 800;
        line-height: 1.1;
    }

    .summary-content small {
        margin-top: 8px;
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        font-weight: 650;
        white-space: nowrap;
    }

.positive-value {
    color: var(--pharmacy-success);
}

.warning-value {
    color: var(--pharmacy-warning);
}

.danger-value {
    color: var(--pharmacy-danger);
}

.summary-arrow {
    align-self: center;
    flex: 0 0 auto;
    color: #abb4c0;
    font-size: 19px;
}

/* ============================================================
   MAIN DASHBOARD GRID (2-Column Layout)
   ============================================================ */

.pharmacy-dashboard-main-grid {
    width: 100%;
    min-width: 0;
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.pharmacy-panel {
    min-width: 0;
    background: var(--pharmacy-panel-bg);
    border: 1px solid var(--pharmacy-border);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(23, 32, 51, 0.035);
    overflow: hidden;
}

.pharmacy-panel-header {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #edf0f4;
    background: #ffffff;
}

    .pharmacy-panel-header > div:first-child {
        min-width: 0;
    }

    .pharmacy-panel-header h2 {
        margin: 0;
        color: var(--pharmacy-text);
        font-size: 15.5px;
        font-weight: 750;
    }

    .pharmacy-panel-header p {
        margin: 3px 0 0;
        color: var(--pharmacy-muted);
        font-size: 12.5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.revenue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.revenue-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.revenue-period-select {
    padding: 5px 12px;
    border: 1px solid var(--pharmacy-border);
    border-radius: 7px;
    font-size: 13px;
    font-weight: 650;
    color: var(--pharmacy-text);
    background: #ffffff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .revenue-period-select:focus {
        border-color: var(--pharmacy-primary);
        box-shadow: 0 0 0 2px rgba(42, 107, 130, 0.12);
    }

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-refresh-btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--pharmacy-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s ease, color 0.15s ease;
}

    .card-refresh-btn:hover {
        color: var(--pharmacy-primary);
        background: var(--pharmacy-primary-soft);
    }

    .card-refresh-btn.spinning i {
        animation: spin 0.8s linear infinite;
    }

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.panel-link-button {
    flex: 0 0 auto;
    padding: 5px 10px;
    color: var(--pharmacy-primary);
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
}

    .panel-link-button:hover {
        text-decoration: underline;
    }

.panel-count {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.panel-count-danger {
    color: var(--pharmacy-danger);
    background: var(--pharmacy-danger-soft);
}

.panel-count-warning {
    color: var(--pharmacy-warning);
    background: var(--pharmacy-warning-soft);
}

/* ============================================================
   PHARMACY BILLING & FINANCIAL SUMMARY
   ============================================================ */

.pharmacy-financial-panel {
    display: flex;
    flex-direction: column;
}

.pharmacy-revenue-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 14px 18px 8px;
}

.pharmacy-revenue-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .pharmacy-revenue-left label {
        color: var(--pharmacy-muted);
        font-size: 12.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .pharmacy-revenue-left h2 {
        margin: 6px 0 4px;
        color: var(--pharmacy-text);
        font-size: 28px;
        font-weight: 800;
        line-height: 1.1;
    }

    .pharmacy-revenue-left p {
        margin: 4px 0 0;
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 13px;
        font-weight: 700;
    }

.pharmacy-revenue-chart {
    min-width: 0;
    height: 195px;
    overflow: hidden;
}

.pharmacy-revenue-bottom {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    border-top: 1px solid #edf0f4;
    background: #fafcfd;
}

.pharmacy-payment-split,
.pharmacy-top-medicines {
    padding: 14px 18px;
}

.pharmacy-top-medicines {
    border-left: 1px solid #edf0f4;
}

    .pharmacy-payment-split h5,
    .pharmacy-top-medicines h5 {
        margin: 0 0 10px;
        color: var(--pharmacy-muted);
        font-size: 12px;
        font-weight: 750;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

.pharmacy-donut-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pharmacy-donut {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6 0% 100%);
    position: relative;
    flex-shrink: 0;
}

    .pharmacy-donut::after {
        content: "";
        position: absolute;
        inset: 18px;
        background: #fafcfd;
        border-radius: 50%;
    }

.pharmacy-payment-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

    .pharmacy-payment-list > div {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 12.5px;
        color: var(--pharmacy-text);
        white-space: nowrap;
    }

    .pharmacy-payment-list b {
        min-width: 55px;
        font-weight: 650;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pharmacy-payment-list small {
        margin-left: auto;
        color: var(--pharmacy-muted);
        font-size: 12px;
        font-weight: 700;
    }

.pharmacy-pay-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pharmacy-empty-tiny {
    color: var(--pharmacy-muted);
    font-size: 12px;
    font-style: italic;
}

.top-medicine-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px dashed #f0f3f6;
}

    .top-medicine-row:last-child {
        border-bottom: 0;
    }

    .top-medicine-row b {
        flex: 0 0 auto;
        color: var(--pharmacy-text);
        font-size: 13px;
        font-weight: 750;
    }

.top-medicine-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.medicine-name {
    color: var(--pharmacy-text);
    font-size: 13px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.medicine-sub {
    color: var(--pharmacy-muted);
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   BILL HISTORY (RECENT BILLS)
   ============================================================ */

.pharmacy-bill-history-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pharmacy-bill-history-list {
    min-height: 320px;
    max-height: 480px;
    padding: 6px 10px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* Modern slim scrollbar for list */
.pharmacy-bill-history-list::-webkit-scrollbar {
    width: 5px;
}

.pharmacy-bill-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.pharmacy-bill-history-list::-webkit-scrollbar-thumb {
    background: #d8dfe6;
    border-radius: 10px;
}

.pharmacy-bill-history-item {
    min-width: 0;
    min-height: 56px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #edf0f4;
    transition: background 0.15s ease;
}

    .pharmacy-bill-history-item:last-child {
        border-bottom: 0;
    }

    .pharmacy-bill-history-item:hover {
        background: #f8fbfc;
        border-radius: 8px;
    }

.bill-history-patient {
    min-width: 0;
}

    .bill-history-patient strong,
    .bill-history-patient span {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bill-history-patient strong {
        color: var(--pharmacy-text);
        font-size: 13.5px;
        font-weight: 700;
    }

    .bill-history-patient span {
        margin-top: 3px;
        color: var(--pharmacy-muted);
        font-size: 11.5px;
    }

        .bill-history-patient span i {
            width: 3px;
            height: 3px;
            margin: 0 5px;
            display: inline-block;
            vertical-align: middle;
            background: #aab3bf;
            border-radius: 50%;
        }

.bill-history-amount {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
}

    .bill-history-amount > strong {
        color: var(--pharmacy-text);
        font-size: 14px;
        font-weight: 800;
    }

.bill-report-button {
    min-height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--pharmacy-primary);
    background: var(--pharmacy-primary-soft);
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

    .bill-report-button:hover {
        color: #ffffff;
        background: var(--pharmacy-primary);
    }

.patient-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--pharmacy-primary);
    background: var(--pharmacy-primary-soft);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 750;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */

.pharmacy-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 23px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.bill-status-paid,
.status-dispensed {
    color: #147a4d;
    background: #e5f7ee;
}

.bill-status-pending,
.status-pending {
    color: #a76105;
    background: #fff1d7;
}

.bill-status-partial,
.status-partial {
    color: #5a53c8;
    background: #efedff;
}

.bill-status-cancelled,
.status-cancelled,
.status-out-stock {
    color: #bf3434;
    background: #ffebeb;
}

.status-critical {
    color: #c64242;
    background: #fff0f0;
}

.status-low-stock {
    color: #b86a07;
    background: #fff3dc;
}

.status-default {
    color: #596576;
    background: #edf1f5;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.pharmacy-empty-state {
    min-height: 270px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--pharmacy-muted);
    text-align: center;
}

    .pharmacy-empty-state i {
        margin-bottom: 10px;
        font-size: 32px;
    }

    .pharmacy-empty-state strong {
        color: var(--pharmacy-text);
        font-size: 14px;
    }

    .pharmacy-empty-state span {
        margin-top: 4px;
        font-size: 12px;
    }

/* ============================================================
   ALERT GRIDS
   ============================================================ */

.pharmacy-alert-grid {
    width: 100%;
    min-width: 0;
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pharmacy-grid-panel {
    height: 350px;
    display: flex;
    flex-direction: column;
}

.pharmacy-grid-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.medicine-cell {
    min-width: 0;
}

    .medicine-cell strong,
    .medicine-cell span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .medicine-cell strong {
        color: var(--pharmacy-text);
        font-size: 13px;
        font-weight: 700;
    }

    .medicine-cell span {
        margin-top: 2px;
        /*color: var(--pharmacy-muted);*/
        font-size: 11.5px;
    }

.grid-action-button {
    min-height: 28px;
    padding: 3px 11px;
    color: var(--pharmacy-primary);
    background: var(--pharmacy-primary-soft);
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

    .grid-action-button:hover {
        color: #ffffff;
        background: var(--pharmacy-primary);
    }

.grid-icon-button {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    color: var(--pharmacy-primary);
    background: transparent;
    border: 1px solid var(--pharmacy-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .grid-icon-button:hover {
        color: #ffffff;
        background: var(--pharmacy-primary);
        border-color: var(--pharmacy-primary);
    }

.expiry-days {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 65px;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.expiry-expired {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.expiry-critical {
    color: #bf3434;
    background: #ffebeb;
}

.expiry-warning {
    color: #b86a07;
    background: #fff3dc;
}

.expiry-normal {
    color: #536174;
    background: #edf1f5;
}

/* ============================================================
   SYNCFUSION DROPDOWN & INPUTS
   ============================================================ */

.pharmacy-page .pharmacy-location-dropdown.e-control-wrapper,
.pharmacy-page .pharmacy-location-dropdown .e-input-group {
    width: 225px;
}

.pharmacy-page .e-input-group,
.pharmacy-page .e-input-group.e-control-wrapper {
    border-radius: 7px;
}

/* ============================================================
   SYNCFUSION GRID OVERRIDES
   ============================================================ */

.pharmacy-page .e-grid {
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    font-family: inherit;
    font-size: 12.5px;
}

    .pharmacy-page .e-grid .e-gridheader {
        border-top: 0;
        border-bottom-color: #e7ebf0;
    }

    .pharmacy-page .e-grid .e-headercontent {
        border-right: 0;
    }

    .pharmacy-page .e-grid .e-headercell {
        height: 38px;
        padding: 0 12px;
        background: #f7f9fb;
    }

    .pharmacy-page .e-grid .e-headercelldiv {
        color: #596576;
        font-size: 11.5px;
        font-weight: 750;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .pharmacy-page .e-grid .e-rowcell {
        height: 46px;
        padding: 6px 12px;
        color: #344054;
        border-color: #edf0f4;
        font-size: 12.5px;
        font-weight: 500;
    }

    .pharmacy-page .e-grid .e-row:hover .e-rowcell {
        background: #f8fbfc;
    }

    .pharmacy-page .e-grid .e-emptyrow td {
        padding: 16px;
        color: var(--pharmacy-muted);
        font-size: 12px;
    }

    .pharmacy-page .e-grid .e-gridcontent,
    .pharmacy-page .e-grid .e-content {
        height: calc(100% - 39px) !important;
    }

/* ============================================================
   BILL DIALOG
   ============================================================ */

.pharmacy-bill-dialog.e-dialog {
    border-radius: 10px;
    overflow: hidden;
}

.pharmacy-bill-dialog .e-dlg-header-content {
    padding: 14px 18px;
    background: #ffffff;
    border-bottom: 1px solid var(--pharmacy-border);
}

.pharmacy-bill-dialog .e-dlg-content {
    padding: 0 !important;
    background: #f6f8fb;
}

.bill-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bill-dialog-title-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--pharmacy-primary);
    background: var(--pharmacy-primary-soft);
    border-radius: 8px;
    font-size: 20px;
}

.bill-dialog-header strong,
.bill-dialog-header span {
    display: block;
}

.bill-dialog-header strong {
    color: var(--pharmacy-text);
    font-size: 15px;
    font-weight: 700;
}

.bill-dialog-header span {
    margin-top: 2px;
    color: var(--pharmacy-muted);
    font-size: 12px;
}

.bill-dialog-loading {
    min-height: 240px;
    display: grid;
    place-items: center;
    color: var(--pharmacy-muted);
    font-size: 13px;
}

.pharmacy-bill-dialog-content {
    padding: 0;
}

.bill-dialog-actions {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: #f7f9fb;
    border-bottom: 1px solid var(--pharmacy-border);
}

.pharmacy-bill-print-area {
    margin: 16px;
    padding: 22px;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
}

.bill-document-header {
    padding-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.bill-type-tag {
    display: inline-block;
    padding: 2px 7px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.bill-store-name {
    margin: 0;
    color: var(--pharmacy-text);
    font-size: 16px;
    font-weight: 700;
}

.bill-document-number {
    text-align: right;
}

.bill-number-label {
    display: block;
    color: var(--pharmacy-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bill-number-value {
    display: block;
    margin-top: 1px;
    color: var(--pharmacy-text);
    font-size: 15px;
    font-weight: 750;
}

.bill-date-value {
    display: block;
    margin-top: 2px;
    color: var(--pharmacy-muted);
    font-size: 11px;
}

.bill-patient-section,
.bill-medicine-section {
    margin-top: 16px;
}

.bill-section-title {
    margin-bottom: 10px;
    padding-bottom: 5px;
    color: var(--pharmacy-primary);
    border-bottom: 1px solid #e6eaf0;
    font-size: 11.5px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.bill-patient-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    padding: 12px 16px;
}

.bill-field label {
    display: block;
    color: var(--pharmacy-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bill-field span {
    display: block;
    margin-top: 2px;
    color: var(--pharmacy-text);
    font-size: 12.5px;
    font-weight: 600;
}

.bill-table-wrapper {
    overflow-x: auto;
}

.bill-medicine-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.bill-medicine-table th {
    padding: 8px 10px;
    color: #475467;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bill-medicine-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.bill-medicine-table tr:hover td {
    background: #f8fafc;
}

.bill-medicine-name strong {
    display: block;
    color: var(--pharmacy-text);
    font-size: 12.5px;
}

.bill-medicine-name span {
    display: block;
    color: var(--pharmacy-muted);
    font-size: 11px;
    margin-top: 1px;
}

.bill-summary-section {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.bill-payment-information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    padding: 12px 14px;
    align-content: start;
}

.bill-total-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bill-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--pharmacy-text);
}

.bill-total-row span:last-child {
    font-weight: 600;
}

.bill-total-row.bill-net-total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 2px solid #0f172a;
    font-size: 14px;
    font-weight: 800;
    color: var(--pharmacy-primary);
}

.bill-total-row.bill-net-total span:last-child {
    font-size: 15px;
    font-weight: 800;
}

.bill-dialog-footer {
    padding: 10px 16px;
    display: flex;
    justify-content: flex-end;
    background: #ffffff;
    border-top: 1px solid var(--pharmacy-border);
}

/* ============================================================
   RESPONSIVE DESIGN (All breakpoints)
   ============================================================ */

@media (max-width: 1400px) {
    .pharmacy-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1150px) {
    .pharmacy-dashboard-main-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pharmacy-alert-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .pharmacy-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .pharmacy-header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .pharmacy-location-dropdown {
        flex: 1 1 220px;
        width: auto;
    }

    .pharmacy-page .pharmacy-location-dropdown.e-control-wrapper,
    .pharmacy-page .pharmacy-location-dropdown .e-input-group {
        width: 100%;
    }

    .pharmacy-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pharmacy-revenue-bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    .pharmacy-top-medicines {
        border-left: 0;
        border-top: 1px solid #edf0f4;
    }
}

@media (max-width: 650px) {
    .pharmacy-title-group h1 {
        font-size: 18px;
    }

    .pharmacy-title-group p {
        font-size: 12px;
    }

    .pharmacy-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .pharmacy-location-dropdown {
        grid-column: 1 / -1;
        width: 100%;
    }

    .pharmacy-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pharmacy-revenue-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .pharmacy-bill-history-item {
        grid-template-columns: 36px minmax(0, 1fr) auto;
    }

    .bill-report-button {
        grid-column: 2 / -1;
        justify-self: start;
    }

    .bill-patient-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

/* ============================================================
   SUSPEND / QUARANTINE DIALOG
   ============================================================ */

.pharmacy-suspend-dialog.e-dialog {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
}

.pharmacy-suspend-dialog .e-dlg-header-content {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--pharmacy-border);
}

.pharmacy-suspend-dialog .e-dlg-header-content .e-btn.e-dlg-closeicon-btn {
    top: 16px;
    right: 16px;
}

.suspend-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.suspend-dialog-title-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #d54444;
    background: #fff0f0;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    font-size: 20px;
    flex-shrink: 0;
}

.suspend-dialog-header strong {
    display: block;
    color: var(--pharmacy-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.suspend-dialog-header span {
    display: block;
    margin-top: 3px;
    color: var(--pharmacy-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
}

.pharmacy-suspend-dialog .e-dlg-content {
    padding: 20px !important;
    background: #ffffff;
}

.suspend-dialog-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 8px;
    padding: 12px 14px;
    color: #92400e;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.suspend-dialog-warning i {
    font-size: 18px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 1px;
}

.pharmacy-suspend-dialog .e-footer-content {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--pharmacy-border);
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    .pharmacy-bill-print-area {
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
    }

    .bill-dialog-actions {
        display: none !important;
    }
}