/* ============================================
   Redibor Properties — Mobile Responsiveness
   Loaded AFTER style.css, so these rules only kick in on
   screens under 768px (phones and small tablets) and never
   touch how the site looks on a desktop/laptop.
   ============================================ */

* {
    box-sizing: border-box;
}

@media (max-width: 768px) {

    /* Logged-in dashboard: the sidebar becomes a horizontal scrolling
       strip across the top instead of eating half the phone screen */
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100% !important;
        height: auto !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px !important;
    }

    .sidebar h2 {
        display: none; /* saves space on a phone screen */
    }

    .sidebar ul {
        display: flex;
        gap: 4px;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .sidebar li {
        display: inline-block;
        white-space: nowrap;
    }

    .sidebar li a {
        display: inline-block;
        padding: 6px 10px;
        font-size: 0.85em;
    }

    .main-content {
        width: 100% !important;
        padding: 15px !important;
    }

    /* Logged-out public header: let the nav links wrap onto a second
       line instead of overflowing off the right edge of the screen */
    div[style*="justify-content: space-between"] {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    /* Any table on the site: scroll sideways instead of squeezing
       columns unreadably or breaking the page layout */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        max-width: 100%;
    }

    /* Dashboard stat cards: 2 per row instead of a tight fixed grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Property/listing cards use a fixed pixel width on desktop so they
       sit neatly side by side — on mobile let each one take the full
       width instead of forcing the whole page to scroll sideways */
    [style*="width: 280px"],
    [style*="width:280px"],
    [style*="width: 300px"],
    [style*="width:300px"] {
        width: 100% !important;
        max-width: 360px;
    }

    img, video, iframe {
        max-width: 100%;
        height: auto;
    }

    /* Form fields: fill the available width instead of the tiny
       default input size, so they're actually usable with a thumb */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="url"],
    input[type="date"],
    input[type="time"],
    input[type="password"],
    input[type="file"],
    select,
    textarea {
        width: 100%;
        max-width: 100%;
    }

}

@media (max-width: 480px) {

    /* Very small phones: drop stat cards to one per row */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

}