:root {
    --brand-950: #0F1F3D;
    --brand-900: #0F1F3D;
    --brand-800: #2F7EE8;
    --brand-700: #2F7EE8;
    --brand-600: #B5D4F4;
    --accent-600: #2F7EE8;
    --accent-500: #2F7EE8;
    --surface-0: #F0F4FB;
    --surface-1: #FFFFFF;
    --surface-2: #FFFFFF;
    --surface-3: #E6EEF8;
    --text-950: #0F1F3D;
    --text-800: #0F1F3D;
    --text-700: #7A8FAE;
    --text-500: #9BAECC;
    --border-color: #D7E2F0;
    --border-strong: #B5D4F4;
    --success-bg: #dcfce7;
    --warning-bg: #fff3cd;
    --danger-bg: #fee2e2;
    --shadow-soft: 0 20px 46px rgba(15, 31, 61, 0.10);
    --shadow-card: 0 14px 30px rgba(15, 31, 61, 0.08);
    --radius-xl: 0;
    --radius-lg: 0;
    --radius-md: 0;
    --radius-sm: 0;
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-border-radius-xl: 0;
    --bs-border-radius-xxl: 0;
    --bs-border-radius-2xl: 0;
    --bs-border-radius-pill: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    border-radius: 0 !important;
}

[class*="rounded"] {
    border-radius: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-start-start-radius: 0 !important;
    border-start-end-radius: 0 !important;
    border-end-start-radius: 0 !important;
    border-end-end-radius: 0 !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text-950);
    background:
        radial-gradient(circle at top left, rgba(255, 178, 72, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(47, 126, 232, 0.12), transparent 32%),
        linear-gradient(180deg, #F0F4FB 0%, #F0F4FB 45%, #F0F4FB 100%);
}

.app-shell {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-layout {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.app-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: 300px;
    min-width: 300px;
    height: 100vh;
    padding: 1rem 0.95rem;
}

.app-sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    padding: 1.4rem 1.05rem;
    border: 1px solid rgba(47, 126, 232, 0.10);
    border-radius: 0 !important;
    background:
        linear-gradient(180deg, rgba(246, 247, 255, 0.98), rgba(241, 244, 253, 0.96));
    box-shadow: var(--shadow-card);
}

.sidebar-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.2rem 0.2rem 1rem;
    border-bottom: 1px solid rgba(47, 126, 232, 0.10);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 0 !important;
    background: linear-gradient(135deg, var(--brand-700), var(--brand-800));
    box-shadow: 0 14px 28px rgba(47, 126, 232, 0.18);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.sidebar-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.brand-title {
    font-size: 1.04rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--brand-900);
}

.brand-tagline {
    font-size: 0.74rem;
    color: var(--text-700);
}

.sidebar-section-label {
    padding: 0 0.25rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-700);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.92rem 1rem;
    border: 1px solid transparent;
    border-radius: 0 !important;
    background: transparent;
    color: var(--text-800);
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-link:hover {
    transform: translateX(2px);
    border-color: rgba(47, 126, 232, 0.10);
    background: rgba(47, 126, 232, 0.06);
}

.sidebar-link.active {
    border-color: rgba(47, 126, 232, 0.14);
    background:
        linear-gradient(180deg, rgba(228, 233, 255, 0.96), rgba(240, 243, 255, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: var(--brand-900);
}

.sidebar-link-label {
    font-size: 0.97rem;
    font-weight: 800;
}

.sidebar-user-card {
    margin-top: auto;
    padding: 1rem;
    border: 1px solid rgba(47, 126, 232, 0.12);
    border-radius: 0 !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 255, 0.96));
}

.sidebar-user-name {
    margin-top: 0.22rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-950);
}

.sidebar-logout-btn {
    width: 100%;
    border-radius: 0 !important;
    font-weight: 800;
    padding: 0.82rem 1rem;
}

.app-mobile-sidebar {
    width: min(88vw, 320px);
    border-right: 0;
    background:
        linear-gradient(180deg, rgba(246, 247, 255, 0.98), rgba(241, 244, 253, 0.98));
}

.app-mobile-sidebar .offcanvas-header,
.app-mobile-sidebar .offcanvas-body {
    padding: 1.2rem;
}

.app-mobile-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.app-content-shell {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    top: 0;
    z-index: 1020;
    padding: 1rem 1.4rem 0;
    background: linear-gradient(180deg, rgba(244, 246, 251, 0.94), rgba(244, 246, 251, 0));
}

.app-topbar-inner {
    width: min(1460px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(47, 126, 232, 0.10);
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 10px 24px rgba(86, 96, 164, 0.05);
    backdrop-filter: blur(10px);
}

.app-topbar-start {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.app-menu-toggle {
    border: 1px solid rgba(47, 126, 232, 0.14);
    border-radius: 0 !important;
    padding: 0.72rem 0.95rem;
    font-weight: 800;
    color: var(--brand-900);
    background: rgba(47, 126, 232, 0.08);
}

.topbar-copy {
    min-width: 0;
}

.topbar-title {
    font-size: 1.04rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-950);
}

.app-user-pill {
    display: flex;
    align-items: center;
    padding: 0.82rem 1rem;
    border: 1px solid rgba(47, 126, 232, 0.14);
    border-radius: 0 !important;
    background: rgba(47, 126, 232, 0.06);
    color: var(--text-950);
}

.user-pill-label {
    color: var(--text-700);
}

.app-main {
    flex: 1 1 auto;
    padding: 1.5rem 1.4rem 0;
}

.app-main-inner {
    width: min(1460px, 100%);
    margin: 0 auto;
}

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

.page-title {
    margin: 0;
    font-size: clamp(1.8rem, 2.5vw, 2.35rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin: 0.45rem 0 0;
    max-width: 780px;
    color: var(--text-700);
    font-size: 1rem;
}

.page-header > :last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.billing-hero {
    padding: 1.6rem;
    background:
        radial-gradient(circle at top right, rgba(47, 126, 232, 0.10), transparent 22%),
        radial-gradient(circle at left center, rgba(255, 178, 72, 0.10), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 255, 0.98));
}

.billing-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
    gap: 1.35rem;
    align-items: stretch;
}

.billing-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.billing-eyebrow,
.billing-pane-eyebrow {
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-700);
}

.page-subtitle,
.billing-eyebrow,
.billing-pane-eyebrow {
    display: none;
}

.billing-page-kicker,
.billing-section-kicker {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-700);
}

.billing-hero-grid-wide {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
}

.billing-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    width: 100%;
}

.billing-overview-card {
    padding: 1rem 1.05rem;
    border: 1px solid rgba(47, 126, 232, 0.12);
    border-radius: 0 !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 246, 255, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.billing-overview-label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-700);
}

.billing-overview-value {
    margin-top: 0.48rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-950);
    line-height: 1.4;
}

.billing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
}

.billing-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.billing-mini-card {
    padding: 1rem;
    border: 1px solid rgba(47, 126, 232, 0.10);
    border-radius: 0 !important;
    background: linear-gradient(180deg, rgba(248, 249, 255, 0.95), rgba(255, 255, 255, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.billing-mini-label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-700);
}

.billing-mini-value {
    margin-top: 0.4rem;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-950);
}

.billing-status-stack,
.billing-main-stack,
.billing-sidebar-stack,
.billing-shortcuts-grid {
    display: grid;
    gap: 1rem;
}

.billing-layout {
    align-items: flex-start;
}

.billing-section {
    padding: 1.45rem;
}

.billing-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.billing-section-head .section-title {
    margin-bottom: 0;
}

.billing-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.billing-row-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.billing-notes-textarea {
    min-height: 150px;
}

.billing-payment-block,
.billing-payment-split,
.billing-tools-card {
    border: 1px solid rgba(47, 126, 232, 0.10);
    border-radius: 0 !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 255, 0.94));
}

.billing-payment-block {
    padding: 1rem 1.05rem;
}

.billing-payment-split {
    padding: 1rem 1.05rem;
}

.billing-tools-card {
    padding: 1.35rem;
}

.billing-shortcuts-grid .btn {
    width: 100%;
}

.detail-metric-highlight {
    border-color: rgba(47, 126, 232, 0.16);
    background:
        radial-gradient(circle at top right, rgba(47, 126, 232, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(245, 247, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.billing-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.billing-items-header {
    margin-top: 0.35rem;
}

.content-card,
.stat-card,
.form-card,
.table-card,
.login-card,
.detail-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 0 !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 255, 0.96));
    box-shadow: var(--shadow-card);
}

.content-card::before,
.form-card::before,
.table-card::before,
.detail-card::before,
.login-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
}

.content-card,
.form-card,
.table-card,
.detail-card {
    padding: 1.5rem;
}

.table-card,
.detail-card {
    overflow: hidden;
}

.section-title {
    margin-bottom: 1rem;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.stat-card {
    height: 100%;
    padding: 1.25rem;
    background:
        radial-gradient(circle at 100% 100%, rgba(47, 126, 232, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 255, 0.98));
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -26px;
    bottom: -26px;
    width: 108px;
    height: 108px;
    border-radius: 0 !important;
    background: rgba(47, 126, 232, 0.10);
}

.stat-label {
    color: var(--text-700);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 0.55rem;
    font-size: clamp(1.55rem, 2vw, 2.05rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.stat-meta {
    position: relative;
    z-index: 1;
    margin-top: 0.75rem;
    color: var(--text-700);
    font-size: 0.92rem;
    line-height: 1.45;
}

.summary-strip {
    border: 1px solid rgba(47, 126, 232, 0.10);
    border-radius: 0 !important;
    padding: 1.35rem;
    color: var(--text-950);
    background:
        radial-gradient(circle at top right, rgba(47, 126, 232, 0.12), transparent 24%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 245, 255, 0.98));
    box-shadow: var(--shadow-soft);
}

.summary-strip .summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.summary-strip .summary-label {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-700);
    opacity: 1;
}

.summary-strip .summary-value {
    margin-top: 0.38rem;
    font-size: 1.38rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.chart-canvas-wrap {
    position: relative;
    min-height: 340px;
    padding-top: 0.25rem;
}

.chart-summary-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-month-filter {
    margin: 0;
}

.dashboard-month-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
}

.dashboard-month-select {
    min-width: 180px;
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid rgba(47, 126, 232, 0.08);
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.86);
    -webkit-overflow-scrolling: touch;
}

.table-card .table,
.detail-card .table {
    min-width: 720px;
}

.table-card .bill-table {
    min-width: 100%;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid rgba(47, 126, 232, 0.10);
    background: linear-gradient(180deg, #fafbff, #eff2fb);
    color: var(--text-700);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    padding: 0.95rem 0.85rem;
    vertical-align: middle;
}

.table tbody td {
    border-color: rgba(47, 126, 232, 0.08);
}

.table-hover tbody tr:hover {
    background: rgba(47, 126, 232, 0.05);
}

.form-label {
    margin-bottom: 0.55rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-800);
}

.form-control,
.form-select {
    min-height: 48px;
    padding: 0.72rem 0.95rem;
    border-radius: 0 !important;
    border: 1px solid rgba(47, 126, 232, 0.12);
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-950);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(47, 126, 232, 0.55);
    box-shadow: 0 0 0 0.22rem rgba(47, 126, 232, 0.14);
}

.form-control[readonly],
.form-control.bg-light,
.line-total.bg-light {
    background: #f6f8fb !important;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}

.ts-wrapper.form-select,
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    min-height: 48px;
    border-radius: 0 !important;
    border: 1px solid rgba(47, 126, 232, 0.12);
    padding: 0.54rem 0.9rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: none;
}

.ts-wrapper.focus .ts-control {
    border-color: rgba(47, 126, 232, 0.55);
    box-shadow: 0 0 0 0.22rem rgba(47, 126, 232, 0.14);
}

.ts-wrapper .ts-control > input {
    font-size: 1rem;
}

.ts-dropdown {
    border: 1px solid rgba(47, 126, 232, 0.14);
    border-radius: 0 !important;
    overflow: hidden;
    z-index: 5000 !important;
    box-shadow: var(--shadow-soft);
}

.ts-dropdown .option.active {
    background: rgba(47, 126, 232, 0.10);
    color: var(--brand-900);
}

.ts-dropdown .ts-dropdown-content {
    max-height: 260px;
    overflow-y: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.74rem 1.08rem;
    border-radius: 0 !important;
    font-weight: 800;
    letter-spacing: -0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus {
    box-shadow: 0 0 0 0.22rem rgba(47, 126, 232, 0.18);
}

.btn-primary {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-800), var(--brand-700));
    box-shadow: 0 12px 26px rgba(47, 126, 232, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-900), var(--brand-800));
}

.btn-outline-dark {
    border-color: rgba(47, 126, 232, 0.18);
    color: var(--brand-800);
    background: rgba(255, 255, 255, 0.88);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
    border-color: var(--brand-800);
    color: var(--brand-900);
    background: rgba(47, 126, 232, 0.08);
}

.btn-outline-light {
    border-color: rgba(47, 126, 232, 0.20);
    color: var(--brand-800);
    background: rgba(255, 255, 255, 0.95);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
    border-color: var(--brand-800);
    color: #fff;
    background: var(--brand-800);
}

.btn-outline-danger {
    border-color: rgba(220, 53, 69, 0.35);
    color: #c92a3f;
    background: rgba(255, 255, 255, 0.92);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    border-color: rgba(220, 53, 69, 0.55);
    color: #fff;
    background: #dc3545;
}

.btn-sm {
    min-height: 38px;
    padding: 0.5rem 0.8rem;
    border-radius: 0 !important;
}

.btn-warning {
    color: #fff;
}

.alert {
    border: 1px solid rgba(17, 34, 54, 0.08);
    border-radius: 0 !important;
    padding: 1rem 1.1rem;
}

.badge-soft-success {
    background: var(--success-bg);
    color: #166534;
}

.badge-soft-warning {
    background: var(--warning-bg);
    color: #9a6700;
}

.badge-soft-danger {
    background: var(--danger-bg);
    color: #991b1b;
}

.search-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.9rem;
    margin-bottom: 1.15rem;
}

.search-toolbar > * {
    flex: 1 1 190px;
}

.field-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.5rem;
}

.field-head .form-label {
    margin-bottom: 0;
}

.inline-form-note {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-700);
}

.customer-quick-btn {
    min-height: 38px;
    padding: 0.45rem 0.8rem;
    font-size: 0.88rem;
}

.detail-metric {
    border: 1px solid rgba(47, 126, 232, 0.10);
    border-radius: 0 !important;
    padding: 1rem 1.05rem;
    background: linear-gradient(180deg, #ffffff, #f8f9ff);
}

.detail-metric .label {
    color: var(--text-700);
    font-size: 0.84rem;
    font-weight: 700;
}

.detail-metric .value {
    margin-top: 0.42rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.invoice-view-grid {
    align-items: flex-start;
}

.invoice-view-card {
    padding: 1.55rem;
    background:
        radial-gradient(circle at top right, rgba(47, 126, 232, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 247, 255, 0.98));
}

.invoice-view-head {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.95fr);
    gap: 1.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(47, 126, 232, 0.12);
}

.invoice-kicker,
.invoice-card-kicker {
    color: var(--brand-700);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.invoice-shop-name {
    margin: 0.5rem 0 0.6rem;
    font-size: clamp(1.9rem, 2vw, 2.45rem);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.invoice-shop-copy,
.invoice-party-copy,
.invoice-note-text,
.invoice-footer-note,
.invoice-summary-note,
.invoice-payment-note,
.invoice-item-meta {
    color: var(--text-700);
}

.invoice-shop-copy,
.invoice-party-copy,
.invoice-note-text {
    line-height: 1.7;
}

.invoice-meta-card {
    align-self: start;
    border: 1px solid rgba(47, 126, 232, 0.12);
    border-radius: 0 !important;
    padding: 1.15rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 246, 255, 0.98));
    box-shadow: var(--shadow-soft);
}

.invoice-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0.45rem 0.85rem;
    border-radius: 0 !important;
    color: var(--brand-700);
    background: rgba(47, 126, 232, 0.10);
    font-size: 0.84rem;
    font-weight: 800;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem 1rem;
    margin-top: 1rem;
}

.invoice-meta-item-wide {
    grid-column: 1 / -1;
}

.invoice-meta-item span {
    display: block;
    margin-bottom: 0.34rem;
    color: var(--text-700);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-meta-item strong {
    display: block;
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 800;
    color: var(--text-950);
}

.invoice-code {
    font-size: 1.06rem;
    letter-spacing: 0.02em;
    word-break: break-word;
}

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

.invoice-party-card,
.invoice-highlight-card,
.invoice-payment-row,
.invoice-empty-state {
    border: 1px solid rgba(47, 126, 232, 0.12);
    border-radius: 0 !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.98));
}

.invoice-party-card {
    padding: 1rem 1.05rem;
}

.invoice-party-title {
    margin: 0.35rem 0 0.45rem;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.invoice-highlight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.35rem;
}

.invoice-highlight-wide {
    grid-column: span 2;
}

.invoice-highlight-card {
    padding: 1rem 1.05rem;
    min-height: 132px;
}

.invoice-highlight-featured {
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 26%),
        linear-gradient(135deg, var(--brand-900), var(--brand-700));
    box-shadow: 0 22px 40px rgba(78, 92, 197, 0.18);
}

.invoice-highlight-featured .invoice-highlight-label,
.invoice-highlight-featured .invoice-highlight-note,
.invoice-highlight-featured .invoice-highlight-value {
    color: #fff;
}

.invoice-highlight-label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-700);
}

.invoice-highlight-value {
    margin-top: 0.65rem;
    font-size: clamp(1.4rem, 1.6vw, 1.9rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-950);
}

.invoice-highlight-note {
    margin-top: 0.48rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.invoice-items-shell {
    margin-top: 1.4rem;
}

.invoice-items-table {
    border-radius: 0 !important;
}

.invoice-line-table {
    min-width: 760px;
}

.invoice-item-name {
    font-weight: 700;
    color: var(--text-950);
}

.invoice-item-meta {
    margin-top: 0.32rem;
    font-size: 0.84rem;
    line-height: 1.45;
}

.invoice-footer-note {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(47, 126, 232, 0.18);
    font-size: 0.92rem;
    line-height: 1.6;
}

.invoice-sidebar-stack {
    display: grid;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.invoice-card-head {
    margin-bottom: 1rem;
}

.invoice-summary-list {
    display: grid;
    gap: 0.3rem;
}

.invoice-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px dashed rgba(47, 126, 232, 0.14);
}

.invoice-summary-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.invoice-summary-row-total {
    margin: 0.2rem 0;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(47, 126, 232, 0.12);
    border-radius: 0 !important;
    background:
        linear-gradient(180deg, rgba(245, 247, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.invoice-summary-label {
    color: var(--text-700);
    font-size: 0.92rem;
    font-weight: 700;
}

.invoice-summary-value,
.invoice-payment-amount {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-950);
    text-align: right;
}

.invoice-summary-row-total .invoice-summary-value {
    font-size: 1.32rem;
    letter-spacing: -0.03em;
}

.invoice-summary-note {
    margin-top: 0.32rem;
    font-size: 0.84rem;
}

.invoice-payment-list {
    display: grid;
    gap: 0.8rem;
}

.invoice-payment-row,
.invoice-empty-state {
    padding: 1rem 1.05rem;
}

.invoice-payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.invoice-payment-mode {
    font-weight: 800;
    color: var(--text-950);
}

.invoice-payment-note {
    margin-top: 0.28rem;
    font-size: 0.84rem;
    line-height: 1.45;
}

.invoice-empty-state {
    color: var(--text-700);
    line-height: 1.6;
}

.invoice-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background:
        radial-gradient(circle at top right, rgba(47, 126, 232, 0.10), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.98));
}

.billing-layout .form-card,
.billing-layout .invoice-summary {
    overflow: visible;
}

.billing-total-row {
    margin-top: 1.25rem;
    padding: 1.15rem;
    border: 1px solid rgba(47, 126, 232, 0.12);
    border-radius: 0 !important;
}

.billing-total-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.billing-total-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
}

.billing-total-grid .billing-payment-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.billing-total-grid .billing-payment-block .form-label {
    margin-bottom: 0.55rem;
}

.billing-total-row #mixed-payment-fields {
    margin-top: 1rem;
}

.billing-checkout-card {
    max-width: 720px;
}

.billing-save-stack {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.35rem;
    padding-top: 1rem;
    padding-bottom: 0.1rem;
    border-top: 1px solid rgba(47, 126, 232, 0.10);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(247, 248, 255, 0.82));
}

.billing-save-stack .btn {
    width: 100%;
}

.billing-save-stack-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bill-items-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
}

.bill-table {
    min-width: 100%;
}

.bill-table input[type="number"],
.bill-table input[type="text"],
.bill-table select,
.bill-table .ts-wrapper {
    min-width: 100%;
}

.bill-table .remove-row-btn {
    min-width: 44px;
}

.bill-row-number-cell {
    text-align: center;
    vertical-align: middle;
}

.bill-row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    border-radius: 0 !important;
    background: rgba(47, 126, 232, 0.10);
    color: var(--brand-700);
    font-weight: 800;
    font-size: 0.92rem;
}

.stock-hint {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-700);
}

.stock-hint.low {
    color: #2F7EE8;
}

@media (max-width: 1199.98px) {
    .invoice-view-head,
    .invoice-party-grid {
        grid-template-columns: 1fr;
    }

    .invoice-sidebar-stack {
        position: static;
    }

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

@media (max-width: 767.98px) {
    .invoice-view-card {
        padding: 1.1rem;
    }

    .invoice-meta-grid,
    .invoice-party-grid,
    .invoice-highlight-grid {
        grid-template-columns: 1fr;
    }

    .invoice-highlight-wide {
        grid-column: auto;
    }

    .invoice-shop-name {
        font-size: 1.65rem;
    }

    .invoice-summary-row {
        gap: 0.75rem;
    }

    .invoice-payment-row {
        gap: 0.75rem;
    }

    .billing-total-row {
        padding: 1rem;
        border-radius: 0 !important;
    }

    .billing-total-grid,
    .billing-save-stack-inline {
        grid-template-columns: 1fr;
    }
}

.modal-content {
    border: 1px solid rgba(47, 126, 232, 0.12);
    border-radius: 0 !important;
    box-shadow: var(--shadow-soft);
}

.app-footer {
    padding: 0 1.4rem 1.5rem;
}

.auth-footer {
    margin-top: 2rem;
    padding: 1.4rem 1rem 2rem;
}

.footer-inner {
    width: min(1460px, 100%);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 0 0;
    border-top: 1px solid rgba(47, 126, 232, 0.12);
}

.footer-note {
    font-size: 0.94rem;
    color: var(--text-700);
}

.footer-credit {
    font-size: 0.94rem;
    color: var(--text-800);
    white-space: nowrap;
}

.login-card {
    width: min(450px, calc(100vw - 2rem));
    padding: 2.1rem;
    background:
        radial-gradient(circle at top right, rgba(47, 126, 232, 0.10), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 255, 0.98));
    backdrop-filter: blur(12px);
}

.auth-shell {
    background:
        radial-gradient(circle at 15% 20%, rgba(47, 126, 232, 0.14), transparent 25%),
        radial-gradient(circle at 85% 10%, rgba(255, 178, 72, 0.14), transparent 24%),
        linear-gradient(135deg, #F0F4FB 0%, #F0F4FB 100%);
}

.auth-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-brand {
    margin-bottom: 1.7rem;
    text-align: center;
}

.login-brand h1 {
    margin-bottom: 0.4rem;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-brand p {
    margin: 0;
    color: var(--text-700);
}

@media (max-width: 1199.98px) {
    .billing-sidebar .invoice-summary {
        position: static;
        top: auto;
    }
}

@media (max-width: 991.98px) {
    .app-main {
        padding-top: 1rem;
    }

    .app-topbar {
        padding: 0.9rem 0.9rem 0;
    }

    .app-topbar-inner {
        align-items: flex-start;
        padding: 0.95rem 1rem;
    }

    .app-topbar-start {
        width: 100%;
    }

    .app-user-pill {
        display: none;
    }

    .page-header {
        align-items: stretch;
    }

    .page-header > :last-child {
        width: 100%;
        justify-content: flex-start;
    }

    .page-subtitle {
        max-width: none;
    }

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

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

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

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-credit {
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    .app-topbar-inner {
        padding: 0.85rem 0.95rem;
    }

    .topbar-subtitle {
        display: none;
    }

    .content-card,
    .stat-card,
    .form-card,
    .table-card,
    .login-card,
    .detail-card,
    .summary-strip,
    .modal-content {
        border-radius: 0 !important;
    }

    .content-card,
    .form-card,
    .table-card,
    .detail-card {
        padding: 1.1rem;
    }

    .page-title {
        font-size: 1.9rem;
    }

    .page-subtitle {
        font-size: 0.96rem;
    }

    .search-toolbar > * {
        flex-basis: 100%;
        min-width: 0;
    }

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

    .chart-canvas-wrap {
        min-height: 260px;
    }

    .dashboard-month-filter-group > * {
        flex: 1 1 100%;
    }

    .dashboard-month-select {
        min-width: 0;
    }

    .table-card .table,
    .detail-card .table {
        min-width: 640px;
    }

    .table-card .bill-table {
        min-width: 100%;
    }

    .field-head {
        flex-direction: column;
        align-items: stretch;
    }

    .customer-quick-btn {
        width: 100%;
    }

    .billing-pane-header,
    .billing-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .billing-pane-header .btn,
    .billing-actions-inline .btn {
        width: 100%;
    }

    .billing-row-actions .btn {
        width: 100%;
    }

    .billing-hero {
        padding: 1.25rem;
    }

    .billing-hero-actions .btn {
        width: 100%;
    }

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

    .billing-overview-grid {
        grid-template-columns: 1fr;
    }

    .bill-table {
        min-width: 100%;
    }

    .bill-table thead {
        display: none;
    }

    .bill-table tbody,
    .bill-table .bill-item-row,
    .bill-table .bill-item-row td {
        display: block;
        width: 100%;
    }

    .bill-table .bill-item-row {
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid rgba(17, 34, 54, 0.08);
        border-radius: 0 !important;
        background: linear-gradient(180deg, #fbfdff, #f5f8fc);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .bill-table .bill-item-row:last-child {
        margin-bottom: 0;
    }

    .bill-table .bill-item-row td {
        padding: 0;
        border: 0;
    }

    .bill-table .bill-item-row td + td {
        margin-top: 0.85rem;
    }

    .bill-table .bill-item-row td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.38rem;
        color: var(--text-700);
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .bill-table .bill-item-row td[data-label="Options"]::before {
        margin-bottom: 0.55rem;
    }

    .bill-table .bill-row-number-cell {
        text-align: left;
    }

    .bill-table .bill-row-number {
        min-width: 2rem;
        min-height: 2rem;
    }

    .bill-table .remove-row-btn {
        width: 100%;
    }

    .bill-table .stock-hint {
        margin-top: 0.55rem !important;
    }
}

@media (max-width: 575.98px) {
    .app-topbar,
    .app-footer {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .app-main {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    .brand-title {
        font-size: 1rem;
    }

    .brand-tagline {
        display: none;
    }

    .page-header > :last-child,
    .page-header > :last-child .btn {
        width: 100%;
    }

    .summary-strip .summary-grid {
        grid-template-columns: 1fr;
    }

    .detail-metric .value,
    .stat-value {
        font-size: 1.35rem;
    }

    .login-card {
        padding: 1.6rem;
    }
}

/* Professional usability refresh */
:root {
    --brand-950: #0F1F3D;
    --brand-900: #0F1F3D;
    --brand-800: #2F7EE8;
    --brand-700: #2F7EE8;
    --brand-600: #B5D4F4;
    --accent-600: #2F7EE8;
    --accent-500: #2F7EE8;
    --surface-0: #F0F4FB;
    --surface-1: #ffffff;
    --surface-2: #F7FAFF;
    --surface-3: #E6EEF8;
    --text-950: #0F1F3D;
    --text-800: #0F1F3D;
    --text-700: #7A8FAE;
    --text-500: #9BAECC;
    --border-color: #D7E2F0;
    --border-strong: #B5D4F4;
    --success-bg: #dcfce7;
    --warning-bg: #fff7d6;
    --danger-bg: #fee2e2;
    --shadow-soft: 0 14px 30px rgba(15, 31, 61, 0.10);
    --shadow-card: 0 8px 18px rgba(15, 31, 61, 0.07);
}

*,
*::before,
*::after {
    letter-spacing: 0 !important;
}

body {
    color: var(--text-950);
    background: var(--surface-0);
    font-size: 16px;
    line-height: 1.55;
}

.app-layout,
.app-content-shell {
    background: var(--surface-0);
}

.app-sidebar {
    width: 286px;
    min-width: 286px;
    padding: 0;
    background: #0F1F3D;
    border-right: 1px solid #1A3460;
}

.app-sidebar-inner {
    padding: 1.2rem;
    border: 0;
    background: #0F1F3D;
    box-shadow: none;
}

.sidebar-brand {
    align-items: center;
    padding: 0 0 1.1rem;
    border-bottom: 1px solid #1A3460;
}

.brand-mark {
    width: 44px;
    height: 44px;
    background: #2F7EE8;
    box-shadow: none;
    font-size: 1.05rem;
}

.brand-title {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.2;
}

.brand-tagline {
    color: #B5D4F4;
    font-size: 0.78rem;
    line-height: 1.35;
}

.sidebar-section-label {
    padding: 0;
    color: #B5D4F4;
    font-size: 0.78rem;
    text-transform: none;
}

.sidebar-nav {
    gap: 0.35rem;
}

.sidebar-link {
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem;
    border: 1px solid transparent;
    color: #E8F1FF;
    background: transparent;
}

.sidebar-link:hover {
    transform: none;
    border-color: #2F7EE8;
    background: #1A3460;
    color: #ffffff;
}

.sidebar-link.active {
    border-color: #1A3460;
    background: #1A3460;
    box-shadow: inset 4px 0 0 #2F7EE8;
    color: #ffffff;
}

.sidebar-link-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    flex: 0 0 2.05rem;
    border: 1px solid #1A3460;
    background: #13284B;
    color: #B5D4F4;
    font-size: 0.76rem;
    font-weight: 800;
}

.sidebar-link.active .sidebar-link-index {
    border-color: #2F7EE8;
    background: #2F7EE8;
    color: #fff;
}

.sidebar-link-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.1rem;
}

.sidebar-link-label {
    color: inherit;
    font-size: 0.96rem;
    line-height: 1.2;
    font-weight: 800;
}

.sidebar-link-helper {
    color: #B5D4F4;
    font-size: 0.78rem;
    line-height: 1.3;
}

.sidebar-user-card {
    padding: 0.9rem;
    border: 1px solid #1A3460;
    background: #13284B;
}

.sidebar-user-name {
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.35;
}

.sidebar-logout-btn {
    border-color: #2F7EE8;
    background: #2F7EE8;
    box-shadow: none;
}

.app-mobile-sidebar {
    background: #0F1F3D;
}

.app-topbar {
    padding: 0.9rem 0.9rem 0;
    background: var(--surface-0);
}

.app-topbar-inner {
    border: 1px solid var(--border-color);
    background: var(--surface-1);
    box-shadow: var(--shadow-card);
    backdrop-filter: none;
}

.app-menu-toggle {
    border-color: var(--brand-800);
    color: #fff;
    background: var(--brand-800);
}

.app-main {
    padding: 1.65rem 1.75rem 0;
}

.app-main-inner {
    width: min(1440px, 100%);
}

.page-header {
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    color: var(--text-950);
    font-size: 2rem;
    line-height: 1.16;
    font-weight: 800;
}

.page-subtitle {
    display: block !important;
    margin-top: 0.4rem;
    max-width: 760px;
    color: var(--text-700);
    font-size: 1rem;
    line-height: 1.5;
}

.billing-eyebrow,
.billing-pane-eyebrow {
    display: block;
}

.content-card,
.stat-card,
.form-card,
.table-card,
.login-card,
.detail-card,
.summary-strip,
.modal-content,
.billing-payment-block,
.billing-payment-split,
.billing-tools-card,
.billing-total-row,
.detail-metric,
.invoice-meta-card,
.invoice-party-card,
.invoice-highlight-card,
.invoice-payment-row,
.invoice-empty-state,
.invoice-summary-row-total {
    border: 1px solid var(--border-color);
    background: var(--surface-1);
    box-shadow: var(--shadow-card);
}

.content-card::before,
.form-card::before,
.table-card::before,
.detail-card::before,
.login-card::before,
.stat-card::after {
    display: none;
}

.content-card,
.form-card,
.table-card,
.detail-card {
    padding: 1.35rem;
}

.section-title {
    color: var(--text-950);
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 800;
}

.stat-card {
    padding: 1.15rem;
    border-left: 4px solid var(--brand-800);
}

.stat-label,
.summary-strip .summary-label,
.billing-overview-label,
.billing-mini-label,
.invoice-highlight-label,
.invoice-meta-item span {
    color: var(--text-700);
    font-size: 0.86rem;
    line-height: 1.35;
    text-transform: none;
}

.stat-value {
    margin-top: 0.35rem;
    color: var(--text-950);
    font-size: 1.65rem;
    line-height: 1.15;
}

.stat-meta {
    margin-top: 0.6rem;
    color: var(--text-700);
    font-size: 0.9rem;
}

.summary-strip {
    border-left: 4px solid var(--accent-500);
    padding: 1.15rem;
}

.summary-strip .summary-value {
    color: var(--text-950);
    font-size: 1.5rem;
    line-height: 1.2;
}

.search-toolbar {
    align-items: end;
    margin: 0 0 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-2);
}

.table-responsive {
    border: 1px solid var(--border-color);
    background: var(--surface-1);
}

.table thead th {
    border-bottom: 1px solid var(--border-strong);
    background: var(--surface-3);
    color: var(--text-800);
    font-size: 0.86rem;
    line-height: 1.3;
    text-transform: none;
}

.table > :not(caption) > * > * {
    padding: 0.85rem;
}

.table tbody td {
    border-color: var(--border-color);
    color: var(--text-800);
}

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

.table-hover tbody tr:hover {
    background: #EEF6FF;
}

.table tbody td[colspan] {
    padding: 2rem 1rem;
    color: var(--text-700) !important;
    background: var(--surface-2);
}

.form-label {
    color: var(--text-800);
    font-size: 0.92rem;
    line-height: 1.35;
}

.form-control,
.form-select,
.ts-wrapper.form-select,
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    min-height: 46px;
    border: 1px solid var(--border-strong);
    background: var(--surface-1);
    color: var(--text-950);
    box-shadow: none;
}

.form-control::placeholder {
    color: var(--text-500);
}

.form-control:focus,
.form-select:focus,
.ts-wrapper.focus .ts-control {
    border-color: var(--brand-800);
    box-shadow: 0 0 0 0.18rem rgba(47, 126, 232, 0.18);
}

.form-control[readonly],
.form-control.bg-light,
.line-total.bg-light {
    background: var(--surface-3) !important;
}

.ts-dropdown {
    border: 1px solid var(--border-strong);
    background: var(--surface-1);
    box-shadow: var(--shadow-soft);
}

.ts-dropdown .option.active {
    background: #EEF6FF;
    color: var(--brand-900);
}

.btn {
    min-height: 44px;
    border-width: 1px;
    box-shadow: none;
    font-size: 0.94rem;
    font-weight: 800;
}

.btn:hover {
    transform: none;
}

.btn:focus {
    box-shadow: 0 0 0 0.18rem rgba(47, 126, 232, 0.22);
}

.btn-primary {
    border-color: var(--brand-800);
    background: var(--brand-800);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--brand-900);
    background: var(--brand-900);
    color: #fff;
}

.btn-outline-primary,
.btn-outline-dark,
.btn-outline-light {
    border-color: var(--border-strong);
    background: var(--surface-1);
    color: var(--brand-900);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-light:hover,
.btn-outline-light:focus {
    border-color: var(--brand-800);
    background: #EEF6FF;
    color: var(--brand-900);
}

.btn-outline-danger {
    border-color: #f1a0aa;
    background: var(--surface-1);
    color: #b42335;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    border-color: #b42335;
    background: #b42335;
    color: #fff;
}

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

.btn-sm {
    min-height: 36px;
    padding: 0.45rem 0.72rem;
    font-size: 0.86rem;
}

.alert {
    border: 1px solid var(--border-color);
    background: var(--surface-1);
    color: var(--text-800);
}

.alert-success {
    border-left: 4px solid #16a34a;
}

.alert-danger {
    border-left: 4px solid #dc2626;
}

.alert-warning {
    border-left: 4px solid var(--accent-500);
}

.alert-info {
    border-left: 4px solid var(--brand-800);
}

.badge {
    padding: 0.42rem 0.56rem;
    border: 1px solid rgba(31, 41, 51, 0.08);
    font-weight: 800;
}

.text-bg-success,
.badge-soft-success {
    background: var(--success-bg) !important;
    color: #166534 !important;
}

.text-bg-secondary {
    background: #eef2f6 !important;
    color: var(--text-800) !important;
}

.text-bg-light {
    background: var(--surface-2) !important;
    color: var(--text-800) !important;
}

.badge-soft-warning {
    background: var(--warning-bg);
    color: #92400e;
}

.badge-soft-danger {
    background: var(--danger-bg);
    color: #991b1b;
}

.billing-section,
.billing-hero,
.invoice-view-card,
.invoice-summary,
.detail-metric-highlight,
.invoice-highlight-featured,
.auth-shell,
.login-card {
    background: var(--surface-1);
}

.billing-section {
    padding: 1.25rem;
}

.billing-section-head,
.billing-pane-header {
    align-items: center;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.billing-section-kicker,
.billing-page-kicker,
.invoice-kicker,
.invoice-card-kicker {
    color: var(--brand-800);
    font-size: 0.78rem;
    line-height: 1.35;
    text-transform: none;
}

.detail-metric {
    padding: 1rem;
    box-shadow: none;
}

.detail-metric .label {
    color: var(--text-700);
    font-size: 0.86rem;
}

.detail-metric .value {
    color: var(--text-950);
    font-size: 1.22rem;
    line-height: 1.2;
}

.detail-metric-highlight {
    border-left: 4px solid var(--brand-800);
    background: #EEF6FF;
}

.billing-total-row {
    padding: 1rem;
    background: var(--surface-2);
    box-shadow: none;
}

.billing-save-stack {
    border-top: 1px solid var(--border-color);
    background: transparent;
}

.bill-table .bill-row-number {
    border: 1px solid var(--border-color);
    background: var(--surface-2);
    color: var(--brand-900);
}

.stock-hint {
    color: var(--text-700);
}

.stock-hint.low,
.stock-hint.text-danger {
    color: #2F7EE8 !important;
}

.invoice-shop-name {
    color: var(--text-950);
    font-size: 2rem;
    line-height: 1.12;
}

.invoice-view-head,
.invoice-footer-note,
.invoice-summary-row {
    border-color: var(--border-color);
}

.invoice-highlight-featured {
    border-color: var(--brand-800);
    background: var(--brand-800);
    box-shadow: none;
}

.invoice-summary-row-total {
    background: #EEF6FF;
    box-shadow: none;
}

.invoice-badge {
    background: #EEF6FF;
    color: var(--brand-900);
}

.auth-main {
    background: var(--surface-0);
}

.login-card {
    border-left: 4px solid var(--brand-800);
    backdrop-filter: none;
}

.login-brand {
    text-align: left;
}

.login-brand h1 {
    color: var(--text-950);
    font-size: 1.7rem;
    line-height: 1.2;
}

.login-brand p {
    color: var(--text-700);
}

.footer-inner {
    border-top: 1px solid var(--border-color);
}

.footer-note,
.footer-credit {
    color: var(--text-700);
}

@media (max-width: 991.98px) {
    .app-main {
        padding: 1rem 0.9rem 0;
    }

    .page-header {
        align-items: stretch;
    }
}

@media (max-width: 767.98px) {
    .content-card,
    .form-card,
    .table-card,
    .detail-card,
    .summary-strip,
    .modal-content {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.65rem;
    }

    .search-toolbar {
        padding: 0.9rem;
    }

    .bill-table .bill-item-row {
        border: 1px solid var(--border-color);
        background: var(--surface-1);
        box-shadow: none;
    }
}

/* Create bill workspace */
.billing-page-header {
    align-items: center;
}

.billing-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.billing-readiness-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    box-shadow: var(--shadow-card);
}

.billing-readiness-item {
    display: flex;
    min-height: 74px;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.95rem 1.1rem;
    border-left: 4px solid #B5D4F4;
}

.billing-readiness-item + .billing-readiness-item {
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
}

.billing-readiness-item span {
    color: var(--text-700);
    font-size: 0.84rem;
    font-weight: 800;
}

.billing-readiness-item strong {
    color: var(--text-950);
    font-size: 1.18rem;
    line-height: 1.2;
    font-weight: 800;
    word-break: break-word;
}

.billing-readiness-item-wide {
    border-left-color: #2F7EE8;
}

.billing-redesign {
    display: block;
}

.billing-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    gap: 1rem;
    align-items: start;
}

.billing-workspace-main,
.billing-main-stack {
    display: grid;
    gap: 1rem;
}

.billing-workspace-side {
    position: sticky;
    top: 1rem;
    align-self: start;
}

.billing-step-card {
    overflow: visible;
    border-top: 4px solid #2F7EE8;
}

.billing-items-card {
    border-top-color: #1A3460;
}

.billing-section-head,
.billing-total-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.billing-section-head > div:first-child,
.billing-total-row-head > div:first-child {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.billing-step-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    background: #0F1F3D;
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 800;
}

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

.billing-field-grid > * {
    width: auto !important;
}

.billing-field-grid > :nth-child(1),
.billing-field-grid > :nth-child(2),
.billing-field-grid > :nth-child(3) {
    grid-column: span 4;
}

.billing-field-grid > :nth-child(4),
.billing-field-grid > :nth-child(5) {
    grid-column: span 6;
}

.bill-items-wrap {
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    overflow-x: auto;
}

.bill-table {
    table-layout: fixed;
}

.bill-table thead th {
    background: #E6EEF8;
    color: #0F1F3D;
}

.bill-table tbody tr:hover {
    background: #EEF6FF;
}

.bill-table .form-control,
.bill-table .form-select,
.bill-table .ts-wrapper.single .ts-control {
    min-height: 42px;
}

.bill-table .remove-row-btn {
    width: 100%;
    min-width: 0;
}

.billing-summary-card {
    margin-top: 0;
    border-top: 4px solid #0F1F3D;
    background: #FFFFFF;
}

.billing-summary-card .billing-total-row-head {
    margin-bottom: 0;
}

.billing-grand-total-panel {
    padding: 1rem;
    background: #0F1F3D;
    color: #FFFFFF;
}

.billing-grand-total-panel .label {
    color: #B5D4F4;
    font-size: 0.86rem;
    font-weight: 800;
}

.billing-grand-total-panel .value {
    margin-top: 0.22rem;
    color: #FFFFFF;
    font-size: clamp(2rem, 3vw, 2.45rem);
    line-height: 1.08;
    font-weight: 800;
}

.billing-summary-card .billing-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--border-color);
    border-bottom: 0;
}

.billing-summary-card .detail-metric {
    border: 0;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    box-shadow: none;
}

.billing-summary-card .detail-metric:nth-child(2n) {
    border-right: 0;
}

.billing-summary-card .billing-payment-block {
    grid-column: 1 / -1;
}

.billing-payment-split,
.billing-side-notes {
    padding: 1rem 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-top: 1px solid var(--border-color);
    background: transparent;
    box-shadow: none;
}

.billing-split-grid {
    display: grid;
    gap: 0.75rem;
}

.billing-side-notes .billing-notes-textarea {
    min-height: 112px;
}

.billing-summary-card .billing-save-stack {
    margin-top: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 1199.98px) {
    .billing-workspace {
        grid-template-columns: 1fr;
    }

    .billing-workspace-side {
        position: static;
    }

    .billing-summary-card .billing-total-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .billing-summary-card .detail-metric {
        border-right: 1px solid var(--border-color);
    }

    .billing-summary-card .detail-metric:nth-child(2n) {
        border-right: 1px solid var(--border-color);
    }

    .billing-summary-card .detail-metric:nth-child(4n),
    .billing-summary-card .billing-payment-block {
        border-right: 0;
    }
}

@media (max-width: 767.98px) {
    .billing-header-actions,
    .billing-header-actions .btn {
        width: 100%;
    }

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

    .billing-field-grid {
        grid-template-columns: 1fr;
    }

    .billing-field-grid > * {
        grid-column: auto !important;
    }

    .billing-section-head,
    .billing-total-row-head {
        align-items: flex-start;
    }

    .billing-section-head .billing-actions-inline,
    .billing-section-head .billing-actions-inline .btn {
        width: 100%;
    }

    .billing-summary-card .billing-total-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .billing-summary-card .detail-metric:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 575.98px) {
    .billing-readiness-strip,
    .billing-summary-card .billing-total-grid,
    .billing-save-stack-inline {
        grid-template-columns: 1fr;
    }

    .billing-summary-card .detail-metric,
    .billing-summary-card .detail-metric:nth-child(2n),
    .billing-summary-card .detail-metric:nth-child(4n) {
        border-right: 0;
    }
}

/* Light professional theme */
:root {
    --brand-950: #1B3350;
    --brand-900: #254563;
    --brand-800: #4F8FEF;
    --brand-700: #2F7EE8;
    --brand-600: #D7E8FB;
    --accent-600: #4F8FEF;
    --accent-500: #4F8FEF;
    --surface-0: #F6F9FD;
    --surface-1: #FFFFFF;
    --surface-2: #F9FBFE;
    --surface-3: #EAF2FB;
    --text-950: #1B3350;
    --text-800: #2F455F;
    --text-700: #73859E;
    --text-500: #A4B4C8;
    --border-color: #DDE7F2;
    --border-strong: #C7D7EA;
    --shadow-soft: 0 14px 30px rgba(27, 51, 80, 0.08);
    --shadow-card: 0 8px 18px rgba(27, 51, 80, 0.06);
}

body,
.app-layout,
.app-content-shell,
.auth-main {
    background: var(--surface-0);
}

.app-sidebar,
.app-sidebar-inner,
.app-mobile-sidebar {
    background: #FFFFFF;
}

.app-sidebar {
    border-right: 1px solid var(--border-color);
}

.sidebar-brand {
    border-bottom-color: var(--border-color);
}

.brand-mark {
    border: 1px solid #D7E8FB;
    background: #EAF3FF;
    color: #2F7EE8;
}

.brand-title,
.sidebar-user-name {
    color: var(--text-950);
}

.brand-tagline,
.sidebar-section-label,
.sidebar-link-helper,
.user-pill-label {
    color: var(--text-700);
}

.sidebar-link {
    color: var(--text-800);
}

.sidebar-link:hover {
    border-color: #D7E8FB;
    background: #F2F7FE;
    color: var(--brand-900);
}

.sidebar-link.active {
    border-color: #D7E8FB;
    background: #EAF3FF;
    box-shadow: inset 4px 0 0 #4F8FEF;
    color: var(--brand-900);
}

.sidebar-link-index {
    border-color: var(--border-color);
    background: #FFFFFF;
    color: var(--text-700);
}

.sidebar-link.active .sidebar-link-index {
    border-color: #4F8FEF;
    background: #4F8FEF;
    color: #FFFFFF;
}

.sidebar-user-card {
    border-color: var(--border-color);
    background: #F9FBFE;
}

.sidebar-logout-btn,
.btn-primary,
.app-menu-toggle {
    border-color: #4F8FEF;
    background: #4F8FEF;
    color: #FFFFFF;
}

.sidebar-logout-btn:hover,
.sidebar-logout-btn:focus,
.btn-primary:hover,
.btn-primary:focus,
.app-menu-toggle:hover,
.app-menu-toggle:focus {
    border-color: #2F7EE8;
    background: #2F7EE8;
    color: #FFFFFF;
}

.app-topbar,
.app-topbar-inner,
.content-card,
.form-card,
.table-card,
.detail-card,
.summary-strip,
.modal-content,
.login-card,
.stat-card {
    background: #FFFFFF;
}

.table thead th,
.bill-table thead th {
    background: #EAF2FB;
    color: var(--text-950);
}

.table-hover tbody tr:hover,
.bill-table tbody tr:hover,
.ts-dropdown .option.active,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-light:hover,
.btn-outline-light:focus,
.detail-metric-highlight,
.invoice-summary-row-total,
.invoice-badge {
    background: #F2F7FE;
}

.billing-step-label {
    border: 1px solid #D7E8FB;
    background: #EAF3FF;
    color: #2F7EE8;
}

.billing-step-card,
.billing-readiness-item-wide,
.billing-summary-card {
    border-top-color: #4F8FEF;
}

.billing-items-card {
    border-top-color: #B5D4F4;
}

.billing-grand-total-panel {
    border: 1px solid #D7E8FB;
    background: #F2F7FE;
    color: var(--text-950);
}

.billing-grand-total-panel .label {
    color: var(--text-700);
}

.billing-grand-total-panel .value {
    color: #2F7EE8;
}

.invoice-highlight-featured {
    border-color: #D7E8FB;
    background: #F2F7FE;
    color: var(--text-950);
}

.invoice-highlight-featured .invoice-highlight-label,
.invoice-highlight-featured .invoice-highlight-note {
    color: var(--text-700);
}

.invoice-highlight-featured .invoice-highlight-value {
    color: #2F7EE8;
}

/* Clean billing page */
.billing-page-header {
    margin-bottom: 1rem !important;
    padding-bottom: 0.85rem;
}

.billing-page-header .page-title {
    font-size: 1.85rem;
}

.billing-page-header .page-subtitle {
    margin-top: 0.25rem;
}

.billing-header-actions .btn {
    min-height: 40px;
    padding: 0.58rem 0.9rem;
}

.billing-setup-alert {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border-left: 3px solid #4F8FEF;
}

.billing-redesign {
    max-width: 1240px;
}

.billing-workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.billing-workspace-side {
    position: static;
}

.billing-redesign .form-card {
    box-shadow: none;
}

.app-sidebar {
    width: 260px;
    min-width: 260px;
}

.sidebar-nav {
    gap: 0.2rem;
}

.sidebar-link {
    padding: 0.7rem 0.8rem;
}

.sidebar-link-index,
.sidebar-link-helper {
    display: none;
}

.sidebar-user-card {
    padding: 0.75rem;
}

.billing-step-card,
.billing-summary-card {
    border-top: 1px solid var(--border-color);
}

.billing-step-label {
    display: none;
}

.billing-section {
    padding: 1rem;
}

.billing-section-head,
.billing-total-row-head {
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
}

.billing-section-head > div:first-child,
.billing-total-row-head > div:first-child {
    gap: 0;
}

.billing-section-kicker {
    margin-bottom: 0.08rem;
    font-size: 0.78rem;
}

.billing-field-grid {
    gap: 0.85rem;
}

.bill-items-wrap {
    border-color: var(--border-color);
}

.bill-table thead th {
    padding: 0.7rem;
    background: #F2F7FE;
}

.bill-table > :not(caption) > * > * {
    padding: 0.7rem;
}

.bill-table .form-control,
.bill-table .form-select,
.bill-table .ts-wrapper.single .ts-control {
    min-height: 40px;
}

.bill-table .remove-row-btn {
    min-height: 40px;
}

.billing-row-actions {
    margin-top: 0.8rem;
}

.billing-summary-card {
    display: block;
    margin-top: 0;
}

.billing-summary-card .billing-total-row-head {
    margin-bottom: 0.75rem;
}

.billing-grand-total-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: #F9FBFE;
}

.billing-grand-total-panel .value {
    margin-top: 0;
    font-size: clamp(1.55rem, 2.2vw, 1.95rem);
}

.billing-summary-card .billing-total-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
    border: 0;
}

.billing-summary-card .detail-metric,
.billing-summary-card .detail-metric:nth-child(2n),
.billing-summary-card .detail-metric:nth-child(4n) {
    border: 1px solid var(--border-color);
}

.billing-summary-card .detail-metric {
    padding: 0.85rem;
}

.billing-summary-card .billing-payment-block {
    grid-column: auto;
}

.billing-payment-split,
.billing-side-notes {
    padding-top: 0.85rem;
}

.billing-side-notes .billing-notes-textarea {
    min-height: 92px;
}

.billing-summary-card .billing-save-stack {
    padding-top: 0.85rem;
}

@media (max-width: 991.98px) {
    .billing-redesign {
        max-width: none;
    }

    .billing-summary-card .billing-total-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .billing-grand-total-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .billing-summary-card .billing-total-grid,
    .billing-save-stack-inline {
        grid-template-columns: 1fr;
    }
}
