/* BnB OS — Layout + Design System
   Brand: Türkis #1a616e, Gold #c39641, Creme #e1d9d2
*/

:root {
    --teal:        #1a616e;
    --teal-light:  #4f8c92;
    --gold:        #c39641;
    --cream:       #e1d9d2;
    --gray-50:     #f7f5f1;
    --gray-100:    #efeae3;
    --gray-300:    #cbc6bf;
    --gray-500:    #8a857e;
    --gray-700:    #4a4742;
    --gray-900:    #1f1d1a;
    --red:         #b8443f;
    --green:       #4f7d4a;

    --font-heading: 'Belleza', Georgia, serif;
    --font-body: 'Open Sans', system-ui, -apple-system, sans-serif;

    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.06);

    --sidebar-width: 230px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--gray-900);
    background: var(--gray-50);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--teal);
    margin: 0 0 0.5em;
    font-weight: 400;
    letter-spacing: 0.5px;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--gold); }
a.disabled { color: var(--gray-300); pointer-events: none; }

.muted { color: var(--gray-500); font-size: 0.9em; }

.error {
    color: var(--red);
    background: #fff1f0;
    border: 1px solid #f3c5c1;
    border-radius: var(--radius);
    padding: 0.6em 0.9em;
    margin: 0.8em 0;
    font-size: 0.92em;
}

.badge {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    font-size: 0.78em;
    background: var(--gray-100);
    color: var(--gray-700);
}
.badge-warn { background: #fff4e1; color: #885000; }

/* --- Buttons --- */
.btn-primary, .btn-secondary, .btn-sm, .btn-link, button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
    padding: 0.7em 1.4em;
    font-size: 0.95em;
    transition: all 0.15s ease;
}
.btn-primary {
    background: var(--teal);
    color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--gold); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
    background: transparent;
    color: var(--teal);
    border: 1px solid var(--teal);
}
.btn-secondary:hover { background: var(--teal); color: white; }
.btn-sm { padding: 0.4em 0.9em; font-size: 0.85em; }
.btn-link {
    background: none;
    color: var(--gray-500);
    padding: 0;
    text-decoration: underline;
}
.btn-link:hover { color: var(--gold); }

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    border-right: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    z-index: 10;
}
.sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.sidebar-brand a {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--teal);
    letter-spacing: 0.5px;
}
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    flex: 1;
    overflow-y: auto;
}
.sidebar-nav li {
    margin: 0.1rem 0;
}
.sidebar-nav a {
    display: block;
    padding: 0.55rem 1.5rem;
    color: var(--gray-700);
    border-left: 3px solid transparent;
    transition: all 0.12s ease;
}
.sidebar-nav a:hover { background: var(--cream); color: var(--teal); }
.sidebar-nav a.active {
    background: var(--cream);
    color: var(--teal);
    border-left-color: var(--gold);
    font-weight: 600;
}
.sidebar-section {
    padding: 1rem 1.5rem 0.3rem;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 1px;
    color: var(--gray-500);
}
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.user-chip {
    display: flex;
    flex-direction: column;
}
.user-name { font-weight: 600; }
.user-role { font-size: 0.78em; color: var(--gray-500); text-transform: capitalize; }

/* --- Main --- */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
main.with-sidebar {
    margin-left: var(--sidebar-width);
    max-width: none;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-head h1 { margin: 0; }

/* --- Cards --- */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.card-head h2 { margin: 0; }

/* --- KPI Grid --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.kpi-card {
    background: white;
    padding: 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.kpi-label {
    color: var(--gray-500);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--teal);
}
.kpi-hint {
    color: var(--gold);
    font-size: 0.75em;
}
.kpi-soon .kpi-value { color: var(--gray-300); }

/* --- Property Grid --- */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.property-card {
    display: block;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    color: inherit;
    transition: all 0.15s ease;
}
.property-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.property-cover {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: var(--cream);
}
.property-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--teal-light);
    background: linear-gradient(135deg, var(--cream), var(--gray-100));
}
.property-body { padding: 1rem 1.2rem; }
.property-body h3 { margin: 0 0 0.3rem; color: var(--gray-900); font-family: var(--font-body); font-weight: 600; }
.property-meta { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* --- Lists --- */
.property-list, .unit-list, .rule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.property-list li, .unit-list li, .rule-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.property-list li:last-child, .unit-list li:last-child, .rule-list li:last-child {
    border-bottom: none;
}
.property-list a { display: flex; justify-content: space-between; gap: 1rem; }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.tag {
    padding: 0.3rem 0.8rem;
    background: var(--cream);
    border-radius: 999px;
    font-size: 0.85em;
    color: var(--teal);
}

/* --- Definition list --- */
.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1.5rem;
    margin: 0;
}
.kv dt { color: var(--gray-500); }
.kv dd { margin: 0; }

/* --- Forms --- */
.form-card {
    max-width: 720px;
}
.form-card fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem;
}
.form-card legend {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--teal);
    padding: 0;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--gray-100);
    width: 100%;
    padding-bottom: 0.3rem;
}
label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--gray-700);
    font-size: 0.9em;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="time"], textarea, select {
    display: block;
    width: 100%;
    padding: 0.55rem 0.8rem;
    margin-top: 0.3rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
    color: var(--gray-900);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 97, 110, 0.12);
}
.form-row {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
}
.form-row label { flex: 1; }
.form-row .grow { flex: 2; }
.form-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 1rem;
    border-top: 1px solid var(--gray-100);
    padding-top: 1rem;
}

/* --- Login --- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cream), var(--gray-100));
    padding: 1rem;
}
.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 380px;
    width: 100%;
}
.login-card .brand {
    text-align: center;
    margin-bottom: 0.2rem;
}
.login-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 2rem;
}
.login-card form button { width: 100%; margin-top: 0.5rem; }

/* --- Modal --- */
.modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
}
.modal::backdrop {
    background: rgba(0,0,0,0.4);
}
.modal form { padding: 1.5rem; }
.modal h3 { margin-top: 0; }
.modal menu {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin: 1.5rem 0 0;
    padding: 0;
}

/* --- Empty state --- */
.empty-state {
    background: white;
    padding: 3rem 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}
.empty-state h2 { color: var(--gray-700); }

/* --- Mobile --- */
@media (max-width: 720px) {
    main.with-sidebar {
        margin-left: 0;
        padding-top: 4rem;
    }
    .sidebar {
        width: 100%;
        height: 56px;
        flex-direction: row;
        padding: 0 1rem;
        align-items: center;
        overflow-x: auto;
    }
    .sidebar-brand { padding: 0; border: none; }
    .sidebar-nav { display: flex; margin: 0 0 0 1rem; flex: 1; gap: 0.3rem; }
    .sidebar-nav li { margin: 0; }
    .sidebar-nav a { padding: 0.3rem 0.7rem; border-left: none; border-bottom: 2px solid transparent; }
    .sidebar-nav a.active { border-left: none; border-bottom-color: var(--gold); }
    .sidebar-section, .sidebar-nav .disabled { display: none; }
    .sidebar-footer { display: none; }
}
