:root {
    /* Brand */
    --accent:        #f4c542;
    --accent-border: #d9a912;
    --accent-ink:    #2a2110;
    --accent-ring:   rgba(244, 197, 66, 0.25);

    /* Surfaces */
    --bg:           #f5f7f3;
    --surface:      #ffffff;
    --surface-soft: #eef3ee;
    --input-bg:     #fbfcfb;

    /* Strokes & type */
    --border:   #dbe2dc;
    --ink:      #18221d;
    --muted:    #68756d;

    /* Semantic */
    --danger:   #b42318;
    --positive: #08734f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
}

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

.sr-only {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

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

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex: 0 0 260px;
    flex-direction: column;
    min-height: 100vh;
    padding: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: flex-basis 180ms ease, padding 180ms ease;
    z-index: 10;
}

.sidebar-header {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding-bottom: 18px;
    transition: padding 180ms ease;
}

.brand {
    align-items: center;
    display: flex;
    font-weight: 800;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
    white-space: nowrap;
}

.brand-label {
    display: inline-block;
    max-width: 170px;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(0);
    transition: max-width 180ms ease, opacity 140ms ease, transform 180ms ease, visibility 180ms ease;
    visibility: visible;
}

.brand-mark {
    align-items: center;
    aspect-ratio: 1;
    background: var(--accent);
    border: 2px solid var(--accent-ink);
    border-radius: 6px;
    color: var(--accent-ink);
    display: inline-flex;
    font-size: 13px;
    justify-content: center;
    width: 34px;
}

.sidebar-toggle {
    align-items: center;
    aspect-ratio: 1;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 11px;
    font-weight: 900;
    justify-content: center;
    transition: background 140ms ease, color 140ms ease, transform 180ms ease;
    width: 34px;
}

.sidebar-toggle:hover {
    background: var(--surface);
    color: var(--ink);
}

.sidebar-toggle-icon {
    display: inline-flex;
    font-size: 0;
    line-height: 1;
}

.sidebar-toggle-icon::before {
    content: "<<";
    font-size: 11px;
}

.app-shell.sidebar-collapsed .sidebar-toggle-icon::before {
    content: ">>";
}

.sidebar-nav {
    display: grid;
    gap: 20px;
    transition: gap 180ms ease;
}

.nav-section {
    display: grid;
    gap: 5px;
    transition: gap 180ms ease;
}

.nav-section + .nav-section {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.nav-section p {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    margin: 0 0 3px;
    max-height: 18px;
    opacity: 1;
    overflow: hidden;
    transform: translateX(0);
    transition: max-height 180ms ease, margin 180ms ease, opacity 140ms ease, transform 180ms ease, visibility 180ms ease;
    text-transform: uppercase;
    visibility: visible;
}

.nav-section :is(a, .nav-disabled) {
    align-items: center;
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    font-weight: 700;
    padding: 10px 11px;
    position: relative;
    text-decoration: none;
    transition: background 140ms ease, color 140ms ease, gap 180ms ease, justify-content 180ms ease, padding 180ms ease;
}

.nav-disabled {
    color: #9aa49d;
    cursor: not-allowed;
    user-select: none;
}

.nav-icon {
    align-items: center;
    color: inherit;
    display: inline-flex;
    flex: 0 0 20px;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.nav-icon svg {
    display: block;
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.nav-label {
    display: block;
    max-width: 160px;
    min-width: 0;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(0);
    transition: max-width 180ms ease, opacity 140ms ease, transform 180ms ease, visibility 180ms ease;
    visibility: visible;
}

.nav-section a.active,
.nav-section a:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.app-shell.sidebar-collapsed .sidebar {
    flex-basis: 78px;
    overflow: visible;
    padding-left: 12px;
    padding-right: 12px;
}

.app-shell.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    justify-content: center;
}

.app-shell.sidebar-collapsed .brand,
.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled) {
    justify-content: center;
}

.app-shell.sidebar-collapsed .brand-label,
.app-shell.sidebar-collapsed .nav-label {
    max-width: 0;
    opacity: 0;
    transform: translateX(-6px);
    visibility: hidden;
}

.app-shell.sidebar-collapsed .nav-section p {
    margin: 0;
    max-height: 0;
    opacity: 0;
    transform: translateX(-6px);
    visibility: hidden;
}

.app-shell.sidebar-collapsed .sidebar-nav {
    gap: 12px;
}

.app-shell.sidebar-collapsed .nav-section {
    gap: 8px;
}

.app-shell.sidebar-collapsed .nav-section + .nav-section {
    border-top: 0;
    padding-top: 0;
}

.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled) {
    align-items: center;
    display: flex;
    gap: 0;
    min-height: 40px;
    padding: 10px 0;
}

.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled)::after {
    background: var(--ink);
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(24, 34, 29, 0.18);
    color: var(--surface);
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 800;
    left: calc(100% + 12px);
    line-height: 1;
    opacity: 0;
    padding: 8px 10px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    visibility: hidden;
    white-space: nowrap;
    z-index: 30;
}

.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled)::before {
    border-bottom: 5px solid transparent;
    border-right: 5px solid var(--ink);
    border-top: 5px solid transparent;
    content: "";
    left: calc(100% + 7px);
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    visibility: hidden;
    z-index: 31;
}

.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled):hover::after,
.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled):focus-visible::after,
.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled):hover::before,
.app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled):focus-visible::before {
    opacity: 1;
    visibility: visible;
}

.main-shell {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 16px;
    justify-content: flex-start;
    min-height: 64px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 9;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    margin-left: auto;
    position: relative;
}

.user-menu {
    position: relative;
}

.user-menu summary {
    list-style: none;
}

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

.user-menu-toggle {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    gap: 9px;
    font-weight: 800;
    min-height: 38px;
    padding: 6px 10px 6px 7px;
}

.user-menu-toggle:focus-visible,
.user-menu-action:focus-visible {
    border-color: var(--accent-border);
    outline: 3px solid var(--accent-ring);
}

.user-avatar {
    align-items: center;
    background: var(--accent);
    border-radius: 50%;
    color: var(--accent-ink);
    display: inline-flex;
    font-size: 12px;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.user-menu-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-chevron {
    border-bottom: 2px solid var(--muted);
    border-right: 2px solid var(--muted);
    height: 7px;
    transform: rotate(45deg);
    transition: transform 140ms ease;
    width: 7px;
}

.user-menu[open] .user-menu-chevron {
    transform: rotate(225deg);
}

.user-menu-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(24, 34, 29, 0.14);
    display: grid;
    gap: 12px;
    min-width: 260px;
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
}

.user-menu-header {
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 2px;
    padding: 2px 2px 12px;
}

.user-menu-header strong {
    font-size: 14px;
}

.user-menu-header span,
.menu-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.user-menu-link {
    align-items: center;
    border-radius: 6px;
    color: var(--ink);
    display: flex;
    font-weight: 800;
    min-height: 38px;
    padding: 8px 10px;
    text-decoration: none;
}

.user-menu-link:hover,
.user-menu-link.active {
    background: var(--surface-soft);
}

.user-menu-link:focus-visible {
    outline: 3px solid var(--accent-ring);
}

.user-menu-form {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.user-menu-action {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--danger);
    cursor: pointer;
    font-weight: 800;
    min-height: 38px;
    padding: 8px 13px;
    width: 100%;
}

.user-menu-action:hover {
    filter: brightness(0.98);
}

.locale-switch {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: inline-flex;
    gap: 2px;
    padding: 3px;
}

.locale-switch a {
    border-radius: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    min-width: 34px;
    padding: 6px 8px;
    text-align: center;
    text-decoration: none;
}

.locale-switch a.active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(24, 34, 29, 0.12);
}

.content {
    flex: 1;
    margin: 0 auto;
    max-width: 1180px;
    min-width: 0;
    padding: 30px 24px 56px;
    width: 100%;
}

.auth-shell {
    align-items: center;
    background: var(--bg);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-panel {
    width: min(100%, 440px);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px;
}

.auth-card h1 {
    font-size: 28px;
    line-height: 1.15;
    margin: 0 0 20px;
}

.auth-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
}

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

.landing-page {
    background: var(--surface);
}

.landing-topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 18px;
    justify-content: flex-start;
    min-height: 72px;
    padding: 0 28px;
}

.landing-brand .brand-label {
    max-width: none;
}

.landing-nav {
    align-items: center;
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.landing-nav a {
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
    padding: 8px 10px;
    text-decoration: none;
}

.landing-nav a.active,
.landing-nav a:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.landing-hero {
    align-items: center;
    background-image:
        linear-gradient(90deg, rgba(8, 18, 15, 0.76) 0%, rgba(8, 18, 15, 0.54) 38%, rgba(8, 18, 15, 0.12) 72%),
        url("/images/landing-hero.png");
    background-position: center;
    background-size: cover;
    color: #ffffff;
    display: flex;
    min-height: calc(100vh - 180px);
    padding: 56px 28px;
}

.landing-hero-content {
    margin: 0 auto;
    max-width: 1180px;
    width: 100%;
}

.landing-hero-content h1 {
    font-size: 64px;
    letter-spacing: 0;
    line-height: 0.98;
    margin: 0;
    max-width: 780px;
}

.landing-hero-content p:not(.eyebrow) {
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
    line-height: 1.6;
    margin: 20px 0 0;
    max-width: 620px;
}

.landing-hero .eyebrow {
    color: rgba(255, 255, 255, 0.78);
}

.landing-cta {
    margin-top: 28px;
}

.landing-band {
    background: var(--bg);
    padding: 30px 28px 56px;
}

.landing-band-inner {
    margin: 0 auto;
    max-width: 1180px;
}

.landing-section-heading {
    align-items: end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.landing-section-heading h2 {
    font-size: 30px;
    line-height: 1.15;
    margin: 0;
}

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

.landing-features article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 150px;
    padding: 18px;
}

.landing-features span {
    color: var(--positive);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.landing-features h3 {
    font-size: 18px;
    margin: 10px 0 8px;
}

.landing-features p {
    color: var(--muted);
    font-weight: 700;
    margin: 0;
}

.pricing-hero {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 72px 28px 42px;
}

.pricing-hero h1 {
    font-size: 48px;
    line-height: 1.04;
    margin: 0;
    max-width: 760px;
}

.pricing-hero p:not(.eyebrow) {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
    margin: 18px 0 0;
    max-width: 700px;
}

.pricing-section {
    background: var(--surface);
    padding: 32px 28px 64px;
}

.pricing-comparison-scroll,
.pricing-comparison {
    --pricing-label-column: 190px;
    --pricing-plan-column: 197.5px;
    --pricing-table-width: calc(var(--pricing-label-column) + (var(--pricing-plan-column) * 4));
}

.pricing-comparison-scroll {
    overflow-x: auto;
}

.pricing-table-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: var(--pricing-table-width);
    overflow: hidden;
}

.pricing-plan-row,
.pricing-action-row {
    display: grid;
    grid-template-columns: var(--pricing-label-column) repeat(4, minmax(var(--pricing-plan-column), 1fr));
    min-width: var(--pricing-table-width);
    width: 100%;
}

.pricing-plan-row {
    margin-bottom: 16px;
}

.pricing-action-row {
    margin-top: 16px;
}

.pricing-plan-spacer,
.pricing-plan-cell,
.pricing-action-spacer,
.pricing-action-cell {
    padding: 0 12px;
}

.pricing-comparison {
    background: var(--surface);
    table-layout: fixed;
}

.pricing-comparison .pricing-label-column {
    width: var(--pricing-label-column);
}

.pricing-comparison th,
.pricing-comparison td {
    vertical-align: top;
}

.pricing-comparison-head {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.pricing-comparison thead th:first-child,
.pricing-comparison tbody th {
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-transform: none;
}

.pricing-comparison td.featured,
.pricing-comparison th.featured {
    background: #fff9e5;
}

.pricing-plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 16px;
}

.pricing-plan-card.featured {
    border-color: var(--accent-border);
    box-shadow: 0 10px 26px rgba(24, 34, 29, 0.1);
}

.pricing-plan-name {
    display: block;
    font-size: 20px;
    line-height: 1.15;
}

.pricing-badge {
    background: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    color: var(--accent-ink);
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    padding: 5px 9px;
}

.pricing-table-price {
    display: block;
    font-size: 32px;
    line-height: 1;
}

.pricing-table-subtext {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-top: 4px;
}

.pricing-availability {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    font-size: 18px;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    line-height: 1;
    width: 30px;
}

.pricing-availability.included {
    background: #dff4e7;
    color: #07583d;
}

.pricing-availability.not-included {
    background: var(--surface-soft);
    color: var(--muted);
}

.pricing-action-cell .button {
    justify-content: center;
    width: 100%;
}

.pricing-note {
    color: var(--muted);
    font-weight: 700;
    margin-top: 18px;
}

.page-heading,
.panel-heading,
.actions,
.form-actions,
.table-actions,
.filter-bar {
    align-items: center;
    display: flex;
    gap: 12px;
}

.page-heading {
    justify-content: space-between;
    margin-bottom: 22px;
}

.page-heading h1 {
    font-size: 30px;
    line-height: 1.15;
    margin: 0;
}

.eyebrow {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.actions,
.form-actions,
.table-actions {
    flex-wrap: wrap;
}

.button,
button.button {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    min-height: 38px;
    padding: 8px 13px;
    text-decoration: none;
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent-border);
    color: var(--accent-ink);
}

.button.danger {
    color: var(--danger);
}

.button:hover {
    filter: brightness(0.98);
}

.metrics {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.metric,
.panel,
.form-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.metric {
    min-height: 108px;
    padding: 18px;
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.metric strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
    margin-top: 8px;
}

.panel {
    margin-top: 18px;
    overflow: hidden;
}

.panel-heading {
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
    padding: 16px 18px;
}

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

.panel-heading a {
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.settings-list {
    display: grid;
}

.setting-row {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 18px;
}

.setting-row strong {
    display: block;
}

.language-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 390px;
}

.language-option {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    display: flex;
    gap: 10px;
    min-height: 44px;
    padding: 9px 11px;
    text-decoration: none;
}

.language-option.active {
    background: var(--accent);
    border-color: var(--accent-border);
    color: var(--accent-ink);
}

.language-option span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.language-option.active span {
    color: var(--accent-ink);
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 13px 18px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

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

.subtext,
.muted {
    color: var(--muted);
}

.subtext {
    display: block;
    font-size: 13px;
}

.positive {
    color: var(--positive);
    font-weight: 800;
}

.negative {
    color: var(--danger);
    font-weight: 800;
}

.status,
.pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    min-height: 26px;
    padding: 4px 9px;
    white-space: nowrap;
}

.status {
    background: #edf1ed;
    color: var(--ink);
}

.status-active,
.status-income {
    background: #dff4e7;
    color: #07583d;
}

.status-maintenance {
    background: #fff2bf;
    color: #6d4b00;
}

.status-inactive,
.status-expense {
    background: #ffe4df;
    color: #8f1d13;
}

.pill {
    background: var(--surface-soft);
    color: var(--ink);
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.empty {
    color: var(--muted);
    padding: 28px 18px;
    text-align: center;
}

.alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 13px 15px;
}

.alert ul {
    font-weight: 500;
    margin: 8px 0 0 20px;
    padding: 0;
}

.alert.success {
    background: #dff4e7;
    color: #07583d;
}

.alert.error {
    background: #ffe4df;
    color: #8f1d13;
}

.form-panel {
    padding: 20px;
}

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

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

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

.checkbox-field {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 13px;
    font-weight: 800;
    gap: 9px;
}

.checkbox-field input {
    min-height: auto;
    width: auto;
}

label,
.field-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    min-height: 40px;
    padding: 9px 11px;
    width: 100%;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-border);
    outline: 3px solid var(--accent-ring);
}

.form-actions {
    border-top: 1px solid var(--border);
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 18px;
}

.filter-bar {
    align-items: flex-end;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    column-gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 16px;
    row-gap: 12px;
}

.filter-bar > :is(.field, select, input) {
    flex: 1 1 180px;
    max-width: 240px;
    min-width: 160px;
}

.filter-bar > .button {
    flex: 0 0 auto;
    justify-content: center;
    min-width: 92px;
}

.segmented {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 3px;
    width: min(100%, 320px);
}

.segmented label {
    color: var(--muted);
    cursor: pointer;
    text-align: center;
}

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

.segmented span {
    border-radius: 5px;
    display: block;
    padding: 8px 10px;
}

.segmented input:checked + span {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(24, 34, 29, 0.12);
}

.pagination {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 18px;
}

.pagination span {
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 860px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        border-bottom: 1px solid var(--border);
        border-right: 0;
        flex-basis: auto;
        height: auto;
        min-height: 0;
        padding: 14px 16px;
        position: static;
        width: 100%;
    }

    .sidebar-header {
        padding-bottom: 14px;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-nav {
        gap: 12px;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .app-shell.sidebar-collapsed .sidebar {
        flex-basis: auto;
        padding: 14px 16px;
    }

    .app-shell.sidebar-collapsed .sidebar-header {
        flex-direction: row;
        justify-content: space-between;
    }

    .app-shell.sidebar-collapsed .brand-label,
    .app-shell.sidebar-collapsed .nav-label {
        opacity: 1;
        transform: translateX(0);
        visibility: visible;
    }

    .app-shell.sidebar-collapsed .brand-label {
        max-width: 170px;
    }

    .app-shell.sidebar-collapsed .nav-label {
        max-width: 160px;
    }

    .app-shell.sidebar-collapsed .nav-section p {
        margin: 0 0 3px;
        max-height: 18px;
        opacity: 1;
        transform: translateX(0);
        visibility: visible;
    }

    .app-shell.sidebar-collapsed .brand,
    .app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled) {
        justify-content: flex-start;
    }

    .app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled) {
        display: flex;
        gap: 10px;
        min-height: 0;
        padding: 10px 11px;
    }

    .app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled)::before,
    .app-shell.sidebar-collapsed .nav-section :is(a, .nav-disabled)::after {
        display: none;
    }

    .main-shell {
        display: block;
    }

    .topbar {
        gap: 12px;
        min-height: 58px;
        padding: 10px 16px;
    }

    .landing-topbar {
        flex-wrap: wrap;
        gap: 10px;
        min-height: 64px;
        padding: 12px 16px;
    }

    .landing-nav {
        margin-left: 0;
        order: 3;
        width: 100%;
    }

    .landing-nav a {
        flex: 1;
        text-align: center;
    }

    .landing-hero {
        background-position: center right 28%;
        min-height: 68vh;
        padding: 42px 16px;
    }

    .landing-hero-content h1 {
        font-size: 42px;
        max-width: 560px;
    }

    .landing-hero-content p:not(.eyebrow) {
        font-size: 16px;
        max-width: 520px;
    }

    .landing-band {
        padding: 26px 16px 42px;
    }

    .landing-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .landing-section-heading h2 {
        font-size: 24px;
    }

    .landing-features {
        grid-template-columns: 1fr;
    }

    .pricing-hero {
        padding: 42px 16px 30px;
    }

    .pricing-hero h1 {
        font-size: 36px;
    }

    .pricing-hero p:not(.eyebrow) {
        font-size: 16px;
    }

    .pricing-section {
        padding: 24px 16px 44px;
    }

    .pricing-comparison-scroll {
        margin-left: -16px;
        margin-right: -16px;
    }

    .pricing-plan-row,
    .pricing-action-row {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pricing-table-wrap {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
    }

    .content {
        padding: 24px 16px 44px;
    }

    .setting-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .language-options {
        grid-template-columns: 1fr;
        min-width: 0;
        width: 100%;
    }

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

    .metric {
        min-height: 92px;
    }

    .filter-bar > :is(.field, select, input, .button) {
        max-width: none;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-header,
    .sidebar-toggle,
    .sidebar-nav,
    .nav-section,
    .nav-section p,
    .nav-section :is(a, .nav-disabled),
    .brand-label,
    .nav-label {
        transition: none;
    }
}
