* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.navbar {
    background: #2c3e50;
    color: white;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
}

.nav-left > a,
.dropdown-trigger {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
}

.nav-left > a:hover,
.dropdown-trigger:hover {
    background: #1a252f;
}

.nav-tenant {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-right: 1rem;
}

.nav-right {
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    min-width: 150px;
    z-index: 1000;
}

.dropdown-right {
    left: auto;
    right: 0;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

.dropdown-divider {
    height: 1px;
    background: #ddd;
    margin: 0.5rem 0;
}



.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.login-container {
    max-width: 400px;
    margin: 4rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid #2c3e50;
    background: #2c3e50;
    color: white;
}

.btn:hover {
    background: #34495e;
}

.btn-cancel {
    background: white;
    color: #2c3e50;
    border: 2px solid #2c3e50;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.error {
    background: #fee;
    color: #c00;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.messages {
    margin-bottom: 1rem;
}

.message {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.message.success {
    background: #efe;
    color: #060;
}

.message.error {
    background: #fee;
    color: #c00;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table-wide {
    min-width: 1100px;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #2c3e50;
    color: white;
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

.data-table input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.data-table .btn-cancel {
    padding: 0.5rem 0.75rem;
    line-height: 1;
}

.list-controls {
    margin-bottom: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-group {
    display: flex;
    gap: 0.5rem;
}

.search-group input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.data-table th a {
    color: white;
    text-decoration: none;
}

.data-table th a:hover {
    text-decoration: underline;
}

.inactive-row {
    color: #c00;
}

.sort-arrow {
    display: inline-block;
    width: 1em;
}

.sort-arrow.hidden {
    visibility: hidden;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #e8f4fc;
}

.inactive-row.clickable-row:hover {
    background: #fce8e8;
}

.form-container {
    max-width: 1000px;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group.full-width {
    flex: 0 0 100%;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-group {
    position: relative;
}

.form-value {
    padding: 0.75rem;
    background: #f5f5f5;
    border-radius: 4px;
    margin: 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: normal;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: normal;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: normal;
    background: white;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: normal;
}

.input-with-prefix,
.input-with-suffix {
    display: flex;
    align-items: stretch;
}

.input-prefix,
.input-suffix {
    background: #e9ecef;
    border: 1px solid #ddd;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    color: #666;
}

.input-prefix {
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.input-suffix {
    border-left: none;
    border-radius: 0 4px 4px 0;
}

.input-with-prefix input,
.input-with-suffix input {
    border-radius: 0;
}

.input-with-prefix input {
    border-radius: 0 4px 4px 0;
}

.input-with-suffix input {
    border-radius: 4px 0 0 4px;
}


.form-hint {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.form-value-changed {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.related-section {
    margin-top: 2rem;
}

.related-section h2 {
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    vertical-align: middle;
    position: relative;
    top: -4px;
}

.dropdown-divider {
    height: 1px;
    background: #ddd;
    margin: 0.5rem 0;
}

.autocomplete-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.autocomplete-results {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
}

.autocomplete-item:hover {
    background: #f5f5f5;
}

.cost-increase {
    color: #dc3545;
}

.cost-decrease {
    color: #28a745;
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
}

.form-row-3 {
    display: flex;
    gap: 1.5rem;
}

.form-row-3 .form-group {
    flex: 1;
}

.form-row-4 {
    display: flex;
    gap: 1rem;
}

.form-row-4 .form-group {
    flex: 1;
}

.form-row-6 {
    display: flex;
    gap: 1rem;
}

.form-row-6 .form-group {
    flex: 1;
}

.calc-field {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    width: 100%;
    font-size: 1rem;
    font-weight: normal;
}

.calc-field-right {
    text-align: right;
}

.text-right {
    text-align: right;
}












/* Mobile responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 0.5rem;
    }
    
    .nav-left {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .nav-brand {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .nav-tenant {
        display: none;
    }
    
    .nav-right {
        margin-top: 0.5rem;
    }
    
    .form-container {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .list-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-group {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .search-group input[type="text"] {
        width: 100%;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}




/* Mobile responsive - iPhone Pro Max portrait */
@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 0.5rem;
    }
    
    .nav-left {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .nav-brand {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .nav-tenant {
        display: none;
    }
    
    .nav-right {
        margin-top: 0.5rem;
    }
    
    .form-container {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .list-controls .filter-form {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .search-group {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .search-group input[type="text"] {
        width: 100%;
    }
    
    .search-group .btn {
        width: 100%;
    }
    
    .filter-form > .btn {
        width: 100%;
    }
    
    .data-table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.4rem;
        white-space: nowrap;
    }
    
    h1 {
        font-size: 1.5rem;
        margin: 0.5rem 0;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
}