* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2937;
    background: #edf2f7;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 420px);
    background: #ffffff;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 48px rgba(31, 41, 55, 0.14);
}

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

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #0f766e;
    color: #ffffff;
    font-weight: 700;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 1.45rem;
    line-height: 1.2;
}

.brand p {
    margin-top: 4px;
    color: #667085;
    font-size: 0.95rem;
}

.alert {
    padding: 12px;
    margin-bottom: 18px;
    border-radius: 8px;
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}

.alert-success {
    color: #0f5132;
    background: #d1e7dd;
    border-color: #badbcc;
}

form {
    display: grid;
    gap: 10px;
}

.wide-form {
    gap: 20px;
}

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

.form-section {
    display: grid;
    gap: 14px;
}

label {
    font-weight: 700;
    font-size: 0.92rem;
}

input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 1rem;
}

textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    resize: vertical;
}

select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    background: #ffffff;
    color: #1f2937;
    font-size: 1rem;
}

input:focus {
    outline: 3px solid rgba(15, 118, 110, 0.2);
    border-color: #0f766e;
}

select:focus {
    outline: 3px solid rgba(15, 118, 110, 0.2);
    border-color: #0f766e;
}

textarea:focus {
    outline: 3px solid rgba(15, 118, 110, 0.2);
    border-color: #0f766e;
}

button,
.logout {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

button {
    margin-top: 10px;
    background: #0f766e;
    color: #ffffff;
    font-size: 1rem;
}

.dashboard {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 32px 20px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #0f766e;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.logout {
    background: #1f2937;
    color: #ffffff;
}

.content {
    background: #ffffff;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    padding: 24px;
}

.content p {
    margin-top: 8px;
    color: #667085;
}

.form-link {
    margin-top: 18px;
    text-align: center;
}

.form-link a {
    color: #0f766e;
    font-weight: 700;
}

.access-box {
    margin-top: 18px;
    padding: 14px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #99f6e4;
    color: #134e4a;
}

.danger-box {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #881337;
}

.actions-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.secondary-link {
    color: #0f766e;
    font-weight: 700;
}

.tower-list {
    display: grid;
    gap: 14px;
}

.tower-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #f8fafc;
}

.tower-card h3 {
    margin: 0;
}

.section-heading-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.section-heading-row h3 {
    margin: 0;
}

.small-button,
.icon-button {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.icon-button {
    align-self: end;
    background: #1f2937;
}

.extra-units-block {
    display: grid;
    gap: 10px;
}

.extra-units-list {
    display: grid;
    gap: 10px;
}

.extra-unit-row {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.hidden {
    display: none !important;
}

.link-separator {
    color: #94a3b8;
    margin: 0 8px;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
}

.panel-block {
    margin-top: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.data-table th,
.data-table td {
    padding: 12px;
    border-bottom: 1px solid #d8dee8;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: #475467;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.data-table td span {
    display: block;
    margin-top: 4px;
    color: #667085;
}

.units-table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.units-table th {
    background: #0f766e;
    color: #ffffff;
    border-bottom: 0;
    font-size: 0.9rem;
    text-transform: none;
}

.units-table th:first-child {
    border-top-left-radius: 8px;
}

.units-table th:last-child {
    border-top-right-radius: 8px;
}

.units-table td {
    border-bottom: 1px solid #d6dde6;
}

.units-table tbody tr:nth-child(odd) {
    background: #f8fafc;
}

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

.units-table tbody tr:hover {
    background: #ecfdf5;
}

.clickable-row {
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.clickable-row:focus {
    outline: 3px solid rgba(15, 118, 110, 0.22);
    outline-offset: -3px;
}

.units-table td:first-child {
    width: 180px;
    color: #134e4a;
    font-weight: 700;
}

.units-table td:nth-child(2) {
    color: #111827;
}

.selectable-table tr {
    transition: background 0.15s ease;
}

.selectable-table tbody tr:hover {
    background: #f8fafc;
}

.selected-row {
    background: #ecfdf5;
}

.table-action {
    color: #0f766e;
    font-weight: 700;
}

.muted-text {
    color: #667085;
    font-size: 0.92rem;
}

.inline-delete-form {
    display: contents;
}

.inline-action-form {
    display: inline;
}

.inline-delete-form input {
    min-width: 120px;
}

.danger-button {
    background: #b42318;
}

.empty-state {
    margin-top: 18px;
    color: #667085;
}

.link-button-danger {
    min-height: 0;
    margin: 0 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b42318;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.first-panel {
    margin-top: 0;
}

.maintenance-card {
    padding: 18px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #f8fafc;
}

.apartment-maintenance-form .section-heading-row p {
    margin-top: 4px;
}

.compact-button {
    align-self: start;
    min-height: 38px;
    margin-top: 0;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.maintenance-actions {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid #d8dee8;
}

.dependents-section {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #d8dee8;
}

.dependents-section h3 {
    margin: 0;
}

.dependents-list {
    display: grid;
    gap: 10px;
}

.dependent-row {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(160px, 1.3fr) minmax(120px, 0.7fr) minmax(140px, 1fr) minmax(180px, 1fr) auto;
    padding: 12px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
}

.dependent-row .icon-button {
    min-height: 44px;
}

.check-list {
    display: grid;
    gap: 12px;
}

.check-item {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #d8dee8;
    background: #ffffff;
}

.check-item span {
    color: #667085;
    overflow-wrap: anywhere;
}

.check-ok {
    border-color: #badbcc;
    background: #f0fdf4;
}

.check-error {
    border-color: #f5c2c7;
    background: #fff1f2;
}

@media (max-width: 560px) {
    .login-panel {
        padding: 22px;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .extra-unit-row {
        grid-template-columns: 1fr;
    }

    .dependent-row {
        grid-template-columns: 1fr;
    }
}
