:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --ink: #172033;
    --muted: #667085;
    --surface: #ffffff;
    --page: #f5f7fb;
    --border: #d9e1ec;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --error-bg: #fff1f2;
    --error-text: #9f1239;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Tahoma, Arial, sans-serif;
    color: var(--ink);
    background: var(--page);
}

a {
    color: inherit;
}

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

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(440px, 100%);
}

.login-panel,
.welcome-panel,
.form-panel,
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
}

.login-panel {
    padding: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 28px;
    line-height: 1.35;
}

h2 {
    margin-bottom: 6px;
    font-size: 20px;
}

p {
    color: var(--muted);
    line-height: 1.8;
}

.form,
.form-panel {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #263143;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd7e6;
    border-radius: 6px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
}

textarea {
    resize: vertical;
}

.primary-button,
.secondary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 6px;
    padding: 0 16px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

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

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

.secondary-button,
.ghost-button {
    color: var(--ink);
    background: #fff;
    border-color: var(--border);
}

.alert {
    border-radius: 6px;
    padding: 12px 14px;
    line-height: 1.7;
}

.alert.success {
    color: var(--success-text);
    background: var(--success-bg);
    border: 1px solid #a7f3d0;
}

.alert.error {
    color: var(--error-text);
    background: var(--error-bg);
    border: 1px solid #fecdd3;
}

.app-page {
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px;
    color: #e5edff;
    background: #111827;
}

.brand {
    display: grid;
    gap: 4px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand strong {
    font-size: 18px;
}

.brand span {
    color: #9ca3af;
    font-size: 13px;
}

.nav {
    display: grid;
    gap: 6px;
    margin-top: 18px;
}

.nav a {
    padding: 11px 12px;
    border-radius: 6px;
    color: #e5edff;
    text-decoration: none;
}

.nav a:hover,
.nav a.disabled {
    background: rgba(255, 255, 255, 0.08);
}

.nav a.disabled {
    color: #8b95a7;
    cursor: default;
}

.app-main {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 82px;
    padding: 18px 28px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.topbar h1 {
    margin: 0;
}

.topbar p {
    margin: 4px 0 0;
    font-size: 14px;
}

.content {
    padding: 28px;
}

.stats-grid,
.module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stats-grid article,
.module-card {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.stats-grid span,
.module-card span {
    color: var(--muted);
    font-size: 13px;
}

.stats-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 14px;
}

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

.module-card {
    display: grid;
    gap: 8px;
    text-decoration: none;
}

.module-card strong {
    font-size: 18px;
}

.module-card p {
    margin: 0;
}

.module-card.disabled {
    opacity: 0.72;
}

.module-detail {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.roadmap {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.roadmap article {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.roadmap span {
    color: var(--muted);
    line-height: 1.7;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
}

.table-card {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 13px;
    background: #f8fafc;
}

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

.row-actions a,
.row-actions button {
    border: 0;
    padding: 0;
    color: var(--primary);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.form-panel {
    padding: 22px;
}

.invoice-form {
    max-width: 980px;
}

.invoice-items {
    margin-top: 18px;
}

.item-form {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr repeat(4, minmax(90px, .7fr)) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.compact-table {
    box-shadow: none;
}

.pos-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 18px;
    align-items: start;
}

.pos-catalog,
.pos-cart {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}

.pos-search {
    margin-bottom: 14px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.product-tile {
    display: grid;
    gap: 8px;
    min-height: 126px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    text-align: right;
    background: #f8fafc;
    cursor: pointer;
}

.product-tile:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.product-tile strong {
    font-size: 15px;
}

.product-tile span {
    color: var(--muted);
    font-size: 12px;
}

.product-tile b {
    color: var(--primary);
}

.pos-cart {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 14px;
}

.cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cart-head h2 {
    margin: 0;
}

.cart-lines {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
}

.cart-line {
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.cart-line-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cart-line-title button {
    border: 0;
    color: #dc2626;
    background: transparent;
    cursor: pointer;
}

.cart-line-inputs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.cart-line-inputs label {
    font-size: 11px;
}

.cart-line-inputs input {
    padding: 8px;
}

.cart-line-total {
    color: var(--primary);
    font-weight: 700;
}

.cart-totals,
.change-line {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.cart-totals div,
.change-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cart-totals .grand {
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 18px;
}

.pos-message {
    border-radius: 6px;
    padding: 12px;
    line-height: 1.6;
}

.pos-message.success {
    color: var(--success-text);
    background: var(--success-bg);
}

.pos-message.error {
    color: var(--error-text);
    background: var(--error-bg);
}

.checkout-button {
    min-height: 48px;
}

.pos-empty {
    grid-column: 1 / -1;
}

.app-page.pos-mode {
    display: block;
    background: #f3f7fb;
}

.pos-mode .app-main {
    min-height: 100vh;
}

.pos-mode .content {
    padding: 14px;
}

.pos-terminal {
    direction: ltr;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 14px;
    min-height: calc(100vh - 28px);
}

.pos-left {
    min-width: 0;
}

.pos-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 180px auto;
    gap: 12px;
    margin-bottom: 16px;
}

.scan-box {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 54px;
    align-items: center;
    background: #fff;
    border: 1px solid #e5ebf2;
    border-radius: 3px;
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.05);
}

.scan-icon {
    color: #4384f4;
    text-align: center;
}

.scan-box input,
.category-select,
.customer-bar select {
    border: 0;
    border-radius: 3px;
    min-height: 36px;
}

.scan-button {
    height: 36px;
    border: 0;
    color: #fff;
    background: #3b82f6;
    cursor: pointer;
}

.category-select,
.view-toggle,
.customer-bar {
    background: #fff;
    border: 1px solid #e5ebf2;
    border-radius: 3px;
    box-shadow: 0 10px 22px rgba(16, 24, 40, 0.05);
}

.view-toggle {
    display: flex;
    overflow: hidden;
}

.view-toggle button,
.customer-add,
.more-button {
    width: 42px;
    border: 0;
    color: #98a2b3;
    background: #fff;
    cursor: pointer;
}

.view-toggle .active {
    color: #2563eb;
    background: #f3f7ff;
}

.pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 14px;
}

.pos-product-tile {
    min-height: 138px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    text-align: center;
    background: #fff;
    border: 0;
    border-radius: 2px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

.pos-product-tile:hover {
    transform: translateY(-1px);
    background: #fff;
    box-shadow: 0 14px 28px rgba(16, 24, 40, 0.1);
}

.product-art {
    display: grid;
    place-items: center;
    height: 94px;
    color: #2f6f73;
    background: linear-gradient(135deg, #eef9fb, #f8fbfd);
    font-size: 42px;
    font-weight: 700;
}

.pos-product-tile strong {
    display: block;
    padding: 10px 8px 4px;
    color: #202939;
    font-size: 13px;
    font-weight: 700;
}

.pos-product-tile small {
    padding-bottom: 8px;
    color: #667085;
    font-size: 11px;
}

.pos-order-panel {
    position: sticky;
    top: 14px;
    display: grid;
    grid-template-rows: auto auto minmax(220px, 1fr) auto;
    gap: 0;
    height: calc(100vh - 28px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #e5ebf2;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.customer-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    gap: 8px;
    padding: 12px;
    border-width: 0 0 1px;
    box-shadow: none;
}

.customer-add {
    display: grid;
    place-items: center;
    color: #98a2b3;
    border-right: 1px solid #eef2f6;
    border-left: 1px solid #eef2f6;
    text-decoration: none;
    font-size: 26px;
}

.cart-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px 96px;
    gap: 8px;
    padding: 12px;
    color: #2563eb;
    border-bottom: 1px solid #eef2f6;
    font-size: 12px;
    font-weight: 700;
}

.pos-cart-lines {
    display: block;
    max-height: none;
    overflow: auto;
    padding: 0;
}

.empty-cart {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 300px;
    gap: 14px;
    color: #c5ccd7;
}

.empty-cart-icon {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    color: #f45f93;
    background: #fde8ef;
    font-size: 46px;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px 96px;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #eef2f6;
    border-radius: 0;
    background: #fff;
}

.cart-product-name {
    min-width: 0;
}

.cart-product-name strong {
    display: block;
    overflow: hidden;
    color: #202939;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.cart-product-name button {
    border: 0;
    padding: 4px 0 0;
    color: #ef4444;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
}

.qty-stepper {
    display: grid;
    grid-template-columns: 24px 1fr 24px;
    gap: 3px;
}

.qty-stepper button {
    border: 1px solid #e5ebf2;
    border-radius: 3px;
    background: #f8fafc;
    cursor: pointer;
}

.qty-stepper input,
.cart-price input,
.cart-adjustments input {
    min-height: 28px;
    padding: 4px;
    text-align: center;
}

.cart-price {
    display: grid;
    gap: 4px;
}

.cart-price strong {
    color: #101828;
    text-align: right;
    font-size: 12px;
}

.cart-adjustments {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-left: 34%;
}

.pos-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e5ebf2;
    background: #fff;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #101828;
    font-weight: 700;
}

.summary-row.mini {
    color: #667085;
    font-size: 12px;
    font-weight: 400;
}

.summary-actions {
    display: flex;
    gap: 6px;
}

.summary-actions button {
    border: 1px solid #dbeafe;
    border-radius: 3px;
    padding: 7px 8px;
    color: #2563eb;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}

.summary-extra {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.summary-extra label {
    gap: 4px;
    color: #667085;
    font-size: 11px;
}

.summary-extra input {
    min-height: 32px;
}

.pay-now {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    border: 0;
    border-radius: 3px;
    padding: 0 14px;
    color: #fff;
    background: #2ec4a6;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.pay-now:disabled {
    opacity: .7;
    cursor: wait;
}

.invoice-view {
    display: grid;
    gap: 16px;
}

.invoice-view-head,
.invoice-actions,
.invoice-totals-box,
.invoice-notes {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}

.invoice-view-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.invoice-meta {
    display: grid;
    gap: 8px;
    text-align: left;
}

.invoice-meta strong {
    color: var(--primary);
    font-size: 22px;
}

.invoice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.invoice-view-table {
    box-shadow: none;
}

.invoice-totals-box {
    justify-self: end;
    width: min(360px, 100%);
    display: grid;
    gap: 10px;
}

.invoice-totals-box div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.invoice-totals-box .grand {
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}

.invoice-notes p {
    margin-bottom: 0;
}

.invoice-page {
    display: grid;
    gap: 18px;
}

.invoice-document {
    width: min(980px, 100%);
    margin-inline: auto;
    padding: 34px;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
    color: #1f2933;
    font-family: var(--invoice-font, Tahoma), Arial, sans-serif;
}

.invoice-doc-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 3px solid var(--invoice-primary, #111827);
}

.invoice-company {
    display: flex;
    gap: 14px;
    align-items: center;
}

.invoice-logo {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    color: #fff;
    background: var(--invoice-primary, #111827);
    border-radius: 8px;
    font-size: 26px;
    font-weight: 700;
}

.invoice-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
}

.invoice-company h2,
.invoice-title-block h1 {
    margin: 0;
}

.invoice-company p,
.invoice-title-block p,
.info-box p {
    margin: 4px 0 0;
    color: #667085;
}

.invoice-title-block {
    text-align: left;
}

.invoice-title-block p {
    font-weight: 700;
    color: var(--invoice-accent, #2563eb);
}

.invoice-title-block h1 {
    margin-top: 6px;
    font-size: 28px;
}

.invoice-status {
    display: inline-flex;
    margin-top: 10px;
    padding: 5px 10px;
    color: #065f46;
    background: #ecfdf5;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.invoice-custom-text {
    margin-top: 18px;
    padding: 14px 16px;
    border-right: 4px solid var(--invoice-accent, #2563eb);
    background: #f8fafc;
    line-height: 1.8;
}

.invoice-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.info-box {
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
}

.info-box > span {
    color: var(--invoice-accent, #2563eb);
    font-size: 13px;
    font-weight: 700;
}

.info-box > strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.info-box dl {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
}

.info-box dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.invoice-items-table {
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
}

.invoice-items-table table {
    min-width: 0;
}

.invoice-items-table th {
    color: #fff;
    background: var(--invoice-primary, #111827);
}

.invoice-items-table th,
.invoice-items-table td {
    padding: 14px;
}

.invoice-items-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.invoice-items-table .item-name {
    font-weight: 700;
}

.invoice-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
    margin-top: 22px;
}

.invoice-notes-panel,
.invoice-summary-panel {
    padding: 16px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
}

.invoice-notes-panel p {
    margin-bottom: 0;
}

.invoice-summary-panel {
    display: grid;
    gap: 10px;
    background: #f8fafc;
}

.invoice-summary-panel div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.invoice-summary-panel .net {
    margin: 4px -16px;
    padding: 14px 16px;
    color: #fff;
    background: var(--invoice-primary, #111827);
    font-size: 18px;
    font-weight: 700;
}

.invoice-footer-text {
    margin-top: 36px;
    padding: 24px;
    color: #fff;
    background: var(--invoice-primary, #111827);
    text-align: center;
}

.invoice-footer-text h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.invoice-footer-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.invoice-template-classic .invoice-doc-header {
    border: 1px solid var(--invoice-primary, #111827);
    padding: 18px;
}

.invoice-template-classic .invoice-items-table th {
    background: #fff;
    color: var(--invoice-primary, #111827);
    border-bottom: 2px solid var(--invoice-primary, #111827);
}

.invoice-template-compact {
    padding: 20px;
    font-size: 13px;
}

.invoice-template-compact .invoice-doc-header,
.invoice-template-compact .invoice-info-grid,
.invoice-template-compact .invoice-bottom {
    margin-block: 12px;
}

.invoice-paper-a5 {
    width: min(720px, 100%);
}

.invoice-paper-receipt80 {
    width: 302px;
    padding: 14px;
    font-size: 11px;
}

.invoice-paper-receipt80 .invoice-doc-header,
.invoice-paper-receipt80 .invoice-company,
.invoice-paper-receipt80 .invoice-info-grid,
.invoice-paper-receipt80 .invoice-bottom,
.invoice-paper-receipt80 .invoice-signatures {
    display: grid;
    grid-template-columns: 1fr;
}

.invoice-paper-receipt80 .invoice-title-block {
    text-align: right;
}

.invoice-paper-receipt80 .invoice-logo,
.invoice-paper-receipt80 .invoice-logo-img {
    width: 44px;
    height: 44px;
}

.invoice-paper-receipt80 .invoice-items-table th,
.invoice-paper-receipt80 .invoice-items-table td {
    padding: 6px 4px;
}

.invoice-paper-receipt80 .invoice-items-table th:nth-child(5),
.invoice-paper-receipt80 .invoice-items-table td:nth-child(5),
.invoice-paper-receipt80 .invoice-items-table th:nth-child(6),
.invoice-paper-receipt80 .invoice-items-table td:nth-child(6),
.invoice-paper-receipt80 .invoice-signatures {
    display: none;
}

.settings-section {
    display: grid;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-of-type {
    border-bottom: 0;
}

.invoice-settings-form {
    gap: 22px;
}

.current-logo {
    display: grid;
    gap: 8px;
    color: var(--muted);
}

.current-logo img {
    width: 120px;
    max-height: 90px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.invoice-signatures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 38px;
}

.invoice-signatures div {
    min-height: 72px;
    border-top: 1px solid #98a2b3;
    padding-top: 10px;
    color: #667085;
    text-align: center;
}

input[readonly] {
    background: #f8fafc;
    color: #475467;
}

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

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

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.page-shell {
    width: min(980px, calc(100% - 32px));
    margin: 48px auto;
}

.welcome-panel {
    padding: 32px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.status-grid div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

dt {
    color: var(--muted);
    font-size: 13px;
}

dd {
    margin: 6px 0 0;
    font-weight: 700;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 980px) {
    .app-page {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .pos-screen {
        grid-template-columns: 1fr;
    }

    .pos-terminal {
        grid-template-columns: 1fr;
    }

    .pos-cart {
        position: static;
    }

    .pos-order-panel {
        position: static;
        height: auto;
        min-height: 520px;
    }

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

    .nav,
    .stats-grid,
    .module-grid,
    .roadmap,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .content,
    .topbar,
    .sidebar {
        padding: 16px;
    }

    .topbar,
    .toolbar,
    .search-form,
    .item-form {
        align-items: stretch;
        flex-direction: column;
    }

    .item-form {
        display: flex;
    }

    .nav,
    .stats-grid,
    .module-grid,
    .roadmap,
    .form-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 23px;
    }

    .invoice-document {
        padding: 18px;
    }

    .invoice-doc-header,
    .invoice-info-grid,
    .invoice-bottom,
    .invoice-signatures {
        grid-template-columns: 1fr;
    }

    .invoice-doc-header {
        display: grid;
    }

    .invoice-title-block {
        text-align: right;
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .invoice-actions {
        display: none !important;
    }

    .app-page {
        display: block;
    }

    .content {
        padding: 0;
    }

    .invoice-document {
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .invoice-paper-a5 {
        width: 148mm;
        margin-inline: auto;
    }

    .invoice-paper-receipt80 {
        width: 80mm;
        margin-inline: auto;
        font-size: 10px;
    }

    .invoice-doc-header {
        border-bottom-color: #000;
    }

    .invoice-items-table,
    .invoice-notes-panel,
    .invoice-summary-panel,
    .info-box {
        break-inside: avoid;
    }

    .invoice-view-head,
    .invoice-totals-box,
    .invoice-notes,
    .table-card {
        border-color: #ddd;
        box-shadow: none;
    }

    .invoice-footer-text {
        color-adjust: exact;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
