/* Legacy Windows Property Management UI */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    background: #808080;
    color: #000;
    overflow: hidden;
    height: 100vh;
}

.app-window {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
}

/* Title bar area with address */
.title-bar {
    background: linear-gradient(to right, #0a246a, #3a6ea5);
    color: #fff;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    min-height: 28px;
}

.title-bar .address {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left sidebar - PROPERTY MANAGED */
.sidebar-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: #404040;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 2px;
    padding: 12px 6px;
    text-align: center;
    width: 28px;
    flex-shrink: 0;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #c0c0c0;
}

.dashboard-main .content-area-full {
    width: 100%;
}

.dashboard-search {
    margin-bottom: 8px;
    padding: 0 4px;
}

/* Tabs */
.tab-bar {
    display: flex;
    background: #c0c0c0;
    padding: 4px 4px 0 4px;
    gap: 1px;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid #808080;
}

.tab {
    padding: 4px 10px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    text-decoration: none;
    color: #000;
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    top: 1px;
}

.tab:hover {
    background: #d4d4d4;
}

.tab.active {
    background: #c0c0c0;
    border-bottom-color: #c0c0c0;
    font-weight: bold;
    top: 0;
    z-index: 1;
}

.tab-content {
    flex: 1;
    overflow: auto;
    padding: 8px;
    background: #c0c0c0;
}

/* Form elements - Windows classic */
fieldset {
    border: 1px groove #fff;
    padding: 8px;
    margin-bottom: 8px;
    background: #c0c0c0;
}

legend {
    padding: 0 4px;
    font-weight: bold;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    gap: 4px;
}

.form-row label {
    min-width: 130px;
    text-align: right;
    padding-right: 6px;
}

.form-row label.wide {
    min-width: 160px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="tel"],
select,
textarea {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 2px 4px;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #fff;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select {
    height: 22px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 1px dotted #000;
}

input[type="checkbox"] {
    width: 13px;
    height: 13px;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.field-sm { width: 80px; }
.field-md { width: 120px; }
.field-lg { width: 180px; }
.field-xl { width: 260px; }
.field-full { flex: 1; width: 100%; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.section-header {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 6px;
    padding: 2px 4px;
    background: #000080;
    color: #fff;
}

.deposit-section {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.deposit-label-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: #808080;
    color: #fff;
    font-weight: bold;
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
}

.panel-box {
    border: 2px groove #fff;
    padding: 8px;
    background: #c0c0c0;
}

.panel-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 12px;
}

/* Data grid / table */
.data-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 11px;
}

.data-grid th {
    background: #c0c0c0;
    border: 1px solid #808080;
    padding: 3px 6px;
    text-align: left;
    font-weight: normal;
}

.data-grid td {
    border: 1px solid #c0c0c0;
    padding: 2px 4px;
    background: #fff;
}

.data-grid tr:hover td {
    background: #000080;
    color: #fff;
}

.data-grid input,
.data-grid select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 11px;
    padding: 1px 2px;
}

.data-grid tr:hover input,
.data-grid tr:hover select {
    color: #fff;
}

.data-grid .actions-cell {
    width: 60px;
    text-align: center;
}

.grid-toolbar {
    margin-bottom: 4px;
}

/* CRUD toolbar on every tab */
.crud-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
    padding: 6px;
    background: #d4d4d4;
    border: 2px groove #fff;
}

.crud-btn {
    padding: 3px 10px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    text-decoration: none;
    color: #000;
    font-size: 11px;
    cursor: pointer;
}

.crud-btn:hover {
    background: #d4d4d4;
}

.crud-btn.active {
    background: #000080;
    color: #fff;
    font-weight: bold;
}

.crud-btn-disabled {
    opacity: 0.5;
    cursor: default;
}

.crud-btn-danger {
    border-color: #ffcccc #800000 #800000 #ffcccc;
}

.detail-panel {
    background: #fff;
    border: 2px groove #808080;
    padding: 10px;
    max-width: 900px;
}

.detail-row {
    display: flex;
    padding: 4px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-label {
    min-width: 160px;
    font-weight: bold;
    color: #404040;
}

.detail-value {
    flex: 1;
}

.list-empty {
    padding: 12px;
    background: #fff;
    border: 1px solid #808080;
}

.nowrap {
    white-space: nowrap;
}

.btn-danger {
    color: #800000;
}

.data-grid tr.list-row-clickable {
    cursor: pointer;
}

/* Buttons - Windows classic */
.btn-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #c0c0c0;
    border-top: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
}

button,
.btn {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 3px 12px;
    min-width: 70px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    cursor: pointer;
    color: #000;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:active,
.btn:active {
    border-color: #404040 #dfdfdf #dfdfdf #404040;
}

button:hover,
.btn:hover {
    background: #d4d4d4;
}

.btn-sm {
    min-width: 40px;
    padding: 2px 8px;
}

.btn-nav {
    min-width: 30px;
    padding: 3px 8px;
}

.spacer {
    flex: 1;
}

.status-bar {
    background: #c0c0c0;
    border-top: 1px solid #808080;
    padding: 2px 8px;
    font-size: 10px;
    display: flex;
    justify-content: space-between;
    color: #404040;
}

.alert {
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    background: #ffffcc;
}

.alert-success {
    background: #ccffcc;
}

.alert-error {
    background: #ffcccc;
}

/* Find dialog / index page */
.find-page {
    max-width: 900px;
    margin: 20px auto;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    padding: 0;
}

.find-page .title-bar {
    margin: 0;
}

.find-body {
    padding: 16px;
}

.find-results table {
    width: 100%;
    margin-top: 12px;
}

.find-results tr {
    cursor: pointer;
}

.find-results tr:hover td {
    background: #000080;
    color: #fff;
}

.setup-page {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
}

.setup-page h1 {
    font-size: 14px;
    margin-bottom: 12px;
}

.setup-page ol {
    margin: 12px 0 12px 20px;
}

.setup-page li {
    margin-bottom: 6px;
}

.history-item {
    border-bottom: 1px solid #808080;
    padding: 6px 0;
}

.history-item .time {
    color: #404040;
    font-size: 10px;
}

.history-item .action {
    font-weight: bold;
}

.inline-form {
    display: inline;
}

.readonly-field {
    background: #e8e8e8 !important;
}

@media (max-width: 900px) {
    .two-col, .three-col, .deposit-section {
        grid-template-columns: 1fr;
    }
}

/* Login landing page */
.login-body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
    background: linear-gradient(135deg, #606060 0%, #808080 40%, #404040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-page {
    width: 100%;
    max-width: 480px;
}

.login-window {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
}

.login-title-bar {
    justify-content: center;
}

.login-content {
    padding: 24px 28px 20px;
    text-align: center;
}

.login-brand {
    margin-bottom: 20px;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    display: block;
    border: 2px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 8px;
}

.login-logo-wide {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 90px;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.login-logo-fallback {
    font-size: 16px;
    font-weight: bold;
    color: #0a246a;
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    border: 2px groove #808080;
}

.login-brand h1 {
    font-size: 18px;
    font-weight: bold;
    color: #0a246a;
    margin-bottom: 4px;
}

.login-tagline {
    font-size: 11px;
    color: #404040;
    letter-spacing: 0.5px;
}

.login-form {
    text-align: left;
    margin-top: 8px;
}

.login-field {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 12px;
}

.login-field label {
    text-align: left;
    min-width: auto;
    margin-bottom: 4px;
    font-weight: bold;
}

.login-field input {
    width: 100%;
}

.login-actions {
    text-align: center;
    margin-top: 16px;
}

.login-btn {
    min-width: 140px;
    padding: 6px 24px;
    font-size: 12px;
    font-weight: bold;
}

.login-alert {
    text-align: left;
    margin-bottom: 12px;
}

.login-footer {
    margin-top: 16px;
    font-size: 10px;
    color: #606060;
}

.title-bar a {
    color: #fff;
    text-decoration: underline;
}

.title-bar a:hover {
    color: #d4e4ff;
}

.status-bar a {
    color: #0a246a;
}

@media (max-width: 480px) {
    .login-content {
        padding: 16px;
    }

    .login-logo {
        width: 96px;
        height: 96px;
    }
}
