@font-face {
    font-family: "IRANSans";
    src: url("/static/fonts/IRANSansWeb.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IRANSans";
    src: url("/static/fonts/IRANSansWeb_Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --app-ink: #17231f;
    --app-muted: #64716c;
    --app-sage: #8b9b91;
    --app-sage-dark: #3f5047;
    --app-sage-soft: #e8eeea;
    --app-amber: #c57a37;
    --app-red: #a84242;
    --app-bg: #f4f6f4;
    --app-surface: #ffffff;
    --app-border: #dfe5e1;
    --app-shadow: 0 8px 24px rgba(27, 47, 40, 0.07);
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-ink);
    background: var(--app-bg);
    font-family: "IRANSans", Tahoma, sans-serif;
    font-size: 0.94rem;
    line-height: 1.7;
    letter-spacing: 0;
}

a {
    color: var(--app-sage-dark);
}

.app-navbar {
    min-height: 72px;
    padding: 0.45rem 0;
    color: var(--app-ink);
    background: var(--app-sage);
    border-bottom: 3px solid var(--app-sage-dark);
    box-shadow: 0 6px 20px rgba(15, 32, 26, 0.16);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--app-ink);
    padding: 0;
    margin-left: 1.5rem;
}

.app-brand:hover,
.app-brand:focus {
    color: var(--app-ink);
}

.app-brand img {
    width: 56px;
    height: 52px;
    object-fit: contain;
    filter: brightness(0);
    opacity: 0.78;
}

.app-brand span {
    display: grid;
    line-height: 1.25;
}

.app-brand strong {
    font-size: 1.05rem;
}

.app-brand small {
    color: rgba(23, 35, 31, 0.7);
    font-size: 0.68rem;
}

.app-navbar .navbar-toggler {
    width: 44px;
    height: 44px;
    color: var(--app-ink);
    border: 1px solid rgba(23, 35, 31, 0.28);
    border-radius: 6px;
}

.app-nav-links {
    gap: 0.2rem;
}

.app-nav-links .nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(23, 35, 31, 0.78);
    border-radius: 6px;
    padding: 0.6rem 0.72rem;
}

.app-nav-links .nav-link:hover,
.app-nav-links .nav-link.active {
    color: var(--app-ink);
    background: rgba(255, 255, 255, 0.3);
}

.app-nav-links .nav-link.active {
    box-shadow: inset 0 -2px 0 var(--app-sage-dark);
}

.app-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: rgba(23, 35, 31, 0.78);
    white-space: nowrap;
}

.app-user .btn-outline-light {
    color: var(--app-ink);
    border-color: rgba(23, 35, 31, 0.35);
}

.app-user .btn-outline-light:hover,
.app-user .btn-outline-light:focus {
    color: var(--app-ink);
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(23, 35, 31, 0.5);
}

.dropdown-menu {
    border-color: var(--app-border);
    border-radius: 6px;
    box-shadow: var(--app-shadow);
}

.dropdown-item {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    padding: 0.65rem 0.9rem;
}

.dropdown-item i {
    width: 18px;
    color: var(--app-sage-dark);
}

.app-main {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.app-alerts {
    position: relative;
    z-index: 3;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--app-ink);
    font-weight: 700;
}

h2.text-center,
h3.text-center {
    text-align: right !important;
    margin-bottom: 1.4rem;
    font-size: 1.55rem;
}

h2.text-center::after,
h3.text-center::after {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-top: 0.55rem;
    background: var(--app-amber);
    border-radius: 2px;
}

hr {
    border-color: var(--app-border);
    opacity: 1;
    margin: 1.5rem 0;
}

.card,
.accordion-item,
.list-group {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    background: var(--app-surface);
}

.card {
    overflow: hidden;
}

.accordion-item {
    overflow: hidden;
}

.accordion-button {
    min-height: 54px;
    font-weight: 700;
    color: var(--app-ink);
    background: var(--app-surface);
}

.accordion-button:not(.collapsed) {
    color: var(--app-sage-dark);
    background: var(--app-sage-soft);
    box-shadow: inset 0 -1px 0 var(--app-border);
}

.form-label {
    margin-bottom: 0.4rem;
    color: #43514c;
    font-size: 0.86rem;
    font-weight: 700;
}

.form-control,
.form-select,
.input-group-text,
.select2-container .select2-selection--single {
    min-height: 46px;
    border-color: #ccd6d1;
    border-radius: 6px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-sage);
    box-shadow: 0 0 0 0.2rem rgba(111, 139, 126, 0.15);
}

.input-group > :not(:first-child) {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
}

.input-group-text {
    color: #42504a;
    background: #f0f3f1;
}

.ltr-field {
    direction: ltr;
    text-align: left !important;
    unicode-bidi: plaintext;
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
}

.form-check-input:checked {
    background-color: var(--app-sage-dark);
    border-color: var(--app-sage-dark);
}

.btn {
    min-height: 42px;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    font-weight: 700;
}

.btn-sm {
    min-height: 34px;
    padding: 0.32rem 0.62rem;
}

.btn-primary,
.btn-success {
    color: var(--app-ink);
    background-color: var(--app-sage);
    border-color: var(--app-sage);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    color: var(--app-ink);
    background-color: #7b8d82;
    border-color: #7b8d82;
}

.btn-warning {
    color: #fff;
    background-color: var(--app-amber);
    border-color: var(--app-amber);
}

.btn-danger {
    background-color: var(--app-red);
    border-color: var(--app-red);
}

.table-responsive {
    overflow: auto;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    padding: 0.85rem 0.75rem;
    border-color: #e3e8e5;
}

.table thead th,
.table-dark th,
.table thead.table-dark th {
    color: #eef4f1;
    background: #304a42;
    border-color: #476158;
    font-size: 0.82rem;
    white-space: nowrap;
}

.table tbody tr:hover {
    --bs-table-bg-state: #f1f5f2;
}

.list-group-item {
    padding: 0.85rem 1rem;
    border-color: var(--app-border);
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.65rem;
}

.page-header p {
    margin: 0.25rem 0 0;
    color: var(--app-muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pricing-section,
.pricing-summary {
    padding: 1.2rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.08rem;
}

.section-heading p {
    margin: 0.25rem 0 0;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.pricing-products-heading {
    align-items: center;
}

.pricing-archive-section {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(480px, 1.2fr);
    align-items: end;
    gap: 1rem 1.5rem;
}

.pricing-archive-intro {
    min-width: 0;
}

.pricing-archive-title {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.pricing-archive-title > i {
    margin-top: 0.25rem;
    color: var(--app-sage-dark);
    font-size: 1.15rem;
}

.pricing-archive-title h2 {
    margin: 0;
    font-size: 1.08rem;
}

.pricing-archive-title p {
    margin: 0.25rem 0 0;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.pricing-archive-date {
    display: inline-block;
    margin: 0.45rem 1.85rem 0 0;
    color: var(--app-muted);
    font-size: 0.72rem;
}

.pricing-archive-controls {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.2fr);
    gap: 0.75rem;
}

.pricing-archive-controls > form:only-child {
    grid-column: 1 / -1;
}

.pricing-archive-controls .form-label {
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
}

.pricing-archive-controls .input-group {
    flex-wrap: nowrap;
}

.pricing-archive-controls .btn {
    white-space: nowrap;
}

.archive-refresh-label {
    display: none;
}

.pricing-search {
    display: flex;
    width: min(100%, 360px);
    gap: 0.5rem;
}

.pricing-search .btn {
    width: 46px;
    padding-inline: 0;
}

.pricing-table {
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.pricing-table-scroll {
    position: relative;
    isolation: isolate;
}

.pricing-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #304a42;
    box-shadow: inset 0 -1px 0 #476158;
}

.pricing-table thead th {
    padding-inline: 0.35rem;
    text-align: center;
    white-space: normal;
    line-height: 1.35;
}

.pricing-header-unit {
    display: block;
    margin-top: 0.15rem;
    color: #c7d3ce;
    font-size: 0.68rem;
    font-weight: 400;
}

.pricing-table .pricing-product-column {
    width: 118px;
    min-width: 118px;
    max-width: 118px;
    white-space: normal;
    line-height: 1.55;
}

.pricing-table .pricing-time-column {
    width: 68px;
    min-width: 68px;
}

.pricing-table .pricing-cost-column {
    width: 77px;
    min-width: 77px;
}

.pricing-table .pricing-components-column {
    width: 124px;
    min-width: 124px;
    white-space: normal;
}

.pricing-table .pricing-total-column {
    width: 108px;
    min-width: 108px;
    text-align: center;
}

.pricing-table .pricing-actions-column {
    width: 82px;
    min-width: 82px;
}

.price-change-badge {
    display: block;
    width: fit-content;
    margin-top: 0.3rem;
    padding: 0.06rem 0.3rem;
    direction: ltr;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.45;
}

.price-change-badge[hidden] {
    display: none;
}

.price-change-badge.increase {
    color: #8f2929;
    background: #fbe9e9;
}

.price-change-badge.decrease {
    color: #176043;
    background: #e4f3ec;
}

.invoice-stats {
    padding: 1.2rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
}

.invoice-stats h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.invoice-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.invoice-stats-grid > div {
    min-width: 0;
    padding: 0.9rem 1rem;
    background: #f5f8f6;
    border: 1px solid var(--app-border);
    border-right: 3px solid var(--app-sage);
    border-radius: 6px;
}

.invoice-stats-grid dt {
    margin-bottom: 0.35rem;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.invoice-stats-grid dd {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    direction: ltr;
    color: var(--app-ink);
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
}

.invoice-stats-grid small {
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 400;
}

.pricing-table tbody tr {
    --pricing-row-bg: var(--app-surface);
    transition: box-shadow 160ms ease, background-color 160ms ease;
}

.pricing-table tbody tr:nth-child(even) {
    --bs-table-bg: #f3f5f4;
    --pricing-row-bg: #f3f5f4;
}

.pricing-table tbody tr.is-dirty {
    --bs-table-bg: #fffaf1;
    --pricing-row-bg: #fffaf1;
    box-shadow: inset -4px 0 0 var(--app-amber);
}

.pricing-table tbody tr.is-saving {
    opacity: 0.72;
}

.pricing-formula-toggle {
    padding: 0.9rem 1rem;
    background: #f5f8f6;
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.pricing-formula-toggle .form-check-label {
    font-weight: 700;
}

.pricing-formula-toggle p {
    margin: 0.45rem 0 0;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.pricing-table tbody td:first-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--pricing-row-bg) !important;
    background-clip: padding-box;
    box-shadow: -1px 0 0 var(--app-border);
}

.pricing-table tbody td:last-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--pricing-row-bg) !important;
    box-shadow: 1px 0 0 var(--app-border);
}

.pricing-table thead th:first-child {
    right: 0;
    z-index: 6;
    background: #304a42 !important;
    box-shadow: -1px 0 0 var(--app-border);
}

.pricing-table thead th:last-child {
    left: 0;
    z-index: 6;
    background: #304a42 !important;
    box-shadow: 1px 0 0 var(--app-border);
}

@media (min-width: 768px) {
    .pricing-table-scroll {
        max-height: calc(100vh - 96px);
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .pricing-archive-section {
        grid-template-columns: 1fr;
    }

    .pricing-table {
        width: 100%;
        min-width: 724px;
    }

    .pricing-table thead th {
        padding-inline: 0.15rem;
        font-size: 0.68rem;
        line-height: 1.25;
    }

    .pricing-header-unit {
        margin-top: 0.1rem;
        font-size: 0.57rem;
    }

    .pricing-table .pricing-product-column {
        width: 76px;
        min-width: 76px;
        max-width: 76px;
        font-size: 0.72rem;
        line-height: 1.45;
    }

    .pricing-table .pricing-time-column {
        width: 40px;
        min-width: 40px;
    }

    .pricing-table .pricing-cost-column {
        width: 58px;
        min-width: 58px;
    }

    .pricing-table .pricing-components-column {
        width: 64px;
        min-width: 64px;
        font-size: 0.66rem;
        line-height: 1.35;
    }

    .pricing-table .pricing-total-column {
        width: 68px;
        min-width: 68px;
        font-size: 0.68rem;
    }

    .pricing-table .pricing-actions-column {
        width: 56px;
        min-width: 56px;
        padding-inline: 0 !important;
    }

    .pricing-table tbody td {
        padding-inline: 0.15rem;
    }

    .pricing-table .inline-pricing-input {
        min-height: 36px;
        padding-inline: 0.05rem;
        font-size: 0.68rem;
    }

    .pricing-table .inline-pricing-input.cost-input {
        font-size: 0.58rem;
    }

    .pricing-table input[type="number"] {
        appearance: textfield;
        -moz-appearance: textfield;
    }

    .pricing-table input[type="number"]::-webkit-inner-spin-button,
    .pricing-table input[type="number"]::-webkit-outer-spin-button {
        margin: 0;
        -webkit-appearance: none;
    }

    .pricing-table .inline-pricing-form {
        grid-template-columns: repeat(2, 26px);
        gap: 1px;
    }

    .pricing-table .pricing-actions-column .inline-pricing-form .btn {
        width: 26px;
        min-height: 32px;
        font-size: 0.72rem;
    }
}

.inline-pricing-input {
    width: 100%;
    min-height: 38px;
    padding: 0.35rem 0.3rem;
    text-align: center;
    direction: ltr;
    font-size: 0.82rem;
}

.inline-pricing-input.cost-input {
    width: 100%;
}

.inline-pricing-form {
    display: grid;
    grid-template-columns: repeat(2, 32px);
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pricing-table tbody td {
    padding-inline: 0.35rem;
}

.pricing-table .pricing-actions-column .btn {
    width: 32px;
    padding-inline: 0;
}

.pricing-table .pricing-actions-column .row-save-status:empty {
    display: none;
}

.row-save-button:disabled {
    color: #78817d;
    background: #e5e9e7;
    border-color: #d7ddda;
    opacity: 1;
}

.row-save-status {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--app-muted);
    font-size: 0.72rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.row-save-status.success {
    color: #1c684d;
}

.row-save-status.error {
    color: var(--app-red);
}

.calculated-price {
    color: #1c684d;
    font-weight: 700;
    white-space: nowrap;
}

.calculated-price.gold {
    color: #8a5b1c;
}

.export-modal-content {
    max-height: min(82vh, 760px);
}

.export-toolbar {
    position: sticky;
    top: -1rem;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    margin: -1rem -1rem 1rem;
    padding: 1rem;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
}

.export-select-all {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    white-space: nowrap;
}

.export-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.export-product-option {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    cursor: pointer;
}

.export-product-option:hover {
    background: var(--app-sage-soft);
}

.export-product-option[hidden] {
    display: none;
}

.export-selection-count,
.export-status {
    color: var(--app-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.export-status {
    margin-left: auto;
}

.export-status.success {
    color: #1c684d;
}

.export-status.error {
    color: var(--app-red);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge.managed {
    color: #315348;
    background: #e4eee8;
}

.status-badge.manual {
    color: #795322;
    background: #fff1dc;
}

.status-badge.raw {
    color: #5f4314;
    background: #fff3cd;
}

.settings-comparison {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--app-border);
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.settings-comparison div {
    display: grid;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    background: var(--app-surface);
}

.settings-comparison span {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.pricing-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 1rem;
}

.pricing-summary {
    position: sticky;
    top: 92px;
}

.pricing-summary dl {
    margin: 0;
}

.pricing-summary dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--app-border);
}

.pricing-summary dl div:last-child {
    border-bottom: 0;
}

.pricing-summary dt {
    color: var(--app-muted);
    font-size: 0.82rem;
}

.pricing-summary dd {
    margin: 0;
    font-weight: 700;
}

.pricing-summary .summary-total,
.pricing-summary .summary-gold {
    margin-inline: -1.2rem;
    padding-inline: 1.2rem;
    background: var(--app-sage-soft);
}

.pricing-summary .summary-gold {
    color: #805820;
    background: #fff5e7;
}

.dashboard-heading {
    margin-bottom: 1.5rem;
}

.dashboard-heading h1 {
    margin-bottom: 0.3rem;
    font-size: 1.7rem;
}

.dashboard-heading p {
    margin: 0;
    color: var(--app-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-card {
    display: flex;
    min-height: 158px;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.15rem;
    color: var(--app-ink);
    text-decoration: none;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-top: 3px solid var(--card-accent, var(--app-sage));
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-card:hover {
    color: var(--app-ink);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(27, 47, 40, 0.12);
}

.dashboard-card i {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--card-accent, var(--app-sage-dark));
    background: #f0f4f2;
    border-radius: 7px;
    font-size: 1.15rem;
}

.dashboard-card strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.dashboard-card small {
    color: var(--app-muted);
    line-height: 1.7;
}

.dashboard-card .card-arrow {
    align-self: flex-end;
    width: auto;
    height: auto;
    color: var(--app-muted);
    background: transparent;
    font-size: 0.8rem;
}

.auth-page {
    background: #eef2ef;
}

.auth-page .app-main {
    display: grid;
    min-height: calc(100vh - 75px);
    place-items: center;
}

.login-panel {
    width: min(100%, 430px);
}

.login-brand {
    display: block;
    width: 116px;
    height: 96px;
    margin: 0 auto 1rem;
    object-fit: contain;
}

.price-approval-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: #fff8ee;
    border: 1px solid #ead5b9;
    border-right: 4px solid var(--app-amber);
    border-radius: 8px;
}

.price-approval-bar > div {
    display: grid;
    gap: 0.2rem;
}

.price-approval-bar span {
    color: var(--app-muted);
    font-size: 0.82rem;
}

.new-price {
    color: #1c684d;
    font-weight: 700;
}

.new-price.gold {
    color: #9a651e;
}

.app-bottom-nav {
    display: none;
}

@media (max-width: 991.98px) {
    .app-navbar .navbar-collapse {
        margin-top: 0.65rem;
        padding: 0.65rem 0 0.35rem;
        border-top: 1px solid rgba(23, 35, 31, 0.16);
    }

    .app-user {
        justify-content: space-between;
        padding: 0.6rem 0.7rem;
    }

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

    .pricing-editor-layout {
        grid-template-columns: 1fr;
    }

    .pricing-summary {
        position: static;
    }

    .settings-comparison {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.9rem;
    }

    .app-navbar {
        min-height: 62px;
    }

    .app-brand img {
        width: 48px;
        height: 44px;
    }

    .app-brand small {
        display: none;
    }

    .app-main {
        padding: 1.25rem 0.85rem calc(6.25rem + env(safe-area-inset-bottom));
    }

    h2.text-center,
    h3.text-center,
    .page-header h1 {
        font-size: 1.3rem;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header .btn {
        width: 100%;
    }

    .page-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .section-heading,
    .pricing-products-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .pricing-search {
        width: 100%;
    }

    .pricing-archive-section,
    .pricing-archive-controls {
        grid-template-columns: 1fr;
    }

    .pricing-archive-controls > form {
        grid-column: 1;
    }

    .pricing-archive-controls .input-group {
        flex-wrap: wrap;
    }

    .pricing-archive-controls .input-group > .form-control,
    .pricing-archive-controls .input-group > .form-select {
        width: 100%;
        border-radius: 6px !important;
    }

    .pricing-archive-controls .input-group > .btn {
        width: 100%;
        margin-top: 0.45rem;
        border-radius: 6px !important;
    }

    .archive-refresh-label {
        display: inline;
    }

    .pricing-section,
    .pricing-summary {
        padding: 1rem;
    }

    .settings-comparison {
        grid-template-columns: 1fr;
    }

    .invoice-stats {
        padding: 1rem;
    }

    .invoice-stats-grid {
        grid-template-columns: 1fr;
    }

    .invoice-stats-grid dd {
        font-size: 1.1rem;
    }

    .card {
        box-shadow: 0 4px 16px rgba(27, 47, 40, 0.06);
    }

    .card.p-3,
    .card.p-4 {
        padding: 1rem !important;
    }

    .table-responsive .table:not(.mobile-card-table) {
        min-width: 720px;
    }

    .mobile-card-table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table tbody {
        padding: 0.75rem;
    }

    .mobile-card-table tbody tr {
        margin-bottom: 0.75rem;
        padding: 0.45rem 0.85rem;
        background: #fff !important;
        border: 1px solid var(--app-border);
        border-right: 4px solid var(--row-accent, var(--app-sage));
        border-radius: 7px;
    }

    .mobile-card-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .mobile-card-table tbody td {
        display: flex;
        min-height: 42px;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.55rem 0 !important;
        text-align: left;
        border: 0;
        border-bottom: 1px dashed #e4e9e6;
    }

    .mobile-card-table tbody td:last-child {
        border-bottom: 0;
    }

    .mobile-card-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: var(--app-muted);
        text-align: right;
        font-size: 0.78rem;
        font-weight: 700;
    }

    .pricing-table {
        min-width: 0;
    }

    .pricing-table th:first-child,
    .pricing-table td:first-child,
    .pricing-table th:last-child,
    .pricing-table td:last-child {
        position: static;
        box-shadow: none;
    }

    .pricing-table tbody tr.is-dirty {
        box-shadow: inset -4px 0 0 var(--app-amber);
    }

    .pricing-table .inline-pricing-input,
    .pricing-table .inline-pricing-input.cost-input {
        width: min(55%, 180px);
    }

    .pricing-table .inline-pricing-form {
        min-width: 0;
        justify-content: flex-end;
    }

    .pricing-table .row-save-status {
        grid-column: 1 / -1;
        text-align: center;
    }

    .export-toolbar {
        grid-template-columns: 1fr;
    }

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

    .export-selection-count {
        text-align: left;
    }

    .app-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1025;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--app-border);
        box-shadow: 0 -8px 24px rgba(30, 48, 42, 0.1);
        backdrop-filter: blur(12px);
    }

    .app-bottom-nav a {
        display: grid;
        min-height: 48px;
        place-items: center;
        align-content: center;
        gap: 0.15rem;
        color: #6c7773;
        text-decoration: none;
        font-size: 0.68rem;
    }

    .app-bottom-nav i {
        font-size: 1.05rem;
    }

    .app-bottom-nav a.active {
        color: var(--app-sage-dark);
        font-weight: 700;
    }

    .dashboard-heading h1 {
        font-size: 1.35rem;
    }

    .price-approval-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .price-approval-bar .btn {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .dashboard-card {
        min-height: 142px;
        padding: 0.9rem;
    }

    .dashboard-card small {
        display: none;
    }
}

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

    .dashboard-card {
        min-height: 116px;
    }
}
