﻿html, body {
    font-family: "Montserrat", "Segoe UI", sans-serif;
    background: #f5f6f8;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    background: radial-gradient(circle at 20% 20%, #f4f6fb, #e9edf4 60%, #e3e8f0);
    transition: grid-template-columns 0.25s ease;
}

.portal-shell.sidebar-collapsed {
    grid-template-columns: 88px 1fr;
}

.portal-sidebar {
    min-height: 100vh;
    background: #0f1b2d;
    color: #fff;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    transition: padding 0.25s ease;
}

.sidebar-collapsed .portal-sidebar {
    min-height: 100vh;
    padding: 1.5rem 0.75rem;
    align-items: center;
}

.portal-main {
    display: flex;
    flex-direction: column;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    background: #121d2f;
    color: #fff;
}

.portal-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-subtitle {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: #9fb0c8;
}

.portal-user {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.portal-user-info {
    font-weight: 600;
}

.portal-user-role {
    font-size: 0.85rem;
    color: #9fb0c8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-content {
    padding: 2.5rem;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-collapsed .nav-brand {
    flex-direction: column;
    gap: 0.75rem;
}

.brand-mark {
    width: 64px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(140deg, #2bb3a2, #0f6e7a);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
}

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

.brand-subtitle {
    font-size: 0.8rem;
    color: #aab8cc;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-collapsed .nav-links {
    align-items: center;
}

.nav-link {
    color: #e5ecf8;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-collapsed .nav-link {
    padding: 0.75rem;
    justify-content: center;
    width: 56px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-text {
    display: none;
}

.nav-link.active {
    background: #2bb3a2;
    color: #0f1b2d;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.nav-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}

.nav-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 72px;
    top: 50%;
    transform: translateY(-50%);
    background: #0f1b2d;
    color: #fff;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

.sidebar-collapsed .nav-link {
    position: relative;
}

.sidebar-collapsed .nav-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(6px);
}

.login-shell {
    min-height: 80vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

.login-shell-single {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin: 0 auto;
}

.login-card {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(15, 27, 45, 0.15);
}

.login-header {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 2rem;
}

.login-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #0f1b2d;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.login-panel {
    color: #0f1b2d;
    padding: 2rem;
}

.login-panel h2 {
    font-weight: 600;
}

.login-helper {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    text-align: right;
    font-size: 0.9rem;
}

.login-link {
    color: #1b365d;
    text-decoration: none;
    font-weight: 600;
}

.login-link:hover {
    text-decoration: underline;
}

.password-requirements {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.password-requirements-top {
    margin-bottom: 1.25rem;
}

.password-requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-requirement .dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #c7cdd8;
    display: inline-block;
}

.password-requirement.met {
    color: #0f766e;
}

.password-requirement.met .dot {
    background: #0f766e;
}

.input-match {
    border-color: #0f766e;
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.15);
}

.input-mismatch {
    border-color: #b42318;
    box-shadow: 0 0 0 0.2rem rgba(180, 35, 24, 0.15);
}

.login-metric {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(15, 27, 45, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.kpi-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 18px;
    box-shadow: 0 16px 30px rgba(15, 27, 45, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dashboard-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
}

.admin-sidebar {
    background: #0f1b2d;
    color: #fff;
    padding: 2rem 1.5rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80vh;
}

.admin-brand {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #2bb3a2;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.admin-title {
    font-weight: 600;
}

.admin-subtitle {
    color: #9fb0c8;
    font-size: 0.85rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-link {
    color: #e5ecf8;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.admin-link.active {
    background: #2bb3a2;
    color: #0f1b2d;
}

.admin-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.admin-user {
    font-size: 0.9rem;
    color: #c9d6ea;
}

.admin-content {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(15, 27, 45, 0.08);
}

.admin-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

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

.admin-inline-actions .form-select {
    flex: 1;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #e5e9f2;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.sap-tests-modal {
    padding: 0;
    overflow: hidden;
}

.sap-tests-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.sap-tests-header h3,
.sap-tests-header p {
    margin: 0;
}

.sap-tests-header p {
    margin-top: 0.3rem;
    color: #64748b;
}

.sap-tests-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0;
}

.sap-tests-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
}

.sap-test-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 88px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.sap-test-card div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sap-test-card span {
    color: #64748b;
    font-size: 0.83rem;
    line-height: 1.3;
}

.sap-test-card .btn {
    flex: 0 0 auto;
}

.sap-tests-result {
    margin: 0 1.75rem 1rem;
}

.sap-tests-actions {
    margin: 0;
    padding: 1rem 1.75rem;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 700px) {
    .sap-tests-grid {
        grid-template-columns: 1fr;
    }
}

.pill {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.pill-active {
    background: #def7ec;
    color: #0f766e;
}

.pill-inactive {
    background: #fde8e8;
    color: #b91c1c;
}

.admin-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    align-items: center;
}

.client-documents-filters {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.client-documents-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.client-documents-filter-item {
    min-width: 0;
}

.client-documents-filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.client-documents-filter-error {
    margin-top: 0.75rem;
    color: #b91c1c;
    font-size: 0.9rem;
}

.client-documents-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    color: #475569;
    font-size: 0.95rem;
}

.admin-log-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.admin-log-header h3 {
    margin: 0;
}

.admin-log-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.admin-log-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.admin-log-item span {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-loading {
    padding: 2rem 0;
    color: #4b5563;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: grid;
    place-items: center;
    z-index: 1000;
}

.modal-card {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    min-width: 320px;
    max-width: 520px;
    width: 90%;
}

.modal-wide {
    max-width: 720px;
}

.sap-connection-modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: hidden;
}

.sap-connection-modal-title {
    flex: 0 0 auto;
    margin: 0;
    padding: 1.5rem 1.75rem 0.75rem;
}

.sap-connection-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.sap-connection-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 1.75rem 1rem;
    scrollbar-gutter: stable;
}

.sap-connection-modal-actions {
    flex: 0 0 auto;
    margin: 0;
    padding: 1rem 1.75rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06);
}

@media (max-width: 575.98px) {
    .modal-backdrop {
        padding: 0.5rem;
    }

    .sap-connection-modal {
        width: 100%;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .sap-connection-modal-title,
    .sap-connection-modal-body,
    .sap-connection-modal-actions {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.modal-confirm {
    max-width: 480px;
}

.modal-confirm h3 {
    margin-bottom: 0.5rem;
}

.modal-confirm p {
    margin-bottom: 1.25rem;
    color: #475569;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1050;
}

.toast-card {
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.25);
    font-size: 0.9rem;
}

.announcement-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.announcement-card {
    background: #f1f7ff;
    border: 1px solid #b6d2ff;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 18px 40px rgba(27, 54, 93, 0.08);
}

.announcement-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.announcement-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1b365d;
}

.announcement-meta {
    font-size: 0.85rem;
    color: #4f6c96;
}

.announcement-close {
    border: none;
    background: transparent;
    color: #1b365d;
    font-weight: 700;
    cursor: pointer;
}

.announcement-message {
    color: #1f2f54;
}

.announcement-media {
    margin: 0.75rem 0;
}

.announcement-media img,
.announcement-media video {
    width: 100%;
    border-radius: 12px;
    max-height: 320px;
    object-fit: cover;
}

.announcement-alert {
    max-width: 520px;
}

.announcement-alert-icon {
    width: 48px;
    height: 48px;
    color: #b45309;
    background: #fff4d6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.announcement-alert-body h3 {
    margin: 0 0 0.5rem;
}

.toast-success {
    background: #0f766e;
}

.toast-error {
    background: #b91c1c;
}

.admin-filter {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.client-rfc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.client-rfc-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem;
    background: #fff;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.client-rfc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.1);
}

.client-rfc-label {
    font-weight: 600;
    font-size: 1rem;
}

.client-rfc-sub {
    color: #64748b;
    font-size: 0.85rem;
}

.client-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.client-tab {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
}

.client-tab.active {
    background: #1b6ec2;
    color: #fff;
    border-color: #1b6ec2;
}

@media (max-width: 1024px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        min-height: auto;
    }
}

@media (max-width: 1024px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        
    min-height: 100vh;flex-direction: row;
        justify-content: space-between;
    }

    .portal-main {
        padding-bottom: 2rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.form-label-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.field-icon {
    width: 18px;
    height: 18px;
    color: #0f1b2d;
}

.field-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    display: block;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ERP Invoice Layout */
.erp-invoice-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.erp-invoice-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.erp-invoice-side {
    position: sticky;
    top: 16px;
}

.erp-card {
    background: #ffffff;
    border: 1px solid #e0e4ea;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.erp-card-header {
    font-weight: 600;
    color: #0f172a;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 14px;
    letter-spacing: 0.2px;
}

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

.erp-header-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.erp-typeahead {
    border: 1px solid #d6dbe3;
    border-radius: 8px;
    background: #f8fafc;
    padding: 6px;
    max-height: 220px;
    overflow: auto;
}

.erp-typeahead-item {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
}

.erp-typeahead-item:hover {
    background: #e2e8f0;
}

.erp-typeahead-title {
    font-weight: 600;
    color: #0f172a;
}

.erp-typeahead-sub {
    font-size: 12px;
    color: #475569;
}

.erp-line-toolbar {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, minmax(0, 0.6fr)) 0.6fr;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.erp-line-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.erp-line-action {
    align-self: end;
}

.erp-item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.erp-item-pill {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    background: #f8fafc;
    color: #1f2937;
    display: flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

.erp-item-pill.selected {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0c4a6e;
}

.erp-table-wrapper {
    overflow-x: auto;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.erp-table th,
.erp-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
    white-space: nowrap;
}

.erp-table th {
    color: #334155;
    font-weight: 600;
    background: #f1f5f9;
}

.erp-table-empty {
    text-align: center;
    color: #64748b;
    padding: 16px;
}

.erp-inline {
    min-width: 90px;
}

.erp-comments {
    resize: vertical;
}

.erp-totals-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.erp-totals-row {
    display: flex;
    justify-content: space-between;
    color: #1f2937;
}

.erp-totals-total {
    font-size: 16px;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
}

.erp-uuid {
    background: #f8fafc;
    border: 1px dashed #cbd5f5;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
}

.erp-downloads {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

@media (max-width: 1200px) {
    .erp-invoice-layout {
        grid-template-columns: 1fr;
    }

    .erp-invoice-side {
        position: static;
    }
}

@media (max-width: 768px) {
    .erp-header-grid,
    .erp-header-row,
    .erp-line-toolbar {
        grid-template-columns: 1fr;
    }
}


.app-version-login {
    margin-top: 1rem;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: right;
}
.nav-version {
    margin-top: auto;
    align-self: flex-start;
    padding-bottom: 0.25rem;
    color: #8ea0bb;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sidebar-collapsed .nav-version {
    align-self: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}
@media (max-width: 1024px) {
    .portal-sidebar {
        min-height: auto;
    }

    .nav-version {
        margin-top: 0;
        align-self: center;
    }
}
