:root {
    --navy-950: #071624;
    --navy-900: #0b1f33;
    --navy-850: #102a43;
    --navy-800: #15344f;
    --teal-600: #0e9f91;
    --teal-500: #16b8a6;
    --teal-400: #34cbbb;
    --teal-100: #dff8f4;
    --blue-600: #3d68e8;
    --blue-100: #e9efff;
    --amber-600: #c9820e;
    --amber-100: #fff4dc;
    --red-600: #d34156;
    --red-100: #ffe8ec;
    --green-600: #17865a;
    --green-100: #e2f7ed;
    --ink-950: #142130;
    --ink-800: #263546;
    --ink-600: #627082;
    --ink-500: #7c8998;
    --line: #e4eaf0;
    --line-strong: #d5dee7;
    --canvas: #f4f7f9;
    --surface: #ffffff;
    --surface-muted: #f8fafb;
    --sidebar-width: 276px;
    --shadow-sm: 0 2px 10px rgba(13, 31, 48, .05);
    --shadow-md: 0 15px 40px rgba(13, 31, 48, .10);
    --radius-sm: 9px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --font: "Tahoma", "Arial", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-950);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

svg.icon {
    display: block;
    flex: 0 0 auto;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

.app-body {
    overflow-x: hidden;
    background: var(--canvas);
}

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

.sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    color: #dbe8f2;
    background:
        radial-gradient(circle at 15% 5%, rgba(22, 184, 166, .12), transparent 28%),
        linear-gradient(180deg, var(--navy-900), var(--navy-950));
    box-shadow: -12px 0 34px rgba(4, 18, 29, .08);
}

.sidebar-head {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-lockup,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    font-size: 23px;
    font-weight: 900;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 14px 6px 14px 14px;
    background: linear-gradient(145deg, var(--teal-400), var(--teal-600));
    box-shadow: 0 8px 22px rgba(16, 166, 151, .25);
}

.brand-mark.large {
    width: 54px;
    height: 54px;
    font-size: 28px;
    border-radius: 17px 7px 17px 17px;
}

.brand-copy,
.auth-brand > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.brand-copy strong,
.auth-brand strong {
    color: #fff;
    font-size: 19px;
    line-height: 1.3;
}

.brand-copy small,
.auth-brand small {
    color: #8fa8bc;
    font-size: 11px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px 30px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.nav-group + .nav-group {
    margin-top: 23px;
}

.nav-label {
    padding: 0 13px 8px;
    color: #728ca2;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
}

.nav-link {
    position: relative;
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    margin-bottom: 3px;
    padding: 9px 13px;
    color: #aebfcd;
    border-radius: 11px;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.nav-link.active {
    color: #fff;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(22, 184, 166, .22), rgba(22, 184, 166, .08));
}

.nav-link.active::before {
    position: absolute;
    top: 10px;
    right: -14px;
    bottom: 10px;
    width: 3px;
    content: "";
    border-radius: 4px 0 0 4px;
    background: var(--teal-400);
}

.nav-icon {
    width: 24px;
    display: grid;
    place-items: center;
}

.sidebar-foot {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.secure-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 11px 12px;
    color: #9eb2c3;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
}

.secure-status span:last-child,
.sidebar-user .user-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.secure-status strong {
    color: #dfeaf2;
    font-size: 11px;
}

.secure-status small {
    font-size: 10px;
}

.secure-icon {
    color: var(--teal-400);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 4px;
}

.avatar {
    width: 39px;
    height: 39px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #e8fffc;
    font-weight: 800;
    border: 1px solid rgba(22, 184, 166, .25);
    border-radius: 12px;
    background: rgba(22, 184, 166, .13);
}

.sidebar-user strong {
    overflow: hidden;
    color: #eff5f9;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user small {
    color: #7992a6;
    font-size: 10px;
}

.app-main {
    min-height: 100vh;
    margin-right: var(--sidebar-width);
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
}

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

.global-search {
    width: min(460px, 42vw);
    height: 45px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    color: var(--ink-500);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.global-search:focus-within {
    border-color: rgba(22, 184, 166, .55);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 184, 166, .09);
}

.global-search input {
    width: 100%;
    min-width: 0;
    color: var(--ink-950);
    border: 0;
    outline: 0;
    background: transparent;
}

.global-search input::placeholder {
    color: #97a4b0;
}

.global-search-submit {
    display: grid;
    place-items: center;
    padding: 0;
    color: inherit;
    cursor: pointer;
    border: 0;
    background: transparent;
}

.global-search kbd {
    direction: ltr;
    padding: 2px 6px;
    color: #7b8997;
    font-family: inherit;
    font-size: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(13, 31, 48, .04);
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--ink-600);
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.icon-button:hover {
    color: var(--teal-600);
    border-color: #b9e5df;
    background: #f5fffd;
}

.icon-button.ghost {
    width: 35px;
    height: 35px;
    color: #8da3b4;
    border: 0;
    background: transparent;
}

.notification-button {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--red-600);
}

.topbar-date {
    display: flex;
    flex-direction: column;
    padding-right: 4px;
    line-height: 1.35;
}

.topbar-date small {
    color: var(--ink-500);
    font-size: 10px;
}

.topbar-date strong {
    font-size: 12px;
}

.page-content {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 30px 32px 55px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px;
}

.page-title-wrap {
    min-width: 0;
}

.page-title-wrap h1 {
    margin-bottom: 5px;
    color: var(--ink-950);
    font-size: clamp(23px, 2vw, 30px);
    line-height: 1.35;
    letter-spacing: -.02em;
}

.page-title-wrap p {
    margin-bottom: 0;
    color: var(--ink-600);
    font-size: 13px;
}

.eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--teal-600);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
}

.eyebrow.light {
    color: #65e3d4;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    border-color: var(--teal-600);
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    box-shadow: 0 6px 16px rgba(14, 159, 145, .18);
}

.btn-primary:hover {
    box-shadow: 0 8px 22px rgba(14, 159, 145, .25);
}

.btn-secondary {
    color: var(--ink-800);
    border-color: var(--line-strong);
    background: #fff;
}

.btn-secondary:hover {
    border-color: #b5c2ce;
    background: var(--surface-muted);
}

.btn-danger {
    color: var(--red-600);
    border-color: #f3c5cd;
    background: #fff;
}

.btn-compact {
    min-height: 40px;
    padding: 8px 13px;
    font-size: 12px;
}

.btn-small {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 8px;
}

.btn-large {
    width: 100%;
    min-height: 50px;
    font-size: 14px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title h2,
.card-title h3 {
    margin-bottom: 1px;
    font-size: 16px;
}

.card-title small {
    display: block;
    color: var(--ink-500);
    font-size: 10px;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--teal-600);
    border-radius: 11px;
    background: var(--teal-100);
}

.card-body {
    padding: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 19px;
}

.stat-card {
    position: relative;
    min-height: 146px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.stat-card::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    content: "";
    background: var(--stat-accent, var(--teal-500));
}

.stat-card.accent-teal {
    --stat-accent: var(--teal-500);
}

.stat-card.accent-blue {
    --stat-accent: var(--blue-600);
}

.stat-card.accent-amber {
    --stat-accent: #e7a326;
}

.stat-card.accent-red {
    --stat-accent: var(--red-600);
}

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

.stat-label {
    color: var(--ink-600);
    font-size: 12px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--stat-accent, var(--teal-600));
    border-radius: 12px;
    background: color-mix(in srgb, var(--stat-accent, var(--teal-500)) 10%, white);
}

.stat-value {
    margin-bottom: 5px;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
}

.stat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink-500);
    font-size: 10px;
}

.trend-up {
    color: var(--green-600);
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    gap: 19px;
    margin-bottom: 19px;
}

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

.metric-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--line);
}

.metric-strip > div {
    padding: 17px;
    background: #fff;
}

.metric-strip small {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-500);
    font-size: 10px;
}

.metric-strip strong {
    font-size: 18px;
}

.list-stack {
    display: flex;
    flex-direction: column;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.list-row:first-child {
    padding-top: 0;
}

.list-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.list-row-icon {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--teal-600);
    border-radius: 11px;
    background: var(--teal-100);
}

.list-row-content {
    min-width: 0;
    flex: 1;
}

.list-row-content strong {
    display: block;
    overflow: hidden;
    margin-bottom: 1px;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row-content small {
    color: var(--ink-500);
    font-size: 10px;
}

.list-row-side {
    flex: 0 0 auto;
    text-align: left;
}

.list-row-side strong,
.list-row-side small {
    display: block;
}

.list-row-side small {
    color: var(--ink-500);
    font-size: 10px;
}

.badge {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    white-space: nowrap;
}

.badge.success {
    color: var(--green-600);
    background: var(--green-100);
}

.badge.warning {
    color: var(--amber-600);
    background: var(--amber-100);
}

.badge.danger {
    color: var(--red-600);
    background: var(--red-100);
}

.badge.neutral {
    color: var(--ink-600);
    background: #edf1f4;
}

.badge.blue {
    color: var(--blue-600);
    background: var(--blue-100);
}

.progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f4;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal-600), var(--teal-400));
}

.progress-native {
    width: 100%;
    height: 7px;
    display: block;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: #edf1f4;
}

.progress-native::-webkit-progress-bar {
    border-radius: 999px;
    background: #edf1f4;
}

.progress-native::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal-600), var(--teal-400));
}

.progress-native::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal-600), var(--teal-400));
}

.progress-row {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.progress-row:last-child {
    border-bottom: 0;
}

.progress-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

.progress-row-head strong {
    font-size: 12px;
}

.progress-row-head span {
    color: var(--ink-500);
    font-size: 10px;
}

.table-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
}

.table-toolbar form,
.filter-bar {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 9px;
}

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

.table-search svg {
    position: absolute;
    top: 50%;
    right: 12px;
    color: var(--ink-500);
    transform: translateY(-50%);
}

.table-search input {
    width: 100%;
    height: 40px;
    padding: 8px 40px 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: 0;
    background: var(--surface-muted);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 14px 18px;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table th {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 700;
    background: #fafcfd;
}

.data-table td {
    color: var(--ink-800);
    font-size: 12px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: #fbfefd;
}

.cell-primary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cell-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--teal-600);
    font-weight: 800;
    border-radius: 10px;
    background: var(--teal-100);
}

.cell-copy strong,
.cell-copy small {
    display: block;
}

.cell-copy strong {
    color: var(--ink-950);
    font-size: 12px;
}

.cell-copy small,
.muted {
    color: var(--ink-500);
    font-size: 10px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.table-actions .icon-button {
    width: 33px;
    height: 33px;
    border-radius: 8px;
}

.empty-state {
    display: flex;
    min-height: 290px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    color: var(--teal-600);
    border-radius: 18px;
    background: var(--teal-100);
}

.empty-state h3 {
    margin-bottom: 6px;
    font-size: 16px;
}

.empty-state p {
    max-width: 390px;
    margin-bottom: 18px;
    color: var(--ink-600);
    font-size: 12px;
}

.empty-state.compact {
    min-height: 205px;
    padding: 20px;
}

.form-card {
    max-width: 1040px;
    margin: 0 auto;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

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

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-two {
    grid-column: span 2;
}

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

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 9px;
    color: var(--ink-950);
    font-size: 12px;
    font-weight: 800;
    border-bottom: 1px solid var(--line);
}

.form-section-title::before {
    width: 4px;
    height: 17px;
    content: "";
    border-radius: 5px;
    background: var(--teal-500);
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.field > span {
    color: var(--ink-800);
    font-size: 11px;
    font-weight: 700;
}

.field small {
    color: var(--ink-500);
    font-size: 10px;
}

.field input,
.field select,
.field textarea,
.control {
    width: 100%;
    min-height: 43px;
    padding: 9px 12px;
    color: var(--ink-950);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: 0;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus,
.control:focus {
    border-color: rgba(22, 184, 166, .7);
    box-shadow: 0 0 0 4px rgba(22, 184, 166, .09);
}

.field input[dir="ltr"],
.field select[dir="ltr"],
.field textarea[dir="ltr"] {
    text-align: left;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.check-card {
    min-height: 72px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-muted);
}

.check-card.wide {
    width: 100%;
}

.check-card input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--teal-600);
}

.check-card span {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.check-card strong {
    font-size: 11px;
}

.check-card small {
    color: var(--ink-500);
    font-size: 9px;
}

.selected-client-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #bce8e2;
    border-radius: 13px;
    background: #f4fffd;
}

.selected-client-card div {
    min-width: 0;
}

.selected-client-card strong,
.selected-client-card small {
    display: block;
}

.selected-client-card strong {
    font-size: 12px;
}

.selected-client-card small {
    color: var(--ink-500);
    font-size: 10px;
}

.selected-client-card > a {
    color: var(--teal-600);
    font-size: 10px;
    font-weight: 700;
}

.service-choice-grid {
    display: grid;
    gap: 9px;
}

.service-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 14px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .18s ease, background .18s ease;
}

.service-choice:has(input:checked) {
    border-color: #98ddd4;
    background: #f3fffd;
}

.service-choice > input {
    width: 18px;
    height: 18px;
    accent-color: var(--teal-600);
}

.service-choice-main,
.service-choice-price {
    display: flex;
    flex-direction: column;
}

.service-choice-main strong,
.service-choice-price {
    font-size: 11px;
}

.service-choice-main small,
.service-choice-price small {
    color: var(--ink-500);
    font-size: 9px;
}

.service-choice-price {
    text-align: left;
}

.terms-list {
    margin: 0;
    padding-right: 22px;
}

.terms-list li {
    padding: 7px 4px;
    color: var(--ink-800);
    font-size: 11px;
    border-bottom: 1px solid var(--line);
}

.terms-list li:last-child {
    border-bottom: 0;
}

form[data-inline-form] {
    display: inline-flex;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(245px, 1fr));
    gap: 13px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.kanban-column {
    min-height: 520px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #eef3f6;
}

.kanban-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 5px 12px;
    color: var(--ink-800);
    font-size: 11px;
    font-weight: 800;
}

.kanban-head b {
    min-width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: var(--ink-600);
    font-size: 10px;
    border-radius: 8px;
    background: #fff;
}

.kanban-stack {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.kanban-empty {
    padding: 25px 10px;
    color: var(--ink-500);
    font-size: 10px;
    text-align: center;
    border: 1px dashed #cad4dc;
    border-radius: 11px;
}

.project-card {
    display: block;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(13, 31, 48, .04);
    transition: transform .16s ease, box-shadow .16s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(13, 31, 48, .08);
}

.project-card-top,
.project-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.project-card-top > small,
.project-card-foot {
    color: var(--ink-500);
    font-size: 9px;
}

.project-card h3 {
    margin: 13px 0 4px;
    font-size: 12px;
    line-height: 1.55;
}

.project-card p {
    overflow: hidden;
    margin-bottom: 12px;
    color: var(--ink-500);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card .progress-native {
    margin-bottom: 9px;
}

.task-list {
    display: flex;
    flex-direction: column;
}

.task-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.task-row:last-child {
    border-bottom: 0;
}

.task-status-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--ink-600);
    border-radius: 10px;
    background: #edf1f4;
}

.task-status-icon.success {
    color: var(--green-600);
    background: var(--green-100);
}

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

.task-main strong,
.task-main small {
    display: block;
}

.task-main strong {
    font-size: 11px;
}

.task-main small {
    color: var(--ink-500);
    font-size: 9px;
}

.task-status-form select {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    background: #fff;
}

.ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .55fr);
    align-items: start;
    gap: 18px;
}

.ticket-conversation {
    overflow: hidden;
}

.ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ticket-message {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 11px;
}

.message-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--teal-600);
    font-weight: 800;
    border-radius: 11px;
    background: var(--teal-100);
}

.message-content {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 4px 13px 13px 13px;
    background: var(--surface-muted);
}

.ticket-message.internal .message-content {
    border-color: #f0d79d;
    background: #fffbf1;
}

.message-content header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 8px;
    margin-bottom: 8px;
}

.message-content header strong {
    font-size: 11px;
}

.message-content header span,
.message-content header time {
    color: var(--ink-500);
    font-size: 9px;
}

.message-content header b {
    padding: 2px 7px;
    color: var(--amber-600);
    font-size: 8px;
    border-radius: 999px;
    background: var(--amber-100);
}

.message-content header time {
    margin-right: auto;
}

.message-content p {
    margin-bottom: 0;
    color: var(--ink-800);
    font-size: 11px;
    line-height: 1.85;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    color: var(--teal-600);
    border: 1px solid #bde7e1;
    border-radius: 9px;
    background: #fff;
}

.attachment-link span,
.attachment-link small {
    display: block;
    font-size: 9px;
}

.attachment-link small {
    color: var(--ink-500);
}

.ticket-reply-box {
    padding: 20px 22px;
    border-top: 1px solid var(--line);
    background: #f8fafb;
}

.ticket-sidebar {
    position: sticky;
    top: 106px;
}

.text-danger {
    color: var(--red-600);
}

.text-success {
    color: var(--green-600);
}

.date-value {
    font-size: 21px;
}

.status-value {
    min-height: 32px;
    display: flex;
    align-items: center;
}

.alert,
.toast {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 9px;
}

.alert ul {
    margin: 7px 0 0;
}

.alert-success,
.toast-success {
    color: var(--green-600);
    border-color: #bfe8d4;
    background: var(--green-100);
}

.alert-warning {
    color: #946107;
    border-color: #f0d79d;
    background: var(--amber-100);
}

.alert-danger,
.toast-danger {
    color: #a92e42;
    border-color: #f0bac4;
    background: var(--red-100);
}

.tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.page-tabs {
    margin-bottom: 18px;
}

.tab-link {
    min-width: max-content;
    padding: 8px 13px;
    color: var(--ink-600);
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
}

.tab-link.active {
    color: var(--teal-600);
    background: var(--teal-100);
}

.client-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 23px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.client-stats {
    margin-top: 18px;
}

.section-card {
    margin-top: 19px;
}

.completion-cell {
    width: 92px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
}

.completion-cell small {
    color: var(--ink-500);
    font-size: 9px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 17px;
    border-top: 1px solid var(--line);
}

.page-link {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--ink-600);
    font-size: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.page-link.active {
    color: #fff;
    border-color: var(--teal-600);
    background: var(--teal-600);
}

.client-hero-avatar {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    color: var(--teal-600);
    font-size: 23px;
    font-weight: 900;
    border-radius: 18px;
    background: var(--teal-100);
}

.client-hero h1 {
    margin-bottom: 4px;
    font-size: 21px;
}

.client-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--ink-500);
    font-size: 11px;
}

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

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

.detail-item {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
}

.detail-item small,
.detail-item strong {
    display: block;
}

.detail-item small {
    margin-bottom: 4px;
    color: var(--ink-500);
    font-size: 10px;
}

.detail-item strong {
    font-size: 12px;
}

.timeline {
    position: relative;
}

.timeline::before {
    position: absolute;
    top: 10px;
    right: 16px;
    bottom: 10px;
    width: 1px;
    content: "";
    background: var(--line-strong);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    padding: 0 0 20px;
}

.timeline-dot {
    z-index: 1;
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    color: var(--teal-600);
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--teal-100);
}

.timeline-content {
    padding-top: 4px;
}

.timeline-content strong,
.timeline-content small {
    display: block;
}

.timeline-content strong {
    margin-bottom: 2px;
    font-size: 11px;
}

.timeline-content small {
    color: var(--ink-500);
    font-size: 10px;
}

.feature-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.feature-note-grid article {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.feature-note-grid article > span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--teal-600);
    border-radius: 11px;
    background: var(--teal-100);
}

.feature-note-grid strong,
.feature-note-grid small {
    display: block;
}

.feature-note-grid strong {
    font-size: 11px;
}

.feature-note-grid small {
    color: var(--ink-500);
    font-size: 9px;
}

.settings-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    gap: 18px;
}

.feature-group-card .card-body {
    padding: 16px;
}

.dependency-note {
    margin-top: 4px;
    color: var(--amber-600) !important;
}

.brand-feature-panel {
    position: sticky;
    top: 106px;
    max-height: calc(100vh - 130px);
    overflow: hidden;
}

.brand-feature-panel .card-body {
    max-height: calc(100vh - 210px);
    overflow-y: auto;
}

.brand-feature-list {
    margin-top: 17px;
    border-top: 1px solid var(--line);
}

.brand-feature-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.brand-feature-row > span {
    font-size: 10px;
}

.brand-feature-row select {
    min-height: 32px;
    padding: 4px 7px;
    font-size: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.employee-card {
    padding: 18px;
}

.employee-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.employee-avatar {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    color: var(--teal-600);
    font-size: 19px;
    font-weight: 900;
    border-radius: 15px;
    background: var(--teal-100);
}

.employee-card h2 {
    margin-bottom: 2px;
    font-size: 15px;
}

.employee-card > p {
    margin-bottom: 14px;
    color: var(--ink-500);
    font-size: 10px;
}

.employee-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--line);
}

.employee-stats > div {
    padding: 10px;
    text-align: center;
    background: var(--surface-muted);
}

.employee-stats strong,
.employee-stats small {
    display: block;
}

.employee-stats strong {
    font-size: 16px;
}

.employee-stats small {
    color: var(--ink-500);
    font-size: 8px;
}

.employee-contact {
    display: flex;
    min-height: 48px;
    flex-direction: column;
    margin-bottom: 12px;
    color: var(--ink-600);
    font-size: 9px;
}

.employee-card .btn {
    width: 100%;
}

.permission-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 75px;
}

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

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-muted);
}

.permission-item:has(input:checked) {
    border-color: #a9e3dc;
    background: #f3fffd;
}

.permission-item input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--teal-600);
}

.permission-item span,
.permission-item strong,
.permission-item small {
    display: block;
}

.permission-item strong {
    font-size: 10px;
}

.permission-item small {
    color: var(--ink-500);
    font-size: 8px;
}

.sticky-save {
    position: fixed;
    z-index: 25;
    right: calc(var(--sidebar-width) + 32px);
    bottom: 18px;
    left: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .95);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
}

.sticky-save span {
    color: var(--ink-600);
    font-size: 11px;
}

.link-card {
    display: grid;
    grid-template-columns: minmax(230px, .65fr) minmax(0, 1.35fr);
    align-items: center;
    gap: 18px;
    padding: 18px;
}

.link-card > div {
    display: flex;
    align-items: center;
    gap: 11px;
}

.link-card strong,
.link-card small {
    display: block;
}

.link-card strong {
    font-size: 11px;
}

.link-card small {
    color: var(--ink-500);
    font-size: 9px;
}

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
}

.copy-field input {
    min-width: 0;
    height: 39px;
    padding: 8px 10px;
    color: var(--ink-600);
    font-size: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-muted);
}

.public-body {
    background:
        radial-gradient(circle at 10% 0, rgba(22, 184, 166, .08), transparent 26%),
        var(--canvas);
}

.public-topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 max(24px, calc((100vw - 980px) / 2));
    color: #fff;
    background: var(--navy-900);
}

.public-brand-copy {
    display: flex;
    flex-direction: column;
}

.public-brand-copy strong {
    font-size: 17px;
}

.public-brand-copy small {
    color: #94acbd;
    font-size: 9px;
}

.secure-public {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #9bded6;
    font-size: 10px;
}

.public-content {
    width: min(940px, calc(100% - 30px));
    margin: 28px auto 50px;
}

.public-document {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 21px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.public-doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 27px;
    border-bottom: 1px solid var(--line);
}

.public-doc-head h1 {
    margin-bottom: 4px;
    font-size: 25px;
}

.public-doc-head p {
    margin-bottom: 0;
    color: var(--ink-600);
    font-size: 11px;
}

.public-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border-bottom: 1px solid var(--line);
    background: var(--line);
}

.public-metrics > div {
    padding: 18px 27px;
    background: var(--surface-muted);
}

.public-metrics small,
.public-metrics strong {
    display: block;
}

.public-metrics small {
    color: var(--ink-500);
    font-size: 9px;
}

.public-metrics strong {
    font-size: 16px;
}

.public-section {
    padding: 25px 27px;
    border-bottom: 1px solid var(--line);
}

.public-section h2 {
    margin-bottom: 14px;
    font-size: 15px;
}

.public-section p {
    margin-bottom: 0;
    color: var(--ink-600);
    font-size: 11px;
}

.public-total {
    width: min(360px, 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 14px 0 0 auto;
    padding: 12px 14px;
    color: #fff;
    font-size: 11px;
    border-radius: 9px;
    background: var(--navy-900);
}

.quote-decision {
    padding: 25px 27px;
    background: #f7fbfa;
}

.quote-decision p {
    color: var(--ink-600);
    font-size: 11px;
}

.quote-decision > div {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.public-result {
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 21px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.result-icon {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    color: var(--ink-600);
    border-radius: 24px;
    background: #edf1f4;
}

.result-icon.success {
    color: var(--green-600);
    background: var(--green-100);
}

.public-result h1 {
    margin-bottom: 7px;
    font-size: 24px;
}

.public-result p {
    max-width: 520px;
    color: var(--ink-600);
}

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

.server-card {
    display: block;
    padding: 18px;
    transition: transform .16s ease, box-shadow .16s ease;
}

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.server-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.server-icon {
    width: 47px;
    height: 47px;
    display: grid;
    place-items: center;
    color: var(--teal-600);
    border-radius: 14px;
    background: var(--teal-100);
}

.server-card h2 {
    margin-bottom: 1px;
    font-size: 15px;
}

.server-card > p {
    overflow: hidden;
    margin-bottom: 15px;
    color: var(--ink-500);
    font-size: 10px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-metric {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--line);
}

.server-metric > div {
    padding: 9px;
    text-align: center;
    background: var(--surface-muted);
}

.server-metric strong,
.server-metric small,
.server-storage span,
.server-storage b,
.server-storage small {
    display: block;
}

.server-metric strong {
    font-size: 13px;
}

.server-metric small,
.server-storage small {
    color: var(--ink-500);
    font-size: 8px;
}

.server-storage span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
}

.server-storage b {
    font-size: 9px;
}

.danger-progress::-webkit-progress-value {
    background: var(--red-600);
}

.danger-progress::-moz-progress-bar {
    background: var(--red-600);
}

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

.feature-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.feature-card.is-off {
    background: #fafbfc;
}

.feature-copy strong,
.feature-copy small {
    display: block;
}

.feature-copy strong {
    margin-bottom: 3px;
    font-size: 12px;
}

.feature-copy small {
    color: var(--ink-500);
    font-size: 10px;
    line-height: 1.55;
}

.switch {
    position: relative;
    width: 46px;
    height: 26px;
    display: inline-block;
}

.switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch-track {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 999px;
    background: #cdd5dc;
    transition: background .2s ease;
}

.switch-track::after {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    content: "";
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(9, 27, 40, .22);
    transition: transform .2s ease;
}

.switch input:checked + .switch-track {
    background: var(--teal-500);
}

.switch input:checked + .switch-track::after {
    transform: translateX(-20px);
}

.switch input:disabled + .switch-track {
    cursor: not-allowed;
    opacity: .55;
}

.contract-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 24px auto;
    padding: 18mm 18mm 16mm;
    color: #1d2732;
    background: #fff;
    box-shadow: 0 15px 50px rgba(10, 26, 40, .16);
}

.contract-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--navy-900);
}

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

.contract-brand .brand-mark {
    width: 49px;
    height: 49px;
}

.contract-brand strong,
.contract-brand small {
    display: block;
}

.contract-brand strong {
    font-size: 18px;
}

.contract-brand small {
    color: #667483;
    font-size: 10px;
}

.contract-ref {
    text-align: left;
}

.contract-ref strong,
.contract-ref span {
    display: block;
}

.contract-ref strong {
    font-size: 13px;
}

.contract-ref span {
    color: #697785;
    font-size: 10px;
}

.contract-title {
    margin: 24px 0;
    text-align: center;
}

.contract-title h1 {
    margin-bottom: 5px;
    font-size: 22px;
}

.contract-title p {
    color: #687684;
    font-size: 10px;
}

.contract-parties {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.contract-party {
    padding: 13px;
    border: 1px solid #dce3e8;
    border-radius: 9px;
    background: #f8fafb;
}

.contract-party small,
.contract-party strong,
.contract-party span {
    display: block;
}

.contract-party small {
    margin-bottom: 3px;
    color: #72808e;
    font-size: 9px;
}

.contract-party strong {
    margin-bottom: 3px;
    font-size: 12px;
}

.contract-party span {
    color: #586674;
    font-size: 9px;
}

.contract-section {
    margin: 18px 0;
}

.contract-section h2 {
    margin-bottom: 9px;
    padding-bottom: 6px;
    font-size: 13px;
    border-bottom: 1px solid #e1e6ea;
}

.contract-section p,
.contract-section li {
    font-size: 10px;
    line-height: 1.85;
}

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

.contract-table th,
.contract-table td {
    padding: 9px;
    font-size: 9px;
    text-align: right;
    border: 1px solid #dfe5e9;
}

.contract-table th {
    background: #f1f5f7;
}

.contract-total {
    width: 280px;
    margin: 10px 0 0 auto;
}

.contract-total div {
    display: flex;
    justify-content: space-between;
    padding: 6px 9px;
    font-size: 10px;
    border-bottom: 1px solid #e3e8ec;
}

.contract-total .grand-total {
    color: #fff;
    font-weight: 800;
    border: 0;
    background: var(--navy-900);
}

.contract-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 50px;
    margin-top: 45px;
}

.signature-box {
    min-height: 80px;
    padding-top: 8px;
    border-top: 1px solid #9da8b2;
    text-align: center;
    font-size: 10px;
}

.print-body {
    background: #dfe5e9;
}

.print-toolbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .95);
}

.auth-body {
    overflow-x: hidden;
    background: #fff;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(390px, .95fr) minmax(430px, 1.05fr);
}

.auth-visual {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 46px 55px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 25%, rgba(22, 184, 166, .24), transparent 26%),
        radial-gradient(circle at 85% 85%, rgba(61, 104, 232, .15), transparent 30%),
        linear-gradient(145deg, var(--navy-900), var(--navy-950));
}

.auth-visual::after {
    position: absolute;
    top: 50%;
    left: -100px;
    width: 330px;
    height: 330px;
    content: "";
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
    box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 120px rgba(255, 255, 255, .018);
}

.auth-message {
    position: relative;
    z-index: 2;
    max-width: 520px;
}

.auth-message h1 {
    margin-bottom: 18px;
    font-size: clamp(36px, 4.5vw, 66px);
    line-height: 1.25;
    letter-spacing: -.04em;
}

.auth-message p {
    max-width: 470px;
    color: #a9bdcc;
    font-size: 15px;
}

.auth-security-strip {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 11px 22px;
    color: #91aabb;
    font-size: 11px;
}

.auth-security-strip span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.auth-security-strip svg {
    color: var(--teal-400);
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 50px;
    background: #fff;
}

.auth-card {
    width: min(410px, 100%);
}

.auth-card h2 {
    margin-bottom: 7px;
    font-size: 28px;
}

.auth-card > p {
    margin-bottom: 28px;
    color: var(--ink-600);
    font-size: 12px;
}

.auth-card .field + .field {
    margin-top: 16px;
}

.auth-card .btn-large {
    margin-top: 21px;
}

.auth-footer {
    width: min(410px, 100%);
    margin: 30px 0 0;
    color: #97a3ae;
    font-size: 10px;
    text-align: center;
}

.installer-body {
    background:
        radial-gradient(circle at 15% 0, rgba(22, 184, 166, .08), transparent 25%),
        var(--canvas);
}

.installer-shell {
    width: min(1220px, calc(100% - 40px));
    min-height: calc(100vh - 60px);
    display: grid;
    grid-template-columns: minmax(320px, .75fr) minmax(550px, 1.25fr);
    overflow: hidden;
    margin: 30px auto;
    border: 1px solid var(--line);
    border-radius: 25px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.installer-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px;
    color: #fff;
    background:
        radial-gradient(circle at 25% 15%, rgba(22, 184, 166, .25), transparent 29%),
        linear-gradient(155deg, var(--navy-900), var(--navy-950));
}

.installer-brand .brand-mark {
    margin-bottom: 35px;
}

.installer-brand h1 {
    margin-bottom: 13px;
    font-size: 34px;
    line-height: 1.3;
}

.installer-brand > p {
    color: #a7bccb;
    font-size: 13px;
}

.security-list {
    display: grid;
    gap: 8px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    color: #c2d0da;
    font-size: 11px;
}

.security-list li::before {
    margin-left: 8px;
    color: var(--teal-400);
    content: "✓";
}

.installer-panel {
    padding: 38px 44px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.panel-heading h2 {
    margin-bottom: 0;
    font-size: 24px;
}

.step-pill {
    padding: 5px 10px;
    color: var(--teal-600);
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    background: var(--teal-100);
}

.public-error-shell,
.error-card {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 30px;
    text-align: center;
}

.error-card {
    min-height: 450px;
}

.error-code {
    margin-bottom: 5px;
    color: var(--teal-500);
    font-size: 75px;
    font-weight: 900;
    line-height: 1;
}

.error-icon-large {
    width: 85px;
    height: 85px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    color: var(--teal-600);
    border-radius: 25px;
    background: var(--teal-100);
}

.error-card h1 {
    margin-bottom: 6px;
    font-size: 23px;
}

.error-card p {
    margin-bottom: 20px;
    color: var(--ink-600);
}

.sidebar-overlay,
.mobile-only {
    display: none;
}

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

.compact-stats {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.stat-value.small-value {
    font-size: 22px;
}

.split-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.split-action p {
    margin: 4px 0 0;
}

.danger-zone {
    margin-top: 12px;
    padding: 14px;
    color: var(--red-600);
    border: 1px solid #f2c9d0;
    border-radius: 12px;
    background: #fffafb;
}

.danger-zone summary,
details summary {
    cursor: pointer;
    font-weight: 700;
}

.danger-zone form,
details .copy-field {
    margin-top: 16px;
}

.action-field {
    justify-content: flex-end;
}

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

.recovery-grid code {
    padding: 13px;
    color: var(--navy-900);
    font-size: 16px;
    text-align: center;
    letter-spacing: .11em;
    border: 1px dashed #abc0ce;
    border-radius: 10px;
    background: var(--surface-muted);
}

.search-page-form {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    margin-bottom: 20px;
}

.search-input-large,
.filter-search {
    position: relative;
}

.search-input-large svg,
.filter-search svg {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 13px;
    color: var(--ink-500);
    transform: translateY(-50%);
}

.search-input-large input,
.filter-search input {
    padding-right: 43px;
}

.filter-search {
    width: min(460px, 100%);
}

.filter-search input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: 0;
    background: #fff;
}

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

.notification-list {
    display: flex;
    flex-direction: column;
}

.notification-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.notification-row.unread {
    border-radius: 11px;
    background: #f2fffd;
}

.notification-row time {
    display: block;
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 9px;
}

.knowledge-card {
    transition: transform .17s ease, box-shadow .17s ease;
}

.knowledge-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.knowledge-card h2 {
    margin: 15px 0 7px;
    font-size: 16px;
}

.knowledge-card p {
    min-height: 54px;
    color: var(--ink-600);
    font-size: 11px;
}

.card-meta,
.inline-form,
.inline-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-meta {
    justify-content: space-between;
    color: var(--ink-500);
    font-size: 10px;
}

.inline-form select {
    min-height: 34px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.inline-field {
    flex-direction: row;
}

.inline-field input {
    min-width: 155px;
}

.prose-content {
    max-width: 900px;
    color: var(--ink-800);
    font-size: 14px;
    line-height: 2.05;
    white-space: normal;
}

@media (max-width: 1180px) {
    :root {
        --sidebar-width: 254px;
    }

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

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

    .topbar,
    .page-content {
        padding-right: 24px;
        padding-left: 24px;
    }

    .settings-split {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .brand-feature-panel {
        position: static;
        max-height: none;
    }

    .brand-feature-panel .card-body {
        max-height: none;
    }
}

@media (max-width: 900px) {
    .mobile-only {
        display: inline-grid;
    }

    .sidebar {
        width: min(310px, 88vw);
        transform: translateX(105%);
        transition: transform .23s ease;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 45;
        inset: 0;
        display: block;
        visibility: hidden;
        cursor: pointer;
        border: 0;
        opacity: 0;
        background: rgba(3, 15, 24, .55);
        transition: opacity .23s ease, visibility .23s ease;
    }

    .sidebar-open .sidebar-overlay {
        visibility: visible;
        opacity: 1;
    }

    .app-main {
        margin-right: 0;
    }

    .sticky-save {
        right: 18px;
        left: 18px;
    }

    .dashboard-grid,
    .dashboard-grid.equal {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 350px;
        padding: 35px;
    }

    .auth-message h1 {
        font-size: 38px;
    }

    .installer-shell {
        grid-template-columns: 1fr;
    }

    .ticket-layout {
        grid-template-columns: 1fr;
    }

    .ticket-sidebar {
        position: static;
    }

    .installer-brand {
        padding: 35px;
    }

    .installer-brand .brand-mark {
        margin-bottom: 20px;
    }
}

@media (max-width: 680px) {
    body {
        font-size: 13px;
    }

    .topbar {
        height: 70px;
        padding: 0 14px;
    }

    .global-search {
        width: 42px;
        padding: 0;
        justify-content: center;
        background: #fff;
    }

    .global-search input,
    .global-search kbd,
    .topbar-date,
    .topbar-actions .btn span {
        display: none;
    }

    .topbar-actions {
        gap: 7px;
    }

    .topbar-actions .btn {
        width: 42px;
        padding: 0;
    }

    .page-content {
        padding: 22px 14px 45px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .page-actions {
        justify-content: flex-start;
    }

    .stats-grid,
    .feature-grid,
    .form-grid.two,
    .form-grid.three,
    .form-grid.four,
    .detail-grid,
    .detail-grid.two,
    .metric-strip {
        grid-template-columns: 1fr;
    }

    .search-results-grid,
    .cards-grid,
    .recovery-grid,
    .search-page-form {
        grid-template-columns: 1fr;
    }

    .split-action,
    .notification-row {
        align-items: stretch;
        flex-direction: column;
    }

    .feature-note-grid {
        grid-template-columns: 1fr;
    }

    .employee-grid,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .sticky-save > span {
        display: none;
    }

    .sticky-save .btn {
        width: 100%;
    }

    .link-card,
    .public-metrics {
        grid-template-columns: 1fr;
    }

    .public-topbar {
        padding: 0 15px;
    }

    .secure-public {
        display: none;
    }

    .public-doc-head,
    .public-section,
    .quote-decision {
        padding: 20px 17px;
    }

    .server-grid {
        grid-template-columns: 1fr;
    }

    .span-two,
    .span-full {
        grid-column: auto;
    }

    .stat-card {
        min-height: 128px;
    }

    .card-header,
    .card-body,
    .form-card {
        padding-right: 16px;
        padding-left: 16px;
    }

    .client-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .client-hero .page-actions {
        grid-column: 1 / -1;
    }

    .auth-visual {
        min-height: 285px;
        padding: 26px 22px;
    }

    .auth-message h1 {
        font-size: 30px;
    }

    .auth-message p {
        font-size: 12px;
    }

    .auth-security-strip {
        display: none;
    }

    .auth-panel {
        padding: 35px 22px;
    }

    .installer-shell {
        width: calc(100% - 20px);
        margin: 10px auto;
        border-radius: 17px;
    }

    .installer-brand,
    .installer-panel {
        padding: 25px 20px;
    }

    .installer-brand h1 {
        font-size: 25px;
    }

    .contract-sheet {
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 25px 18px;
        box-shadow: none;
    }

    .contract-head,
    .contract-parties,
    .contract-signatures {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .task-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .task-status-form {
        grid-column: 1 / -1;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html,
    body.print-body {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }

    .contract-sheet {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 16mm 17mm;
        box-shadow: none;
    }

    .contract-section,
    .contract-table,
    .contract-signatures {
        break-inside: avoid;
    }
}
