* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: min(1400px, calc(100vw - 40px));
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    color: #666;
    margin-bottom: 0;
    font-size: 0.95em;
}

.hogia-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hogia-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hogia-nav-btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    color: white;
    background: #0f766e;
}

.hogia-nav-btn:hover {
    background: #0d9488;
    color: white;
}

.hogia-nav-btn--muted {
    background: #6c757d;
}

.hogia-nav-btn--muted:hover {
    background: #5a6268;
}

.hogia-nav-btn--danger {
    background: #dc3545;
}

.hogia-nav-btn--danger:hover {
    background: #c82333;
}

.hogia-nav-btn--small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.form-banner {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 0.95em;
}

.form-banner--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-banner--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.section-title {
    color: #333;
    font-size: 1.35em;
    margin-bottom: 8px;
}

.section-hint {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 16px;
    line-height: 1.45;
}

.companies-section {
    background: #f8f9fa;
    padding: 22px;
    border-radius: 8px;
    margin-bottom: 28px;
    border: 1px solid #e9ecef;
}

.add-company-form {
    background: white;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 560px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9em;
    color: #495057;
}

.form-field input {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.form-field input:focus {
    outline: none;
    border-color: #0f766e;
}

.form-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.add-company-submit {
    margin-top: 6px;
    padding: 11px 16px;
    background: #0f766e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.add-company-submit:hover {
    background: #0d9488;
}

.buildings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.buildings-table th {
    background: #0f766e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.buildings-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.buildings-table tr:hover {
    background: #f8f9fa;
}

.mono {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #0f766e;
    word-break: break-all;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.xml-link {
    color: #0f766e;
    text-decoration: none;
    font-weight: 500;
}

.xml-link:hover {
    text-decoration: underline;
}

.panel {
    margin-top: 28px;
    padding-top: 8px;
}

.apartment-list {
    margin-top: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
}

.apartment-list table {
    width: 100%;
    border-collapse: collapse;
}

.apartment-list th,
.apartment-list td {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    font-size: 0.92em;
}

.apartment-list th {
    background: #e2e8f0;
    color: #334155;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
}

.badge--active {
    background: #d1fae5;
    color: #065f46;
}

.badge--inactive {
    background: #fee2e2;
    color: #991b1b;
}

.inline-form {
    display: inline;
}
