:root {
    --erp-bg: #edf2f6;
    --erp-ink: #102033;
    --erp-muted: #698096;
    --erp-card: rgba(255, 255, 255, 0.84);
    --erp-line: rgba(16, 32, 51, 0.08);
    --erp-primary: #0d6efd;
    --erp-primary-deep: #083b8f;
    --erp-success: #1f9d68;
    --erp-warning: #d18b1f;
    --erp-danger: #c94f4f;
    --erp-info: #2c8fbf;
    --erp-shadow: 0 18px 44px rgba(15, 40, 70, 0.12);
}

body.erp-body {
    height: 100vh;
    margin: 0;
    overflow: hidden;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--erp-ink);
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.14), transparent 26%),
        radial-gradient(circle at right, rgba(31, 157, 104, 0.12), transparent 20%),
        linear-gradient(180deg, #f7fbff 0%, var(--erp-bg) 100%);
}

.erp-shell {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
}

.erp-sidebar {
    overflow: hidden;
    color: #eff6ff;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background:
        radial-gradient(circle at top, rgba(82, 168, 255, 0.14), transparent 22%),
        linear-gradient(180deg, #0b1623 0%, #102336 56%, #143049 100%);
}

.sidebar-scroll,
.main-scroll {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sidebar-scroll {
    padding: 18px 16px 22px;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.main-scroll {
    padding: 16px 18px 20px;
    scrollbar-color: rgba(16, 32, 51, 0.18) transparent;
}

.sidebar-scroll::-webkit-scrollbar,
.main-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.sidebar-scroll::-webkit-scrollbar-thumb,
.main-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(107, 138, 171, 0.35);
    background-clip: padding-box;
}

.sidebar-scroll::-webkit-scrollbar-track,
.main-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-brand-card {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(82, 168, 255, 0.18), rgba(47, 109, 246, 0.28));
    box-shadow: 0 8px 18px rgba(16, 73, 185, 0.22);
}

.brand-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.brand-copy h1 {
    margin: 0 0 2px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.15;
}

.brand-copy p {
    margin: 0;
    color: rgba(239, 246, 255, 0.58);
    font-size: 0.68rem;
}

.sidebar-context-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.context-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    padding: 4px 0;
}

.context-chip i {
    flex: 0 0 auto;
    width: 10px;
    text-align: center;
    color: rgba(239, 246, 255, 0.62);
    font-size: 0.62rem;
}

.context-chip strong,
.context-chip span {
    color: #fff;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.62rem;
    line-height: 1.1;
    font-weight: 500;
}

.context-chip strong {
    font-weight: 500;
}

.context-dot {
    flex: 0 0 auto;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.sidebar-section-label {
    margin: 10px 8px 8px;
    color: rgba(239, 246, 255, 0.46);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(238, 246, 255, 0.86);
    text-decoration: none;
    font-size: 0.79rem;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    border-color: rgba(82, 168, 255, 0.2);
    color: #fff;
    background: linear-gradient(90deg, rgba(82, 168, 255, 0.18), rgba(255, 255, 255, 0.08));
    transform: translateX(2px);
}

.sidebar-link span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.sidebar-link i {
    width: 14px;
    text-align: center;
    font-size: 0.8rem;
}

.sidebar-link .badge {
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.62rem;
}

.erp-main {
    overflow: hidden;
}

.erp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding: 0;
}

.topbar-title h2 {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.15;
}

.topbar-title p {
    margin: 2px 0 0;
    color: var(--erp-muted);
    font-size: 0.74rem;
}

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

.info-pill {
    padding: 7px 11px;
    border: 1px solid var(--erp-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 6px 14px rgba(15, 40, 70, 0.06);
    font-size: 0.74rem;
}

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

.hero-panel,
.glass-panel,
.db-launch-card {
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    background: var(--erp-card);
    box-shadow: var(--erp-shadow);
    backdrop-filter: blur(22px);
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 12px;
    padding: 18px;
}

.hero-panel h1,
.db-launch-card h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 2.7vw, 2.7rem);
}

.hero-panel p,
.db-launch-card p {
    margin: 0;
    max-width: 760px;
    color: var(--erp-muted);
    font-size: 0.88rem;
}

.compact-hero h1 {
    font-size: clamp(1.32rem, 1.8vw, 1.9rem);
}

.eyebrow {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--erp-primary-deep);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-meta {
    display: grid;
    gap: 10px;
}

.hero-chip {
    min-width: 170px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(31, 157, 104, 0.12));
}

.hero-chip span {
    display: block;
    color: var(--erp-muted);
    font-size: 0.78rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.metric-card {
    padding: 14px;
    border: 1px solid var(--erp-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 40, 70, 0.08);
}

.metric-card .tone {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
}

.metric-card .tone.success { background: rgba(31, 157, 104, 0.12); color: var(--erp-success); }
.metric-card .tone.warning { background: rgba(209, 139, 31, 0.15); color: var(--erp-warning); }
.metric-card .tone.danger { background: rgba(201, 79, 79, 0.15); color: var(--erp-danger); }
.metric-card .tone.info { background: rgba(44, 143, 191, 0.14); color: var(--erp-info); }
.metric-card .tone.indigo { background: rgba(95, 108, 244, 0.14); color: #4d57d8; }
.metric-card .tone.slate { background: rgba(76, 93, 115, 0.14); color: #496176; }

.metric-card h3 {
    margin: 10px 0 4px;
    font-size: 1.34rem;
}

.metric-card p,
.soft-label {
    color: var(--erp-muted);
    font-size: 0.74rem;
}

.dashboard-shell {
    display: grid;
    gap: 12px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
    align-items: stretch;
    gap: 16px;
    padding: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(82, 168, 255, 0.18), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 247, 255, 0.86));
}

.hero-content {
    display: grid;
    align-content: center;
    gap: 8px;
}

.hero-content p {
    max-width: 760px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

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

.hero-chip {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(13, 110, 253, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.hero-chip strong {
    display: block;
    margin-top: 3px;
    font-size: 0.88rem;
    line-height: 1.3;
}

.hero-chip-compact strong {
    font-size: 0.83rem;
    color: var(--erp-primary-deep);
}

.dashboard-quick-panel {
    padding: 15px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.quick-dashboard-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(16, 32, 51, 0.08);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.92));
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.quick-dashboard-card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.18);
    box-shadow: 0 16px 28px rgba(15, 40, 70, 0.08);
}

.quick-dashboard-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    color: #fff;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #0d6efd, #2c8fbf);
}

.quick-dashboard-card.success .quick-dashboard-icon { background: linear-gradient(135deg, #1f9d68, #4bc58d); }
.quick-dashboard-card.info .quick-dashboard-icon { background: linear-gradient(135deg, #0d6efd, #2c8fbf); }
.quick-dashboard-card.warning .quick-dashboard-icon { background: linear-gradient(135deg, #d18b1f, #f0ad4e); }
.quick-dashboard-card.danger .quick-dashboard-icon { background: linear-gradient(135deg, #c94f4f, #ff7a59); }
.quick-dashboard-card.indigo .quick-dashboard-icon { background: linear-gradient(135deg, #5f6cf4, #8b5cf6); }
.quick-dashboard-card.slate .quick-dashboard-icon { background: linear-gradient(135deg, #4c5d73, #7a8ca6); }

.quick-dashboard-card h3 {
    margin: 0 0 3px;
    font-size: 0.8rem;
}

.quick-dashboard-card p {
    margin: 0;
    color: var(--erp-muted);
    font-size: 0.7rem;
    line-height: 1.4;
}

.dashboard-metrics {
    margin-bottom: 0;
}

.dashboard-grid-primary {
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr);
}

.dashboard-grid-secondary {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.95fr);
}

.dashboard-grid-tertiary {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
}

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

.dashboard-chart-canvas {
    position: relative;
    width: 100%;
    height: 240px !important;
    max-height: 240px;
}

.dashboard-chart-medium {
    height: 240px !important;
    max-height: 240px;
}

.dashboard-chart-small {
    height: 205px !important;
    max-height: 205px;
    margin-bottom: 8px;
}

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

.module-summary-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--erp-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
}

.module-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--erp-primary);
}

.module-summary-card h3 {
    margin: 0 0 4px;
    font-size: 0.85rem;
}

.module-summary-card p,
.module-summary-card span {
    margin: 0;
    color: var(--erp-muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.module-summary-card span {
    display: inline-block;
    margin-top: 4px;
    color: var(--erp-primary-deep);
}

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

.snapshot-card,
.insight-card {
    padding: 12px 13px;
    border: 1px solid var(--erp-line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 255, 0.92));
}

.snapshot-card span,
.insight-card span {
    display: block;
    color: var(--erp-muted);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.snapshot-card strong,
.insight-card strong {
    display: block;
    margin: 6px 0 3px;
    font-size: 0.92rem;
    line-height: 1.25;
}

.snapshot-card p,
.insight-card p {
    margin: 0;
    color: var(--erp-muted);
    font-size: 0.74rem;
}

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

.compact-activity-list {
    gap: 8px;
}

.compact-item {
    padding: 10px 12px;
}

.sales-summary-shell {
    display: grid;
    gap: 10px;
}

.sales-summary-filters {
    padding: 10px 12px;
}

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

.sales-summary-actions .btn {
    padding: 6px 11px;
    font-size: 0.73rem;
    line-height: 1.2;
    border-radius: 10px;
}

.sales-filter-grid {
    display: grid;
    grid-template-columns: 132px 132px minmax(0, 1fr) 118px;
    gap: 8px;
    align-items: end;
}

.sales-filter-field .form-label {
    margin-bottom: 3px;
    font-size: 0.7rem;
    color: var(--erp-muted);
}

.sales-filter-field .form-control-sm {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.74rem;
    border-radius: 9px;
}

.sales-filter-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sales-filter-presets .btn {
    padding: 5px 10px;
    border-radius: 999px;
    border-color: rgba(16, 32, 51, 0.08);
    font-size: 0.69rem;
    color: var(--erp-muted);
    background: rgba(255, 255, 255, 0.8);
}

.sales-filter-presets .btn.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #0d6efd, #2c8fbf);
    box-shadow: 0 10px 18px rgba(13, 110, 253, 0.18);
}

.sales-filter-submit {
    min-width: 108px;
}

.sales-filter-submit .btn {
    min-height: 32px;
    font-size: 0.73rem;
    border-radius: 9px;
}

.sales-summary-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.toolbar-stat {
    padding: 9px 11px;
    border: 1px solid var(--erp-line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 250, 255, 0.92));
}

.toolbar-stat span {
    display: block;
    color: var(--erp-muted);
    font-size: 0.66rem;
}

.toolbar-stat strong {
    display: block;
    margin-top: 3px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--erp-primary-deep);
}

.toolbar-stat strong a {
    color: inherit;
    text-decoration: none;
}

.sales-summary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.sales-summary-grid-top {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
}

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

.sales-summary-grid-bottom {
    grid-template-columns: minmax(0, 1.32fr) minmax(290px, 0.82fr);
}

.summary-insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.summary-insight-card,
.summary-signal-item {
    padding: 10px 11px;
    border: 1px solid var(--erp-line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 255, 0.92));
}

.summary-insight-card span,
.summary-signal-item span {
    display: block;
    color: var(--erp-muted);
    font-size: 0.68rem;
}

.summary-insight-card strong,
.summary-signal-item strong {
    display: block;
    margin: 4px 0 2px;
    font-size: 0.84rem;
    line-height: 1.24;
}

.summary-insight-card p,
.summary-signal-item p {
    margin: 0;
    color: var(--erp-muted);
    font-size: 0.68rem;
}

.summary-signal-list {
    display: grid;
    gap: 8px;
}

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

.sales-summary-shell .dashboard-grid {
    gap: 12px;
    margin-bottom: 0;
}

.sales-summary-shell .glass-panel {
    padding: 14px;
    border-radius: 18px;
}

.sales-summary-shell .panel-head {
    gap: 10px;
    margin-bottom: 8px;
}

.sales-summary-shell .panel-head h2 {
    margin: 2px 0 0;
    font-size: 0.92rem;
}

.sales-summary-shell .soft-label {
    font-size: 0.7rem;
}

.sales-summary-shell .metric-card {
    min-height: 110px;
    padding: 12px;
    border-radius: 17px;
}

.sales-summary-shell .metric-card .tone {
    padding: 4px 9px;
    font-size: 0.66rem;
}

.sales-summary-shell .metric-card h3 {
    margin: 8px 0 4px;
    font-size: 0.96rem;
}

.sales-summary-shell .metric-card p {
    font-size: 0.73rem;
}

.sales-summary-shell .dashboard-chart-canvas {
    height: 175px !important;
    max-height: 175px;
}

.sales-summary-shell .dashboard-chart-small {
    height: 150px !important;
    max-height: 150px;
}

.sales-summary-shell .modern-table {
    font-size: 0.74rem;
}

.sales-summary-shell .modern-table td,
.sales-summary-shell .modern-table th {
    padding-top: 9px;
    padding-bottom: 9px;
}

.invoice-list-shell {
    display: grid;
    gap: 8px;
}

.invoice-list-filters {
    padding: 9px 11px;
}

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

.invoice-list-actions .btn {
    padding: 5px 10px;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 9px;
}

.invoice-filter-grid {
    display: grid;
    grid-template-columns: 132px 132px minmax(0, 1fr) 118px;
    gap: 7px;
    align-items: end;
}

.invoice-filter-field .form-label {
    margin-bottom: 2px;
    font-size: 0.67rem;
    color: var(--erp-muted);
}

.invoice-filter-field .form-control-sm {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 0.72rem;
    border-radius: 8px;
}

.invoice-filter-submit .btn {
    min-height: 30px;
    font-size: 0.71rem;
    border-radius: 8px;
}

.invoice-toolbar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.invoice-list-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.invoice-list-shell .dashboard-grid {
    gap: 12px;
    margin-bottom: 0;
}

.invoice-list-shell .glass-panel {
    padding: 11px 12px;
    border-radius: 16px;
}

.invoice-list-shell .panel-head {
    gap: 8px;
    margin-bottom: 6px;
}

.invoice-list-shell .panel-head h2 {
    margin: 1px 0 0;
    font-size: 0.86rem;
}

.invoice-list-shell .soft-label {
    font-size: 0.66rem;
}

.invoice-list-shell .metric-card {
    min-height: 78px;
    padding: 9px 10px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(15, 40, 70, 0.06);
}

.invoice-list-shell .metric-card .tone {
    padding: 3px 8px;
    font-size: 0.61rem;
}

.invoice-list-shell .metric-card h3 {
    margin: 6px 0 2px;
    font-size: 0.84rem;
}

.invoice-list-shell .metric-card p {
    font-size: 0.67rem;
}

.invoice-modern-table {
    font-size: 0.71rem;
}

.invoice-modern-table td,
.invoice-modern-table th {
    padding-top: 7px;
    padding-bottom: 7px;
}

.invoice-row-primary {
    font-weight: 600;
    color: var(--erp-primary-deep);
    font-size: 0.72rem;
}

.invoice-row-party {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-row-amount {
    font-weight: 600;
}

.invoice-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.invoice-row-actions .btn {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
}

.invoice-list-shell .toolbar-stat {
    padding: 8px 9px;
    border-radius: 12px;
}

.invoice-list-shell .toolbar-stat span {
    font-size: 0.63rem;
}

.invoice-list-shell .toolbar-stat strong {
    margin-top: 2px;
    font-size: 0.73rem;
}

.invoice-list-shell .eyebrow {
    padding: 3px 8px;
    font-size: 0.61rem;
}

.purchase-list-shell {
    display: grid;
    gap: 8px;
}

.purchase-list-filters {
    padding: 9px 11px;
}

.purchase-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.purchase-list-actions .btn {
    padding: 5px 10px;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 9px;
}

.purchase-filter-grid {
    display: grid;
    grid-template-columns: 132px 132px minmax(0, 1fr) 118px;
    gap: 7px;
    align-items: end;
}

.purchase-filter-field .form-label {
    margin-bottom: 2px;
    font-size: 0.67rem;
    color: var(--erp-muted);
}

.purchase-filter-field .form-control-sm {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 0.72rem;
    border-radius: 8px;
}

.purchase-filter-submit .btn {
    min-height: 30px;
    font-size: 0.71rem;
    border-radius: 8px;
}

.purchase-toolbar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.purchase-list-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.purchase-list-shell .glass-panel {
    padding: 11px 12px;
    border-radius: 16px;
}

.purchase-list-shell .panel-head {
    gap: 8px;
    margin-bottom: 6px;
}

.purchase-list-shell .panel-head h2 {
    margin: 1px 0 0;
    font-size: 0.86rem;
}

.purchase-list-shell .soft-label {
    font-size: 0.66rem;
}

.purchase-list-shell .metric-card {
    min-height: 78px;
    padding: 9px 10px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(15, 40, 70, 0.06);
}

.purchase-list-shell .metric-card .tone {
    padding: 3px 8px;
    font-size: 0.61rem;
}

.purchase-list-shell .metric-card h3 {
    margin: 6px 0 2px;
    font-size: 0.84rem;
}

.purchase-list-shell .metric-card p {
    font-size: 0.67rem;
}

.purchase-list-shell .toolbar-stat {
    padding: 8px 9px;
    border-radius: 12px;
}

.purchase-list-shell .toolbar-stat span {
    font-size: 0.63rem;
}

.purchase-list-shell .toolbar-stat strong {
    margin-top: 2px;
    font-size: 0.73rem;
}

.purchase-list-shell .eyebrow {
    padding: 3px 8px;
    font-size: 0.61rem;
}

.purchase-modern-table {
    font-size: 0.71rem;
}

.purchase-modern-table td,
.purchase-modern-table th {
    padding-top: 7px;
    padding-bottom: 7px;
}

.purchase-row-primary {
    font-weight: 600;
    color: var(--erp-primary-deep);
    font-size: 0.72rem;
}

.purchase-row-party {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-row-amount {
    font-weight: 600;
}

.sale-print-shell {
    position: relative;
    display: grid;
    gap: 12px;
}

.sale-print-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sale-print-paper {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 24px 26px;
    border: 1px solid rgba(16, 32, 51, 0.08);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(15, 40, 70, 0.10);
}

.sale-print-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid #132334;
}

.sale-print-title-row h1 {
    margin: 6px 0 0;
    font-size: 1.8rem;
    line-height: 1.15;
}

.sale-print-kicker {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.08);
    color: var(--erp-primary-deep);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sale-print-company-block {
    margin-top: 10px;
    color: #425467;
    font-size: 0.85rem;
    line-height: 1.6;
}

.sale-print-meta {
    min-width: 250px;
    text-align: right;
    display: grid;
    gap: 6px;
}

.sale-print-type {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: #132334;
}

.sale-print-meta span {
    display: block;
    color: #6d7f93;
    font-size: 0.72rem;
}

.sale-print-meta strong {
    font-size: 0.88rem;
}

.sale-print-summary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.sale-print-box {
    border: 1px solid #d6dfeb;
    border-radius: 18px;
    padding: 13px 14px;
    background: #fbfdff;
    font-size: 0.84rem;
    line-height: 1.55;
}

.sale-print-box-title {
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #d6dfeb;
    font-weight: 700;
    color: #132334;
}

.sale-print-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
}

.sale-print-summary-total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 2px solid #132334;
    font-weight: 700;
}

.sale-print-table {
    margin-top: 14px;
    font-size: 0.74rem;
}

.sale-print-table th,
.sale-print-table td {
    padding: 6px 7px;
    border: 1px solid #d6dfeb;
    vertical-align: middle;
}

.sale-print-table thead th {
    background: #f3f7fb;
    color: #30465d;
    white-space: nowrap;
}

.sale-print-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-top: 14px;
    font-size: 0.84rem;
}

.sale-print-footer-left {
    display: grid;
    gap: 8px;
}

.sale-print-signature {
    min-width: 220px;
    text-align: right;
}

.sale-print-sign-line {
    width: 180px;
    margin-left: auto;
    margin-bottom: 10px;
    border-top: 1px solid #132334;
}

.invoice-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
}

.invoice-loader {
    width: 56px;
    height: 56px;
    border: 5px solid #e7edf5;
    border-top: 5px solid #132334;
    border-radius: 50%;
    animation: invoice-spin 1s linear infinite;
}

@keyframes invoice-spin {
    to { transform: rotate(360deg); }
}

.compact-item h3 {
    font-size: 0.82rem;
}

.compact-item p {
    font-size: 0.72rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.second-row {
    grid-template-columns: 1fr 1.1fr;
}

.glass-panel {
    padding: 18px;
}

.dense-panel,
.inner-panel {
    padding: 18px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-head h2 {
    margin: 6px 0 0;
    font-size: 1.1rem;
}

.mini-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    min-height: 250px;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 8px;
    min-height: 210px;
}

.chart-bar .bar {
    border-radius: 16px 16px 6px 6px;
    background: linear-gradient(180deg, #58a6ff 0%, #125bd2 100%);
    box-shadow: 0 14px 24px rgba(18, 91, 210, 0.2);
}

.chart-bar strong,
.chart-bar span {
    text-align: center;
    font-size: 0.76rem;
}

.quick-links-grid,
.activity-list {
    display: grid;
    gap: 12px;
}

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

.quick-link-card {
    padding: 16px;
    border: 1px solid rgba(13, 110, 253, 0.08);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(31, 157, 104, 0.08));
}

.quick-link-card i {
    font-size: 1.2rem;
    color: var(--erp-primary);
}

.quick-link-card h3 {
    margin: 10px 0 4px;
    font-size: 0.98rem;
}

.quick-link-card p {
    margin: 0;
    color: var(--erp-muted);
    font-size: 0.8rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--erp-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.activity-item h3 {
    margin: 0 0 4px;
    font-size: 0.92rem;
}

.activity-item p {
    margin: 0;
    color: var(--erp-muted);
    font-size: 0.78rem;
}

.activity-status {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--erp-primary-deep);
    font-size: 0.75rem;
}

.filter-bar {
    display: grid;
    grid-template-columns: 140px 140px minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.filter-grow {
    min-width: 220px;
}

.filter-actions {
    display: flex;
    align-items: end;
    gap: 8px;
}

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

.modern-table {
    font-size: 0.8rem;
}

.modern-table thead th {
    color: var(--erp-muted);
    border-bottom-color: var(--erp-line);
    white-space: nowrap;
}

.modern-table td,
.modern-table th {
    padding-top: 12px;
    padding-bottom: 12px;
    vertical-align: middle;
}

.modern-table tbody tr:hover {
    background: rgba(13, 110, 253, 0.04);
}

.db-launch-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    max-width: 960px;
    margin: 10vh auto 0;
    padding: 36px;
    border-radius: 32px;
}

.db-launch-form {
    align-self: center;
}

.skeleton-card {
    min-height: 140px;
    background: linear-gradient(90deg, rgba(238, 243, 247, 0.9), rgba(255, 255, 255, 0.9), rgba(238, 243, 247, 0.9));
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite linear;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

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

.invoice-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.invoice-paper {
    padding: 28px;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--erp-shadow);
}

.invoice-header-block {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--erp-line);
}

.invoice-header-block h1 {
    margin: 8px 0;
    font-size: 1.5rem;
}

.invoice-header-block p,
.invoice-party-block p {
    margin: 0;
    color: var(--erp-muted);
    font-size: 0.86rem;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 12px;
}

.invoice-meta-grid div,
.total-card {
    padding: 12px 14px;
    border: 1px solid var(--erp-line);
    border-radius: 16px;
    background: #fbfdff;
}

.invoice-meta-grid span,
.total-card span {
    display: block;
    font-size: 0.75rem;
    color: var(--erp-muted);
}

.invoice-party-block {
    padding: 18px 0;
}

.invoice-party-block h2 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.invoice-table {
    font-size: 0.8rem;
}

.invoice-total-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.total-card.accent {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(31, 157, 104, 0.08));
}

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

    .no-print,
    .erp-sidebar,
    .erp-topbar {
        display: none !important;
    }

    html,
    body.erp-body {
        height: auto;
        overflow: visible;
        background: #fff;
    }

    body.erp-body * {
        visibility: hidden;
    }

    .erp-shell {
        display: block;
        height: auto;
        overflow: visible;
    }

    .erp-main,
    .main-content,
    .main-scroll,
    .invoice-paper,
    .sale-print-paper {
        padding: 0;
        box-shadow: none;
        overflow: visible;
    }

    .sale-print-shell {
        display: block;
        margin: 0;
        padding: 0;
    }

    #invoiceDocument,
    #invoiceDocument * {
        visibility: visible;
    }

    #invoiceDocument {
        width: 190mm;
        max-width: 190mm;
        margin: 0;
        border: none;
        border-radius: 0;
        padding: 0;
        background: #fff;
        color: #000;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .sale-print-header,
    .sale-print-summary-row,
    .sale-print-footer {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sale-print-box,
    .sale-print-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .sale-print-title-row h1 {
        font-size: 22px;
    }

    .sale-print-company-block,
    .sale-print-box,
    .sale-print-footer {
        font-size: 12px;
        line-height: 1.45;
    }

    .sale-print-meta {
        min-width: 52mm;
    }

    .sale-print-type {
        font-size: 12px;
        letter-spacing: 0.16em;
    }

    .sale-print-meta span {
        font-size: 10px;
    }

    .sale-print-meta strong {
        font-size: 12px;
    }

    .sale-print-table {
        width: 100%;
        font-size: 10px;
        border-collapse: collapse;
    }

    .sale-print-table th,
    .sale-print-table td {
        padding: 4px 5px;
    }

    .sale-print-signature {
        min-width: 42mm;
    }
}

@media (max-width: 1100px) {
    body.erp-body {
        height: auto;
        overflow: auto;
    }

    .erp-shell,
    .dashboard-grid,
    .second-row,
    .db-launch-card {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .erp-sidebar,
    .erp-main {
        overflow: visible;
    }

    .sidebar-scroll,
    .main-scroll {
        height: auto;
        overflow: visible;
    }

    .erp-topbar {
        position: static;
        background: transparent;
        backdrop-filter: none;
    }

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

    .dashboard-hero,
    .dashboard-grid-primary,
    .dashboard-grid-secondary,
    .dashboard-grid-tertiary,
    .dashboard-grid-bottom,
    .sales-summary-grid-top,
    .sales-summary-grid-middle,
    .sales-summary-grid-bottom,
    .quick-access-grid,
    .insight-rail,
    .module-summary-grid,
    .sales-filter-grid,
    .sales-summary-metrics,
    .sales-summary-toolbar,
    .invoice-filter-grid,
    .invoice-toolbar-grid,
    .invoice-list-metrics,
    .purchase-filter-grid,
    .purchase-toolbar-grid,
    .purchase-list-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-canvas,
    .dashboard-chart-medium,
    .dashboard-chart-small {
        height: 260px !important;
        max-height: 260px;
    }
}

@media (max-width: 900px) {
    .filter-bar,
    .invoice-header-block,
    .invoice-total-grid,
    .invoice-meta-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-side-grid,
    .snapshot-grid,
    .summary-insight-grid,
    .sale-print-summary-row {
        grid-template-columns: 1fr;
    }

    .invoice-toolbar,
    .sale-print-toolbar,
    .sale-print-header,
    .sale-print-footer {
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }
}

@media (max-width: 680px) {
    .main-scroll {
        padding: 14px;
    }

    .metrics-grid,
    .dashboard-grid-primary,
    .dashboard-grid-secondary,
    .dashboard-grid-tertiary,
    .dashboard-grid-bottom,
    .sales-summary-grid-top,
    .sales-summary-grid-middle,
    .sales-summary-grid-bottom,
    .quick-access-grid,
    .snapshot-grid,
    .insight-rail,
    .module-summary-grid,
    .sales-summary-metrics,
    .summary-insight-grid,
    .invoice-list-metrics,
    .purchase-list-metrics,
    .quick-links-grid,
    .mini-chart,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .erp-topbar {
        flex-direction: column;
        align-items: start;
    }

    .topbar-panel {
        flex-wrap: wrap;
    }

    .dashboard-hero,
    .glass-panel,
    .hero-panel {
        padding: 16px;
        border-radius: 20px;
    }

    .sale-print-paper {
        padding: 18px;
        border-radius: 18px;
    }

    .quick-dashboard-card,
    .module-summary-card,
    .snapshot-card,
    .insight-card {
        padding: 12px;
    }
}
