:root {
    color: #202b3c;
    background: #f4f6f9;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    --accent: #ed6a18;
    --accent-dark: #cb5010;
    --ink: #202b3c;
    --muted: #748093;
    --line: #e8ebf0;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
}

.page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 50% 0, rgb(237 106 24 / 8%), transparent 36%),
        #f4f6f9;
}

.card {
    width: min(100%, 430px);
    padding: 42px;
    border: 1px solid #e8ebf0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgb(26 39 58 / 10%);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-align: center;
}

.card h1 {
    margin: 0 0 28px;
    color: var(--ink);
    font-size: 30px;
    letter-spacing: -0.035em;
    text-align: center;
}

.card form {
    display: grid;
    gap: 12px;
}

label {
    margin-top: 4px;
    color: #344054;
    font-size: 14px;
    font-weight: 650;
}

input {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #dce1e8;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(237 106 24 / 14%);
}

button {
    min-height: 46px;
    margin-top: 12px;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

button:hover {
    background: var(--accent-dark);
    box-shadow: 0 6px 16px rgb(203 80 16 / 20%);
}

button:active {
    transform: translateY(1px);
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgb(237 106 24 / 40%);
    outline-offset: 3px;
}

.error {
    margin: 0 0 16px;
    padding: 11px 13px;
    border: 1px solid #ffd1cf;
    border-radius: 8px;
    background: #fff5f4;
    color: #b42318;
    font-size: 14px;
    text-align: center;
}

.site-header {
    position: relative;
    z-index: 1;
    background: #17191d;
    color: #fff;
    box-shadow: 0 4px 18px rgb(22 29 39 / 12%);
}

.site-header::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #f6a04d 45%, transparent);
    content: "";
}

.site-header-inner {
    display: flex;
    width: min(100% - 64px, 1320px);
    min-height: 104px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
}

.brand {
    color: #fff;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -0.055em;
    text-decoration: none;
}

.brand span {
    color: #f08a45;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.account-label {
    margin: 0;
    color: #c4c8ce;
    font-size: 13px;
}

.account-label strong {
    color: #fff;
    font-weight: 650;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: #65c58b;
    box-shadow: 0 0 0 3px rgb(101 197 139 / 15%);
    vertical-align: 1px;
}

.logout-form {
    display: block;
}

.logout-form button {
    min-height: 38px;
    margin: 0;
    padding: 8px 13px;
    border: 1px solid #45484e;
    border-radius: 7px;
    background: transparent;
    color: #e6e8eb;
    font-size: 13px;
}

.logout-form button:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.dashboard {
    display: grid;
    width: min(100% - 64px, 1320px);
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    margin: 32px auto 64px;
}

.sidebar {
    min-width: 0;
    padding: 18px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(26 39 58 / 4%);
}

.nav-group {
    margin: 0 0 18px;
}

.nav-group:last-child {
    margin-bottom: 0;
}

.nav-group h2 {
    margin: 4px 8px 9px;
    padding: 0 0 9px;
    border-bottom: 1px solid var(--line);
    color: #344054;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-group:not(:first-child) h2 {
    margin-top: 18px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: none;
}

.nav-group ul {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-group a {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 7px;
    color: #687386;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 140ms ease, color 140ms ease;
}

.nav-group a::before {
    flex: 0 0 14px;
    color: #aab1bb;
    content: "›";
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
}

.nav-group a:hover {
    background: #f7f8fa;
    color: var(--accent-dark);
}

.nav-group a:hover::before {
    color: var(--accent);
}

.nav-group a[aria-current="page"] {
    background: #fff3e9;
    color: #c95312;
}

.nav-group a[aria-current="page"]::before {
    color: var(--accent);
}

.dashboard-content {
    min-width: 0;
    min-height: 300px;
    padding: clamp(28px, 5vw, 56px);
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        radial-gradient(ellipse at 100% 0, rgb(237 106 24 / 6%), transparent 42%),
        #fff;
    box-shadow: 0 8px 24px rgb(26 39 58 / 4%);
}

.content-eyebrow {
    margin: 0 0 12px !important;
    color: var(--accent-dark) !important;
    font-size: 11px !important;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.dashboard-content h1 {
    margin: 0 0 13px;
    color: var(--ink);
    font-size: clamp(30px, 3.5vw, 44px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.15;
    text-align: left;
}

.dashboard-content p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.dashboard-content .coming-soon {
    margin-top: 8px;
    font-size: 15px;
}

.dashboard-content-tenants {
    padding: 32px 28px;
}

.tenant-intro {
    margin-bottom: 20px !important;
    font-size: 14px !important;
}

.form-message {
    margin: 0 0 16px !important;
    padding: 11px 14px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 14px !important;
}

.form-message-error {
    border-color: #ffd1cf;
    background: #fff5f4;
    color: #b42318 !important;
}

.form-message-success {
    border-color: #b7e4c7;
    background: #f0fff4;
    color: #187341 !important;
}

.tenant-form {
    display: grid;
    justify-items: center;
    gap: 18px;
}

.tenant-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    scrollbar-color: #c6ccd5 #f4f6f9;
}

.tenant-table-wrap:focus-visible {
    outline: 3px solid rgb(237 106 24 / 35%);
    outline-offset: 3px;
}

.tenant-table {
    width: 100%;
    min-width: 1490px;
    border-collapse: separate;
    border-spacing: 6px 7px;
    table-layout: fixed;
}

.tenant-table th,
.tenant-table td {
    width: 138px;
    padding: 0;
    text-align: left;
}

.tenant-table .tenant-field-heading,
.tenant-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 136px;
    padding: 8px 10px;
    background: #f8f9fb;
    color: #596579;
    font-size: 12px;
    font-weight: 700;
}

.tenant-table thead th {
    padding: 8px 6px 10px;
    color: #344054;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    text-align: center;
    vertical-align: bottom;
}

.tenant-table thead .tenant-field-heading {
    z-index: 2;
    text-align: left;
}

.tenant-table input,
.tenant-table textarea {
    display: block;
    min-width: 0;
    min-height: 40px;
    padding: 8px 9px;
    border-color: #e0e4ea;
    border-radius: 6px;
    background: #fff;
    color: #344f88;
    font-size: 13px;
}

.tenant-table textarea {
    width: 100%;
    resize: vertical;
}

.tenant-table input:focus,
.tenant-table textarea:focus {
    position: relative;
    z-index: 3;
}

.tenant-save-button {
    min-width: 190px;
    margin: 0;
}

.dashboard-content-upload {
    max-width: 920px;
}

.upload-intro {
    margin-bottom: 26px !important;
    font-size: 15px !important;
}

.upload-form {
    display: grid;
    max-width: 620px;
    gap: 12px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfc;
}

.upload-form label {
    margin: 8px 0 0;
}

.upload-form select,
.upload-form input:not([type="checkbox"]) {
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    border: 1px solid #dfe3e9;
    border-radius: 7px;
    background: #fff;
    color: #344054;
    font: inherit;
    font-size: 14px;
}

.upload-form input[type="file"] {
    padding: 7px;
}

.upload-form input[type="file"]::file-selector-button {
    min-height: 30px;
    margin-right: 12px;
    padding: 5px 10px;
    border: 1px solid #dfe3e9;
    border-radius: 5px;
    background: #f7f8fa;
    color: #344054;
    cursor: pointer;
    font: inherit;
}

.upload-form select:focus,
.upload-form input:not([type="checkbox"]):focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(237 106 24 / 14%);
}

.upload-form .upload-hint {
    margin: -5px 0 4px;
    color: var(--muted);
    font-size: 12px;
}

.upload-form button {
    justify-self: start;
    min-width: 170px;
    margin: 8px 0 0;
}

.important-date-annual {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 0 0 !important;
}

.important-date-annual input {
    accent-color: var(--accent);
}

.important-date-list-title {
    margin: 32px 0 12px;
    color: #173c50;
    font-size: 19px;
}

.important-date-table {
    min-width: 720px;
}

.important-date-edit {
    display: inline-block;
    margin-right: 10px;
    color: #167f92;
    font-size: 13px;
    text-decoration: underline;
}

.document-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 24px;
    border-radius: 10px;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    color: #173c50;
}

.document-table th {
    padding: 12px 14px;
    background: #168397;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.document-table th:first-child {
    text-align: left;
}

.document-table td {
    padding: 2px 12px;
    border-bottom: 1px solid #dce5e8;
    text-align: center;
}

.document-table tbody tr:nth-child(even) {
    background: #eaf3f4;
}

.document-table td:first-child {
    max-width: 520px;
    overflow-wrap: anywhere;
    text-align: left;
}

.document-table form {
    margin: 0;
}

.document-download,
.document-delete {
    display: inline-block;
    padding: 6px 12px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #167f92;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.document-download {
    padding: 0;
    line-height: 0;
    text-decoration: none;
}

.document-file-icon {
    display: block;
    width: 26px;
    height: 30px;
    filter: drop-shadow(0 1px 1px rgb(16 24 40 / 15%));
    transition: transform 120ms ease;
}

.document-download:hover .document-file-icon {
    transform: translateY(-2px);
}

.document-file-page {
    fill: #fff;
    stroke: #c9d1d9;
    stroke-width: 1.5;
}

.document-file-fold {
    fill: #e7edf2;
    stroke: #c9d1d9;
    stroke-width: 1.5;
}

.document-file-badge {
    fill: #687786;
}

.document-file-label {
    fill: #fff;
    font-family: Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
}

.document-download-pdf .document-file-badge {
    fill: #df332c;
}

.document-download-word .document-file-badge {
    fill: #2874c8;
}

.document-download-spreadsheet .document-file-badge {
    fill: #26834a;
}

.document-download-image .document-file-badge {
    fill: #7054a3;
}

.document-download-text .document-file-badge {
    fill: #667580;
}

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

.document-delete {
    display: inline-grid;
    width: 24px;
    height: 24px;
    padding: 2px;
    place-items: center;
    color: #c62828;
    line-height: 0;
    text-decoration: none;
}

.document-delete-icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2.5;
    transition: transform 120ms ease;
}

.document-delete:hover .document-delete-icon {
    transform: scale(1.12);
}

.document-download:focus-visible,
.document-delete:focus-visible {
    outline: 3px solid rgb(237 106 24 / 35%);
    outline-offset: 2px;
}

.required-mark {
    color: #c2410c;
}

.dashboard-content-rent {
    padding: 32px clamp(20px, 4vw, 48px);
}

.rent-intro {
    margin-bottom: 24px !important;
    font-size: 14px !important;
}

.rent-selection {
    margin-bottom: 28px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fafbfc;
}

.rent-selection fieldset {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    border: 0;
}

.rent-selection legend {
    float: left;
    width: 150px;
    color: #475467;
    font-size: 14px;
    font-weight: 700;
}

.rent-apartment-select {
    display: block;
    margin: 0;
}

.rent-apartment-select select {
    width: min(100%, 420px);
    min-height: 44px;
    padding: 9px 36px 9px 12px;
    border: 1px solid #dfe3e9;
    border-radius: 7px;
    background: #fff;
    color: #344f88;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}

.rent-apartment-select select:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(237 106 24 / 14%);
}

.rent-details {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 20px;
}

.rent-preview-form {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 24px;
}

.rent-row {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    column-gap: 22px;
    row-gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf0f3;
}

.rent-row h2 {
    margin: 0;
    color: #475467;
    font-size: 15px;
    font-weight: 700;
}

.rent-row > input,
.rent-row select,
.rent-row textarea,
.rent-extra-fields input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border: 1px solid #dfe3e9;
    border-radius: 7px;
    background: #fff;
    color: #344f88;
    font: inherit;
    font-size: 14px;
}

.rent-row select {
    width: auto;
    max-width: 100%;
    min-width: 112px;
    padding: 8px 11px;
}

.rent-document-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0;
    padding: 0;
    border: 0;
}

.rent-document-choice label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #344054;
    cursor: pointer;
    font-size: 14px;
}

.rent-document-choice input[type="radio"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--accent);
}

.rent-month-controls {
    display: flex;
    gap: 8px;
}

.rent-recipient {
    display: flex;
    min-height: 48px;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    color: #475467 !important;
    font-size: 14px !important;
}

.rent-recipient a {
    color: var(--accent-dark);
    text-decoration: none;
}

.rent-recipient a:hover {
    text-decoration: underline;
}

.rent-missing,
.rent-empty {
    color: #98a2b3 !important;
    font-size: 14px !important;
}

.rent-extra-fields {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.8fr);
    gap: 10px;
}

.rent-extra-fields input {
    width: 100%;
    padding: 9px 11px;
}

.rent-row-message {
    align-items: start;
}

.rent-row-message h2 {
    padding-top: 11px;
}

.rent-row textarea {
    min-height: 230px;
    padding: 14px;
    line-height: 1.8;
    resize: vertical;
}

.rent-note {
    margin: 2px 0 0 168px !important;
    color: #8a5a2b !important;
    font-size: 12px !important;
}

.rent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: 168px;
}

.rent-actions button {
    min-height: 42px;
    margin: 0;
    padding: 9px 14px;
    font-size: 13px;
}

.rent-actions button:disabled {
    background: #c9cdd4;
    box-shadow: none;
    cursor: not-allowed;
}

.rent-actions .button-secondary {
    border: 1px solid #dfe3e9;
    background: #fff;
    color: #667085;
}

.rent-empty {
    margin-top: 24px !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 760px) {
    .site-header-inner,
    .dashboard {
        width: min(100% - 32px, 600px);
    }

    .site-header-inner {
        min-height: 82px;
    }

    .account-actions {
        gap: 0;
    }

    .account-label {
        display: none;
    }

    .dashboard {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin-top: 20px;
    }

    .dashboard-content {
        grid-row: 1;
        min-height: 220px;
        padding: 28px 24px;
    }

    .dashboard-content-tenants {
        padding: 24px 16px;
    }

    .tenant-table {
        min-width: 1420px;
    }

    .rent-selection fieldset,
    .rent-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .rent-selection legend {
        float: none;
        width: auto;
        margin-bottom: 10px;
    }

    .rent-note,
    .rent-actions {
        margin-left: 0 !important;
    }

    .sidebar {
        grid-row: 2;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 18px;
    }

    .card {
        padding: 32px 24px;
    }

    .site-header-inner {
        width: calc(100% - 32px);
        gap: 12px;
    }

    .brand {
        font-size: 30px;
    }

    .logout-form button {
        padding: 7px 9px;
        font-size: 12px;
    }
}
