
/* Theme colors
   --primary: #23415f
   --accent:  #196d14
   --highlight: #ce140e  (original was '#ce14oe' — invalid hex, adjusted to '#ce140e')
   --gold:    #c19547
*/

:root{
    --primary: #23415f;
    --accent: #196d14;
    --highlight: #ce140e;
    --gold: #c19547;

    --bg: #f3f6f8;
    --card-bg: #ffffff;
    --muted: #6b7a86;
    --radius: 10px;
    --max-width: 420px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, rgba(35,65,95,0.06) 0%, rgba(33,33,33,0) 100%), var(--bg);
    color: #122028;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    padding:32px;
    display:flex;
    align-items:center;
    justify-content:center;
}

/* Page container */
.container{
    width:100%;
    max-width:var(--max-width);
    /* offset for fixed header (default) */
    margin:64px auto 24px;
}

/* Header */
header{
    /* Fixed header that starts after the left sidebar */
    position:fixed;
    left:0; /* default: full-width header */
    right:0;
    top:0;
    display:flex;
    align-items:center;
    gap:12px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    color:white;
    padding:12px 16px;
    height:64px;
    border-radius: calc(var(--radius) - 4px);
    box-shadow: 0 6px 18px rgba(15, 31, 45, 0.08);
    margin:0;
    z-index:70;
}
header img{height:50px; width:auto; display:block}
.header-text h1{
    font-size:18px;
    line-height:1;
    margin-bottom:4px;
}
.header-text p{
    font-size:12px;
    opacity:0.92;
    margin:0;
}

/* Header action area (right side) */
.header-actions{ margin-left:auto; display:flex; gap:8px; align-items:center; }

/* Buttons inside the header need to be visible on dark background */
header .btn{ background: rgba(255,255,255,0.12); color: #fff; border: none; }
header .btn-ghost{ background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.12); }

/* Hamburger button visible on small screens */
.hamburger{
    display:none;
    background:transparent;
    border:none;
    color:#fff;
    font-size:20px;
    padding:6px 10px;
    border-radius:6px;
    cursor:pointer;
}
.hamburger:focus{ outline:none; box-shadow:0 0 0 3px rgba(255,255,255,0.06); }

/* Backdrop for mobile sidebar */
.sidebar-backdrop{
    display:none;
    position:fixed;
    left:0; top:0; right:0; bottom:0;
    background: rgba(0,0,0,0.4);
    z-index:55;
}
.sidebar-backdrop.visible{ display:block; }

/* Card / form area */
.card{
    background:var(--card-bg);
    border-radius:var(--radius);
    padding:28px;
    box-shadow:0 10px 30px rgba(22,40,60,0.08);
    border-top:4px solid var(--accent);
}

/* Table styles for dashboard/owners list */
.owners-table{
    width:100%;
    border-collapse:collapse;
    margin-top:8px;
}
.owners-table thead th{
    text-align:left;
    padding:10px 12px;
    font-size:13px;
    color:var(--muted);
    border-bottom:1px solid #eef2f4;
}
.owners-table tbody td{
    padding:12px;
    vertical-align:middle;
    border-bottom:1px solid #f2f5f7;
    font-size:14px;
}
.owners-table tbody tr:last-child td{ border-bottom: none; }

/* Small action/link styles */
.link{ margin-right:10px; color:var(--primary); text-decoration:none; font-weight:600 }
.link:hover{ color:var(--accent); text-decoration:underline }
.link-danger{ color:#b82a2a }

/* Simple button styles used on dashboard actions */
.btn{
    display:inline-block;
    padding:8px 12px;
    background: linear-gradient(180deg, var(--accent), #0f5b11);
    color:#fff;
    border-radius:8px;
    text-decoration:none;
    font-weight:600;
}
.btn-cancel{
    display:inline-block;
    padding:8px 12px;
    background: #d72d4d;
    color:#fff;
    border-radius:8px;
    text-decoration:none;
    font-weight:600;
}
.btn-ghost{ background:transparent; color:var(--primary); border:1px solid rgba(35,65,95,0.06); }

/* Dashboard layout: sidebar + main */
.dashboard{ display:flex; gap:20px; align-items:flex-start; }
/* Make the sidebar fixed to the left edge of the viewport, full height */
.sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:250px;
    min-width:200px;
    padding:28px;
    z-index:60;
    box-shadow: 2px 0 12px rgba(15,31,45,0.06);
    background:var(--card-bg);
}
.sidebar .nav-link{ display:block; padding:10px 12px; color:var(--primary); text-decoration:none; border-radius:8px; }
.sidebar .nav-link:hover{ background: rgba(35,65,95,0.04); color:var(--accent); }

.sidebar .nav-link.active{ background: linear-gradient(90deg, rgba(35,65,95,0.06), rgba(193,149,71,0.03)); color: var(--accent); font-weight:700; }

.main{ flex:1; }

/* Summary cards */
.summary-grid{ display:grid; grid-template-columns: repeat(5, 1fr); gap:12px; }
.summary-card{ background:linear-gradient(180deg,#fff,#fbfdfe); border-radius:10px; padding:12px; box-shadow:0 6px 18px rgba(15,31,45,0.04); text-align:center; }
.summary-value{ font-size:20px; font-weight:700; color:var(--primary); }
.summary-label{ font-size:13px; color:var(--muted); margin-top:6px }

/* Responsive: stack sidebar under 880px */
@media (max-width: 880px){
    .dashboard{ flex-direction:column; }
    .summary-grid{ grid-template-columns: repeat(2, 1fr); }
    /* On small screens, keep sidebar off-canvas and toggleable */
    .sidebar{ width:250px; position:fixed; left:0; top:0; bottom:0; transform:translateX(-110%); transition:transform .28s ease; box-shadow: 2px 0 12px rgba(15,31,45,0.06); }
    body.sidebar-open .sidebar{ transform:translateX(0); }
    /* Reset dashboard-container positioning on small screens */
    .dashboard-container{ position:static; top:auto; left:auto; right:auto; bottom:auto; padding:0 12px; display:block; }
    /* show backdrop when sidebar open */
    .sidebar-backdrop{ display:none; }
    .sidebar-backdrop.visible{ display:block; }
    header{ position:static; left:auto; right:auto; top:auto; border-radius:calc(var(--radius) - 4px); z-index:50; }
    .dashboard-container{ margin-top:18px; }
    .hamburger{ display:inline-block; }
    /* header actions should remain right aligned on small screens */
    .header-actions{ margin-left:auto; }
}

@media (max-width: 520px){
    .summary-grid{ grid-template-columns: 1fr; }
}

/* Headings */
h2{
    font-size:20px;
    margin-bottom:12px;
    color:var(--primary);
}

/* Form */
form{display:block}
label{
    display:block;
    font-size:13px;
    color:var(--muted);
    margin-bottom:8px;
}
input[type="email"],
input[type="password"],
input[type="text"]{
    width:100%;
    padding:10px 12px;
    border:1px solid #e4e8ea;
    border-radius:8px;
    font-size:14px;
    margin-bottom:14px;
    transition:box-shadow .12s, border-color .12s;
    background:#fff;
}
input:focus{
    outline:none;
    border-color:var(--highlight);
    box-shadow:0 4px 18px rgba(205,20,14,0.08);
}

/* Button */
button[type="submit"]{
    width:70%;
    background: linear-gradient(180deg, var(--accent), #0f5b11);
    color:white;
    border:none;
    padding:12px 14px;
    font-weight:600;
    border-radius:8px;
    cursor:pointer;
    box-shadow: 0 8px 20px rgba(25,109,20,0.14);
    transition:transform .08s ease, box-shadow .12s;
}
button[type="submit"]:hover{ transform:translateY(-2px); }
button[type="submit"]:active{ transform:translateY(0); box-shadow:0 4px 10px rgba(25,109,20,0.12); }

/* Links and footer text */
p{ font-size:14px; color:var(--muted); margin-top:12px; text-align:center;}
a{ color:var(--primary); text-decoration:none; font-weight:600; }
a:hover{ color:var(--accent); text-decoration:underline; }


/* Utility */
.text-error{ color:#b82a2a; font-size:13px; margin-top:8px; display:none; }
/* Alert messages (server-side feedback) */
.alert{
    width:100%;
    padding:10px 12px;
    border-radius:8px;
    margin-bottom:14px;
    font-size:14px;
    text-align:center;
}
.alert-success{
    background: linear-gradient(180deg, rgba(25,109,20,0.08), rgba(25,109,20,0.04));
    color: #114d10;
    border: 1px solid rgba(25,109,20,0.12);
}
.alert-error{
    background: linear-gradient(180deg, rgba(184,42,42,0.06), rgba(184,42,42,0.03));
    color: #7a1a1a;
    border: 1px solid rgba(184,42,42,0.12);
}
/* Modal (add owner) */
.modal{
    position:fixed;
    left:0;right:0;top:0;bottom:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,0.35);
    opacity:0;
    pointer-events:none;
    transition:opacity .18s ease;
    z-index:120;
}
.modal.open{ opacity:1; pointer-events:auto; }
.modal-content{ background:var(--card-bg); padding:18px; border-radius:10px; width:100%; max-width:520px; box-shadow:0 12px 40px rgba(15,31,45,0.12); }
.modal-close{ position:absolute; right:18px; top:18px; background:transparent; border:none; font-size:22px; cursor:pointer }
.modal label{ display:block; margin-bottom:10px }

/* Register form tweaks */
.card form label { display:block; margin-bottom:6px; color:var(--muted); }
.card form label input { margin-top:6px; }
.card .hint { font-size:13px; color:var(--muted); margin-top:8px; text-align:center }
/* ...existing code... */

/* Improved responsive rules */
@media (max-width: 900px) {
    :root {
        --max-width: 520px;
        --radius: 8px;
    }
    body {
        padding: 22px;
    }
    header {
        padding: 10px 12px;
    }
    .header-text h1 { font-size: 16px; }
    .header-text p { font-size: 11px; }
    h2 { font-size: 18px; }
    /* reduce top offset on small screens where header becomes static */
    .container { margin-top:18px; }
}

@media (max-width: 720px) {
    body {
        padding: 18px;
        align-items: flex-start;
    }
    .container {
        margin-top: 18px;
        padding: 0 4px;
    }
    header {
        flex-direction: row;
        gap: 10px;
        border-radius: calc(var(--radius) - 6px);
    }
    header img { height: 44px; }
    .card {
        padding: 20px;
        border-radius: calc(var(--radius) - 2px);
    }
    input[type="email"],
    input[type="password"] {
        padding: 10px;
        font-size: 14px;
    }
    button[type="submit"] {
        padding: 10px;
        font-size: 15px;
    }
}

/* Small phones */
@media (max-width: 520px) {
    :root {
        --max-width: 380px;
        --radius: 8px;
    }

    body {
        padding: 14px;
    }

    /* Stack header vertically to save horizontal space */
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        padding: 10px;
    }
    header img { height: 40px; }

    .container {
        width: 100%;
        max-width: var(--max-width);
        margin: 8px auto;
    }

    .card {
        padding: 16px;
        border-radius: var(--radius);
        box-shadow: 0 6px 20px rgba(22,40,60,0.06);
    }

    h2 { font-size: 17px; margin-bottom: 10px; }

    label { font-size: 13px; }

    input[type="email"],
    input[type="password"] {
        padding: 10px;
        font-size: 14px;
        margin-bottom: 12px;
    }

    button[type="submit"]{
        padding: 12px;
        font-size: 15px;
        border-radius: 8px;
    }

    /* Make the primary link and small text easier to tap */
    p{ font-size:14px; }
    a{ font-size:14px; }

    /* Optional: keep primary action visible on very small screens */
    .action-sticky {
        position: sticky;
        bottom: 12px;
        left: 0;
        right: 0;
        margin: 0 auto;
        width: calc(100% - 28px);
        max-width: var(--max-width);
        z-index: 60;
    }
}

/* Extra small landscape phones / small tablets */
@media (min-width: 521px) and (max-width: 880px) {
    .container { max-width: 480px; }
}

/* Accessibility: increase hit targets on touch devices */
@media (pointer: coarse) {
    input[type="email"],
    input[type="password"],
    button[type="submit"],
    a {
        -webkit-tap-highlight-color: rgba(0,0,0,0.06);
    }
}

/* Wider container for dashboard pages */
.dashboard-container{
    position:absolute;
    top:0px;
    left:260px;
    right:0;
    bottom:0;
    padding:24px;
    overflow:auto;
    /* layout: let children take full available width by default */
    display:block;
}

/* Make the inner .container inside dashboard use the full remaining width
   instead of the default max-width centered layout. This keeps login/register
   pages unaffected because the rule is scoped to .dashboard-container. */
.dashboard-container > .container{
    max-width: none;
    width: 100%;
    padding: 0;
}

.dashboard-container .main{ width:100%; }
.dashboard-container .card{ width:100%; max-width:none; }

/* When a page includes the sidebar, shift the header to start after the sidebar */
body.has-sidebar header{ left:250px; }
body.has-sidebar header{ border-radius:0 0 calc(var(--radius) - 4px) 0; }
.addncancel{
    margin-top:25px;
    display:flex;
    gap:5px;
}
/* Add to your styles.css */
.status.vacant { color: green; font-weight: bold; }
.status.occupied { color: #b74; font-weight: bold; }
.status.maintenance { color: #e7192a; font-weight: bold; }
select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 40px 10px 14px;        /* space for arrow */
    font-size: 15px;
    color: #1f2937;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
select:hover {
    border-color: #9ca3af;
}
/* If you wrap select in a label or div, make it look even better */
label select {
    margin-top: 6px;
}
label input {
    margin-top: 2px;
    border-radius: 8px;
    padding: 10px 40px 10px 14px;        /* space for arrow */
    font-size: 15px;
    color: #1f2937;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}
/* For smaller screens – make sure it doesn't get too cramped */
@media (max-width: 640px) {
    select {
        padding: 12px 40px 12px 14px;
        font-size: 16px; /* prevents zoom on iOS */
    }
}