/*
 * GG Private Google Sheets Tables 1.3.0
 * Agent Login responsive presentation.
 */

.gg-sheet-browser {
    --ggs-bg: #ffffff;
    --ggs-soft: #f5f7fa;
    --ggs-border: #dfe5ec;
    --ggs-text: #202833;
    --ggs-muted: #758294;
    --ggs-accent: #315d91;
    width: 100%;
    color: var(--ggs-text);
    font: inherit;
}

.ggap-portal-preview .gg-sheet-browser,
.ggal-manager-mode .gg-sheet-browser {
    --ggs-bg: var(--ggap-card, #ffffff);
    --ggs-border: var(--ggap-border, #dfe5ec);
    --ggs-text: var(--ggap-text, #202833);
    --ggs-muted: var(--ggap-muted, #758294);
    --ggs-accent: var(--ggap-link, #315d91);
}

.gg-sheet-browser *,
.gg-sheet-browser *::before,
.gg-sheet-browser *::after {
    box-sizing: border-box;
}

.gg-sheet-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--ggs-border);
    border-radius: 14px;
    background: var(--ggs-bg);
    box-shadow: 0 5px 18px rgba(32, 40, 51, .04);
    -webkit-overflow-scrolling: touch;
}

.gg-sheet-table {
    width: 100%;
    min-width: 780px;
    margin: 0;
    border: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    color: var(--ggs-text);
    font: inherit;
}

.gg-sheet-table th,
.gg-sheet-table td {
    border: 0 !important;
    border-right: 1px solid var(--ggs-border) !important;
    border-bottom: 1px solid var(--ggs-border) !important;
    padding: 11px 12px;
    vertical-align: middle;
    text-align: left;
}

.gg-sheet-table th:last-child,
.gg-sheet-table td:last-child {
    border-right: 0 !important;
}

.gg-sheet-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

.gg-sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ggs-soft);
    color: #526071;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
}

.gg-sheet-table tbody tr {
    background: var(--ggs-bg);
    transition: background .13s ease;
}

.gg-sheet-table tbody tr:hover {
    background: #fafbfd;
}

.gg-sheet-table td {
    color: var(--ggs-text);
    font-size: 13px;
    line-height: 1.4;
}

.gg-sheet-cell--address {
    min-width: 220px;
    font-weight: 700;
}

.gg-sheet-cell--agent {
    min-width: 92px;
    font-weight: 700;
}

.gg-sheet-cell--projected-list-date {
    min-width: 135px;
}

.gg-sheet-cell--notes {
    min-width: 150px;
}

.gg-sheet-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef3f8;
    color: #44576d;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.gg-sheet-value--empty {
    color: #b3bdc8;
}

.gg-sheet-empty {
    display: flex;
    min-height: 160px;
    padding: 28px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px dashed var(--ggs-border);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
    text-align: center;
}

.gg-sheet-empty strong {
    color: var(--ggs-text);
    font-size: 15px;
}

.gg-sheet-empty span {
    color: var(--ggs-muted);
    font-size: 13px;
}


/* Explicit responsive modes. The mobile view uses dedicated card markup,
   so it can never inherit table widths or horizontal overflow from a theme. */
.gg-sheet-mobile {
    display: none;
}

@media (max-width: 760px) {
    .gg-sheet-browser {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .gg-sheet-desktop {
        display: none !important;
    }

    .gg-sheet-mobile {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        gap: 12px;
    }

    .gg-sheet-card {
        width: 100%;
        min-width: 0;
        overflow: hidden;
        border: 1px solid var(--ggs-border);
        border-radius: 14px;
        background: var(--ggs-bg);
        box-shadow: 0 4px 14px rgba(32,40,51,.035);
    }

    .gg-sheet-card-head {
        display: flex;
        min-width: 0;
        gap: 10px;
        align-items: flex-start;
        justify-content: space-between;
        padding: 14px 14px 12px;
        background: #fafbfd;
        border-bottom: 1px solid var(--ggs-border);
    }

    .gg-sheet-card-title {
        min-width: 0;
        flex: 1 1 auto;
        color: var(--ggs-text);
        font-size: 16px;
        font-weight: 800;
        line-height: 1.3;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .gg-sheet-card-head .gg-sheet-status {
        flex: 0 0 auto;
        max-width: 42%;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }

    .gg-sheet-card-agent {
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        border-bottom: 1px solid var(--ggs-border);
    }

    .gg-sheet-card-agent span,
    .gg-sheet-card-field span {
        color: var(--ggs-muted);
        font-size: 10px;
        font-weight: 800;
        line-height: 1.25;
        letter-spacing: .055em;
        text-transform: uppercase;
    }

    .gg-sheet-card-agent strong {
        min-width: 0;
        color: var(--ggs-text);
        font-size: 13px;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .gg-sheet-card-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
    }

    .gg-sheet-card-field {
        min-width: 0;
        padding: 11px 14px;
        border-bottom: 1px solid var(--ggs-border);
    }

    .gg-sheet-card-field:nth-child(odd):not(.is-wide) {
        border-right: 1px solid var(--ggs-border);
    }

    .gg-sheet-card-field.is-wide {
        grid-column: 1 / -1;
    }

    .gg-sheet-card-field strong {
        display: block;
        margin-top: 4px;
        color: var(--ggs-text);
        font-size: 13px;
        font-weight: 700;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 390px) {
    .gg-sheet-card-grid {
        grid-template-columns: 1fr;
    }

    .gg-sheet-card-field:nth-child(odd):not(.is-wide) {
        border-right: 0;
    }

    .gg-sheet-card-field.is-wide {
        grid-column: auto;
    }
}


/* v1.3.2 status pills */
.gg-sheet-status {
    border: 1px solid transparent;
}
.gg-sheet-status--withheld {
    background: #e7f2fb;
    border-color: #c5def0;
    color: #245b85;
}
.gg-sheet-status--relist {
    background: #e8f6ec;
    border-color: #c9e7d1;
    color: #27633a;
}
.gg-sheet-status--pre-appointment {
    background: #fff1dc;
    border-color: #f4d5a5;
    color: #8a4b0d;
}
.gg-sheet-status--on-hold {
    background: #fde7e7;
    border-color: #f0c3c3;
    color: #9e2f2f;
}
.gg-sheet-status--sold {
    background: #cf3f3f;
    border-color: #cf3f3f;
    color: #fff;
}
.gg-sheet-status--coming-soon {
    background: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}
.gg-sheet-status--upcoming {
    background: #efe7fb;
    border-color: #dccbf5;
    color: #68439b;
}
.gg-sheet-status--appointment-set {
    background: #e3f1ff;
    border-color: #bddbf6;
    color: #205d8f;
}
