:root {
    --bg: #f3f6f8;
    --panel: #ffffff;
    --sidebar: #15202b;
    --sidebar-text: #d7e0e8;
    --text: #102132;
    --muted: #5f7387;
    --border: #d9e3ea;
    --success: #0f9d58;
    --error: #dc4c3f;
    --accent: #0f9d58;
    --shadow: none;
    --radius: 0;
    --font-size: 14px;
}

html[data-theme="warm"] {
    --bg: #f7f3ec;
    --panel: #fffdf9;
    --text: #2b241b;
    --muted: #756858;
    --border: #eadfce;
}

html[data-theme="slate"] {
    --bg: #eef2f6;
    --panel: #fdfefe;
    --text: #122030;
    --muted: #627385;
    --border: #d7e0e8;
}

html[data-density="comfortable"] {
    --font-size: 15px;
}

* {
    box-sizing: border-box;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: var(--font-size);
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 20%),
        linear-gradient(180deg, #fbfcfd 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.guest-shell {
    width: min(320px, 100%);
}

.guest-shell.install-shell {
    width: min(640px, 100%);
}

.auth-card,
.panel,
.stat-card,
.info-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card {
    padding: 28px;
    background: transparent;
    border: 0;
}

.auth-card.wide {
    width: min(760px, 100%);
}

.install-card {
    width: min(640px, 100%);
}

.requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0;
}

.requirement {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 600;
}

.requirement span {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    font-size: 10px;
}

.requirement span {
    border-radius: 50% !important;
}

.requirement.is-ready {
    background: rgba(15, 157, 88, 0.09);
    color: #13653f;
}

.requirement.is-ready span {
    background: #0f9d58;
    color: #fff;
}

.requirement.has-error {
    background: rgba(220, 76, 63, 0.1);
    color: #9c2f25;
}

.requirement.has-error span {
    background: #dc4c3f;
    color: #fff;
}

.install-form {
    gap: 20px;
}

.install-section {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(16, 33, 50, 0.025);
}

.install-section h2 {
    margin: 0;
    font-size: 16px;
}

.install-section p {
    margin: 7px 0 16px;
    color: var(--muted);
    line-height: 1.5;
}

.auth-heading h1,
.topbar h1,
.panel-header h2,
.subsection h3 {
    margin: 0;
}

.auth-heading p,
.topbar p {
    color: var(--muted);
}

.login-card {
    padding: 0;
}

.login-card .auth-heading {
    display: grid;
    justify-items: center;
    gap: 2px;
    margin-bottom: 24px;
}

.login-logo {
    display: block;
    width: min(90px, 100%);
    max-height: 90px;
    object-fit: contain;
}

.login-brand-name,
.setup-page-title {
    width: 100%;
    font-size: 18px;
    text-align: center;
    font-weight: 500;
}

.twofactor-setup {
    display: grid;
    justify-items: center;
    gap: 20px;
}

.twofactor-setup .auth-heading {
    text-align: center;
}

.twofactor-challenge .auth-heading {
    text-align: center;
}

.twofactor-qr {
    width: 220px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
}

.twofactor-qr img {
    display: block;
    width: 100%;
    height: auto;
}

.twofactor-setup form {
    width: min(360px, 100%);
}

.remember-credentials span {
    font-size: 13px;
    font-weight: 500;
}

.badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--accent);
    font-size: 12px;
    margin-bottom: 10px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-row,
.item-grid,
.two-columns,
.stats-grid,
.legal-grid {
    display: grid;
    gap: 16px;
}

.form-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.install-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.install-database-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.two-columns {
    grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.1fr);
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.legal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-list-heading, .legal-list-row summary { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.6fr) 80px 74px 34px 62px; gap: 12px; align-items: center; text-align: left; }
.legal-list-heading { padding: 0 10px 12px; color: var(--muted); font-size: 12px; font-weight: 400; border-bottom: 1px solid var(--border); }
.legal-list-row { position: relative; border-bottom: 1px solid var(--border); }
.legal-list-row:last-child { border-bottom: 0; }
.legal-list-row summary { min-height: 58px; padding: 12px 10px; cursor: pointer; list-style: none; }
.legal-list-row summary::-webkit-details-marker { display: none; }
.legal-item-title { align-self: start; color: var(--text); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.legal-item-preview { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.legal-item-preview > :first-child:not(p) { margin-top: 0; }
.legal-item-preview > :last-child:not(p) { margin-bottom: 0; }
.legal-item-preview p { margin: 5px 0; }
.legal-switch-form { margin: 0; }
.legal-switch, .legal-switch-placeholder { display: grid; place-items: center; width: 34px; height: 22px; }
.legal-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.legal-switch span { position: relative; display: block; width: 32px; height: 18px; border: 1px solid var(--border); border-radius: 99px !important; background: #e7ebf1; }
.legal-switch span::after { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50% !important; background: var(--muted); content: ""; transition: left .15s ease, background .15s ease; }
.legal-switch input:checked + span { border-color: #16a34a; background: #16a34a; }
.legal-switch input:checked + span::after { left: 16px; background: #fff; }
.legal-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.legal-eye { display: grid; place-items: center; justify-self: end; color: var(--muted); }
.legal-eye .ui-icon { width: 19px; height: 19px; }
.legal-inline-actions { display: flex; align-items: center; gap: 5px; justify-self: end; }
.legal-inline-actions a, .legal-inline-actions button { display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.legal-inline-actions a:hover { color: var(--accent); }
.legal-inline-actions button:hover { color: #b63c36; }
.legal-inline-actions .ui-icon { width: 17px; height: 17px; }
.content-list-panel:has(.legal-list-row[open]) .legal-list-heading, .legal-list-row[open] summary { display: none; }
.legal-list-detail { padding: 16px 10px 18px; background: #fbfcfe; }
.legal-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.legal-detail-header h2 { margin: 0; font-size: 14px; font-weight: 500; }
.legal-detail-header .placement-row-actions { margin: 0; }
.legal-full-text { max-height: 420px; overflow: auto; padding: 15px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 13px; line-height: 1.55; }
.legal-full-text > :first-child, .legal-wysiwyg > :first-child { margin-top: 0; }
.legal-full-text > :last-child, .legal-wysiwyg > :last-child { margin-bottom: 0; }
.legal-full-text p, .legal-wysiwyg p { margin: 5px 0; }
.legal-full-text p { margin: 5px 0 !important; }
.legal-edit-form { display: grid; gap: 12px; }
.legal-form-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .7fr) auto; align-items: end; gap: 15px; }
.legal-print-option { display: flex; align-items: center; gap: 7px; padding-bottom: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.legal-print-option input { width: auto; }
.legal-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.legal-toolbar button { padding: 5px 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 12px; cursor: pointer; }
.legal-wysiwyg { min-height: 260px; max-height: 420px; overflow: auto; padding: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 13px; line-height: 1.55; outline: 0; }
.dashboard-grid.profile-settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.company-profile-box, .users-profile-box { display: grid; align-content: start; gap: 15px; }
.company-profile-box .registry-billing { grid-template-columns: repeat(2, minmax(0, 220px)); }
.company-logo { display: block; max-width: min(150px, 100%); height: auto; }
.company-assets-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; align-items: end; }
.company-logo-field { width: 100%; min-width: 0; }
.company-assets-row small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.users-profile-box .users-list { background: #fff; }
.company-profile-box h2, .users-profile-box h2 { margin: 0; font-size: 16px; }
.company-profile-form { display: grid; gap: 15px; }
.company-city-row { display: grid; grid-template-columns: 20fr 50fr 30fr; gap: 15px; }
.company-two-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.user-summary { display: flex; align-items: center; justify-content: space-between; min-height: 59px; padding: 12px; background: #fff; border-bottom: 1px solid #eef0f5; }
.user-summary:last-child { border-bottom: 0; }
.user-summary > div:first-child { display: grid; gap: 0; min-width: 0; overflow-wrap: anywhere; }
.users-profile-box .user-summary strong { margin-bottom: 3px; color: #13192d; font-size: 13px; font-weight: 600; }
.users-profile-box .user-summary span { color: #6c7190; font-size: 12px; font-weight: 500; }
.user-summary form { margin: 0; }
.user-summary .legal-switch-form { position: static; margin-right: 12px; }
.account-security-field { display: grid; gap: 7px; }
.account-security-field > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.account-security-option { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.account-security-option b { color: var(--muted); font-size: 12px; font-weight: 600; }
.user-summary .registry-inline-actions { position: static; display: flex; flex-shrink: 0; }
.user-summary .legal-switch input:disabled + span, .user-summary button:disabled { opacity: .5; cursor: not-allowed; }
.preferences-panel { margin-top: 16px; }
.preferences-panel h2 { margin: 0 0 15px; font-size: 16px; }
.preferences-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 15px; }
.preferences-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.archive-navigation { display: flex; justify-content: flex-end; padding: 18px 0; }
.archive-record-control { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.archive-record-control .legal-switch { flex-shrink: 0; }
.archive-prompt { width: min(560px, calc(100% - 32px)); max-height: 80vh; overflow: auto; padding: 24px; border: 1px solid var(--border); color: var(--text); background: var(--panel); }
.archive-prompt::backdrop { background: rgba(24, 32, 51, .55); }
.archive-prompt h2 { font-size: 16px; }
.archive-prompt li { margin: 8px 0; }
.preferences-actions button { white-space: nowrap; }
@media (max-width: 1180px) { .preferences-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .preferences-form .preferences-actions { grid-column: 1 / -1; } }
@media (max-width: 600px) { .preferences-form { grid-template-columns: 1fr; } }
.preferences-form .checkbox-row { min-height: 44px; }
.preferences-form select, .preferences-form input[type="color"] { height: 44px; min-height: 44px; }
@media (max-width: 860px) { .dashboard-grid.profile-settings-grid, .company-city-row, .company-two-row, .company-assets-row { grid-template-columns: 1fr; } }

label {
    display: grid;
    gap: 7px;
}

label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 11px 12px;
    color: var(--text);
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

select {
    font-family: inherit;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 4px;
}

.password-toggle svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-icon-visible {
    display: none;
}

.password-toggle.is-visible .password-icon-hidden {
    display: none;
}

.password-toggle.is-visible .password-icon-visible {
    display: block;
}

textarea {
    resize: vertical;
}

.primary-button,
.ghost-button,
.secondary-button,
.danger-button {
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 600;
}

.primary-button {
    background: var(--success);
    color: #fff;
}

.secondary-button {
    background: #fff;
    border: 1px solid #c8ccd8;
    color: #3a4057;
}

.danger-button {
    background: #b63c36;
    color: #fff;
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
}

.text-action { color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; }
.auth-cancel-link { justify-self: center; text-decoration: none; }
.import-export-topbar-action { margin: 0 8px; }
.panel.content-filter-panel { padding: 0; background: transparent !important; border: 0; }

.placement-header-links { display: inline-flex; align-items: center; gap: 14px; }
.availability-builder-panel { display: grid; gap: 16px; }
.availability-builder-panel .panel-header h2 { font-size: 16px; font-weight: 500; }
.availability-filter-form { display: grid; gap: 15px; }
.availability-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 15px; align-items: start; }
.availability-filter-grid.is-consultation { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.availability-filter-grid label { display: grid; gap: 7px; min-width: 0; }
.availability-filter-grid label > span { color: var(--muted); font-size: 12px; font-weight: 400; }
.availability-filter-grid select[multiple] { min-height: 185px; padding: 7px; }
.availability-filter-grid option:disabled { color: #b9bdca; background: #f6f7fa; }
.availability-filter-help { margin: 0; color: var(--muted); font-size: 12px; }
.availability-actions { display: flex; justify-content: flex-end; gap: 10px; }
.availability-results-panel { display: grid; gap: 18px; margin-top: 18px; }
.availability-results-panel .panel-header h2 { font-size: 16px; font-weight: 500; }
.availability-results-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.availability-results-summary div { display: grid; gap: 5px; padding: 12px; background: #f8f9fb; border: 1px solid var(--border); }
.availability-results-summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
.availability-results-summary strong { color: #13192d; font-size: 13px; font-weight: 600; }
.availability-city-block { display: grid; gap: 8px; min-width: 0; }
.availability-city-block h3 { margin: 0; color: #13192d; font-size: 13px; font-weight: 700; }
.availability-web-table-wrap { max-width: 100%; max-height: 70vh; overflow: auto; border: 1px solid var(--border); }
.availability-web-table { width: 100%; min-width: 2450px; border-collapse: collapse; font-size: 11px; }
.availability-web-table th, .availability-web-table td { padding: 7px 8px; border-bottom: 1px solid #e5e7ee; border-right: 1px solid #e5e7ee; vertical-align: middle; }
.availability-web-table th { position: sticky; top: 0; z-index: 4; background: #e6e6e6; color: #000; font-weight: 400; text-align: center; white-space: nowrap; }
.availability-web-table th:nth-child(2) { text-align: left; }
.availability-web-table td { color: #13192d; }
.availability-web-table tr:last-child td { border-bottom: 0; }
.availability-web-table th:nth-child(1), .availability-web-table td:nth-child(1), .availability-web-table th:nth-child(2), .availability-web-table td:nth-child(2), .availability-web-table th:nth-child(3), .availability-web-table td:nth-child(3) { position: sticky; background: #fff; z-index: 3; }
.availability-web-table th:nth-child(1), .availability-web-table th:nth-child(2), .availability-web-table th:nth-child(3) { z-index: 5; background: #e6e6e6; }
.availability-web-table th:nth-child(1), .availability-web-table td:nth-child(1) { left: 0; }
.availability-web-table th:nth-child(2), .availability-web-table td:nth-child(2) { left: 110px; }
.availability-web-table th:nth-child(3), .availability-web-table td:nth-child(3) { left: 440px; }
.availability-web-code, .availability-web-format { text-align: center; white-space: nowrap; }
.availability-web-code, .availability-web-table th:nth-child(1) { width: 110px; min-width: 110px; }
.availability-web-address, .availability-web-table th:nth-child(2) { width: 330px; min-width: 330px; text-align: left; }
.availability-web-format, .availability-web-table th:nth-child(3) { width: 105px; min-width: 105px; }
.availability-web-cell { width: 70px; min-width: 70px; text-align: center; font-weight: 600; white-space: nowrap; }
.availability-web-cell.free { background: #92d050; color: #13192d; }
.availability-web-cell.busy { background: #ff5050; color: #fff; }
@media (max-width: 1100px) { .availability-filter-grid, .availability-filter-grid.is-consultation { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .placement-header-links { flex-wrap: wrap; justify-content: flex-end; } .availability-filter-grid, .availability-results-summary { grid-template-columns: 1fr; } .availability-actions { justify-content: stretch; } .availability-actions > * { flex: 1; text-align: center; } }
.content-list-panel, .placement-form-panel, .taxonomy-panel { padding: 18px; }
.content-list-panel, .placement-form-panel, .taxonomy-layout { margin-top: 18px; }
.content-filter-form { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 15px; align-items: end; margin-top: 16px; }
.filter-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; min-width: 0; }
.filter-reset-area { display: flex; align-items: end; }
.filter-reset-area .secondary-button { width: 80px; text-align: center; }
.content-filters, .registry-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; align-items: end; margin-top: 16px; }
.registry-filters { grid-template-columns: repeat(6, minmax(0, 1fr)) 80px; }
.registry-filters .filter-actions { grid-column: 7; width: 80px; }
.registry-filters .filter-actions .secondary-button { width: 80px; text-align: center; }
.content-filter-panel label span,
.client-order-history [data-history-filters] label span,
.media-toolbar label span { font-weight: 400; }
.placement-form label > span:first-child,
.registry-form label > span:first-child,
.order-form label > span:first-child,
.legal-form label > span:first-child,
.taxonomy-edit-form label > span:first-child,
.company-profile-form label > span:first-child,
.preferences-form label > span:first-child,
.mail-panel label > span:first-child { font-weight: 400; }
.registry-list-heading, .registry-list-row summary { display: grid; grid-template-columns: minmax(180px, 1.8fr) repeat(5, minmax(100px, 1fr)) 34px 62px; gap: 12px; align-items: center; justify-items: start; text-align: left; }
.registry-list-heading.registry-has-shortname, .registry-list-row summary.registry-has-shortname { grid-template-columns: minmax(160px, 1.7fr) minmax(90px, .8fr) repeat(5, minmax(90px, 1fr)) 34px 62px; }
.registry-list-heading { padding: 0 10px 12px; color: var(--muted); font-size: 12px; font-weight: 400; border-bottom: 1px solid var(--border); }
.registry-list-row { position: relative; border-bottom: 0; }
.registry-list-row summary { min-height: 58px; padding: 12px 10px; cursor: pointer; list-style: none; }
.registry-list-row summary::-webkit-details-marker { display: none; }
.registry-name { color: var(--text); font-size: 14px; font-weight: 500; }
.registry-list-row summary > span:not(.registry-name):not(.registry-eye):not(.registry-inline-actions) { color: var(--muted); font-size: 12px; font-weight: 500; }
.registry-eye { display: grid; place-items: center; justify-self: end; color: var(--muted); }
.registry-eye .ui-icon { width: 19px; height: 19px; }
.registry-inline-actions { display: flex; align-items: center; gap: 5px; justify-self: end; }
.registry-inline-actions a, .registry-inline-actions button { display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.registry-inline-actions .ui-icon { width: 17px; height: 17px; }
.registry-detail { padding: 16px 10px 18px; background: #fbfcfe; }
.registry-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.registry-detail-grid > div { display: grid; gap: 6px; padding: 5px; background: #fbfcfe; }
.registry-detail-grid span { color: var(--muted); font-size: 12px; }
.registry-detail-grid strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.registry-detail-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.registry-detail-box { display: grid; align-content: start; gap: 15px; padding: 15px; background: #fff; border: 1px solid var(--border); }
.registry-detail-box h3 { margin: 0; font-size: 14px; }
.registry-detail-box > div { display: grid; gap: 5px; padding: 5px; background: #fbfcfe; }
.registry-detail-box span { color: var(--muted); font-size: 12px; }
.registry-detail-box strong { font-size: 13px; font-weight: 500; }
.registry-billing strong { color: var(--text); }
.registry-billing { grid-template-columns: repeat(3, minmax(0, 220px)); }
.registry-contacts { grid-template-columns: 1fr; }
.registry-contacts a { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 500; }
.registry-contacts a span { color: var(--text); font-size: 13px; font-weight: 500; }
.registry-contacts .ui-icon { width: 17px; height: 17px; color: var(--muted); }
.content-list-panel:has(.registry-list-row[open]) .registry-list-heading, .registry-list-row[open] summary { display: none; }
.registry-form-panel { padding: 18px; }
.registry-form-panel .panel-header h2 { font-size: 16px; }
.registry-form { display: grid; gap: 22px; margin-top: 16px; }
.registry-form h3 { margin: 0; font-size: 16px; }
.registry-row { display: grid; gap: 15px; }
.registry-row-one { grid-template-columns: 50fr 10fr 20fr 20fr; }
.registry-row-two { grid-template-columns: 50fr 10fr 25fr 15fr; }
.registry-row-three { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.registry-row-client-payment { grid-template-columns: 25fr 25fr 50fr; }
.registry-row-legal { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.order-filters, .order-selector-filters { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.content-list-heading.order-list-heading, .order-list-row { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, .75fr) minmax(0, 1.80fr) minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .75fr) 250px; gap: 15px; align-items: center; }
.order-list-row { min-height: 54px; padding: 10px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 500; }
.order-list-row > div:not(:first-child):not(.order-inline-actions) { color: var(--muted); font-size: 12px; font-weight: 500; }
.order-inline-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.order-inline-actions a, .order-inline-actions button { display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.order-inline-actions button:disabled { cursor: not-allowed; opacity: .55; }
.order-inline-actions .ui-icon { width: 17px; height: 17px; }
.order-draft-label { color: var(--muted); font-size: 12px; font-weight: 500; margin-right: 2px; }
.order-draft-owner { color: #9a5b00; background: #fff7e6; border: 0; font-size: 10px; font-weight: 500; }
.order-draft-owner.is-editing { color: #8a6515; background: #fff1cf; border: 0; }
.order-total, .order-line-prices input, .order-line-financial input, .order-totals input { text-align: right; }
.order-shared-print-field input, .order-shared-discount-field input { text-align: right; }
.order-line-prices > label { width: 100%; }
.order-price-label { display: inline-flex; align-items: center; gap: 6px; }
.order-copy-button { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.order-copy-button:disabled { color: var(--muted); opacity: .45; cursor: not-allowed; }
.order-copy-button .ui-icon { width: 14px; height: 14px; }
.content-list-heading.order-list-heading > span:nth-child(6) { justify-self: end; text-align: right; }
.order-inline-actions form { margin: 0; }
.order-inline-actions .order-email-sent { background: #32804a; color: #fff; border-radius: 50% !important; }
.order-inline-actions .order-email-sent:disabled { opacity: .75; }
.order-email-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.order-email-modal.is-open { opacity: 1; pointer-events: auto; }
.order-email-dialog { position: relative; z-index: 1; width: min(760px, 100%); max-height: min(840px, calc(100vh - 40px)); overflow: auto; background: var(--panel); border: 1px solid var(--border); }
.order-email-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.order-email-dialog h2 { margin: 0; font-size: 16px; font-weight: 500; }
.order-email-body { display: grid; gap: 14px; padding: 18px; }
.order-email-question { margin: 0; color: #5f7387; font-size: 12px; line-height: 1.45; font-weight: 500; }
.order-email-question strong { color: #13192d; font-weight: 600; }
.order-email-error { padding: 10px 12px; background: #fff3f2; border: 1px solid #f0c0bd; color: #9f2d27; font-size: 12px; }
.order-email-editor { display: grid; gap: 12px; }
.order-email-editor label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.order-email-editor input, .order-email-editor textarea { width: 100%; }
.order-email-editor input[readonly], .order-email-editor textarea[readonly] { background: #f8f9fb; color: #4b5169; }
.order-email-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.order-email-inline .secondary-button { width: 42px; padding-right: 0; padding-left: 0; }
.order-email-inline .secondary-button:disabled { cursor: not-allowed; opacity: .45; }
.order-email-dialog > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--border); }

.topbar-actions form { margin: 0; }
.order-status-button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 8px 12px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.order-status-button .ui-icon { width: 17px; height: 17px; }
.order-status-button.is-active { background: #32804a; border-color: #32804a; color: #fff; }
.order-status-button:disabled { opacity: .55; cursor: not-allowed; }
.order-status-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.order-status-switch.is-active { color: #32804a; }
.order-status-switch.is-disabled { opacity: .55; cursor: not-allowed; }
.order-status-switch .legal-switch { flex-shrink: 0; }
.order-filter-switch { align-self: end; height: 44px; min-height: 44px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.order-filter-switch > span:last-child { color: var(--muted); font-size: 12px; font-weight: 400; }
.order-summary-line { width: min(620px, 100%); margin: -4px 0 12px auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.order-summary-block { display: grid; gap: 8px; }
.order-summary-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.order-summary-title h2 { margin: 0; color: var(--text); font-size: 16px; font-weight: 500; }
.order-summary-title .text-action { padding: 0 8px; border: 0; background: transparent; }
.order-summary-table { width: 100%; table-layout: fixed; margin: 0; border-collapse: collapse; border-bottom: 1px solid var(--border); color: var(--text); font-size: 12px; text-align: left; }
.order-summary-table th, .order-summary-table td { padding: 5px 8px 5px 0; border: 0; text-align: left; vertical-align: top; }
.order-summary-table th { color: var(--muted); font-size: 11px; font-weight: 500; }
.order-note-table td { white-space: pre-line; }
.order-installment-summary-table th:first-child, .order-installment-summary-table td:first-child { width: 100px; }
.order-installment-summary-table th:nth-child(2), .order-installment-summary-table td:nth-child(2) { width: 85px; }
.order-installment-summary-table th:nth-child(4), .order-installment-summary-table td:nth-child(4) { width: 105px; text-align: right; }
.order-summary-amount { text-align: right !important; white-space: nowrap; }
.order-summary-action-cell { width: 70px; text-align: right !important; padding-right: 0 !important; }
.order-invoice-table th:first-child, .order-invoice-table td:first-child { width: 100px; }
.order-invoice-table th:nth-child(2), .order-invoice-table td:nth-child(2) { width: 85px; }
.order-invoice-table th:nth-child(4), .order-invoice-table td:nth-child(4) { width: 105px; text-align: right; }
.order-summary-action-cell .text-action { padding: 0 8px; border: 0; background: transparent; }
.order-invoice-row [name$="[amount]"] { text-align: right; }

.order-modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(19,25,45,.35); }
.order-modal[hidden] { display: none !important; }
.order-modal-dialog { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 18px; border: 1px solid var(--border); background: var(--panel); box-shadow: 0 18px 45px rgba(19,25,45,.18); }
.order-modal-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.order-modal-dialog > header h2 { margin: 0; font-size: 16px; font-weight: 500; }
.order-modal-dialog > header button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.order-modal-text { margin: 0; color: var(--text); font-size: 13px; }
.order-modal-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.order-installments-dialog, .order-invoice-dialog { width: min(900px, 100%); }
.order-installments-dialog .order-installment-row { grid-template-columns: 50px 180px minmax(0, 1.5fr) minmax(0, .5fr) auto; }
.order-invoice-dialog .order-invoice-row { grid-template-columns: 90px 180px minmax(0, 1.5fr) minmax(0, .5fr) auto; }
.order-installments-dialog [data-installment-number] { text-align: center; }
.order-invoice-panel { width: min(760px, 100%); margin: 0 0 14px auto; padding: 12px; border: 1px solid var(--border); background: #fff; }
.order-invoice-panel label > span { font-weight: 400; }
.order-note-panel textarea { width: 100%; resize: vertical; }
.order-invoice-form { display: grid; gap: 10px; }
.order-invoice-rows { display: grid; gap: 10px; }
.order-invoice-row { display: grid; grid-template-columns: minmax(0, .5fr) minmax(0, .65fr) minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 10px; align-items: end; }
.order-installments-panel { width: min(600px, 100%); margin-top: -15px; margin-left: auto; padding: 0; border: 0; background: transparent !important; display: grid; gap: 12px; }
.order-installments-panel.is-active { padding: 18px; border: 1px solid var(--border); background: var(--panel) !important; }
.order-installments-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.order-installments-title { display: inline-flex; align-items: center; gap: 10px; }
.order-installments-header h2 { margin: 0; font-size: 16px; font-weight: 500; }
.order-installments-header .text-action { padding: 0; border: 0; background: transparent; }
.order-installments-switch { min-height: 0; }
.order-installments-body { display: none; gap: 10px; }
.order-installments-panel.is-active.is-editing .order-installments-body { display: grid; }
.order-installment-rows { display: grid; gap: 10px; }
.order-installment-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, .75fr) auto; gap: 10px; align-items: end; }
.order-installment-row label > span { font-weight: 400; }
.order-installment-row [data-installment-amount] { text-align: right; }
.order-installment-error { margin: 0; padding: 8px 10px; background: #fff3f2; border: 1px solid #f0c0bd; color: #9f2d27; font-size: 12px; }
.order-installments-panel .order-invoice-actions { margin-top: 8px; }
.order-invoice-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.order-invoice-add, .order-invoice-remove { display: grid; place-items: center; }
.order-invoice-add { width: 38px; height: 38px; padding: 0; }
.order-invoice-remove { width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.order-state-badge { display: grid; place-items: center; width: 28px; height: 28px; background: #fff; color: var(--muted); border-radius: 50% !important; }
.order-state-badge.is-active { background: #32804a; color: #fff; }
.order-state-badge .ui-icon { width: 17px; height: 17px; }
.order-signed-badge { display: grid; place-items: center; width: 28px; height: 28px; background: #32804a; color: #fff; border-radius: 50% !important; }
.mail-panel { margin-top: 20px; padding: 20px; }
.mail-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-top: 20px; }
.mail-settings-grid > .panel.mail-panel { margin-top: 0; }
.mail-settings-grid > .mail-panel { min-width: 0; display: flex; flex-direction: column; }
.mail-panel h2 { margin: 0 0 15px; font-size: 16px; }
.mail-settings-grid .company-profile-form { flex: 1; display: flex; flex-direction: column; gap: 15px; }
.mail-settings-grid .placement-row-actions { margin-top: auto; flex-wrap: wrap; }
.mail-template-panel .mail-message-editor { height: 350px; min-height: 350px; max-height: 350px; overflow-y: auto; resize: none; }
.mail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
[data-provider-section] { display: grid; gap: 15px; }
[data-provider-section][hidden], [data-provider-field][hidden] { display: none !important; }
.mail-provider-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 10px; align-items: end; }
.mail-guide-button { display: grid; place-items: center; width: 40px; height: 44px; padding: 0; border: 1px solid var(--border); background: #fff; color: var(--accent); cursor: pointer; }
.mail-guide-button .ui-icon { width: 18px; height: 18px; }
.mail-oauth-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0 2px; }
.mail-oauth-actions form { margin: 0; }
.mail-oauth-status { color: #6c7190; font-size: 12px; }
.mail-guide-dialog { width: min(760px, calc(100vw - 32px)); max-height: min(780px, calc(100vh - 32px)); padding: 0; border: 1px solid var(--border); background: #fff; color: var(--text); }
.mail-guide-dialog::backdrop { background: rgba(16, 18, 34, .55); }
.mail-guide-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.mail-guide-dialog h2, .mail-guide-dialog h3 { margin: 0; }
.mail-guide-dialog h2 { font-size: 16px; }
.mail-guide-dialog h3 { font-size: 14px; }
.mail-guide-body { display: grid; gap: 18px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 18px; }
.mail-guide-body section { display: grid; gap: 10px; }
.mail-guide-body ol, .mail-guide-body ul { margin: 0; padding-left: 20px; color: #3a4057; font-size: 13px; line-height: 1.6; }
.mail-guide-body p { margin: 0; color: #6c7190; font-size: 12px; line-height: 1.6; }
.mail-guide-body code { padding: 2px 4px; background: #f5f7fa; color: var(--text); font-size: 12px; }
.mail-fields.mail-server-fields { grid-template-columns: minmax(0, 4.5fr) minmax(0, 1fr) minmax(0, 4.5fr); }
.mail-server-fields input[name="port"] { padding-inline: 3px; appearance: textfield; }
.mail-server-fields input[name="port"]::-webkit-inner-spin-button, .mail-server-fields input[name="port"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
@media (max-width: 800px) { .mail-fields.mail-server-fields { grid-template-columns: 1fr; } }
.mail-test-result { font-size: 12px; color: var(--accent); }
.mail-test-result.is-error { color: #b42318; }
.mail-fields > label { min-width: 0; }
.mail-help { color: #6c7190; font-size: 12px; line-height: 1.6; }
.mail-log-heading, .mail-log-pages { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mail-log-heading form { margin: 0; }
.mail-log-pages { justify-content: flex-end; margin-top: 16px; font-size: 12px; }
.mail-table-scroll { width: 100%; overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.history-table th, .history-table td { padding: 12px; border-bottom: 1px solid #eef0f5; text-align: left; vertical-align: middle; }
.history-table th { color: #6c7190; font-size: 12px; font-weight: 600; }
.history-table .history-total { white-space: nowrap; }
.history-table .order-inline-actions { position: static; }
.client-order-history { width: 100%; margin-top: 20px; background: #fff; padding: 15px; border: 1px solid var(--border); }
.client-order-history h3 { font-size: 14px; margin: 0 0 12px; }
.client-history-list { margin-top: 20px; }
.client-order-history .client-history-heading, .client-order-history .client-history-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, .7fr) minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, .75fr) 66px; gap: 15px; }
.client-order-history .client-history-heading > .order-total { justify-self: end; text-align: right; }
.client-history-row > div { min-width: 0; overflow-wrap: anywhere; }
.client-history-row[hidden], .client-order-history [hidden] { display: none !important; }
@media (max-width: 860px) { .mail-settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .mail-fields { grid-template-columns: 1fr; } .mail-log-heading { align-items: flex-start; flex-direction: column; } .client-order-history .client-history-heading { display: none; } .client-order-history .client-history-row { grid-template-columns: 1fr; gap: 5px; } }
.dashboard-orders-table tbody td:not(:first-child):not(:nth-child(4)) { color: var(--muted); font-size: 12px; font-weight: 500; }
.dashboard-orders-table th, .dashboard-orders-table td { vertical-align: middle; }
.order-selection-panel { padding: 18px; }
.order-draft-summary { display: flex; justify-content: flex-end; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.order-draft-summary form { margin: 0; }
.order-draft-summary > span, .order-draft-summary .ghost-button { display: inline-flex; justify-content: center; min-width: 100px; padding: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 600; }
.order-draft-summary .order-draft-count { align-items: center; gap: 5px; }
.order-draft-summary form .ghost-button { width: 100px; }
.order-selection-heading, .order-placement-row { display: grid; grid-template-columns: 30px 12fr 18fr 34fr 18fr 18fr; gap: 12px; align-items: center; }
.order-selection-heading { padding: 0 10px 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 400; }
.order-placement-row { min-height: 52px; padding: 10px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 500; }
.order-placement-row:nth-of-type(even) { background: #fbfcfe; }
.order-sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: center; gap: 15px; padding: 16px 0; background: var(--panel); }
.order-draft-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.order-draft-modal.is-open { opacity: 1; pointer-events: auto; }
.order-draft-dialog { position: relative; z-index: 1; width: min(840px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 18px; background: var(--panel); border: 1px solid var(--border); }
.order-draft-dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.order-draft-dialog h2, .order-draft-dialog h3 { margin: 0; }
.order-draft-dialog h3 { margin-top: 18px; padding: 7px 0; background: #fbfcfe; font-size: 13px; }
.order-draft-item { display: flex; gap: 10px; align-items: center; min-height: 34px; font-size: 13px; }
.order-draft-item input { width: 14px; height: 14px; flex: 0 0 14px; }
.order-draft-dialog form > .primary-button { display: block; margin-top: 30px; margin-left: auto; }
.order-draft-city { display: block; margin-top: 10px; font-size: 13px; font-weight: 500; }
.order-form, .order-section { display: grid; gap: 15px; }
.order-section > h2, .order-totals > h2, .order-section-title > h2 { margin: 0; font-size: 16px; }
.order-section-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.order-selected-count { color: var(--muted); font-size: 12px; font-weight: 500; }
.order-selected-count strong { color: var(--text); font-size: 13px; }
.order-info-row, .order-line-grid, .order-totals > div { display: grid; gap: 15px; }
.order-info-first { grid-template-columns: 10fr 10fr 20fr 10fr 10fr 10fr 10fr 20fr; }
.order-info-second { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; }
.order-info-second > * { min-width: 0; }
.order-option-group { display: grid; gap: 7px; min-width: 0; align-content: start; }
.order-choice { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.order-choice legend { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.order-choice label { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-size: 13px; }
.order-choice input { width: auto !important; }
.order-period-group { display: grid; gap: 0; padding: 15px; }
.order-period-title { padding: 5px; background: #fbfcfe; font-size: 14px; }
.order-line { display: grid; gap: 12px; padding: 15px 5px; border-top: 1px solid var(--border); }
.order-period-title + .order-line { border-top: 0; }
.order-line-layout { position: relative; display: grid; grid-template-columns: 60fr 40fr; gap: 15px; padding-right: 36px; }
.order-line-placement, .order-line-financial { display: grid; gap: 5px; min-width: 0; }
.order-line-placement-row { min-height: 36px; padding: 8px; background: #fbfcfe; color: var(--text); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.order-line-placement-controls { display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 0; background: transparent; }
.order-line-placement-controls > span { white-space: nowrap; }
.order-line-placement-controls .order-compact-control { display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 5px; min-width: 0; }
.order-line-placement-controls .order-compact-control > span { margin: 0; color: var(--text); font-size: 13px; white-space: nowrap; }
.order-line-placement-controls .order-compact-control input, .order-line-placement-controls .order-compact-control select { min-width: 0; min-height: 32px; }
.order-line-print-excluded-control { grid-template-columns: auto auto !important; flex: 0 0 auto; }
.order-line-print-excluded-control input { width: auto; min-height: auto !important; }
.order-form.is-print-excluded .order-shared-print-field { display: none; }
.order-line-layout > .order-line-remove { position: absolute; top: 5%; right: 0; transform: none; }
.order-line-financial { justify-items: end; }
.order-line-financial-row { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; width: 100%; text-align: right; }
.order-line-financial-row .order-price-field { flex: 0 1 132px; min-width: 0; width: 132px; }
.order-line-financial-row .order-price-field:only-child { width: 132px; }
.order-line-financial-row .order-price-field > span:first-child { margin-bottom: 0; text-align: left; }
.order-line-read { grid-template-columns: 10fr 12fr 26fr 16fr 14fr 16fr 18fr 26px; align-items: end; }
.order-read-value { display: grid; gap: 5px; min-width: 0; padding: 5px; background: #fbfcfe; }
.order-read-value span { color: var(--muted); font-size: 12px; }
.order-read-value strong { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.order-compact-control input, .order-compact-control select { min-height: 32px; padding: 6px 8px; font-size: 13px; }
.order-line-read .order-compact-control > span { margin-bottom: 0; }
.order-line-remove { display: grid; place-items: center; width: 26px; height: 32px; padding: 3px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.order-line-remove .ui-icon { width: 16px; height: 16px; }
.order-line-prices { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: end; }
.order-line-prices::after { content: none; }
.order-form.is-single-print:not(.is-single-discount) .order-line-prices label:first-child { grid-column: 2; }
.order-form.is-single-discount:not(.is-single-print) .order-line-prices label:first-child { grid-column: 3; }
.order-form.is-single-print.is-single-discount .order-line-prices label:first-child { grid-column: 4; }
.order-line-read > .order-compact-control:first-of-type { padding: 5px; background: #fbfcfe; }
.order-line-read > .order-compact-control:first-of-type input { min-height: auto; padding: 0; border: 0; background: transparent; color: var(--text); font-weight: 500; pointer-events: none; }
.order-form.is-single-team .order-line-team, .order-form.is-single-subject .order-line-subject { padding: 5px; background: #fbfcfe; }
.order-form.is-single-team .order-line-team select, .order-form.is-single-subject .order-line-subject input { min-height: auto; padding: 0; border: 0; background: transparent; color: var(--text); font-weight: 500; pointer-events: none; }
.order-form.is-single-team .order-line-team select { appearance: none; }
.order-shared-team-field, .order-shared-subject-field, .order-shared-print-field, .order-shared-discount-field, .order-global-discount-field { display: none; }
.order-form.is-single-team .order-shared-team-field, .order-form.is-single-subject .order-shared-subject-field, .order-form.is-single-print .order-shared-print-field, .order-form.is-single-discount .order-shared-discount-field, .order-form.has-global-discount .order-global-discount-field { display: grid; }
.order-shared-discount-field .suffix-field, .order-global-discount-field .suffix-field { min-width: 0; }
.order-global-discount-field [data-order-percent-wrapper], .order-global-discount-field [data-order-amount-wrapper] { display: none; }
.order-form.has-percent-discount .order-global-discount-field [data-order-percent-wrapper], .order-form.has-amount-discount .order-global-discount-field [data-order-amount-wrapper] { display: grid; }
.order-form.is-single-discount .order-line-prices label:nth-child(4), .order-form.is-single-discount .order-line-prices label:nth-child(5) { display: none; }
.order-form.is-single-discount .order-price-discount, .order-form.is-single-discount .order-price-discounted { display: none; }
.order-form:not(.has-global-discount) .order-total-discount-field, .order-form:not(.has-global-discount) .order-total-discounted-field { display: none; }
.order-form:not(.has-global-discount) .order-totals > div label:first-child { grid-column: 1 / -1; }
.order-line label, .order-info-row label, .order-totals label { min-width: 0; }
.order-info-row input, .order-info-row select { width: 100%; min-width: 0; box-sizing: border-box; }
.order-global-discount-field input { text-align: right; }
.order-line label > span:first-child, .order-info-row label > span:first-child, .order-totals label > span:first-child { display: block; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.suffix-field { display: grid; grid-template-columns: minmax(0, 1fr) 28px; }
.suffix-field b { display: grid; place-items: center; border: 1px solid var(--border); border-left: 0; background: #f5f7fa; color: var(--muted); font-size: 13px; font-weight: 500; }
.order-totals { display: grid; gap: 15px; width: min(500px, 100%); justify-self: end; }
.order-totals > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.order-totals > div label:last-child { grid-column: 1 / -1; }
.order-save-actions { display: flex; justify-content: flex-end; gap: 15px; padding-bottom: 18px; }

@media (max-width: 1180px) {
    .registry-filters, .registry-row-one, .registry-row-two, .registry-row-three, .registry-row-client-payment, .registry-row-legal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .registry-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .registry-detail-boxes { grid-template-columns: 1fr; }
    .order-filters, .order-selector-filters, .order-info-first, .order-info-second, .order-line-read, .order-line-edit, .order-line-prices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .order-line-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .content-filter-form { grid-template-columns: 1fr; }
    .filter-reset-area { justify-content: flex-end; }
    .registry-filters, .registry-row-one, .registry-row-two, .registry-row-three, .registry-row-client-payment, .registry-row-legal, .registry-list-heading, .registry-list-row summary, .registry-detail-grid { grid-template-columns: 1fr; }
    .registry-list-heading { display: none; }
    .registry-list-row summary { gap: 5px; }
    .registry-eye { position: absolute; top: 12px; right: 74px; }
    .registry-inline-actions { position: absolute; top: 12px; right: 10px; }
    .order-list-heading { display: none; }
    .order-list-row, .order-selection-heading, .order-placement-row, .order-totals > div { grid-template-columns: 1fr; gap: 5px; }
    .order-inline-actions { position: absolute; right: 10px; }
    .order-list-row { position: relative; padding-right: 110px; }
    .order-draft-summary { justify-content: flex-start; flex-wrap: wrap; }
    .order-form { gap: 10px; }
    .order-info-first, .order-info-second, .order-line-read, .order-line-edit, .order-line-prices { grid-template-columns: 1fr; }
    .order-save-actions { justify-content: stretch; }
    .order-save-actions > * { flex: 1; text-align: center; }
    .legal-list-heading { display: none; }
    .legal-list-row summary { grid-template-columns: 1fr; gap: 5px; padding-right: 110px; }
    .legal-switch-form { position: absolute; top: 12px; right: 74px; }
    .legal-eye { position: absolute; top: 12px; right: 42px; }
    .legal-inline-actions { position: absolute; top: 8px; right: 10px; }
    .legal-form-header { grid-template-columns: 1fr; }
    .legal-print-option { padding-bottom: 0; }
}
.filter-actions, .placement-form-actions, .placement-row-actions { display: flex; align-items: center; gap: 10px; }
.filter-actions .primary-button, .filter-actions .secondary-button { padding: 10px 14px; white-space: nowrap; }
.content-filter-title { color: var(--text); font-size: 16px; font-weight: 500; }
.content-list-heading, .placement-list-row summary { display: grid; grid-template-columns: minmax(90px, .6fr) minmax(170px, 1.8fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(130px, 1fr) minmax(140px, 1fr) 34px 62px; gap: 12px; align-items: center; justify-items: start; text-align: left; }
.content-list-heading { padding: 0 10px 12px; color: var(--muted); font-size: 12px; font-weight: 400; border-bottom: 1px solid var(--border); }
.placement-list-row { position: relative; border-bottom: 1px solid var(--border); }
.placement-list-row:last-child { border-bottom: 0; }
.placement-list-row summary { min-height: 58px; padding: 12px 10px; cursor: pointer; list-style: none; }
.placement-list-row summary::-webkit-details-marker { display: none; }
.placement-expand-column, .placement-expand-marker { width: 34px; justify-self: end; }
.placement-expand-marker { display: grid; place-items: center; color: var(--muted); }
.placement-expand-marker .ui-icon { width: 19px; height: 19px; }
.content-list-panel:has(.placement-list-row[open]) .content-list-heading { display: none; }
.placement-list-row[open] summary { display: none; }
.placement-code { color: var(--text); font-size: 14px; font-weight: 500; }
.placement-location, .placement-city, .placement-province, .placement-region, .placement-agency, .placement-format { color: var(--muted); font-size: 12px; font-weight: 500; }
.placement-list-detail { padding: 16px 10px 18px; background: #fbfcfe; border-top: 0; border-bottom: 0; }
.placement-inline-actions { display: flex; align-items: center; gap: 10px; justify-self: end; }
.placement-inline-actions a, .placement-inline-actions button { display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.placement-inline-actions a:hover { color: var(--accent); }
.placement-inline-actions button:hover { color: #b63c36; }
.placement-inline-actions .ui-icon { width: 17px; height: 17px; }
.placement-detail-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.placement-detail-box { display: grid; align-content: start; gap: 15px; padding: 15px; background: #fff; border: 1px solid var(--border); }
.placement-detail-row { display: grid; gap: 15px; }
.placement-detail-row-two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.placement-detail-row-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.placement-detail-row-one-up { grid-template-columns: 1fr; }
.placement-detail-row-three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.placement-detail-row > div { display: grid; align-content: start; gap: 6px; min-height: 52px; padding: 5px; background: #fbfcfe; }
.placement-detail-row span { color: var(--muted); font-size: 12px; }
.placement-detail-row strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.placement-detail-row a { color: var(--accent); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.placement-detail-photo-box { min-height: 100%; }
.placement-detail-photo-box > span { color: var(--muted); font-size: 12px; }
.placement-detail-photo-box img { display: block; width: 100%; height: 220px; object-fit: cover; background: #f4f6f8; }
.placement-detail-photo-box a { display: block; cursor: zoom-in; }
.placement-detail-photo a { display: block; }
.placement-detail-photo img { display: block; width: 100%; height: 145px; object-fit: cover; background: #f4f6f8; }
.placement-list-detail h3, .placement-availability-section h3 { margin: 0 0 12px; font-size: 14px; }
.placement-row-actions { justify-content: flex-end; margin-top: 16px; }
.placement-row-actions-top { margin-top: 0; margin-bottom: 16px; }
.placement-row-actions form { margin: 0; }
.content-empty { margin: 0; padding: 26px; color: var(--muted); text-align: center; }
.placement-form { display: grid; gap: 22px; margin-top: 16px; }
.placement-form-row { display: grid; gap: 15px; }
.placement-form-row-one { grid-template-columns: 10fr 42fr 12fr 12fr 12fr 12fr; }
.placement-form-row-two { grid-template-columns: 76fr 12fr 12fr; }
.placement-form-row-three { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.placement-local-upload { padding: 8px 0 0; border: 0; background: transparent; font-size: 12px; }
.currency-field { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0; }
.currency-field b { display: grid; place-items: center; color: var(--muted); background: #f5f7fa; border: 1px solid var(--border); border-right: 0; font-size: 13px; font-weight: 500; }
.placement-radio { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-content: start; gap: 12px; }
.placement-radio legend { width: 100%; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.placement-radio label { display: inline-flex; align-items: center; min-height: 44px; gap: 5px; font-size: 13px; }
.placement-radio input { width: auto; margin: 0; }
.placement-availability-section { padding-top: 20px; border-top: 1px solid var(--border); }
.availability-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.availability-option { display: block; min-width: 0; margin: 0; cursor: pointer; }
.availability-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.availability-option span, .availability-option.is-selected, .availability-grid.is-readonly .availability-option { display: grid; min-height: 50px; place-content: center; gap: 4px; padding: 5px 5px; background: #eaf5df; border: 1px solid #cadfb9; color: #527836; text-align: center; }
.availability-option strong { font-size: 12px; font-weight: 500; line-height: 1.25; }
.availability-option small { font-size: 11px; font-weight: 600; }
.availability-option input:checked + span, .availability-option.is-selected { background: #fff1cf; border-color: #ead59a; color: #8a6515; }
.availability-option.is-order-occupied { cursor: not-allowed; }
.availability-grid.is-readonly .availability-option.is-selected { background: #fff1cf; border-color: #ead59a; color: #8a6515; }
.availability-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.placement-form-actions { justify-content: flex-end; padding-top: 2px; }
.taxonomy-intro { margin: 0 0 -2px; }
.taxonomy-intro > span { color: var(--text); font-size: 16px; font-weight: 600; }
.taxonomy-intro p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.taxonomy-panel .panel-header h2 { font-size: 16px; }
.taxonomy-form { display: grid; gap: 14px; margin-top: 16px; }
.taxonomy-create-form { padding-bottom: 18px; }
.taxonomy-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.taxonomy-panel-city { grid-column: 1 / -1; }
.taxonomy-region-form { grid-template-columns: minmax(0, 9fr) minmax(110px, 1fr); align-items: end; }
.taxonomy-province-form { grid-template-columns: minmax(0, 5fr) 82px minmax(0, 4fr) minmax(110px, 1fr); align-items: end; }
.taxonomy-code-field input { text-align: center; text-transform: uppercase; }
.taxonomy-city-form { grid-template-columns: minmax(0, 3fr) minmax(0, 3fr) minmax(0, 3fr) minmax(110px, 1fr); align-items: end; }
.taxonomy-create-form .primary-button { min-width: 110px; padding-right: 10px; padding-left: 10px; white-space: nowrap; }
.taxonomy-layout .panel + .panel { margin-top: 0; }
.taxonomy-archive { margin-top: 16px; }
.taxonomy-archive-label { color: var(--muted); font-size: 12px; }
.taxonomy-list { margin: 20px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.taxonomy-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 59px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.taxonomy-list li, .taxonomy-list li strong { font-weight: 500; }
.taxonomy-list li span { color: var(--muted); font-size: 12px; }
.taxonomy-copy { display: grid; gap: 3px; }
.taxonomy-actions { display: flex; align-items: center; gap: 8px; }
.taxonomy-actions a, .taxonomy-actions button { display: grid; place-items: center; width: 28px; height: 28px; padding: 4px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.taxonomy-actions a:hover { color: var(--accent); }
.taxonomy-actions button:hover { color: #b63c36; }
.taxonomy-actions form { margin: 0; }
.taxonomy-actions .ui-icon { width: 17px; height: 17px; }
.taxonomy-edit-panel { width: min(560px, 100%); padding: 18px; }
.taxonomy-edit-form { display: grid; gap: 16px; margin-top: 16px; }
.taxonomy-edit-header { justify-content: flex-end; }
.taxonomy-edit-header .text-action { margin-left: auto; }
.taxonomy-edit-name-code { display: grid; grid-template-columns: minmax(0, 9fr) minmax(70px, 1fr); gap: 12px; align-items: end; }

.placement-photo-field { display: grid; gap: 7px; }
.placement-photo-field > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.media-picker-trigger { display: grid; min-height: 44px; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; background: #fff; border: 1px solid var(--border); color: var(--text); cursor: pointer; text-align: left; }
.media-picker-trigger span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.media-picker-trigger b { color: var(--accent); font-size: 12px; font-weight: 600; }
.media-picker-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.media-picker-modal.is-open { opacity: 1; pointer-events: auto; }
.media-picker-backdrop { position: absolute; inset: 0; background: rgba(16, 18, 34, .55); }
.media-picker-dialog { position: relative; z-index: 1; width: min(820px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; background: var(--panel); border: 1px solid var(--border); }
.media-picker-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.media-picker-dialog h2 { margin: 0; font-size: 16px; }
.media-picker-close { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; font-weight: 400; line-height: 1; }
.media-picker-body { display: grid; gap: 22px; padding: 18px; }
.media-picker-section h3 { margin: 0 0 12px; font-size: 14px; }
.media-picker-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-height: 350px; overflow-y: auto; }
.media-picker-item { min-width: 0; padding: 0; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; text-align: left; }
.media-picker-item.is-selected { border-color: var(--accent); }
.media-picker-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #f4f6f8; }
.media-picker-item span { display: block; overflow: hidden; padding: 7px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.media-picker-upload { padding-top: 18px; border-top: 1px solid var(--border); }
.media-picker-upload-control { display: grid; justify-items: center; gap: 5px; min-height: 124px; padding: 18px; border: 1px dashed #aeb7c8; background: #fbfcfe; color: var(--muted); cursor: pointer; text-align: center; }
.media-picker-upload-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.media-picker-upload-control .ui-icon { width: 26px; height: 26px; }
.media-picker-upload-control strong { color: var(--text); font-size: 13px; font-weight: 500; }
.media-picker-upload-control small { font-size: 12px; }
.import-export-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.import-export-modal:target { opacity: 1; pointer-events: auto; }
.import-export-backdrop { position: absolute; inset: 0; background: rgba(16, 18, 34, .55); }
.import-export-dialog { position: relative; z-index: 1; width: min(980px, 100%); max-height: min(840px, calc(100vh - 40px)); overflow: auto; background: var(--panel); border: 1px solid var(--border); }
.import-export-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.import-export-dialog h2, .import-export-dialog h3 { margin: 0; }
.import-export-dialog h2 { font-size: 16px; }
.import-export-dialog h3 { font-size: 14px; }
.import-export-body { display: grid; gap: 18px; padding: 18px; }
.import-export-section { display: grid; gap: 12px; }
.import-export-section p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.import-field-list { display: flex; flex-wrap: wrap; gap: 7px; }
.import-field-list code, .import-export-section code { padding: 2px 5px; background: #f5f7fa; color: var(--text); font-size: 12px; }
.import-template-actions, .import-preview-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.import-export-section > .secondary-button { justify-self: start; }
.import-upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.import-upload-form label > span:first-child { font-weight: 400; }
.import-preview-table { overflow: auto; border: 1px solid var(--border); }
.import-preview-heading, .import-preview-row { display: grid; grid-template-columns: 58px 90px 130px minmax(180px, 1fr) 140px minmax(220px, 1.2fr); min-width: 860px; border-bottom: 1px solid var(--border); }
.import-preview-table-registry .import-preview-heading, .import-preview-table-registry .import-preview-row { grid-template-columns: 58px 90px minmax(180px, 1fr) 140px 150px 130px minmax(220px, 1.2fr); min-width: 980px; }
.import-preview-heading { background: #f7f8fb; color: var(--muted); font-size: 12px; font-weight: 600; }
.import-preview-heading span, .import-preview-row span { padding: 9px 10px; border-right: 1px solid var(--border); }
.import-preview-heading span:last-child, .import-preview-row span:last-child { border-right: 0; }
.import-preview-row { color: var(--text); font-size: 12px; }
.import-preview-row:last-child { border-bottom: 0; }
.import-preview-row.has-errors { background: #fff7f5; color: #a34336; }
.import-preview-actions { justify-content: flex-end; }
.import-preview-actions form { margin: 0; }
.image-lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 28px; background: rgba(16, 18, 34, .88); cursor: zoom-out; }
.image-lightbox img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-lightbox button { position: fixed; top: 14px; right: 18px; width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 28px; font-weight: 400; line-height: 1; }

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.app-body {
    background: #f7f8fc;
}

.sidebar {
    background: #202137;
    color: #fff;
    padding: 20px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.menu-link,
.topbar,
.panel-header,
.checkbox-row {
    display: flex;
    align-items: center;
}

.panel-header {
    justify-content: space-between;
}

.ui-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sidebar-profile {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    min-height: 50px;
}

.sidebar-product-mark {
    display: grid;
    place-items: center;
    height: 50px;
    color: #9cabff;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-logo {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.sidebar-profile-copy {
    display: grid;
    gap: 3px;
    padding-left: 12px;
}

.sidebar-profile-copy strong {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.sidebar-profile-copy span,
.sidebar-profile-copy small {
    color: #c5c7dd;
    font-size: 11px;
}

.menu {
    display: grid;
    gap: 3px;
}

.menu-link {
    gap: 12px;
    min-height: 38px;
    padding: 9px 10px;
    color: #f3f4ff;
    font-size: 13px;
    font-weight: 500;
}

.menu-link.active,
.menu-link:hover {
    background: #3a3b53;
    color: #fff;
}

.menu-accordion {
    display: grid;
    gap: 3px;
}

.menu-accordion-trigger {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    border: 0;
    background: transparent;
    color: #f3f4ff;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    list-style: none;
}

.menu-accordion-trigger::-webkit-details-marker {
    display: none;
}

.menu-accordion-trigger:hover,
.menu-accordion[open] .menu-accordion-trigger {
    background: #3a3b53;
}

.menu-chevron {
    display: grid;
    place-items: center;
    transition: transform 160ms ease;
}

.menu-chevron .ui-icon {
    width: 15px;
    height: 15px;
}

.menu-accordion[open] .menu-chevron {
    transform: rotate(180deg);
}

.menu-submenu {
    display: grid;
    gap: 2px;
    padding: 2px 0 4px 22px;
}

.menu-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 7px 10px;
    color: #cfd1e3;
    font-size: 12px;
}

.menu-sublink .menu-icon {
    width: 17px;
}

.menu-sublink .ui-icon {
    width: 17px;
    height: 17px;
}

.menu-sublink:hover,
.menu-sublink.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.menu-icon {
    display: grid;
    place-items: center;
    width: 20px;
    color: #e6e8f5;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
    padding: 10px;
}

.sidebar-footer-user {
    display: grid;
    gap: 3px;
}

.sidebar-footer-user strong {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-footer-user span {
    color: #c5c7dd;
    font-size: 11px;
}

.logout-form {
    margin: 0;
}

.logout-form .ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.logout-dialog {
    width: min(360px, calc(100vw - 32px));
    padding: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.logout-dialog::backdrop {
    background: rgba(16, 18, 34, .55);
}

.logout-dialog h2 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 500;
}

.logout-forget-device {
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 12px;
}

.logout-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.content {
    padding: 24px;
}

.topbar {
    min-height: 48px;
    margin-bottom: 22px;
    justify-content: space-between;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-heading-icon {
    display: grid;
    place-items: center;
    color: #202137;
}

.page-heading-icon .ui-icon {
    width: 22px;
    height: 22px;
}

.mobile-menu-toggle,
.mobile-sidebar-backdrop {
    display: none;
}

.topbar h1 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.topbar-action {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 0;
    padding: 9px 13px;
    background: var(--success);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.topbar-actions small { color: var(--muted); font-size: 12px; }
.topbar-action:disabled { cursor: not-allowed; opacity: .55; }
.topbar-action-secondary { background: #fff; color: var(--accent); border-color: var(--accent); }
.app-body .topbar-action-secondary { background: #fff; color: var(--accent); }
.archive-filter-tabs { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #d9deea; background: transparent; }
.archive-filter-tabs a { min-height: 36px; padding: 9px 13px; border-right: 1px solid #d9deea; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.2; }
.archive-filter-tabs a:last-child { border-right: 0; }
.archive-filter-tabs a.active { background: transparent; color: var(--accent); }

.topbar-action::before {
    content: "+";
    margin-right: 7px;
    font-size: 17px;
    font-weight: 400;
    line-height: 0;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    border-radius: 10px;
    padding: 11px 14px;
    border: 1px solid transparent;
}

.flash-success {
    background: rgba(15, 157, 88, 0.08);
    border-color: rgba(15, 157, 88, 0.18);
    color: #13653f;
}

.flash-error {
    background: rgba(220, 76, 63, 0.08);
    border-color: rgba(220, 76, 63, 0.2);
    color: #9c2f25;
}

.panel,
.info-card,
.stat-card {
    padding: 18px;
    border-color: #dce0ea;
    background: #fff;
}

.panel + .panel {
    margin-top: 18px;
}

.stat-card span {
    color: var(--muted);
    display: block;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.status-pill {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--accent);
}

.dashboard-overview {
    min-height: 195px;
}

.dashboard-overview .panel-header h2,
.dashboard-section .panel-header h2 {
    font-size: 16px;
}

.dashboard-state {
    padding: 7px 10px;
    background: #eef7df;
    color: #5e8517;
    font-size: 12px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.overview-grid > div {
    min-height: 62px;
    padding: 12px 10px;
    background: #fbfcfe;
    border-right: 8px solid #fff;
}

.overview-grid span,
.operations-list small {
    display: block;
    color: #6c7190;
    font-size: 12px;
}

.overview-grid strong {
    display: block;
    margin-top: 7px;
    color: #11172b;
    font-size: 15px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 16px;
    margin-top: 18px;
}

.dashboard-grid .panel + .panel {
    margin-top: 0;
}

.dashboard-section {
    min-height: 278px;
}

.dashboard-section .panel-header a {
    border: 1px solid #c8ccd8;
    padding: 8px 10px;
    color: #3a4057;
    font-size: 12px;
}

.empty-table {
    color: var(--muted);
    text-align: center;
}

.operations-list {
    display: grid;
    gap: 1px;
    margin-top: 14px;
    background: #edf0f5;
}

.operations-list a {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
}

.operations-list a:hover {
    background: #fbfcfe;
}

.operations-list > a > span {
    display: grid;
    place-items: center;
    color: #343950;
}

.operations-list strong {
    display: block;
    margin-bottom: 3px;
    color: #13192d;
    font-size: 13px;
}

.media-upload-panel {
    margin-bottom: 18px;
}

.media-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    align-items: start;
}

.media-dropzone {
    display: grid;
    column-gap: 12px;
    align-items: center;
    min-height: 108px;
    padding: 18px;
    border: 1px dashed #aeb7c8;
    background: #fbfcfe;
    cursor: pointer;
    justify-items: center;
}

.media-dropzone.is-dragging {
    border-color: var(--success);
    background: #f2faed;
}

.media-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.media-dropzone-icon {
    display: grid;
    place-items: center;
    color: var(--success);
}

.media-dropzone-icon .ui-icon {
    width: 28px;
    height: 28px;
}

.media-dropzone strong,
.media-dropzone small,
.media-upload-selection {
    min-width: 0;
}

.media-dropzone strong {
    color: #172039;
    font-size: 13px;
}

.media-dropzone small,
.media-upload-selection {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.media-upload-selection {
    font-weight: 600;
}

.media-library {
    display: grid;
    gap: 15px;
}

.media-toolbar {
    display: flex;
    align-items: end;
    gap: 15px;
}

.media-search {
    flex: 1 1 280px;
}

.media-filter {
    flex: 0 1 220px;
}

.media-bulkbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    color: var(--muted);
    font-size: 12px;
}

.media-selection-form {
    display: grid;
    gap: 15px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 15px;
}

.media-card {
    position: relative;
    min-width: 0;
    border: 1px solid #dce0ea;
    background: #fff;
}

.media-card:has(input:checked) {
    border-color: var(--success);
}

.media-select {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 8px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin: 0;
    background: rgba(255, 255, 255, 0.94);
}

.media-select input {
    width: 15px;
    height: 15px;
    margin: 0;
}

.media-select span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.media-preview {
    position: relative;
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    background: #f5f7fb;
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-icon {
    color: #4d5673;
}

.media-preview-icon .ui-icon {
    width: 42px;
    height: 42px;
}

.media-preview-type {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 5px 7px;
    background: #202137;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.media-card-meta {
    display: grid;
    gap: 4px;
    padding: 10px;
}

.media-file-name {
    display: flex;
    min-width: 0;
    color: #172039;
    font-size: 13px;
    font-weight: 600;
}

.media-file-name span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-file-name b {
    flex: 0 0 auto;
    font-weight: 600;
}

.media-card-meta small {
    color: var(--muted);
    font-size: 11px;
}

.media-empty {
    padding: 26px;
    color: var(--muted);
    text-align: center;
}

.subsection {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(16, 33, 50, 0.025);
    border: 1px solid var(--border);
}

.checkbox-row {
    gap: 10px;
}

.checkbox-row input {
    width: auto;
}

.hint-list,
.info-card p {
    color: var(--muted);
    line-height: 1.6;
}

.sidebar-collapsed .app-shell {
    grid-template-columns: 96px 1fr;
}

.sidebar-collapsed .sidebar-profile-copy,
.sidebar-collapsed .menu-link span:last-child,
.sidebar-collapsed .menu-accordion-trigger span:nth-child(2),
.sidebar-collapsed .menu-chevron,
.sidebar-collapsed .sidebar-footer-user,
.sidebar-collapsed .ghost-button span {
    display: none;
}

.sidebar-collapsed .sidebar-profile {
    grid-template-columns: 1fr;
}

.sidebar-collapsed .sidebar-product-mark {
    border-right: 0;
}

@media (max-width: 1180px) {
    .form-row,
    .item-grid,
    .stats-grid,
    .legal-grid,
    .two-columns {
        grid-template-columns: 1fr 1fr;
    }

    .overview-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .media-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .install-admin-grid {
        grid-template-columns: 1fr 1fr;
    }

    .install-database-grid {
        grid-template-columns: 1fr 1fr;
    }

    .content-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .placement-form-row-one, .placement-form-row-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .placement-form-row-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .placement-form-row-two > :first-child { grid-column: 1 / -1; }
    .availability-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .media-picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .taxonomy-region-form, .taxonomy-city-form { grid-template-columns: 1fr 1fr; }
    .taxonomy-city-form button { grid-column: 1 / -1; }
    .placement-detail-boxes { grid-template-columns: 1fr; }
    .placement-detail-row-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .taxonomy-layout { grid-template-columns: 1fr; }
    .taxonomy-region-form, .taxonomy-province-form, .taxonomy-city-form { grid-template-columns: 1fr 1fr; }
    .taxonomy-province-form button, .taxonomy-city-form button { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    .app-shell,
    .form-row,
    .item-grid,
    .stats-grid,
    .legal-grid,
    .two-columns {
        grid-template-columns: 1fr;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .install-admin-grid {
        grid-template-columns: 1fr;
    }

    .install-database-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(280px, 84vw);
        padding-bottom: 28px;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    .mobile-menu-toggle {
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #202137;
        cursor: pointer;
    }

    .mobile-menu-toggle .ui-icon {
        width: 23px;
        height: 23px;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 20;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(16, 18, 34, 0.5);
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-menu-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-collapsed .sidebar-profile-copy {
        display: grid;
    }

    .sidebar-collapsed .menu-link span:last-child,
    .sidebar-collapsed .menu-accordion-trigger span:nth-child(2),
    .sidebar-collapsed .ghost-button span {
        display: inline;
    }

    .sidebar-collapsed .menu-chevron,
    .sidebar-collapsed .sidebar-footer-user {
        display: grid;
    }

    .sidebar-collapsed .menu-accordion[open] .menu-submenu {
        display: grid;
    }

    .sidebar-collapsed .sidebar-profile {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .sidebar-collapsed .sidebar-product-mark {
        border-right: 1px solid rgba(255, 255, 255, 0.16);
    }

    .content {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        gap: 12px;
    }

    .topbar-actions {
        flex-wrap: wrap;
    }

    .media-upload-form,
    .media-toolbar {
        grid-template-columns: 1fr;
        display: grid;
        align-items: stretch;
    }

    .media-upload-form .primary-button,
    .media-toolbar .secondary-button {
        width: 100%;
    }

    .media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .content-filters, .placement-form-row-one, .placement-form-row-two, .placement-form-row-three, .content-list-heading, .placement-list-row summary, .taxonomy-region-form, .taxonomy-province-form, .taxonomy-city-form, .placement-detail-row-two-up, .placement-detail-row-four, .placement-detail-row-three-up { grid-template-columns: 1fr; }
    .content-list-heading { display: none; }
    .placement-list-row summary { gap: 5px; }
    .placement-expand-marker { position: absolute; top: 12px; right: 10px; }
    .placement-list-row summary .placement-code::before, .placement-list-row summary .placement-location::before, .placement-list-row summary .placement-city::before, .placement-list-row summary .placement-province::before, .placement-list-row summary .placement-region::before, .placement-list-row summary .placement-agency::before, .placement-list-row summary .placement-format::before { display: inline-block; width: 98px; color: var(--muted); font-size: 12px; font-weight: 400; }
    .placement-list-row summary .placement-code::before { content: "N. impianto: "; }
    .placement-list-row summary .placement-location::before { content: "Ubicazione: "; }
    .placement-list-row summary .placement-city::before { content: "CittÃ : "; }
    .placement-list-row summary .placement-province::before { content: "Provincia: "; }
    .placement-list-row summary .placement-region::before { content: "Regione: "; }
    .placement-list-row summary .placement-agency::before { content: "Agenzia: "; }
    .placement-list-row summary .placement-format::before { content: "Formato: "; }
    .placement-form-row-two > :first-child { grid-column: auto; }
    .availability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .media-picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .taxonomy-city-form button { grid-column: auto; }
    .placement-detail-photo-box img { height: 190px; }
    .placement-detail-photo img { height: 190px; }
    .filter-actions, .placement-form-actions, .placement-row-actions { align-items: stretch; flex-direction: column; }
    .filter-actions .secondary-button, .placement-form-actions .secondary-button, .placement-row-actions .secondary-button, .placement-row-actions .danger-button, .placement-row-actions form { width: 100%; text-align: center; }
}

.legal-position { display: inline-grid; place-items: center; justify-self: center; width: 28px; height: 26px; border: 1px solid var(--border); background: #f5f7fa; color: var(--muted); font-size: 12px; font-weight: 500; }
.legal-position-description { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.45; }
.registry-billing > .registry-billing-field { display: grid; align-content: start; gap: 5px; }
.legal-list-heading > :nth-child(3), .legal-list-heading > :nth-child(4) { text-align: center; justify-self: center; }
.legal-list-row summary > .legal-switch-form, .legal-list-row summary > .legal-switch-placeholder { justify-self: center; }
.preferences-form input[type="color"] { padding: 3px; }
.badge:has(.ui-icon) { display: inline-flex; align-items: center; gap: 6px; }

/* The menu scrolls independently so the account and logout stay visible. */
.app-body .sidebar { background: #182033; position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar > .menu { flex: 1; min-height: 0; overflow-y: auto; align-content: start; }
.sidebar-profile, .sidebar-footer { flex-shrink: 0; }
@media (min-width: 861px) {
    .app-body .sidebar { width: 280px; }
    .app-shell > .content { grid-column: 2; }
    .sidebar-collapsed .sidebar { width: 96px; }
    .sidebar-collapsed .menu-submenu { padding-left: 0; }
    .sidebar-collapsed .menu-sublink { justify-content: center; padding: 9px 0; }
    .sidebar-collapsed .menu-sublink > span:last-child { display: none; }
    .sidebar-collapsed .menu-accordion-trigger { grid-template-columns: 20px; }
}
@media (max-width: 860px) { .app-body .sidebar { position: fixed; } }

/* Apply the preferences to components that previously used fixed values. */
.app-body { background: var(--bg); }
.app-body .panel, .app-body .info-card, .app-body .stat-card { background: var(--panel); border-color: var(--border); }
html[data-theme="warm"] .app-body input, html[data-theme="warm"] .app-body select, html[data-theme="warm"] .app-body textarea { background-color: #fffdf9; }
html[data-theme="slate"] .app-body input, html[data-theme="slate"] .app-body select, html[data-theme="slate"] .app-body textarea { background-color: #f1f5f9; }
.app-body .primary-button, .app-body .topbar-action { background: var(--accent); }
.app-body input:focus, .app-body select:focus, .app-body textarea:focus { border-color: var(--accent); outline-color: var(--accent); }
.app-body .menu-link.active, .app-body .menu-sublink.active { box-shadow: inset 3px 0 var(--accent) !important; }
html[data-density="comfortable"] .app-body .order-list-row,
html[data-density="comfortable"] .app-body .registry-list-row summary,
html[data-density="comfortable"] .app-body .placement-list-row summary,
html[data-density="comfortable"] .app-body .legal-list-row summary,
html[data-density="comfortable"] .app-body .user-summary { padding-top: 16px; padding-bottom: 16px; min-height: 64px; }
html[data-density="comfortable"] .app-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
html[data-density="comfortable"] .app-body select { min-height: 48px; }
html[data-density="comfortable"] .app-body .company-profile-form { gap: 20px; }
html[data-density="comfortable"] .preferences-form input[type="color"] { height: 48px; min-height: 48px; }
@media (max-width: 650px) { .legal-position { justify-self: start; } .legal-detail-header { flex-wrap: wrap; } }
.filter-autocomplete { position: relative; }
.filter-autocomplete-input { width: 100%; }
.filter-autocomplete-select { display: none !important; }
.filter-autocomplete-suggestions {
    display: none;
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(19, 25, 45, .14);
}
.filter-autocomplete.is-open .filter-autocomplete-suggestions { display: block; }
.filter-autocomplete-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}
.filter-autocomplete-option:hover, .filter-autocomplete-option.is-active { background: #f3f5fa; color: var(--accent); }
.filter-autocomplete-option.is-muted { color: var(--muted); }
.filter-autocomplete-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.content-filter-form.is-filtering [data-placement-list-panel], .content-list-panel.is-filtering { opacity: .55; }
.content-filter-form.is-filtering { cursor: progress; }

.mail-switch-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }


.geonames-autocomplete { position: relative; min-width: 0; }
.geonames-autocomplete-input { width: 100%; }
.geonames-autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 45;
    display: none;
    width: max(100%, 360px);
    max-width: min(520px, calc(100vw - 48px));
    max-height: 245px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 18px 35px rgba(19, 25, 45, 0.14);
}
.geonames-autocomplete.is-open .geonames-autocomplete-suggestions { display: block; }
.geonames-autocomplete-option {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    background: transparent;
    color: #13192d;
    font-size: 13px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}
.geonames-autocomplete-option:hover, .geonames-autocomplete-option.is-active { background: #f3f5fa; color: var(--accent); }

