* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(238, 249, 243, 0.95), transparent 28%),
        linear-gradient(180deg, #f7f9fc 0%, #f4f7fb 100%);
    color: #122033;
}

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

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e5eaf2;
    padding: 18px 12px 24px;
}

.brand {
    font-size: 34px;
    font-weight: 800;
    margin: 12px 16px 24px;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 12px 22px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 16px;
    color: #0f1728;
    line-height: 1.2;
    font-weight: 700;
}

.brand-mark {
    width: 18px;
    height: 28px;
    border-radius: 4px;
    background: linear-gradient(180deg, #2fb383 0%, #238f67 100%);
    position: relative;
    display: inline-block;
}

.brand-mark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 6px;
    width: 4px;
    height: 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.85);
}

.sidebar-toggle {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 8px;
    display: grid;
    align-content: center;
    gap: 4px;
}

.sidebar-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #59657d;
}

.workspace-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e5eaf2;
    border-radius: 16px;
    margin: 0 12px 24px;
    padding: 12px;
}

.workspace-card p,
.topbar-right p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #637188;
}

.workspace-icon,
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2fb383;
    color: #ffffff;
    font-weight: 700;
}

.nav-group-title {
    margin: 18px 16px 10px;
    font-size: 14px;
    color: #718198;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-list {
    display: grid;
    gap: 8px;
    padding: 0 8px;
}

.nav-item {
    padding: 13px 14px;
    border-radius: 12px;
    color: #41506a;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-icon {
    width: 16px;
    height: 16px;
    position: relative;
    display: inline-block;
    flex: 0 0 16px;
    color: #67758d;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon,
.nav-submenu.open .nav-parent .nav-icon {
    color: currentColor;
}

.nav-icon::before,
.nav-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

.nav-icon-grid::before {
    inset: 1px;
    border: 2px solid currentColor;
    border-radius: 4px;
    box-shadow: 8px 0 0 -6px currentColor, 0 8px 0 -6px currentColor, 8px 8px 0 -6px currentColor;
}

.nav-icon-party::before {
    left: 5px;
    top: 1px;
    width: 6px;
    height: 6px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.nav-icon-party::after {
    left: 3px;
    top: 9px;
    width: 10px;
    height: 6px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.nav-icon-inventory::before {
    left: 2px;
    top: 3px;
    width: 12px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.nav-icon-inventory::after {
    left: 4px;
    top: 1px;
    width: 8px;
    height: 3px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
}

.nav-icon-sales::before {
    inset: 2px;
    border: 2px solid currentColor;
    border-radius: 3px;
    transform: rotate(45deg);
}

.nav-icon-sales::after {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    left: 2px;
    top: 6px;
}

.nav-icon-purchase::before {
    left: 2px;
    top: 4px;
    width: 10px;
    height: 7px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 4px 4px;
}

.nav-icon-purchase::after {
    left: 3px;
    top: 1px;
    width: 8px;
    height: 2px;
    background: currentColor;
    box-shadow: -2px 11px 0 0 currentColor, 8px 11px 0 0 currentColor;
}

.nav-icon-expense::before,
.nav-icon-income::before,
.nav-icon-accounts::before,
.nav-icon-reports::before,
.nav-icon-profile::before,
.nav-icon-audit::before,
.nav-icon-staff::before {
    inset: 1px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.nav-icon-expense::after {
    left: 4px;
    top: 4px;
    width: 6px;
    height: 4px;
    border: 2px solid currentColor;
    border-top: 0;
}

.nav-icon-income::after {
    left: 2px;
    top: 6px;
    width: 12px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 4px 0 0 currentColor;
}

.nav-icon-accounts::after {
    left: 2px;
    top: 6px;
    width: 12px;
    height: 2px;
    background: currentColor;
}

.nav-icon-reports::after {
    left: 4px;
    bottom: 3px;
    width: 2px;
    height: 5px;
    background: currentColor;
    box-shadow: 4px -2px 0 0 currentColor, 8px -5px 0 0 currentColor;
}

.nav-icon-profile::after {
    left: 5px;
    top: 3px;
    width: 6px;
    height: 6px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.nav-icon-audit::after {
    left: 4px;
    top: 4px;
    width: 8px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 4px 0 0 currentColor;
}

.nav-icon-staff::after {
    left: 2px;
    top: 9px;
    width: 12px;
    height: 4px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.nav-submenu {
    border-radius: 12px;
}

.nav-submenu summary {
    list-style: none;
    cursor: pointer;
}

.nav-submenu summary::-webkit-details-marker {
    display: none;
}

.nav-submenu.open .nav-parent {
    background: #2fb383;
    color: #ffffff;
}

.nav-submenu:not(.open) .nav-parent {
    background: transparent;
    color: #41506a;
}

.nav-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.nav-submenu.open .nav-chevron {
    transform: rotate(45deg);
}

.nav-submenu:not(.open) .nav-parent:hover {
    background: #f3f6fb;
    color: #223249;
}

.nav-children {
    display: grid;
    gap: 8px;
    padding: 12px 14px 6px 42px;
}

.nav-child {
    color: #50607a;
    font-size: 16px;
    padding: 8px 0;
}

.nav-child.active {
    color: #20a874;
    font-weight: 500;
}

.nav-item.active,
.nav-item:hover {
    background: #2fb383;
    color: #ffffff;
}

.main-content {
    flex: 1;
    padding: 24px 28px 36px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    backdrop-filter: blur(10px);
}

.searchbox {
    width: min(420px, 100%);
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
    padding: 14px 18px;
    color: #7b879b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.searchbox span {
    float: right;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-right .workspace-icon,
.topbar-right .avatar {
    border-radius: 14px;
}

.page-content {
    display: grid;
    gap: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-title {
    margin: 0;
    font-size: 24px;
}

.muted {
    color: #75839a;
}

.button,
button,
.button-secondary {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.button {
    background: #2fb383;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(47, 179, 131, 0.16);
}

.button-secondary {
    background: #eef2f7;
    color: #223249;
    border: 1px solid #dfe6ef;
}

.button:hover,
.button-secondary:hover,
button:hover {
    transform: translateY(-1px);
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

.card {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 14px 30px rgba(22, 37, 57, 0.04);
}

.stat-card.green {
    background: #eaf8f1;
}

.stat-card.red {
    background: #fdeef1;
}

.stat-card.blue {
    background: #edf5ff;
}

.stat-card h3,
.card h3 {
    margin: 0 0 8px;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 22px;
    line-height: 1.25;
}

.split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.empty-state {
    background: #ffffff;
    border: 1px dashed #d9e2ef;
    border-radius: 20px;
    padding: 52px 24px;
    text-align: center;
}

.empty-state h2 {
    margin-bottom: 8px;
}

.table-card {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(22, 37, 57, 0.04);
}

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

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f6;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #60708a;
    font-size: 14px;
    font-weight: 700;
}

tbody tr:hover {
    background: #fbfcfe;
}

.form-card {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 14px 30px rgba(22, 37, 57, 0.04);
}

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

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

.field {
    display: grid;
    gap: 8px;
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d7dfeb;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #7fd4b2;
    box-shadow: 0 0 0 4px rgba(47, 179, 131, 0.12);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.alert.success {
    background: #ebf9f1;
    color: #15704d;
}

.alert.error {
    background: #fff1f3;
    color: #9f2440;
}

.chip-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 10px 14px;
    background: #f1f5f9;
    font-weight: 700;
    border: 1px solid #e5ecf4;
}

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

.report-box {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 18px;
    padding: 20px;
}

.report-box p {
    color: #6f7f95;
    margin-bottom: 0;
}

.line-items-card {
    display: grid;
    gap: 12px;
    border: 1px solid #e4e9f2;
    border-radius: 16px;
    padding: 14px;
    background: #f9fbfd;
}

.line-items-head,
.line-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.line-items-head {
    font-size: 13px;
    font-weight: 700;
    color: #60708a;
}

.line-remove {
    background: #ffe8ec;
    color: #b63b57;
}

.chart-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
    align-items: end;
    min-height: 240px;
}

.chart-col {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.chart-pair {
    height: 210px;
    width: 100%;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 8px;
}

.bar {
    width: 18px;
    border-radius: 10px 10px 0 0;
}

.bar.in {
    background: #2fb383;
}

.bar.out {
    background: #f15a74;
}

.chart-label {
    font-size: 12px;
    color: #66778f;
}

.cashflow-card {
    display: grid;
    gap: 18px;
}

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

.cashflow-head h3 {
    margin: 0;
}

.cashflow-range {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 116px;
    justify-content: center;
}

.cashflow-chart {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.cashflow-scale {
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    justify-items: end;
    color: #8a96a8;
    font-size: 14px;
    padding-top: 4px;
}

.cashflow-plot {
    position: relative;
    display: grid;
    align-items: end;
}

.cashflow-grid {
    position: absolute;
    inset: 0 0 24px 0;
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    pointer-events: none;
}

.cashflow-grid span {
    border-top: 1px dashed #dfe6ef;
}

.cashflow-legend {
    display: flex;
    justify-content: center;
    gap: 70px;
    padding-top: 6px;
}

.cashflow-legend-item {
    display: flex;
    align-items: start;
    gap: 8px;
    color: #60708a;
}

.cashflow-legend-item .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 6px;
}

.cashflow-legend-item.in .dot {
    background: #2fb383;
}

.cashflow-legend-item.out .dot {
    background: #f15a74;
}

.cashflow-legend-item strong {
    display: block;
    margin-top: 6px;
    font-size: 16px;
}

.cashflow-legend-item.in strong {
    color: #1faa76;
}

.cashflow-legend-item.out strong {
    color: #f15a74;
}

.report-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    border: 1px solid #dce5f0;
    border-radius: 12px;
    background: #ffffff;
    color: #5f6f87;
    text-decoration: none;
    font-size: 18px;
    box-shadow: 0 8px 18px rgba(31, 52, 84, 0.05);
}

.party-workspace {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 0;
    background: #ffffff;
    border: 1px solid #e5ebf3;
    border-radius: 24px;
    overflow: hidden;
    min-height: 720px;
    box-shadow: 0 18px 40px rgba(22, 37, 57, 0.05);
}

.party-sidebar-panel {
    border-right: 1px solid #e5ebf3;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 18px;
    padding: 28px 24px;
    background: #ffffff;
}

.party-detail-panel {
    display: grid;
    align-content: start;
    gap: 26px;
    padding: 24px;
    background: #ffffff;
}

.party-panel-header,
.party-detail-top,
.party-action-row,
.party-transactions-head,
.party-search-form,
.party-filter-row,
.party-transaction-search,
.party-action-group,
.party-transactions-actions,
.party-toggle-row,
.party-modal-footer,
.party-modal-header,
.party-modal-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.party-panel-header,
.party-detail-top,
.party-action-row,
.party-transactions-head,
.party-modal-header {
    justify-content: space-between;
}

.party-panel-header .page-title,
.party-detail-top h2,
.party-transactions-head h3 {
    margin: 0;
}

.party-add-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.party-search-form {
    gap: 10px;
}

.party-search-wrap {
    flex: 1;
    position: relative;
}

.party-search-wrap input {
    padding-left: 42px;
}

.party-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6e7f96;
}

.party-filter-row {
    align-items: stretch;
    flex-wrap: wrap;
}

.party-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #54647c;
    background: #f3f5f8;
    border: 1px solid #edf2f7;
}

.party-filter-chip.active {
    color: #1eaa7a;
    background: #eefbf5;
    border-color: #cfeedd;
}

.party-inline-menu {
    position: relative;
}

.party-inline-menu summary {
    list-style: none;
    cursor: pointer;
}

.party-inline-menu summary::-webkit-details-marker {
    display: none;
}

.party-menu-sheet {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 15;
    min-width: 180px;
    display: grid;
    gap: 4px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(31, 52, 84, 0.12);
}

.sort-menu .party-menu-sheet {
    max-height: 360px;
    overflow: auto;
}

.party-menu-sheet a,
.party-menu-sheet button,
.party-menu-label {
    border: 0;
    background: transparent;
    padding: 10px 8px;
    text-align: left;
    border-radius: 10px;
    text-decoration: none;
    color: #223249;
    font-size: 15px;
}

.party-menu-sheet a:hover,
.party-menu-sheet button:hover {
    background: #f3f7fb;
}

.party-menu-label {
    color: #8a96a9;
    font-size: 13px;
    font-weight: 700;
    padding-bottom: 4px;
}

.party-menu-danger {
    color: #f05252;
    width: 100%;
    cursor: pointer;
}

.party-list {
    display: grid;
    gap: 0;
    margin: 0 -24px -28px;
    overflow: auto;
}

.party-empty-list {
    padding: 24px;
}

.party-list-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px 24px;
    border-top: 1px solid #edf2f7;
    text-decoration: none;
    color: #223249;
    transition: background-color 0.18s ease;
}

.party-list-item.active {
    background: #e4f8ee;
}

.party-list-item:hover {
    background: #f7fbf9;
}

.party-list-photo,
.party-profile-photo,
.party-modal-photo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    background: #e8edf4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #60708a;
    font-weight: 800;
}

.party-profile-photo,
.party-modal-photo {
    width: 68px;
    height: 68px;
    border-radius: 16px;
}

.party-list-photo img,
.party-profile-photo img,
.party-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.party-list-main,
.party-profile-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.party-list-main {
    display: grid;
    gap: 4px;
}

.party-list-main strong,
.party-list-main span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.party-list-main span {
    color: #697a91;
}

.party-list-balance {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right;
}

.party-balance-status {
    color: #6f7d92;
}

.party-balance-status.receive {
    color: #1ba46e;
}

.party-balance-status.give {
    color: #d34d67;
}

.party-detail-top {
    padding-bottom: 18px;
    border-bottom: 1px solid #edf2f7;
}

.party-profile-block h2 {
    font-size: 18px;
}

.party-profile-block p,
.party-balance-box span {
    color: #67788f;
    margin: 0;
}

.party-balance-box {
    display: grid;
    justify-items: end;
    gap: 6px;
    text-align: right;
}

.party-balance-box strong {
    font-size: 18px;
}

.party-transactions-card {
    display: grid;
    gap: 18px;
}

.party-transaction-search input {
    max-width: 260px;
}

.party-empty-transactions,
.party-detail-empty {
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    gap: 10px;
}

.party-empty-illustration {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    display: grid;
    place-items: center;
    font-size: 48px;
    color: #8c9ab0;
    background: linear-gradient(180deg, #f7f9fc, #eef3f8);
}

.party-transaction-list {
    display: grid;
    gap: 12px;
}

.party-transaction-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid #e4e9f2;
    border-radius: 18px;
    text-decoration: none;
    color: #223249;
    background: #ffffff;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.party-transaction-item:hover {
    transform: translateY(-1px);
    border-color: #d5e7dc;
    box-shadow: 0 12px 24px rgba(31, 52, 84, 0.06);
}

.party-transaction-type {
    min-width: 112px;
    border-radius: 999px;
    padding: 8px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    background: #eef3f8;
    color: #55667e;
}

.party-transaction-type.sales,
.party-transaction-type.payment-in {
    background: #ebf9f1;
    color: #1f9e70;
}

.party-transaction-type.purchase,
.party-transaction-type.payment-out {
    background: #fff2f4;
    color: #d5536a;
}

.party-transaction-type.quotation,
.party-transaction-type.sales-return,
.party-transaction-type.purchase-return {
    background: #f4f5fb;
    color: #5f6590;
}

.party-transaction-body {
    display: grid;
    gap: 4px;
}

.party-transaction-body span {
    color: #6f7d92;
}

.party-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(24, 36, 52, 0.42);
}

.party-modal-card {
    width: min(850px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(14, 29, 46, 0.26);
}

.party-modal-header,
.party-modal-form {
    padding: 24px;
}

.party-modal-header {
    border-bottom: 1px solid #edf2f7;
}

.party-modal-close {
    text-decoration: none;
    font-size: 28px;
    color: #7c889b;
}

.party-modal-form {
    display: grid;
    gap: 22px;
}

.party-modal-top {
    align-items: start;
}

.party-modal-photo-wrap {
    width: 112px;
    display: grid;
    gap: 12px;
    justify-items: start;
}

.party-upload-label,
.party-remove-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.party-modal-fields {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.party-tab-set {
    display: grid;
    gap: 18px;
}

.party-tab-row {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid #edf2f7;
}

.party-tab-button {
    padding: 12px 6px 14px;
    border-radius: 0;
    background: transparent;
    color: #6a778e;
    border-bottom: 2px solid transparent;
}

.party-tab-button.active {
    color: #2fb383;
    border-bottom-color: #2fb383;
}

.party-tab-panel {
    display: none;
}

.party-tab-panel.active {
    display: block;
}

.party-toggle-row {
    flex-wrap: wrap;
}

.party-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e4e9f2;
    background: #f5f7fa;
    color: #3d4a60;
    cursor: pointer;
}

.party-toggle.active {
    background: #eefbf5;
    border-color: #2fb383;
    color: #1f9d70;
}

.party-toggle input {
    display: none;
}

.party-modal-footer {
    justify-content: flex-end;
}

.payment-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5ebf3;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(22, 37, 57, 0.04);
}

.payment-toolbar-search {
    position: relative;
}

.payment-toolbar-search input {
    padding-left: 42px;
}

.payment-toolbar-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6e7f96;
}

.payment-table-card table td:last-child {
    width: 180px;
}

.payment-modal-card {
    width: min(760px, 100%);
}

.quotation-convert-link {
    white-space: nowrap;
}

.quotation-preview-shell {
    display: grid;
    justify-content: center;
    padding: 24px 0 12px;
}

.quotation-preview-paper {
    width: min(820px, 100%);
    background: #ffffff;
    border: 1px solid #e5ebf3;
    border-radius: 24px;
    padding: 30px 34px;
    box-shadow: 0 10px 28px rgba(31, 52, 84, 0.06);
}

.quotation-preview-head,
.quotation-preview-meta,
.quotation-preview-totals {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.quotation-preview-head {
    align-items: start;
}

.quotation-preview-head h2,
.quotation-preview-title {
    margin: 0;
}

.quotation-preview-head p {
    margin: 8px 0 0;
    color: #6f7d92;
}

.quotation-preview-brand {
    font-size: 22px;
    font-weight: 800;
    color: #1a2b44;
}

.quotation-preview-title {
    margin: 24px 0 28px;
    text-align: center;
}

.quotation-preview-meta {
    align-items: start;
    margin-bottom: 24px;
}

.quotation-preview-meta-block {
    display: grid;
    gap: 10px;
}

.quotation-preview-meta-block.right {
    min-width: 240px;
}

.quotation-preview-meta-block div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
}

.quotation-preview-meta-block span {
    color: #6f7d92;
}

.quotation-balance {
    color: #d5536a;
}

.quotation-preview-table {
    margin-top: 18px;
}

.quotation-preview-totals {
    justify-content: flex-end;
    margin-top: 22px;
}

.quotation-preview-totals div {
    min-width: 220px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    font-size: 18px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.status-pill.unpaid {
    color: #ef4e4e;
    background: #fff0f0;
}

.status-pill.paid {
    color: #1c9b68;
    background: #e9fbf1;
}

.status-pill.partial {
    color: #d98a00;
    background: #fff7df;
}

.document-progress-grid {
    display: grid;
    gap: 18px;
    margin: 18px 0 22px;
}

.document-progress-card {
    padding: 20px 22px;
}

.document-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.document-progress-bar {
    height: 12px;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}

.document-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1fb57a 0%, #34c38f 100%);
}

.document-progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.document-progress-stats span {
    display: block;
    color: #71809b;
    font-size: 13px;
    margin-bottom: 4px;
}

.document-progress-stats strong {
    color: #12284c;
    font-size: 18px;
}

.document-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.document-section-head h3 {
    margin: 0;
    font-size: 18px;
}

.document-section-head span {
    color: #71809b;
    font-size: 13px;
    font-weight: 600;
}

.status-pill.accepted {
    color: #1c9b68;
    background: #e9fbf1;
}

.status-pill.inactive {
    color: #8a96a8;
    background: #f3f5f8;
}

.reports-search {
    position: relative;
    width: min(320px, 100%);
}

.reports-search input {
    padding-left: 42px;
}

.reports-tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.reports-tab {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: #f3f5f8;
    color: #334259;
    text-decoration: none;
    font-weight: 600;
}

.reports-tab.active {
    background: #2fb383;
    color: #ffffff;
}

.reports-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.reports-summary-card {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 18px;
    padding: 18px 20px;
    display: grid;
    gap: 8px;
}

.reports-summary-card span {
    color: #6d7b90;
}

.reports-summary-card strong {
    font-size: 26px;
}

.reports-section {
    display: grid;
    gap: 16px;
    margin-bottom: 28px;
}

.reports-section-title {
    margin: 0;
    font-size: 18px;
}

.report-browser-card {
    display: grid;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 18px;
    padding: 22px 18px;
    text-decoration: none;
    color: #1b2940;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.report-browser-card:hover {
    border-color: #cae8d9;
    box-shadow: 0 12px 26px rgba(31, 52, 84, 0.08);
    transform: translateY(-1px);
}

.report-browser-card h3 {
    margin: 0;
}

.report-browser-card p {
    margin: 0;
    color: #6f7f95;
}

.account-balance-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-radius: 16px;
    background: #f8fbfd;
    border: 1px solid #e5ebf3;
}

.account-balance-strip span {
    color: #68788e;
}

.account-balance-strip strong {
    font-size: 20px;
}

.staff-intro-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 28px 24px;
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 20px;
    box-shadow: 0 14px 30px rgba(22, 37, 57, 0.04);
    margin-bottom: 16px;
}

.staff-intro-copy {
    max-width: 680px;
}

.staff-intro-copy h2 {
    margin: 0 0 10px;
}

.staff-intro-copy p {
    margin: 0 0 18px;
    color: #617089;
    font-size: 15px;
    line-height: 1.5;
}

.staff-intro-art {
    position: relative;
    width: 120px;
    height: 100px;
    flex: 0 0 120px;
}

.staff-art-card {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 82px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f7fbff, #edf3fb);
    border: 1px solid #dfe7f2;
    box-shadow: 0 12px 26px rgba(31, 52, 84, 0.08);
}

.staff-art-dots {
    position: absolute;
    left: 18px;
    bottom: 16px;
    width: 66px;
    height: 42px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 14px 14px, #2fb383 0 6px, transparent 7px),
        radial-gradient(circle at 34px 14px, #91a4bf 0 6px, transparent 7px),
        radial-gradient(circle at 54px 14px, #f0b26c 0 6px, transparent 7px),
        radial-gradient(circle at 24px 30px, #91a4bf 0 6px, transparent 7px),
        radial-gradient(circle at 44px 30px, #2fb383 0 6px, transparent 7px);
    background-color: #ffffff;
    border: 1px solid #e4e9f2;
    box-shadow: 0 10px 20px rgba(31, 52, 84, 0.05);
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .alert,
    .button,
    .button-secondary,
    .line-remove,
    form {
        display: none !important;
    }

    .app-shell,
    .main-content,
    .page-content,
    .card,
    .table-card {
        display: block !important;
        width: 100% !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }

    table {
        font-size: 12px;
    }

    th,
    td {
        border: 1px solid #ddd;
    }
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .split,
    .form-grid,
    .form-grid-3,
    .line-items-head,
    .line-item-row {
        grid-template-columns: 1fr;
    }

    .party-workspace {
        grid-template-columns: 1fr;
    }

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

    .quotation-preview-head,
    .quotation-preview-meta,
    .quotation-preview-totals {
        flex-direction: column;
    }

    .quotation-preview-meta-block div {
        grid-template-columns: 1fr;
    }

    .party-sidebar-panel {
        border-right: 0;
        border-bottom: 1px solid #e5ebf3;
    }

    .party-modal-top,
    .party-search-form,
    .party-action-row,
    .party-transactions-head {
        flex-direction: column;
        align-items: stretch;
    }

    .party-modal-fields {
        grid-template-columns: 1fr;
    }

    .party-list-item,
    .party-transaction-item {
        grid-template-columns: 1fr;
    }

    .party-list-balance,
    .party-balance-box {
        justify-items: start;
        text-align: left;
    }
}
