:root {
    --bg: #f6f6fb;
    --text: #1f1f2e;
    --muted: #6d6d86;
    --border: #e3e3ef;
    --border2: #e7e7f4;
    --panel: #ffffff;
    --head: #f3f3fb;
    --purple: #2f1b66;
    --shadow: 0 8px 22px rgba(0, 0, 0, .06);
    --radius: 16px;
    --radius2: 14px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background: var(--bg);
    margin: 0;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrap {
    max-width: 1280px;
    margin: 28px auto;
    padding: 0 16px;
}

.page {
    display: block;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.top-meta {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.top-meta-item {
    min-width: 140px;
}

.top-meta-item--type {
    min-width: 220px;
}

.top-meta-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.top-meta-value {
    height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
}

.top-meta-control select,
.top-meta-control input {
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
    width: 100%;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    margin-top: 6px;
}

.person {
    padding-top: 6px;
}

.person-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.person-title {
    font-size: 12px;
    color: var(--muted);
}

.person-select select {
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
    min-width: 280px;
}

.person-search {
    position: relative;
    margin: 8px 0 16px;
}

.search-input {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 10px 44px 10px 12px;
    background: #fff;
    outline: none;
}

.person-search::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #d9d9e6;
}

.person-search--disabled .search-input::placeholder {
    color: #c9c9d8;
}

.dropdown {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: 48px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
    max-height: 220px;
    overflow: auto;
    display: none;
}

.dropdown button {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 0;
    background: #fff;
    cursor: pointer;
}

.dropdown button:hover {
    background: var(--bg);
}

.kv {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
    align-items: center;
    margin: 10px 0;
}

.kv-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.kv-control input,
.kv-control select {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
    outline: none;
}

.balance-row {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 240px;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(227, 227, 239, .65);
}

.balance-row.note-row {
    align-items: flex-start;
    grid-template-columns: 1fr minmax(0, 1fr);
}

.balance-label {
    font-size: 12px;
    color: var(--muted);
}

.balance-control input {
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
    width: 100%;
}

.balance-control textarea {
    width: 100%;
    max-width: 100%;
    resize: vertical;
    min-height: 92px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
    font: inherit;
    box-sizing: border-box;
}

.panel {
    margin-top: 18px;
}

.panel-body {
}

.table-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--shadow);
}

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

#full_services_table {
    min-width: 1120px;
}

.table-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px 2px;
}

.table th {
    text-align: center;
    font-size: 12px;
    background: var(--head);
    color: var(--muted);
    padding: 10px 10px;
    border-bottom: 1px solid var(--border2);
}

.table td {
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0fa;
}

.th-center {
    text-align: center;
}

.th-right {
    text-align: right;
}

.td-center {
    text-align: center;
}

.td-right {
    text-align: right;
}

.td-quantity > input {
    max-width: 55px;

}

.td-price > input, .td-value > input {
    max-width: 100%;
}

.th-del {
    width: 60px;
}

.btn-row {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.btn {
    border: 1px solid #d6d6ea;
    background: #fff;
    padding: 12px 16px;
    border-radius: 14px;
    cursor: pointer;
}

.btn-small {
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.btn-pill {
    min-width: 220px;
    border-radius: 999px;
    padding: 12px 18px;
}

.btn-primary {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
    border-radius: 14px;
    padding: 12px 18px;
}

.total-row {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.total-label {
    font-size: 12px;
    color: var(--muted);
}

.total-control input {
    width: 240px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
}

.checks {
    margin-top: 18px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 12px;
    color: var(--muted);
}

.check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2bb673;
}

.sign-email {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    align-items: center;
}

.sign-email-label {
    font-size: 12px;
    color: var(--muted);
}

.sign-email-control input {
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
    width: 100%;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 22px;
}
