body {
    margin: 0;
    background: #f3f7fb;
    color: #08233f;
    font-family: Arial, Helvetica, sans-serif;
}

.shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 22px 26px 36px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.master-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.master-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid #bfd2e5;
    border-radius: 999px;
    background: #fff;
    color: #0b365f;
    padding: 0 16px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(8, 35, 63, 0.08);
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.master-nav a:hover {
    transform: translateY(-1px);
    border-color: #1672bd;
    background: #edf6ff;
}

.master-nav a.active {
    background: #1672bd;
    border-color: #1672bd;
    color: #fff;
}

.master-nav a:nth-child(2):not(.active) {
    border-color: #e5bf72;
    background: #fff8e8;
    color: #7a4a00;
}

.master-nav a:nth-child(2):hover {
    border-color: #d98b00;
    background: #ffefd0;
}

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

.brand-mark {
    background: #ff9900;
    color: #fff;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: 0;
    padding: 8px 12px;
}

h1 {
    margin: 0;
    font-size: 28px;
}

h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.muted {
    color: #5c728a;
    margin: 4px 0 0;
}

.layout {
    display: grid;
    grid-template-columns: minmax(360px, 480px) 1fr;
    gap: 18px;
    align-items: start;
}

.master-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.panel {
    background: #fff;
    border: 1px solid #d8e4f0;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}

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

.customer-form .field {
    margin-bottom: 14px;
}

.customer-form > .field {
    max-width: none;
}

.customer-form textarea {
    min-height: 92px;
}

.customer-list {
    overflow-x: auto;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
}

.field input,
.field textarea,
.field select {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #cbd9e8;
    border-radius: 6px;
    padding: 9px 10px;
    color: #08233f;
    font: inherit;
}

.field .connector-custom {
    margin-top: 6px;
    font-size: 13px;
}

.field input.readonly {
    background: #eef4fa;
    color: #506780;
    font-weight: 700;
}

.field textarea {
    min-height: 82px;
    resize: vertical;
}

.password-policy-row {
    display: grid;
    grid-template-columns: 230px repeat(4, max-content);
    align-items: center;
    column-gap: 22px;
    row-gap: 8px;
}

.password-policy-row label {
    display: inline;
    margin: 0;
}

.password-policy-row > label {
    display: block;
    font-weight: 700;
}

.password-policy-row input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0 6px 0 0;
}

.password-policy-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 700;
}

.password-policy-option span {
    display: inline;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    border: 0;
    border-radius: 7px;
    padding: 10px 16px;
    cursor: pointer;
    font: inherit;
    margin: 2px 2px;
}

.btn-primary {
    background: #1672bd;
    color: #fff;
}

.btn-secondary {
    background: #e7edf4;
    color: #08233f;
}

.message {
    display: block;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 7px;
    background: #eaf4ff;
    color: #00427a;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 35, 63, 0.42);
}

.modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border: 1px solid #c9d9e8;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 18px 48px rgba(8, 35, 63, 0.24);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1640px;
    table-layout: fixed;
    font-size: 14px;
}

.table th,
.table td {
    border-bottom: 1px solid #dbe6f1;
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table th {
    background: #edf3f9;
    font-size: 14px;
}

.table tr:hover td {
    background: #f7fbff;
}

.table table {
    min-width: 0;
}

.table .btn {
    min-width: 0;
    padding: 7px 10px;
    font-size: 13px;
}

.table th:nth-child(1),
.table td:nth-child(1) {
    width: 90px;
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: 145px;
}

.table th:nth-child(3),
.table td:nth-child(3) {
    width: 500px;
}

.table th:nth-child(4),
.table td:nth-child(4) {
    width: 210px;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    width: 170px;
}

.table th:nth-child(6),
.table td:nth-child(6) {
    width: 220px;
}

.table th:nth-child(7),
.table td:nth-child(7) {
    width: 190px;
}

.table th:nth-child(8),
.table td:nth-child(8) {
    width: 260px;
}

.table td:nth-child(3) {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.table td:nth-child(3) input {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 4px;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    background: #e7f3ec;
    color: #17613a;
    font-size: 12px;
    font-weight: 700;
}

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

    .customer-form .grid {
        grid-template-columns: 1fr;
    }
}
