/* =========================================================
   PHARMCY PHARMACY MANAGEMENT SYSTEM
   Professional Stylesheet
   ========================================================= */

:root {
    --primary: #0f8b72;
    --primary-dark: #08735e;
    --primary-light: #e8f7f3;

    --text: #17211f;
    --text-secondary: #66736f;
    --text-light: #8b9692;

    --background: #f5f8f7;
    --surface: #ffffff;
    --border: #e3ebe8;

    --success: #1d9b73;
    --warning: #d89520;
    --danger: #d64b4b;

    --sidebar-width: 260px;
    --topbar-height: 78px;

    --radius: 14px;
    --shadow: 0 4px 18px rgba(22, 42, 36, 0.05);
    --shadow-lg: 0 12px 35px rgba(22, 42, 36, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* =========================================================
   APP
   ========================================================= */

.app {
    display: flex;
    min-height: 100vh;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
}

.brand-text {
    margin-left: 12px;
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.brand-text span {
    display: block;
    margin-top: 2px;
    color: var(--text-light);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 25px;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.navigation {
    flex: 1;
    padding: 22px 13px;
    overflow-y: auto;
}

.nav-label {
    margin: 18px 11px 8px;
    color: #a0aaa7;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.nav-label:first-child {
    margin-top: 0;
}

.nav-item {
    width: 100%;
    height: 44px;
    border: 0;
    background: transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: 0.2s ease;
}

.nav-item:hover {
    background: #f1f6f4;
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f6faf8;
    padding: 12px;
    border-radius: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
}

.system-status strong {
    display: block;
    font-size: 11px;
    color: var(--text);
}

.system-status small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    color: var(--text-light);
}

/* =========================================================
   MAIN
   ========================================================= */

.main {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-width: 0;
}

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 500;
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar h2 {
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.4px;
}

.topbar p {
    margin-top: 3px;
    color: var(--text-light);
    font-size: 11px;
}

.menu-button {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: var(--text-secondary);
    font-size: 18px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-action {
    border: 0;
    background: var(--primary);
    color: white;
    padding: 10px 15px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: 0.2s ease;
}

.topbar-action:hover {
    background: var(--primary-dark);
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    background: #e5f3ef;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.profile-info strong {
    display: block;
    font-size: 11px;
}

.profile-info span {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    color: var(--text-light);
}

/* =========================================================
   CONTENT
   ========================================================= */

.content {
    padding: 30px;
}

.page-section {
    display: none;
    animation: fadeIn 0.2s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.section-heading h3 {
    font-size: 21px;
    letter-spacing: -0.5px;
}

.section-heading p {
    color: var(--text-secondary);
    margin-top: 5px;
    font-size: 12px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.primary-button,
.secondary-button,
.danger-button {
    border: 0;
    border-radius: 9px;
    min-height: 40px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    transition: 0.2s ease;
}

.primary-button {
    background: var(--primary);
    color: white;
}

.primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.secondary-button {
    background: #eef4f2;
    color: var(--text);
}

.secondary-button:hover {
    background: #e3ece9;
}

.danger-button {
    background: #fff0f0;
    color: var(--danger);
}

.danger-button:hover {
    background: #ffe3e3;
}

.text-button,
.danger-text-button {
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
}

.text-button {
    color: var(--primary);
}

.danger-text-button {
    color: var(--danger);
}

/* =========================================================
   STAT CARDS
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.sales-icon {
    background: #e8f7f3;
    color: var(--primary);
}

.product-icon {
    background: #edf3ff;
    color: #4870c8;
}

.stock-icon {
    background: #fff5df;
    color: #c88816;
}

.profit-icon {
    background: #eaf8ee;
    color: #29935c;
}

.stat-content span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
}

.stat-content strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.stat-content small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 9px;
}

.positive {
    color: var(--success) !important;
}

.warning-text {
    color: var(--warning) !important;
}

/* =========================================================
   PANELS
   ========================================================= */

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--border);
}

.panel-header h4 {
    font-size: 13px;
    font-weight: 750;
}

.panel-header p {
    margin-top: 3px;
    color: var(--text-light);
    font-size: 10px;
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 20px;
}

.large-panel {
    min-width: 0;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8faf9;
    color: #78837f;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 12px 15px;
    text-align: left;
    white-space: nowrap;
}

td {
    border-top: 1px solid #edf1ef;
    padding: 13px 15px;
    font-size: 11px;
    white-space: nowrap;
}

tbody tr:hover {
    background: #fafcfb;
}

.alert-list {
    padding: 8px 15px 15px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 5px;
    border-bottom: 1px solid #edf1ef;
}

.alert-item:last-child {
    border-bottom: 0;
}

.alert-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warning);
}

.alert-indicator.danger {
    background: var(--danger);
}

.alert-item strong {
    display: block;
    font-size: 10px;
}

.alert-item span {
    display: block;
    margin-top: 2px;
    color: var(--text-light);
    font-size: 9px;
}

/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 700;
}

.badge-success {
    background: #e9f7ef;
    color: var(--success);
}

.badge-warning {
    background: #fff4dc;
    color: #b9790c;
}

.badge-danger {
    background: #fff0f0;
    color: var(--danger);
}

.badge-neutral {
    background: #eef2f1;
    color: var(--text-secondary);
}

/* =========================================================
   SEARCH / TOOLBAR
   ========================================================= */

.toolbar {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.search-box {
    height: 40px;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0 12px;
    background: white;
}

.search-box span {
    color: var(--text-light);
    font-size: 17px;
}

.search-box input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 11px;
}

.search-box input::placeholder {
    color: #a3aca9;
}

/* =========================================================
   POS
   ========================================================= */

.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.pos-search {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.pos-search .search-box {
    width: 100%;
}

.category-filter {
    padding: 12px 16px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.category-btn {
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 700;
}

.category-btn.active,
.category-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #ccebe3;
}

.product-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: calc(100vh - 290px);
    min-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.product-card {
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 13px;
    background: white;
    transition: 0.2s ease;
}

.product-card:hover {
    border-color: #b8ddd4;
    box-shadow: 0 6px 18px rgba(15, 139, 114, 0.08);
    transform: translateY(-1px);
}

.product-card.disabled {
    opacity: 0.5;
}

.product-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.product-icon-small {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
}

.product-stock {
    color: var(--text-light);
    font-size: 8px;
}

.product-card h5 {
    margin-top: 12px;
    font-size: 11px;
    line-height: 1.35;
}

.product-category {
    margin-top: 3px;
    color: var(--text-light);
    font-size: 8px;
}

.product-card-bottom {
    margin-top: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary);
}

.add-product-button {
    border: 0;
    width: 27px;
    height: 27px;
    border-radius: 7px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    line-height: 1;
}

.sale-cart {
    position: sticky;
    top: 100px;
}

.cart-items {
    max-height: 280px;
    overflow-y: auto;
}

.cart-item {
    padding: 13px 16px;
    border-bottom: 1px solid #edf1ef;
}

.cart-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.cart-item-name {
    font-size: 10px;
    font-weight: 700;
}

.cart-item-price {
    margin-top: 3px;
    color: var(--primary);
    font-size: 9px;
}

.remove-cart {
    border: 0;
    background: transparent;
    color: #a0aaa7;
    font-size: 16px;
}

.quantity-control {
    margin-top: 9px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.quantity-control button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    color: var(--text);
}

.quantity-control span {
    min-width: 25px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
}

.sale-form {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.form-group {
    margin-bottom: 13px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    min-height: 38px;
    padding: 0 10px;
    color: var(--text);
    font-size: 10px;
}

.form-group textarea {
    padding: 10px;
    resize: vertical;
}

.discount-row {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 8px;
}

.totals {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.totals > div {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: var(--text-secondary);
    font-size: 10px;
}

.totals strong {
    color: var(--text);
}

.grand-total {
    padding-top: 10px !important;
    margin-top: 4px;
    border-top: 1px dashed var(--border);
    color: var(--text) !important;
    font-size: 13px !important;
    font-weight: 700;
}

.grand-total strong {
    color: var(--primary);
    font-size: 17px;
}

.change-box {
    margin: 10px 0;
    background: #f3f9f7;
    border-radius: 9px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 10px;
}

.change-box strong {
    color: var(--success);
}

.complete-sale-button {
    width: 100%;
    height: 43px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 750;
    transition: 0.2s ease;
}

.complete-sale-button:hover {
    background: var(--primary-dark);
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 35px 20px;
    text-align: center;
    color: var(--text-light);
}

.empty-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border-radius: 10px;
    background: #f0f4f3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.empty-state h5 {
    color: var(--text-secondary);
    font-size: 11px;
}

.empty-state p {
    margin-top: 4px;
    font-size: 9px;
}

/* =========================================================
   INVENTORY
   ========================================================= */

.inventory-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.inventory-summary {
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.inventory-summary span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
}

.inventory-summary strong {
    display: block;
    margin-top: 7px;
    font-size: 24px;
}

.warning-card strong {
    color: var(--warning);
}

.danger-card strong {
    color: var(--danger);
}

/* =========================================================
   REPORTS
   ========================================================= */

.report-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.report-stat {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.report-stat span {
    color: var(--text-secondary);
    font-size: 10px;
}

.report-stat strong {
    display: block;
    margin-top: 7px;
    color: var(--primary);
    font-size: 22px;
}

.report-chart {
    min-height: 230px;
    padding: 20px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.chart-bar-container {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: flex-end;
}

.chart-bar {
    width: 100%;
    min-height: 3px;
    border-radius: 5px 5px 2px 2px;
    background: var(--primary);
}

.chart-column span {
    color: var(--text-light);
    font-size: 8px;
}

.chart-value {
    color: var(--text-secondary) !important;
    font-size: 8px !important;
}

/* =========================================================
   SETTINGS
   ========================================================= */

.settings-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.settings-form {
    padding: 20px;
}

.danger-panel {
    border-color: #f0dada;
}

.danger-box {
    padding: 20px;
}

.danger-box h5 {
    font-size: 12px;
}

.danger-box p {
    margin: 8px 0 18px;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.6;
}

/* =========================================================
   MODALS
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(18, 31, 27, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 3000;
    backdrop-filter: blur(3px);
}

.modal.show {
    display: flex;
}

.modal-content {
    width: min(650px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.small-modal {
    width: min(480px, 100%);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.modal-header h3 {
    font-size: 16px;
}

.modal-header p {
    margin-top: 4px;
    color: var(--text-light);
    font-size: 10px;
}

.modal-close {
    border: 0;
    background: #f3f6f5;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 20px;
}

.modal-content form {
    padding: 20px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.full-width {
    grid-column: 1 / -1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

/* =========================================================
   TOAST
   ========================================================= */

.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    max-width: 350px;
    padding: 13px 17px;
    border-radius: 10px;
    background: #17211f;
    color: white;
    font-size: 11px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateY(80px);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    z-index: 5000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--primary);
}

.toast.error {
    background: var(--danger);
}

/* =========================================================
   SIDEBAR OVERLAY
   ========================================================= */

.sidebar-overlay {
    display: none;
}

/* =========================================================
   PRINT AREA
   ========================================================= */

#printArea {
    display: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .stats-grid,
    .inventory-cards,
    .report-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 900px) {

    :root {
        --sidebar-width: 240px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 900;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .menu-button {
        display: block;
    }

    .pos-layout,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .sale-cart {
        position: static;
    }

}

@media (max-width: 700px) {

    .product-grid {
        min-height: 360px;
        max-height: calc(100vh - 300px);
    }

    .content {
        padding: 20px 15px;
    }

    .topbar {
        padding: 0 15px;
    }

    .profile-info {
        display: none;
    }

    .topbar-action {
        padding: 9px 11px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid,
    .inventory-cards,
    .report-stats {
        grid-template-columns: 1fr 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }

    .search-box {
        min-width: 0;
        width: 100%;
    }

    .toolbar {
        align-items: stretch;
    }

}

@media (max-width: 480px) {

    .stats-grid,
    .inventory-cards,
    .report-stats {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .topbar-action {
        display: none;
    }

    .topbar h2 {
        font-size: 16px;
    }

    .section-heading h3 {
        font-size: 18px;
    }

    .content {
        padding: 17px 12px;
    }

}

/* =========================================================
   PRINT
   ========================================================= */

@media print {

    body {
        background: white;
    }

    body * {
        visibility: hidden !important;
    }

    #printArea,
    #printArea * {
        visibility: visible !important;
    }

    #printArea {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        padding: 4mm;
        color: #000;
        background: #fff;
        font-family: Arial, sans-serif;
    }

    .receipt {
        width: 100%;
        font-size: 11px;
    }

    .receipt-header {
        text-align: center;
        margin-bottom: 10px;
    }

    .receipt-header h2 {
        margin: 0;
        font-size: 17px;
        font-weight: 800;
    }

    .receipt-header p {
        margin: 3px 0;
        font-size: 9px;
    }

    .receipt-divider {
        border-top: 1px dashed #000;
        margin: 8px 0;
    }

    .receipt-meta {
        font-size: 9px;
        line-height: 1.5;
    }

    .receipt-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 7px;
    }

    .receipt-table th,
    .receipt-table td {
        border: 0;
        padding: 3px 0;
        font-size: 9px;
        color: #000;
    }

    .receipt-table th {
        background: none;
        text-transform: none;
    }

    .receipt-table td:last-child,
    .receipt-table th:last-child {
        text-align: right;
    }

    .receipt-total {
        margin-top: 8px;
        font-size: 10px;
    }

    .receipt-total div {
        display: flex;
        justify-content: space-between;
        padding: 2px 0;
    }

    .receipt-total .final {
        font-size: 13px;
        font-weight: 800;
        border-top: 1px dashed #000;
        margin-top: 4px;
        padding-top: 6px;
    }

    .receipt-footer {
        text-align: center;
        margin-top: 14px;
        font-size: 8px;
    }

    @page {
        size: 80mm auto;
        margin: 0;
    }

}
/* =========================================================
   PHARMACY.IN CUSTOMER / CART EXPERIENCE
   ========================================================= */

.admin-only {
    display: none !important;
}

body.admin-mode .admin-only {
    display: flex !important;
}

body.customer-mode .page-section:not(#pos) {
    display: none !important;
}

body.customer-mode .navigation .nav-label,
body.customer-mode .sidebar-footer {
    display: none;
}

body.customer-mode .sidebar {
    width: 220px;
}

body.customer-mode .main {
    width: calc(100% - 220px);
    margin-left: 220px;
}

body.customer-mode .navigation {
    padding-top: 28px;
}

body.customer-mode .nav-item[data-section="pos"] {
    display: flex !important;
    background: var(--primary-light);
    color: var(--primary);
}

.profile-button {
    border: 0;
    background: transparent;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    text-align: left;
    color: inherit;
}

.profile-button:hover {
    background: #f3f7f5;
}

.profile-login .profile-avatar {
    background: var(--primary);
    color: #fff;
}

.profile-login .profile-info strong {
    color: var(--primary);
}

.cart-topbar-button {
    height: 42px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 11px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    transition: 0.2s ease;
}

.cart-topbar-button:hover {
    border-color: #b9d9d1;
    background: var(--primary-light);
    color: var(--primary);
}

.cart-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.cart-icon svg {
    width: 18px;
    height: 18px;
}

.cart-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.customer-mode .brand-text h1 {
    letter-spacing: -0.7px;
}

.pos-layout {
    display: block !important;
}

.pos-products.panel {
    width: 100%;
}

.product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cart-modal {
    padding: 20px;
}

.cart-modal-content {
    width: min(1040px, 100%);
    max-width: 1040px;
    height: min(92vh, 900px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-modal-content .cart-modal-header {
    flex: 0 0 auto;
}

.cart-modal-content .cart-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.cart-modal-header {
    flex-shrink: 0;
}

.modal-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.cart-modal-body {
    padding: 0 24px 24px;
    overflow-y: auto;
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    min-height: 0;
}

.checkout-item {
    min-height: 68px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto 28px;
    gap: 12px;
    align-items: center;
    background: #fff;
}

.checkout-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.checkout-item-details {
    min-width: 0;
}

.checkout-item-details strong,
.checkout-item-details span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-item-details strong {
    font-size: 12px;
}

.checkout-item-details span {
    margin-top: 4px;
    color: var(--text-light);
    font-size: 10px;
}

.checkout-qty {
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
}

.checkout-qty button {
    width: 30px;
    height: 100%;
    border: 0;
    background: #f6f9f8;
    color: var(--text);
    font-weight: 800;
}

.checkout-qty button:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.checkout-qty span {
    min-width: 30px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.checkout-line-total {
    min-width: 72px;
    text-align: right;
    color: var(--primary);
    font-size: 12px;
}

.checkout-item .remove-cart {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: #fff2f2;
    color: var(--danger);
    font-size: 16px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.checkout-main {
    display: grid;
    gap: 14px;
}

.checkout-card,
.checkout-summary {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.checkout-card {
    padding: 18px;
}

.checkout-card-heading {
    margin-bottom: 16px;
}

.checkout-card-heading h4 {
    font-size: 13px;
}

.checkout-card-heading p {
    margin-top: 4px;
    color: var(--text-light);
    font-size: 10px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.payment-method {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.payment-method:hover,
.payment-method.active {
    border-color: #b8ddd4;
    background: var(--primary-light);
    color: var(--primary);
}

.checkout-summary {
    padding: 18px;
    position: sticky;
    top: 0;
}

.checkout-summary-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 800;
}

.summary-status {
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.checkout-summary .totals {
    padding: 14px 0;
}

.checkout-summary .totals > div {
    padding: 7px 0;
}

.clear-cart-button {
    width: 100%;
    height: 42px;
    margin-top: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--danger);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
}

.clear-cart-button:hover {
    background: #fff4f4;
    border-color: #f0caca;
}

.checkout-empty {
    min-height: 145px;
    border: 1px dashed #cfdcd8;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fbfdfc;
}

.checkout-empty-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 9px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.checkout-empty h4 {
    font-size: 12px;
}

.checkout-empty p {
    margin-top: 4px;
    color: var(--text-light);
    font-size: 10px;
}

.logout-nav-item {
    margin-top: 4px;
    color: var(--danger) !important;
}

.logout-nav-item:hover {
    background: #fff3f3 !important;
    color: var(--danger) !important;
}

.auth-modal-content {
    max-width: 430px;
}

@media (max-width: 1050px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
    }
}

@media (max-width: 900px) {
    body.customer-mode .sidebar {
        width: var(--sidebar-width);
    }

    body.customer-mode .main {
        width: 100%;
        margin-left: 0;
    }

    .topbar-right {
        gap: 5px;
    }

    .cart-topbar-button {
        padding: 0 9px;
    }

    .profile-info {
        display: none;
    }
}

@media (max-width: 620px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .cart-modal {
        padding: 8px;
    }

    .cart-modal-content {
        height: 96vh;
        max-height: 96vh;
    }

    .cart-modal-body {
        padding: 0 14px 14px;
    }

    .checkout-item {
        grid-template-columns: 38px minmax(0, 1fr) auto 28px;
    }

    .checkout-line-total {
        grid-column: 2 / 3;
        text-align: left;
    }

    .checkout-qty {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
    }

    .checkout-item .remove-cart {
        grid-column: 4 / 5;
        grid-row: 1 / 2;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }
}
