* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f2f4f7;
    margin: 0;
    padding: 0;
    color: #1f2937;
}
.container {
    max-width: 480px;
    margin: 40px auto;
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.container.wide {
    max-width: 900px;
}
h1 { font-size: 1.4rem; margin-top: 0; }
h2 { font-size: 1.1rem; }
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=password], input[type=number], select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}
button, .btn {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 18px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .btn:hover { background: #1d4ed8; }
.btn.secondary { background: #6b7280; }
.btn.secondary:hover { background: #4b5563; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: .9rem;
}
.success {
    background: #dcfce7;
    color: #166534;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: .9rem;
}
.radio-card {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}
.radio-card label {
    flex: 1;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}
.radio-card input { display: none; }
.radio-card input:checked + span { color: #2563eb; }
.radio-card label:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: .9rem;
}
th, td { padding: 8px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
th { background: #f9fafb; }
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.badge.owner { background: #dbeafe; color: #1e40af; }
.badge.tenant { background: #fef3c7; color: #92400e; }
.badge.none { background: #f3f4f6; color: #6b7280; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.small { font-size: .8rem; color: #6b7280; }

@media (max-width: 640px) {
    .container {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 16px;
    }
    .container.wide { max-width: 100%; }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .top-bar > div {
        display: flex;
        gap: 8px;
    }
    .top-bar .btn { flex: 1; text-align: center; margin-top: 0; }

    form button[type=submit] { width: 100%; }

    table.responsive, table.responsive thead, table.responsive tbody,
    table.responsive th, table.responsive tr {
        display: block;
        width: 100%;
    }
    table.responsive thead { display: none; }
    table.responsive tr {
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 4px 12px;
        margin-bottom: 10px;
    }
    table.responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid #f3f4f6;
        padding: 8px 0;
        text-align: right;
    }
    table.responsive td:last-child { border-bottom: none; }
    table.responsive td:empty { display: none; }
    table.responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: .78rem;
        flex-shrink: 0;
        text-align: left;
    }
    table.responsive td form { margin: 0; width: 100%; }
}
