@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg: #edf2f4;
    --bg-strong: #0f2530;
    --sidebar: linear-gradient(180deg, var(--sidebar-start, #0f2230) 0%, var(--sidebar-end, #1d4d63) 100%);
    --panel: rgba(255, 255, 255, 0.94);
    --panel-border: rgba(15, 37, 48, 0.08);
    --text: #16313a;
    --muted: #61747d;
    --primary: #145369;
    --primary-strong: #0f5160;
    --accent: #dd7f38;
    --success: #1f8a58;
    --danger: #c94949;
    --shadow: 0 20px 60px rgba(12, 27, 35, 0.12);
    --radius: 24px;
    --surface-tint: #f4efe7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background-color: var(--surface-tint);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(221, 127, 56, 0.22), transparent 26%),
        radial-gradient(circle at bottom right, rgba(30, 107, 124, 0.22), transparent 20%),
        linear-gradient(145deg, #eff4f5 0%, #dbe9eb 100%);
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(15, 37, 48, 0.08);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.login-panel,
.login-side {
    padding: 42px;
}

.login-side {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 18%),
        linear-gradient(180deg, var(--sidebar-start, #0f2230) 0%, var(--sidebar-end, #1d4d63) 100%);
    color: #f7fafb;
}

.login-brand-stack {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.feature-badge,
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--accent);
}

.hero-copy,
.brand-copy,
.panel-head span,
.login-help span,
.feature-list li,
.footer-note,
.activity-item p {
    color: var(--muted);
}

.login-side .feature-list li,
.login-side .hero-copy,
.login-side h2 {
    color: #f4fbfd;
}

.feature-list {
    margin: 18px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.login-credit-card {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(20, 83, 105, 0.08), rgba(221, 127, 56, 0.08));
    border: 1px solid rgba(20, 83, 105, 0.12);
    display: grid;
    gap: 4px;
}

.login-credit-card strong {
    color: var(--primary-strong);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-credit-card span,
.login-credit-card a {
    color: var(--muted);
    font-size: 0.94rem;
}

.login-credit-name {
    color: var(--text) !important;
    font-size: 1rem !important;
    font-weight: 700;
}

.login-credit-socials {
    margin-top: 6px;
    display: flex;
    gap: 10px;
}

.login-social-link {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: #fff !important;
    font-size: 0.82rem !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-social-link i {
    font-size: 1rem;
}

.login-social-link.facebook {
    background: #1877f2;
}

.login-social-link.instagram {
    background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}

.dashboard-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(221, 127, 56, 0.12), transparent 20%),
        linear-gradient(180deg, #f3eee6 0%, #e5ecef 100%);
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
    width: 100%;
    overflow-x: clip;
}

.mobile-nav-toggle,
.mobile-nav-overlay,
.mobile-quick-nav {
    display: none;
}

.sidebar {
    background: var(--sidebar);
    color: #f4fbfd;
    padding: 20px 16px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
}

.brand-block h1 {
    margin: 8px 0 10px;
    overflow-wrap: anywhere;
}

.brand-block-compact {
    gap: 10px;
    justify-items: start;
}

.brand-block-compact h1,
.brand-block-compact .brand-copy,
.brand-block-compact .brand-meta {
    display: none;
}

.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #f0a96d);
    box-shadow: 0 12px 24px rgba(221, 127, 56, 0.25);
}

.brand-mark.large {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
}

.brand-logo-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
}

.brand-logo-image.large {
    width: 72px;
    height: 72px;
    border-radius: 22px;
}

.brand-copy {
    color: rgba(244, 251, 253, 0.72);
}

.brand-meta {
    color: rgba(244, 251, 253, 0.72);
    font-size: 0.92rem;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav.grouped {
    align-content: start;
}

.nav-group {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.nav-group-title {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    color: rgba(244, 251, 253, 0.72);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-group-title::-webkit-details-marker {
    display: none;
}

.nav-group-links {
    display: grid;
    gap: 6px;
    padding: 0 8px 8px;
}

.nav-link {
    padding: 9px 10px;
    border-radius: 12px;
    color: rgba(244, 251, 253, 0.82);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateX(2px);
}

.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.nav-icon i,
.mobile-quick-link i,
.mobile-nav-toggle i {
    font-size: 1rem;
}

.sidebar-footer {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sidebar-footer p {
    margin: 4px 0 0;
    color: rgba(244, 251, 253, 0.68);
}

.logout-link {
    color: #fff;
    font-weight: 700;
}

.dashboard-main {
    padding: 28px;
    display: grid;
    gap: 24px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topbar h2 {
    margin: 8px 0 0;
    font-size: 2rem;
}

.connection-badge,
.flash {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 600;
}

.connection-badge {
    background: rgba(30, 107, 124, 0.1);
    color: var(--primary-strong);
}

.connection-badge.offline {
    background: rgba(221, 127, 56, 0.12);
    color: var(--accent);
}

.flash {
    border-radius: 16px;
}

.flash-success {
    background: rgba(31, 138, 88, 0.12);
    color: var(--success);
}

.flash-error {
    background: rgba(201, 73, 73, 0.12);
    color: var(--danger);
}

.stats-grid,
.content-grid,
.report-grid {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    padding: 28px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 20%),
        linear-gradient(135deg, rgba(20, 83, 105, 0.96), rgba(15, 34, 48, 0.98));
    color: #fff;
    box-shadow: var(--shadow);
    min-width: 0;
    align-items: center;
}

.hero-brand-lockup {
    display: grid;
    align-self: stretch;
    align-content: center;
    justify-items: center;
    padding: 10px 0;
}

.hero-logo-image,
.hero-brand-mark {
    width: 92px;
    height: 92px;
    border-radius: 24px;
    box-shadow: 0 18px 32px rgba(15, 37, 48, 0.22);
}

.hero-copy-block,
.chart-panel,
.dashboard-table-panel,
.stat-card,
.panel {
    min-width: 0;
}

.hero-panel h3 {
    margin: 8px 0 10px;
    font-size: 2rem;
    overflow-wrap: anywhere;
}

.hero-panel p {
    margin: 0;
    color: rgba(244, 251, 253, 0.84);
}

.hero-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.hero-meta span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.hero-actions {
    display: grid;
    gap: 12px;
    align-content: center;
}

.dashboard-visual-grid,
.dashboard-alert-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.dashboard-chart-grid {
    gap: 24px;
}

.dashboard-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    align-items: stretch;
}

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

.dashboard-table-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 250, 0.96));
}

.dashboard-table-panel .panel-head {
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(15, 37, 48, 0.07);
}

.dashboard-table-panel .table-wrap {
    border-radius: 18px;
    background: rgba(15, 37, 48, 0.025);
    padding: 4px 8px;
}

.dashboard-table-panel table {
    border-collapse: separate;
    border-spacing: 0;
}

.dashboard-table-panel thead th {
    position: sticky;
    top: 0;
    background: rgba(246, 249, 250, 0.98);
    z-index: 1;
}

.chart-panel {
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(225, 137, 58, 0.12), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 249, 0.96));
}

.chart-panel-stock {
    border-color: rgba(20, 83, 105, 0.14);
}

.chart-panel-flow {
    border-color: rgba(225, 137, 58, 0.18);
}

.chart-panel-head {
    align-items: center;
}

.chart-type-control {
    display: grid;
    gap: 6px;
    min-width: 132px;
}

.chart-type-control span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chart-type-select {
    border: 1px solid rgba(20, 83, 105, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    padding: 10px 12px;
    color: var(--text);
    font-weight: 600;
}

.chart-shell {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.chart-canvas {
    width: 100%;
    min-height: 280px;
    max-width: 100%;
    display: block;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(244, 248, 249, 0.98));
}

.chart-insight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(15, 37, 48, 0.04);
}

.chart-insight strong {
    font-size: 1.2rem;
    color: var(--text);
}

.chart-insight span {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: right;
}

.alert-panel.warning {
    background: linear-gradient(145deg, rgba(255, 247, 236, 0.98), rgba(255, 255, 255, 0.96));
}

.alert-panel.danger-soft {
    background: linear-gradient(145deg, rgba(255, 240, 240, 0.98), rgba(255, 255, 255, 0.96));
}

.alert-stack {
    display: grid;
    gap: 12px;
}

.alert-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.alert-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(15, 37, 48, 0.04);
    display: grid;
    gap: 4px;
}

.alert-item-inline {
    padding: 12px 14px;
    min-height: 0;
}

.alert-item strong {
    font-size: 1rem;
}

.alert-item span,
.alert-item small {
    color: var(--muted);
}

.stat-card {
    padding: 16px 16px 14px;
    min-height: 118px;
}

.stat-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 6px;
    font-size: 0.84rem;
    line-height: 1.2;
}

.stat-card strong {
    font-size: 1.35rem;
    display: block;
    line-height: 1.08;
}

.stat-card small {
    color: var(--muted);
    display: block;
    margin-top: 6px;
    font-size: 0.77rem;
    line-height: 1.3;
}

.panel {
    padding: 24px;
}

.panel-span-full {
    grid-column: 1 / -1;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: baseline;
    margin-bottom: 16px;
}

.panel-head h3 {
    margin: 0;
    font-size: 1.3rem;
}

.form-grid,
.form-2col {
    display: grid;
    gap: 14px;
}

.form-2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-2col button {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 600;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid rgba(15, 37, 48, 0.12);
    background: rgba(247, 250, 251, 0.96);
    color: var(--text);
}

textarea {
    resize: vertical;
}

button,
.button-link,
.quick-link {
    border: none;
    border-radius: 16px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--primary), #2c8798);
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

button:hover,
.button-link:hover,
.quick-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(30, 107, 124, 0.22);
}

.button-link.alt {
    background: linear-gradient(135deg, var(--accent), #e59a61);
}

.table-wrap {
    overflow: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(15, 37, 48, 0.08);
    vertical-align: top;
}

thead th {
    color: var(--muted);
    font-size: 0.92rem;
}

.quick-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-link {
    background: linear-gradient(135deg, rgba(20, 83, 105, 0.96), rgba(42, 112, 133, 0.96));
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 37, 48, 0.03);
}

.activity-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.96rem;
}

.activity-item p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.35;
}

.activity-meta {
    text-align: right;
}

.activity-meta span {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
}

.activity-meta small {
    color: var(--muted);
    font-size: 0.78rem;
}

.balance-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
}

.balance-chip.due {
    background: rgba(221, 127, 56, 0.16);
    color: #a34f14;
}

.balance-chip.clear {
    background: rgba(31, 138, 88, 0.12);
    color: var(--success);
}

.balance-chip.reminder-overdue {
    background: rgba(201, 73, 73, 0.14);
    color: var(--danger);
}

.balance-chip.reminder-upcoming {
    background: rgba(221, 127, 56, 0.16);
    color: #a34f14;
}

.report-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.backup-table-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.backup-table-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 37, 48, 0.04);
    border: 1px solid rgba(15, 37, 48, 0.08);
}

.backup-table-option input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.report-card .button-link {
    flex: 1 1 180px;
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-builder-head,
.ledger-header,
.receipt-meta,
.receipt-customer,
.receipt-summary,
.signature-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.invoice-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.invoice-actions > * {
    flex: 1 1 220px;
}

.invoice-preview-panel {
    align-self: start;
}

.receipt-sheet,
.ledger-sheet {
    background: #fff;
    border: 1px dashed rgba(15, 37, 48, 0.2);
    border-radius: 20px;
    padding: 22px;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid rgba(15, 37, 48, 0.15);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.receipt-header h2,
.ledger-header h2 {
    margin: 0 0 8px;
}

.receipt-header p,
.ledger-header p {
    margin: 4px 0;
    color: var(--muted);
}

.receipt-summary {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px solid rgba(15, 37, 48, 0.1);
}

.receipt-summary > div {
    min-width: 180px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 37, 48, 0.04);
}

.receipt-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
}

.receipt-classic-sheet {
    width: 100%;
    max-width: 210mm;
    margin: 0 auto;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    padding: 18px 22px 14px;
    box-shadow: none;
    color: #111;
    font-family: "Arial Narrow", Arial, Helvetica, sans-serif;
    overflow: hidden;
}

.receipt-classic-header {
    text-align: center;
    border-bottom: 0;
    padding-bottom: 10px;
    margin-bottom: 8px;
}

.receipt-classic-header h1 {
    margin: 0 0 6px;
    font-size: 2.2rem;
    letter-spacing: 0.02em;
    color: #000;
}

.receipt-classic-header .invoice-container {
    max-width: 100%;
    margin: auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    font-family: "Poppins", sans-serif;
}

.receipt-classic-header .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 2px solid #eee;
}

.receipt-classic-header .logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    text-align: left;
}

.receipt-classic-header .invoice-logo-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
    flex: 0 0 70px;
}

.receipt-classic-header .invoice-logo-mark {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    color: #111;
    font-size: 16px;
    font-weight: 400;
    background: transparent;
    border: 0;
    padding-top: 0;
}

.receipt-classic-header .invoice-logo-icon {
    position: relative;
    width: 16px;
    height: 16px;
    border: 1px solid #c8d0da;
    background: linear-gradient(135deg, #ffffff 0%, #eef3f8 100%);
    flex: 0 0 16px;
}

.receipt-classic-header .invoice-logo-icon::before {
    content: "";
    position: absolute;
    left: 2px;
    bottom: 2px;
    width: 10px;
    height: 6px;
    background: linear-gradient(135deg, #8cbf50 0%, #3a9d5d 100%);
    clip-path: polygon(0 100%, 35% 40%, 55% 65%, 100% 0, 100% 100%);
}

.receipt-classic-header .invoice-logo-text {
    line-height: 1;
}

.receipt-classic-header .brand-text {
    padding-top: 0;
    min-width: 0;
    flex: 0 1 auto;
    text-align: left;
    margin-right: auto;
}

.receipt-classic-header .brand-text h1 {
    margin: 0;
    font-size: 50px;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: normal;
    line-height: 1;
    text-align: left;
}

.receipt-classic-header .brand-text p {
    margin: 3px 0 0;
    font-size: 15px;
    color: #666;
    font-weight: 700;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.45;
    text-align: left;
}

.receipt-classic-header .invoice-title {
    text-align: right;
    min-width: 210px;
    padding-top: 0;
    flex: 0 0 auto;
}

.receipt-classic-header .invoice-title h2 {
    margin: 0;
    font-size: 26px;
    color: #111;
    letter-spacing: 2px;
    line-height: 1.45;
    font-weight: 700;
}

.receipt-classic-header .invoice-title span {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: #777;
}

.receipt-classic-header .info-bar {
    background: #1e3a5f;
    color: #fff;
    padding: 10px 30px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 12px;
    border-radius: 0;
}

.receipt-brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.receipt-brand-logo,
.receipt-brand-fallback {
    width: 82px;
    height: 82px;
    object-fit: contain;
    border-radius: 18px;
    border: 1px solid #111;
    background: #fff;
}

.receipt-brand-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.receipt-brand-copy {
    display: grid;
    gap: 4px;
    text-align: left;
}

.receipt-shop-name {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #000;
    text-transform: uppercase;
}

.receipt-shop-subtitle {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    max-width: 520px;
    line-height: 1.35;
}

.receipt-shop-owner {
    margin: 0 0 10px;
    font-size: 1.08rem;
    font-weight: 700;
    color: #111;
    padding: 4px 10px;
    border: 1px solid #111;
    display: inline-block;
}

.receipt-classic-meta-top,
.receipt-classic-staff {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
    text-align: left;
    font-size: 1.02rem;
    color: #000;
    line-height: 1.18;
}

.receipt-classic-customer-line,
.receipt-classic-address-line {
    text-align: left;
    color: #000;
    margin: 4px 0;
    font-size: 1.08rem;
    line-height: 1.18;
}

.receipt-classic-customer-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 5px;
    border-bottom: 2px solid #111;
}

.receipt-classic-customer-inline > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-inline-separator {
    flex: 0 0 auto;
    font-weight: 700;
}

.receipt-classic-address-line {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #111;
}

.receipt-credit-type {
    text-align: right;
    font-weight: 700;
}

.receipt-classic-staff {
    padding: 5px 0 4px;
    border-bottom: 2px solid #111;
    margin-bottom: 4px;
    font-weight: 700;
}

.receipt-classic-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.receipt-classic-table th,
.receipt-classic-table td {
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid #111;
    padding: 7px 6px;
    color: #000;
    background: #fff;
    font-size: 0.98rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.receipt-classic-table th {
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
    font-weight: 800;
    text-transform: uppercase;
}

.receipt-classic-table td:nth-child(1),
.receipt-classic-table td:nth-child(4),
.receipt-classic-table td:nth-child(5),
.receipt-classic-table td:nth-child(6),
.receipt-classic-table td:nth-child(7) {
    text-align: right;
}

.receipt-classic-table th:nth-child(1),
.receipt-classic-table td:nth-child(1) {
    width: 6%;
}

.receipt-classic-table th:nth-child(2),
.receipt-classic-table td:nth-child(2) {
    width: 30%;
}

.receipt-classic-table th:nth-child(3),
.receipt-classic-table td:nth-child(3) {
    width: 17%;
}

.receipt-classic-table th:nth-child(4),
.receipt-classic-table td:nth-child(4) {
    width: 9%;
}

.receipt-classic-table th:nth-child(5),
.receipt-classic-table td:nth-child(5) {
    width: 12%;
}

.receipt-classic-table th:nth-child(6),
.receipt-classic-table td:nth-child(6),
.receipt-classic-table th:nth-child(7),
.receipt-classic-table td:nth-child(7) {
    width: 13%;
}

.receipt-classic-summary {
    margin-top: 26px;
    padding-top: 10px;
    border-top: 2px solid #111;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
}

.receipt-classic-summary-left,
.receipt-classic-summary-right {
    display: grid;
    gap: 8px;
}

.receipt-classic-summary-left > div,
.receipt-classic-summary-right > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 0;
    min-width: 0;
    background: transparent;
    border-radius: 0;
    color: #000;
    font-size: 1.03rem;
}

.receipt-classic-summary-right > div:last-child span,
.receipt-classic-summary-right > div:nth-child(4) span,
.receipt-classic-summary-left > div:nth-child(3) span {
    font-weight: 800;
}

@media (max-width: 900px) {
    .receipt-classic-sheet {
        max-width: 100%;
        padding: 14px 14px 12px;
    }

    .receipt-classic-header .header {
        padding: 16px 18px;
        gap: 16px;
    }

    .receipt-classic-header .brand-text h1 {
        font-size: 40px;
    }

    .receipt-classic-header .brand-text p {
        font-size: 13px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .receipt-classic-header .invoice-title {
        min-width: 160px;
    }

    .receipt-classic-header .invoice-title h2 {
        font-size: 22px;
    }

    .receipt-classic-meta-top,
    .receipt-classic-staff {
        gap: 8px;
        font-size: 0.92rem;
    }

    .receipt-classic-customer-line,
    .receipt-classic-address-line,
    .receipt-classic-summary-left > div,
    .receipt-classic-summary-right > div,
    .receipt-classic-table th,
    .receipt-classic-table td {
        font-size: 0.9rem;
    }

    .receipt-classic-table th,
    .receipt-classic-table td {
        padding: 6px 4px;
    }
}

.receipt-classic-footer {
    margin-top: 22px;
    padding-top: 8px;
    border-top: 2px solid #111;
    color: #000;
    text-align: left;
}

.receipt-classic-footer p {
    color: #000;
    margin: 6px 0;
}

.thermal-receipt-mode .receipt-brand-block {
    display: none;
}

.thermal-receipt-mode .receipt-operator-line {
    display: none;
}

.thermal-receipt-mode .receipt-classic-meta-top,
.thermal-receipt-mode .receipt-classic-staff {
    gap: 8px;
    font-size: 0.94rem;
    line-height: 1.1;
}

.thermal-receipt-mode .receipt-classic-customer-line,
.thermal-receipt-mode .receipt-classic-address-line {
    margin: 2px 0;
    font-size: 0.95rem;
    line-height: 1.08;
}

.thermal-receipt-mode .receipt-classic-customer-inline {
    gap: 5px;
    padding-bottom: 3px;
}

.thermal-receipt-mode .receipt-classic-staff {
    grid-template-columns: minmax(0, 1fr);
    padding: 3px 0;
    margin-bottom: 2px;
}

.thermal-receipt-mode .receipt-classic-table th,
.thermal-receipt-mode .receipt-classic-table td {
    padding: 5px 5px;
    font-size: 0.94rem;
    line-height: 1.12;
}

.thermal-receipt-mode .receipt-classic-summary {
    margin-top: 8px;
    padding-top: 6px;
    gap: 10px;
}

.thermal-receipt-mode .receipt-classic-summary-left,
.thermal-receipt-mode .receipt-classic-summary-right {
    gap: 2px;
}

.thermal-receipt-mode .receipt-classic-summary-left > div,
.thermal-receipt-mode .receipt-classic-summary-right > div {
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.08;
}

.thermal-receipt-mode .receipt-classic-footer {
    margin-top: 10px;
}

.thermal-receipt-mode .receipt-classic-footer p {
    margin: 4px 0;
    line-height: 1.14;
}

.receipt-powered {
    font-size: 0.86rem;
}

.ledger-meta {
    text-align: right;
    display: grid;
    gap: 6px;
}

.ledger-table .number-col {
    text-align: right;
    white-space: nowrap;
}

.debit-col {
    background: rgba(221, 127, 56, 0.08);
}

.credit-col {
    background: rgba(31, 138, 88, 0.08);
}

.ledger-summary {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.signature-row {
    margin-top: 36px;
    border-top: 1px solid rgba(15, 37, 48, 0.1);
    padding-top: 18px;
}

.report-card p {
    color: var(--muted);
    min-height: 48px;
}

.report-group-stack {
    display: grid;
    gap: 20px;
}

.report-group-panel {
    padding: 20px;
}

.report-group-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.report-group-head h3 {
    margin: 6px 0 4px;
    font-size: 1.28rem;
}

.report-group-head span {
    color: var(--muted);
}

.report-group-head strong {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 37, 48, 0.06);
    color: var(--primary-strong);
    white-space: nowrap;
    font-size: 0.88rem;
}

.report-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.report-tile {
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(15, 37, 48, 0.08);
    display: grid;
    gap: 14px;
    min-height: 210px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 252, 0.96));
}

.report-tile.tone-ocean {
    background: linear-gradient(145deg, rgba(233, 245, 249, 0.98), rgba(255, 255, 255, 0.96));
}

.report-tile.tone-amber {
    background: linear-gradient(145deg, rgba(255, 246, 234, 0.98), rgba(255, 255, 255, 0.96));
}

.report-tile.tone-rose {
    background: linear-gradient(145deg, rgba(255, 241, 241, 0.98), rgba(255, 255, 255, 0.96));
}

.report-tile.tone-emerald {
    background: linear-gradient(145deg, rgba(238, 250, 244, 0.98), rgba(255, 255, 255, 0.96));
}

.report-tile.tone-slate {
    background: linear-gradient(145deg, rgba(240, 244, 246, 0.98), rgba(255, 255, 255, 0.96));
}

.report-tile.tone-violet {
    background: linear-gradient(145deg, rgba(244, 240, 252, 0.98), rgba(255, 255, 255, 0.96));
}

.report-tile-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.report-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 24px rgba(20, 83, 105, 0.16);
}

.report-tag {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 37, 48, 0.07);
    color: var(--primary-strong);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.report-tile-copy h4 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.report-tile-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.report-tile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.report-launch-form {
    align-items: center;
}

.report-format-select {
    flex: 1 1 170px;
    min-width: 150px;
    background: rgba(255, 255, 255, 0.92);
}

.mini-action {
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(20, 83, 105, 0.1);
    color: var(--primary-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.mini-action.alt {
    background: rgba(225, 137, 58, 0.14);
    color: #9b571c;
}

.settings-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}

.settings-preview-card {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 240, 0.96));
    border: 1px solid rgba(15, 37, 48, 0.08);
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
    align-content: center;
}

.settings-preview-card strong {
    font-size: 1.2rem;
}

.settings-preview-card span,
.settings-preview-card small {
    color: var(--muted);
}

.live-search-box {
    margin-bottom: 14px;
}

.live-search-input {
    max-width: 420px;
    background: #fff;
}

.invoice-search-shell {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(30, 58, 95, 0.06), rgba(255, 255, 255, 0.98)),
        #fff;
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.06);
}

.invoice-search-copy {
    display: grid;
    gap: 4px;
}

.invoice-search-copy strong {
    color: #1e3a5f;
    font-size: 1rem;
    font-weight: 700;
}

.invoice-search-copy span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.invoice-search-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.invoice-search-input {
    min-width: min(100%, 320px);
    max-width: 460px;
    flex: 1 1 320px;
    border-radius: 999px;
    padding-left: 18px;
    font-weight: 600;
    border: 1px solid rgba(30, 58, 95, 0.16);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.invoice-search-status {
    color: #1e3a5f;
    font-size: 0.9rem;
    font-weight: 600;
}

.hidden-field {
    display: none;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.sales-builder-panel {
    padding: 18px;
    background: linear-gradient(145deg, rgba(248, 251, 252, 0.98), rgba(255, 255, 255, 0.98));
}

.sale-entry-panel .form-grid,
.invoice-entry-panel .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.sale-entry-panel .form-grid > .sales-builder-panel,
.sale-entry-panel .form-grid > label:last-of-type,
.sale-entry-panel .form-grid > button,
.invoice-entry-panel .form-grid > .sales-builder-table-wrap,
.invoice-entry-panel .form-grid > .invoice-summary-strip,
.invoice-entry-panel .form-grid > .invoice-actions,
.invoice-entry-panel .form-grid > .soft-copy {
    grid-column: 1 / -1;
}

.invoice-entry-layout {
    grid-template-columns: 1fr;
}

.sales-builder-table-wrap {
    grid-column: 1 / -1;
}

.invoice-entry-panel .invoice-builder-head {
    align-items: flex-start;
}

.invoice-entry-panel .invoice-builder-head h4 {
    margin: 0 0 6px;
}

.invoice-summary-strip {
    margin-bottom: 6px;
}

#invoiceTempCustomerWrap,
#invoiceSaveCustomerWrap,
#invoiceDueDateWrap {
    grid-column: span 1;
}

#invoiceSaveCustomerWrap {
    align-content: end;
}

#invoiceSaveCustomerWrap input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.sales-summary-strip {
    margin-top: 14px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.sales-summary-strip span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 37, 48, 0.06);
    color: var(--muted);
}

.sales-summary-strip strong {
    color: var(--primary-strong);
}

.table-inline-help {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.sale-product-picker {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 252, 0.96), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(15, 37, 48, 0.08);
}

.sale-product-picker input[type="search"],
#saleProductSearch {
    margin-bottom: 0;
}

.sale-product-search-results {
    display: none;
    border: 1px solid rgba(15, 37, 48, 0.08);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 37, 48, 0.08);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

.sale-product-search-results.active {
    display: grid;
}

.sale-product-search-item,
.sale-product-search-empty {
    padding: 10px 14px;
}

.sale-product-search-item {
    border: 0;
    background: transparent;
    text-align: left;
    display: grid;
    gap: 4px;
    width: 100%;
    cursor: pointer;
}

.sale-product-search-item:hover,
.sale-product-search-item.active {
    background: rgba(30, 107, 124, 0.08);
}

.sale-product-search-main {
    color: var(--primary-strong);
    font-weight: 700;
}

.sale-product-search-sub,
.sale-product-search-empty {
    color: var(--muted);
    font-size: 0.84rem;
}

.sale-product-native-select {
    display: none;
}

.sale-measure-wrap {
    display: grid;
    gap: 6px;
}

.sale-measure-wrap select {
    margin-bottom: 0;
}

.settings-permission-panel {
    display: grid;
    gap: 12px;
}

.settings-permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.settings-permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(20, 83, 105, 0.05);
    border: 1px solid rgba(20, 83, 105, 0.08);
}

.settings-permission-item input {
    margin: 0;
}

.rate-chatbot-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-strong), #1f7b8a 60%, var(--accent));
    color: #fff;
    box-shadow: 0 20px 40px rgba(15, 37, 48, 0.24);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.rate-chatbot-toggle:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 24px 42px rgba(15, 37, 48, 0.28);
}

.rate-chatbot {
    position: fixed;
    right: 24px;
    bottom: 98px;
    z-index: 1199;
    width: min(380px, calc(100vw - 28px));
    border-radius: 26px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 37, 48, 0.08);
    box-shadow: 0 28px 56px rgba(15, 37, 48, 0.18);
    transform-origin: bottom right;
    animation: rateChatbotPop 0.24s ease;
}

.rate-chatbot.hidden {
    display: none;
}

.rate-chatbot-head {
    padding: 16px 18px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 24%),
        linear-gradient(135deg, var(--primary-strong), #1b6a7a);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    cursor: move;
}

.rate-chatbot-head small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.8);
}

.rate-chatbot-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.rate-chatbot-body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.rate-chatbot-bubble {
    padding: 12px 14px;
    border-radius: 18px 18px 18px 6px;
    background: linear-gradient(135deg, rgba(20, 83, 105, 0.08), rgba(221, 127, 56, 0.08));
    color: var(--text);
    font-weight: 600;
}

.rate-chatbot-body label {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: var(--primary-strong);
}

.rate-chatbot-body input {
    margin-bottom: 0;
}

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

.rate-chatbot-results {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rate-chatbot-results article {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 252, 0.98), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(15, 37, 48, 0.08);
    display: grid;
    gap: 6px;
}

.rate-chatbot-results span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.rate-chatbot-results strong {
    color: var(--primary-strong);
    font-size: 1.1rem;
}

@keyframes rateChatbotPop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .rate-chatbot-toggle {
        right: 14px;
        bottom: 14px;
        width: 56px;
        height: 56px;
    }

    .rate-chatbot {
        right: 14px !important;
        left: 14px;
        bottom: 82px;
        width: auto;
    }

    .rate-chatbot-results {
        grid-template-columns: 1fr;
    }
}

.offline-sales-panel {
    display: grid;
    gap: 12px;
}

.offline-sales-empty {
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(15, 37, 48, 0.05);
    color: var(--muted);
}

.offline-sale-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 248, 238, 0.98), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(225, 137, 58, 0.18);
    display: grid;
    gap: 10px;
}

.offline-sale-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--primary-strong);
}

.offline-sale-card-head strong {
    font-size: 1rem;
}

.offline-sale-card-head span,
.offline-sale-card-products {
    color: var(--muted);
    font-size: 0.92rem;
}

.offline-sale-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.offline-sale-card-meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(225, 137, 58, 0.12);
    color: #9b571c;
    font-size: 0.82rem;
    font-weight: 700;
}

.pagination-bar {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(30, 107, 124, 0.12);
    color: var(--primary-strong);
    font-weight: 700;
}

.pagination-link.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.pagination-status {
    color: var(--muted);
    font-weight: 600;
}

.action-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-action {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(30, 107, 124, 0.12);
    color: var(--primary-strong);
    font-weight: 700;
    font-size: 0.9rem;
}

.table-action.danger {
    background: rgba(201, 73, 73, 0.12);
    color: var(--danger);
}

.table-action.whatsapp-action {
    background: rgba(31, 138, 88, 0.14);
    color: var(--success);
}

.collapsible-panel {
    overflow: hidden;
}

.collapsible-summary {
    list-style: none;
    cursor: pointer;
    margin-bottom: 0;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-title-wrap {
    display: grid;
    gap: 4px;
}

.collapsible-indicator {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 37, 48, 0.06);
    color: var(--primary-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.collapsible-panel[open] .collapsible-indicator {
    background: rgba(225, 137, 58, 0.16);
    color: #9b571c;
}

.collapsible-content {
    margin-top: 16px;
}

.soft-copy {
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 16px;
}

.soft-copy[data-state="success"] {
    color: #1f8a58;
    font-weight: 700;
}

.soft-copy[data-state="error"] {
    color: var(--danger);
    font-weight: 700;
}

button:disabled,
.button-link:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dark-list {
    padding-left: 18px;
    margin: 0;
}

.dark-list li {
    color: var(--text);
}

.category-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.category-tile {
    background: linear-gradient(145deg, #163c4c 0%, #1f6171 100%);
    color: #fff;
    padding: 22px;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.category-tile span {
    display: block;
    color: rgba(255, 255, 255, 0.76);
    margin-bottom: 8px;
}

.category-tile strong {
    font-size: 1.6rem;
}

.category-metric-list {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.category-metric-list small {
    display: block;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.84rem;
}

.report-body {
    background: #e6eef0;
    padding: 24px;
}

.report-shell {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.report-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.letterpad {
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.letterpad-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
}

.letterpad-logo {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #163c4c, #dd7f38);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
}

.report-logo-image {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    object-fit: cover;
    border: 1px solid rgba(15, 37, 48, 0.12);
    background: #fff;
}

.letterpad-title h1 {
    margin: 0 0 10px;
    font-size: 1.8rem;
}

.letterpad-title p,
.letterpad-meta span {
    margin: 4px 0;
    color: var(--muted);
}

.letterpad-meta {
    text-align: right;
    display: grid;
    gap: 6px;
}

.letterpad-divider {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #163c4c, #dd7f38);
    margin: 20px 0;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    border: 1px solid rgba(15, 37, 48, 0.1);
    padding: 12px 10px;
}

.report-table th {
    background: #eef5f7;
}

.report-summary-grid {
    margin-bottom: 16px;
}

.thermal-body {
    background: #f5f5f5;
}

.thermal-pad {
    max-width: 420px;
    margin: 0 auto;
    border: 1px dashed rgba(0, 0, 0, 0.3);
    font-size: 0.92rem;
}

.thermal-pad .letterpad-head,
.thermal-pad .receipt-summary {
    grid-template-columns: 1fr;
}

.thermal-pad .letterpad-logo {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
}

.thermal-pad .report-table th,
.thermal-pad .report-table td {
    padding: 8px 6px;
    font-size: 0.84rem;
}

.footer-note {
    padding: 8px 0 2px;
}

.footer-credit {
    margin-top: 8px;
    border-top: 1px solid rgba(15, 37, 48, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-credit-copy {
    display: grid;
    gap: 4px;
}

.footer-credit-copy strong {
    color: var(--text);
    font-size: 0.92rem;
}

.footer-credit-copy span,
.footer-credit-copy a {
    color: var(--muted);
    font-size: 0.86rem;
}

.footer-socials {
    display: flex;
    gap: 10px;
}

.footer-social {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 10px 20px rgba(20, 83, 105, 0.18);
}

code {
    background: rgba(15, 37, 48, 0.06);
    padding: 2px 6px;
    border-radius: 8px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .category-summary-grid,
    .report-grid,
    .content-grid,
    .settings-hero {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .report-tile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-visual-grid,
    .dashboard-alert-grid {
        grid-template-columns: 1fr;
    }

    .compact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .dashboard-shell,
    .login-shell {
        grid-template-columns: 1fr;
    }

    .mobile-nav-toggle {
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1400;
        width: 48px;
        height: 48px;
        border: 0;
        border-radius: 14px;
        background: linear-gradient(135deg, var(--primary-strong), var(--accent));
        color: #fff;
        display: inline-grid;
        place-items: center;
        box-shadow: 0 18px 30px rgba(15, 37, 48, 0.18);
    }

    .mobile-nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 1300;
        background: rgba(12, 27, 35, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.mobile-nav-open .mobile-nav-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(310px, calc(100vw - 52px));
        z-index: 1350;
        gap: 18px;
        transform: translateX(-104%);
        transition: transform 220ms ease;
        overflow-y: auto;
        box-shadow: 0 24px 42px rgba(15, 37, 48, 0.26);
    }

    body.mobile-nav-open .sidebar {
        transform: translateX(0);
    }

    .dashboard-main {
        padding: 74px 18px 86px;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        padding-left: 48px;
        min-width: 0;
    }

    .form-2col,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-grid {
        grid-template-columns: 1fr;
    }

    .sale-entry-panel .form-grid,
    .invoice-entry-panel .form-grid {
        grid-template-columns: 1fr;
    }

    .letterpad-head {
        grid-template-columns: 1fr;
    }

    .letterpad-meta {
        text-align: left;
    }

    .mobile-quick-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1250;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 10px;
        padding: 10px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(15, 37, 48, 0.08);
        box-shadow: 0 16px 30px rgba(15, 37, 48, 0.16);
        backdrop-filter: blur(12px);
    }

    .mobile-quick-link {
        display: grid;
        justify-items: center;
        gap: 4px;
        padding: 10px 8px;
        border-radius: 18px;
        color: var(--muted);
        font-size: 0.8rem;
        font-weight: 700;
    }

    .mobile-quick-link.active {
        background: linear-gradient(135deg, rgba(20, 83, 105, 0.12), rgba(221, 127, 56, 0.14));
        color: var(--primary-strong);
    }

    .hero-brand-lockup {
        justify-items: flex-start;
    }
}

@media (max-width: 640px) {
    .login-panel,
    .login-side,
    .panel,
    .stat-card {
        padding: 20px;
    }

    .sidebar {
        width: min(290px, calc(100vw - 34px));
        padding: 18px 14px 24px;
    }

    .quick-links,
    .report-actions,
    .report-toolbar,
    .footer-credit {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-link,
    .button-link,
    button {
        width: 100%;
    }

    .topbar {
        padding-left: 42px;
    }

    .topbar h2 {
        font-size: 1.5rem;
    }

    .hero-panel {
        padding: 20px;
    }

    .hero-actions,
    .hero-meta,
    .chart-panel-head,
    .chart-insight {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-quick-nav {
        left: 8px;
        right: 8px;
        bottom: 8px;
        gap: 6px;
        padding: 8px;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 0.92rem;
    }

    table {
        min-width: 560px;
    }

    .activity-item {
        flex-direction: column;
    }

    .activity-meta {
        text-align: left;
    }

    .letterpad {
        padding: 18px;
    }

    .receipt-meta,
    .receipt-customer,
    .receipt-summary,
    .signature-row,
    .invoice-builder-head,
    .ledger-header,
    .login-brand-stack,
    .sales-summary-strip {
        flex-direction: column;
    }

    .report-group-head,
    .report-tile-actions {
        flex-direction: column;
    }

    .report-tile-grid {
        grid-template-columns: 1fr;
    }

    .receipt-classic-meta-top,
    .receipt-classic-staff,
    .receipt-classic-summary {
        grid-template-columns: 1fr;
    }

    .receipt-brand-lockup {
        flex-direction: column;
        text-align: center;
    }

    .receipt-brand-copy {
        text-align: center;
    }

    .receipt-classic-header .header,
    .receipt-classic-header .logo-section,
    .receipt-classic-header .info-bar {
        flex-direction: column;
        text-align: center;
    }

    .receipt-classic-header .invoice-title {
        text-align: center;
    }

    .receipt-classic-header .brand-text p {
        margin-top: 12px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .receipt-classic-sheet {
        padding: 12px 10px;
        border-radius: 0;
    }

    .receipt-classic-table th,
    .receipt-classic-table td {
        padding: 5px 3px;
        font-size: 0.78rem;
    }

    .receipt-classic-summary-left > div,
    .receipt-classic-summary-right > div,
    .receipt-classic-customer-line,
    .receipt-classic-address-line,
    .receipt-classic-meta-top,
    .receipt-classic-staff {
        font-size: 0.82rem;
    }

    .receipt-classic-customer-inline {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .receipt-inline-separator {
        display: none;
    }
}

@media print {
    @page {
        size: auto;
        margin: 6mm;
    }

    html,
    body {
        background: #fff !important;
    }

    .receipt-classic-header .brand-text p {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .receipt-classic-header .header {
        gap: 12px;
    }

    .sidebar,
    .topbar,
    .flash,
    .footer-note,
    .invoice-actions,
    .report-actions,
    .panel > .panel-head:not(.invoice-preview-panel .panel-head) {
        display: none !important;
    }

    .dashboard-shell {
        display: block;
    }

    .dashboard-main {
        padding: 0;
    }

    .panel,
    .invoice-preview-panel,
    .ledger-sheet {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
    }

    #invoiceForm,
    .panel:not(.invoice-preview-panel):not(.ledger-sheet) {
        display: none !important;
    }

    .invoice-preview-panel,
    .ledger-sheet {
        display: block !important;
    }

    .report-toolbar {
        display: none;
    }

    .thermal-pad {
        max-width: none;
        border: none;
    }

    .report-body {
        background: #fff;
        padding: 0;
    }

    .letterpad {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .receipt-classic-sheet {
        border: none;
        max-width: 100%;
        width: 100%;
        padding: 0;
        margin: 0 auto;
        font-family: "Arial Narrow", Arial, Helvetica, sans-serif;
    }

    .thermal-receipt-mode {
        max-width: 80mm;
    }

    .thermal-receipt-mode .receipt-brand-block,
    .thermal-receipt-mode .receipt-operator-line {
        display: none !important;
    }

    .thermal-receipt-mode .receipt-classic-header .invoice-container {
        box-shadow: none;
        border-radius: 0;
    }

    .thermal-receipt-mode .receipt-classic-header .header {
        padding: 10px 0 8px;
        gap: 10px;
    }

    .thermal-receipt-mode .receipt-classic-header .invoice-logo-image,
    .thermal-receipt-mode .receipt-classic-header .invoice-logo-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .thermal-receipt-mode .receipt-classic-header .brand-text h1 {
        font-size: 24px;
    }

    .thermal-receipt-mode .receipt-classic-header .brand-text p,
    .thermal-receipt-mode .receipt-classic-header .invoice-title span,
    .thermal-receipt-mode .receipt-classic-meta-top,
    .thermal-receipt-mode .receipt-classic-staff,
    .thermal-receipt-mode .receipt-classic-customer-line,
    .thermal-receipt-mode .receipt-classic-address-line,
    .thermal-receipt-mode .receipt-classic-summary-left > div,
    .thermal-receipt-mode .receipt-classic-summary-right > div {
        font-size: 10px;
        line-height: 1.3;
    }

    .thermal-receipt-mode .receipt-classic-header .invoice-title {
        min-width: 88px;
    }

    .thermal-receipt-mode .receipt-classic-header .invoice-title h2 {
        font-size: 16px;
        letter-spacing: 1px;
        line-height: 1.2;
    }

    .thermal-receipt-mode .receipt-classic-header .info-bar {
        padding: 6px 8px;
        font-size: 10px;
        gap: 6px;
    }

    .thermal-receipt-mode .receipt-classic-meta-top,
    .thermal-receipt-mode .receipt-classic-staff,
    .thermal-receipt-mode .receipt-classic-summary {
        gap: 4px;
    }

    .thermal-receipt-mode .receipt-classic-table th,
    .thermal-receipt-mode .receipt-classic-table td {
        padding: 4px 2px;
        font-size: 9px;
        line-height: 1.1;
    }

    .thermal-receipt-mode .receipt-classic-summary {
        margin-top: 6px;
        gap: 6px;
    }

    .thermal-receipt-mode .receipt-classic-footer {
        margin-top: 10px;
        padding-top: 6px;
        font-size: 9px;
    }
}

