﻿/* ============================================
   PHARMACY POS — Page-specific Styles
   ============================================ */

/* ---- Dashboard ---- */
.dashboard-chart-card {
    grid-column: span 2;
}

.chart-container {
    position: relative;
    height: 280px;
    padding-top: var(--space-md);
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.recent-list {
    max-height: 320px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.recent-item-text {
    display: flex;
    flex-direction: column;
}

.recent-item-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.recent-item-sub {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.recent-item-right {
    text-align: right;
}

.recent-item-amount {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.recent-item-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ---- Low Stock Alerts ---- */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.alert-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    background: var(--color-danger-light);
    border-radius: var(--radius-md);
    border: 1px solid rgba(225, 112, 85, 0.15);
}

.alert-item.warning-level {
    background: var(--color-warning-light);
    border-color: rgba(253, 203, 110, 0.15);
}

.alert-item-icon {
    font-size: 18px;
}

.alert-item-text {
    flex: 1;
    font-size: var(--font-size-sm);
}

.alert-item-stock {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
}

/* ---- Products Page ---- */
.products-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.products-toolbar .search-bar {
    flex: 1;
    min-width: 240px;
}

.products-toolbar .filter-group {
    display: flex;
    gap: var(--space-sm);
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stock-dot.in-stock {
    background: var(--color-success);
}

.stock-dot.low-stock {
    background: var(--color-warning);
}

.stock-dot.out-of-stock {
    background: var(--color-danger);
}

/* ---- Customers Page ---- */
.customer-details {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-lg);
}

.customer-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.customer-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: white;
    margin-bottom: var(--space-md);
}

.customer-stat {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    font-size: var(--font-size-sm);
}

.customer-stat:last-child {
    border: none;
}

.customer-stat-label {
    color: var(--text-muted);
}

.customer-stat-value {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

/* ---- Clinic Consultations ---- */
.clinic-header,
.clinic-actions,
.clinic-tabs,
.clinic-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.clinic-header {
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.clinic-tabs {
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.clinic-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.clinic-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    font-weight: var(--font-weight-semibold);
}

.clinic-toolbar {
    margin-bottom: var(--space-md);
}

.clinic-toolbar .search-bar {
    max-width: 520px;
    width: 100%;
}

.clinic-shell {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

.clinic-list,
.clinic-detail,
.clinic-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.clinic-list {
    padding: var(--space-sm);
    max-height: calc(100vh - 250px);
    overflow: auto;
}

.clinic-detail {
    min-height: 520px;
    padding: var(--space-lg);
}

.clinic-visit-card {
    width: 100%;
    display: block;
    text-align: left;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    margin-bottom: 8px;
}

.clinic-visit-card:hover,
.clinic-visit-card.active {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.clinic-visit-main,
.clinic-visit-meta,
.clinic-visit-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.clinic-visit-main span,
.clinic-visit-meta,
.clinic-visit-foot {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.clinic-visit-meta {
    margin: 8px 0;
    align-items: center;
}

.clinic-empty-detail {
    height: 100%;
    min-height: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.clinic-file-header,
.clinic-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.clinic-file-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
}

.clinic-file-header h3 {
    margin: 4px 0;
    font-size: 1.35rem;
}

.clinic-file-header p,
.clinic-file-kicker {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin: 0;
}

.clinic-file-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.clinic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.clinic-panel {
    padding: var(--space-md);
}

.clinic-panel h4 {
    margin: 0 0 var(--space-sm);
}

.clinic-notes label {
    display: block;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    margin-top: var(--space-sm);
}

.clinic-notes p {
    margin: 4px 0 0;
    white-space: pre-wrap;
}

.clinic-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    background: #e5e7eb;
    white-space: nowrap;
}

.clinic-status.lab-requested,
.clinic-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.clinic-status.lab-completed,
.clinic-status.available,
.clinic-status.dispensed {
    background: #dcfce7;
    color: #166534;
}

.clinic-status.pharmacy-pending,
.clinic-status.open {
    background: #dbeafe;
    color: #1d4ed8;
}

.clinic-status.partially-dispensed,
.clinic-status.external-prescription,
.clinic-status.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.clinic-lab-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-top: var(--space-sm);
}

.clinic-lab-card p {
    margin: 6px 0;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.clinic-lab-result {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin: var(--space-sm) 0;
}

.clinic-table td,
.clinic-table th {
    vertical-align: top;
}

.clinic-billing-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 12px;
}

.clinic-billing-summary span {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 7px 10px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.clinic-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.clinic-span-2 {
    grid-column: span 2;
}

.clinic-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

@media (max-width: 1100px) {
    .clinic-shell,
    .clinic-grid {
        grid-template-columns: 1fr;
    }

    .clinic-list {
        max-height: 360px;
    }
}

@media (max-width: 700px) {
    .clinic-header,
    .clinic-file-header,
    .clinic-panel-head {
        flex-direction: column;
    }

    .clinic-form-grid {
        grid-template-columns: 1fr;
    }

    .clinic-span-2 {
        grid-column: span 1;
    }
}

/* ---- Reports Page ---- */
.report-filters {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.report-card {
    padding: var(--space-lg);
}

.top-products-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.top-product-rank {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.top-product-info {
    flex: 1;
}

.top-product-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.top-product-qty {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.top-product-revenue {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    transition: width var(--transition-slow);
}

/* ---- Settings ---- */
.settings-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-lg);
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-nav-item {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.settings-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
    animation: fadeIn var(--transition-base) ease;
}

.settings-section h3 {
    margin-bottom: var(--space-lg);
}

.settings-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

/* ---- Receipt Modal ---- */
.receipt {
    background: white;
    color: #333;
    padding: var(--space-xl);
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    max-width: 320px;
    margin: 0 auto;
}

.receipt-header {
    text-align: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 2px dashed #ddd;
}

.receipt-header h3 {
    color: #333;
    font-size: var(--font-size-md);
}

.receipt-header p {
    font-size: var(--font-size-xs);
    color: #666;
}

.receipt-items {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 2px dashed #ddd;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    padding: 3px 0;
    color: #333;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: var(--font-size-md);
    padding: var(--space-sm) 0;
    border-top: 2px dashed #ddd;
    margin-top: var(--space-sm);
    color: #333;
}

.receipt-footer {
    text-align: center;
    margin-top: var(--space-md);
    font-size: var(--font-size-xs);
    color: #999;
}

/* Payment method buttons in checkout modal */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.payment-method-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.payment-method-btn.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.payment-method-btn .method-icon {
    font-size: 24px;
}

/* Category filter pills */
.category-pills {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
}

.category-pill {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.category-pill:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.category-pill.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ---- Breadcrumbs ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

.breadcrumb-item {
    cursor: default;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.5;
}

/* ---- Purchase Orders Toolbar ---- */
.po-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.po-search {
    flex: 0 1 280px;
    min-width: 200px;
}

.po-date-range {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.po-date-icon {
    font-size: 14px;
}

.po-date-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    width: 140px;
}

.po-date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

/* ---- Product Settings / Transfer Tabs ---- */
.ps-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
}

.ps-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ps-tab:hover {
    color: var(--text-primary);
}

.ps-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.ps-tab-icon {
    font-size: 14px;
}

/* ---- Stock Taking Toolbar ---- */
.st-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.st-search {
    flex: 0 1 260px;
    min-width: 180px;
}

.st-select-wrap {
    flex: 0 0 auto;
}

.st-branch-select {
    min-width: 160px;
}

.st-items-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.st-filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Print Styles for Receipts ---- */
@media print {
    body * {
        visibility: hidden;
    }

    #receiptModal,
    #receiptModal * {
        visibility: visible;
    }

    #receiptModal {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        padding: 0;
        background: white;
        box-shadow: none;
        width: 100%;
    }

    .modal-header,
    .modal-footer {
        display: none !important;
    }

    .modal-body {
        padding: 0;
    }

    .receipt {
        max-width: 100%;
        margin: 0;
        padding: 0;
        border: none;
    }
}

/* ---- Dashboard Background ---- */
.dashboard-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url('../assets/pharmacy_bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: calc(100vh - 64px);
}

/* ---- AI Report PDF Export ---- */
.ai-pdf-wrapper {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 7.75in;
    background: #ffffff;
    color: #172033;
    padding: 0;
    font-family: 'DM Sans', Arial, sans-serif;
    z-index: -1;
}

.ai-pdf-cover {
    background: #9D1F6C;
    color: #ffffff;
    padding: 28px 30px;
    margin-bottom: 18px;
}

.ai-pdf-brand {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    opacity: 0.9;
}

.ai-pdf-cover h1 {
    margin: 8px 0;
    font-size: 28px;
    line-height: 1.1;
    color: #ffffff;
}

.ai-pdf-cover p {
    margin: 0;
    font-size: 12px;
    opacity: 0.86;
}

.ai-pdf-wrapper #aiReportPdfClone {
    padding: 0 22px 22px;
}

.ai-pdf-wrapper .grid-4,
.ai-pdf-wrapper .grid-3,
.ai-pdf-wrapper .grid-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
}

.ai-pdf-wrapper .kpi-card,
.ai-pdf-wrapper .card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
    background: #ffffff !important;
    color: #172033 !important;
}

.ai-pdf-wrapper .kpi-card {
    min-height: auto !important;
    padding: 12px !important;
}

.ai-pdf-wrapper .kpi-value {
    font-size: 18px !important;
    color: #172033 !important;
}

.ai-pdf-wrapper .kpi-label,
.ai-pdf-wrapper .text-muted {
    color: #64748b !important;
}

.ai-pdf-wrapper .card {
    padding: 14px !important;
    border-radius: 8px !important;
}

.ai-pdf-wrapper .card[style*="grid-column"] {
    grid-column: span 2 !important;
}

.ai-pdf-wrapper .card-header {
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.ai-pdf-wrapper .card-title {
    color: #172033 !important;
    font-size: 14px !important;
}

.ai-pdf-wrapper img {
    max-height: 230px;
    object-fit: contain;
}

.ai-pdf-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.ai-pdf-wrapper th,
.ai-pdf-wrapper td {
    padding: 6px 7px !important;
    border-bottom: 1px solid #edf0f5 !important;
    color: #172033 !important;
}

.ai-pdf-wrapper th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 9px;
    text-transform: uppercase;
}

.ai-pdf-wrapper .table-container {
    overflow: visible !important;
}

.dashboard-bg .page-header {
    background: transparent;
    border-bottom: none;
    color: white;
}

.dashboard-bg .page-title,
.dashboard-bg .page-subtitle,
.dashboard-bg .page-header-actions span {
    color: white !important;
}

/* Translucent cards for dashboard override - Light Mode */
.dashboard-bg .card,
.dashboard-bg .kpi-card {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    border-color: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

.dashboard-bg .card-title,
.dashboard-bg .kpi-label,
.dashboard-bg .kpi-value,
.dashboard-bg .recent-item-title,
.dashboard-bg .recent-item-sub,
.dashboard-bg .text-muted,
.dashboard-bg .empty-state p {
    color: #0f172a !important;
}

/* Translucent cards for dashboard override - Dark Mode */
body.dark-theme .dashboard-bg .card,
body.dark-theme .dashboard-bg .kpi-card {
    background: rgba(15, 23, 42, 0.75) !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    color: white;
}

body.dark-theme .dashboard-bg .card-title,
body.dark-theme .dashboard-bg .kpi-label,
body.dark-theme .dashboard-bg .kpi-value,
body.dark-theme .dashboard-bg .recent-item-title,
body.dark-theme .dashboard-bg .recent-item-sub,
body.dark-theme .dashboard-bg .text-muted,
body.dark-theme .dashboard-bg .empty-state p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ---- Online Orders ---- */
.online-orders-page .section-header {
    margin-bottom: var(--space-md);
}

.online-order-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-md);
}

.online-order-tab {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.online-order-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.online-order-tab span {
    margin-left: 6px;
    opacity: 0.8;
}

.online-order-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: var(--space-md);
}

.online-order-summary .summary-card {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 8px;
    padding: 14px;
}

.online-order-summary .summary-card span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.online-order-summary .summary-card strong {
    color: var(--text-primary);
    font-size: 22px;
}

.online-order-modal {
    max-width: 760px;
    width: min(760px, calc(100vw - 32px));
    margin: 0 auto;
}

.online-order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.online-order-detail-grid h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.online-order-detail-grid p {
    margin: 4px 0;
}

@media (max-width: 720px) {
    .online-order-detail-grid {
        grid-template-columns: 1fr;
    }

    .online-order-modal {
        width: min(100%, calc(100vw - 24px));
        max-height: calc(100vh - 24px);
    }
}

.online-order-totals {
    margin-left: auto;
    margin-top: var(--space-md);
    max-width: 320px;
}

.online-order-totals div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.online-order-totals .grand {
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 10px;
    font-size: 18px;
    color: var(--accent-primary);
}

@media (max-width: 700px) {
    .online-order-summary,
    .online-order-detail-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 820px) {
  .inventory-import-layout {
    grid-template-columns: 1fr !important;
  }

  .inventory-import-fields {
    grid-template-columns: 1fr !important;
  }

  .inventory-import-layout aside {
    position: static !important;
  }
}

@media (max-width: 900px) {
  .supplier-ledger-layout {
    grid-template-columns: 1fr !important;
  }

  .supplier-ledger-layout > aside > div:last-child {
    max-height: 260px !important;
  }

  .supplier-ledger-summary {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
  }
}
