/* ===============================
   RESET & BASE
================================*/

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Inter', sans-serif;
}

:root{
    --line:#e5e7eb;
    --line-strong:#cbd5e1;
    --shadow-md:0 3px 10px rgba(0,0,0,.06);
    --shadow-lg:0 18px 50px rgba(0,0,0,.22);

    --radius-panel:8px;
    --radius-inner:6px;

    --calendar-hour-col:60px;
    --calendar-day-col:128px;

    --lista-first-col:105px;
    --lista-col:110px;
}

body{
    background:#f4f6fb;
    display:flex;
    flex-direction:column;
    min-height:100vh;
    color:#111827;
}

/* ===============================
   LAYOUT GLOBAL
================================*/

.container{
    padding:10px;
    text-align:center;
    flex:1;
}

.app-shell{
    width:100%;
    max-width:none;
    margin:0 auto;
}

.calendar-wrap,
.lista-wrap{
    display:inline-block;
    text-align:left;
    max-width:100%;
}

/* ===============================
   TOPBAR
================================*/

.topbar{
    background:linear-gradient(135deg,#1f2937,#111827);
    color:white;
    padding:14px;
    display:flex;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    text-align:center;
    box-shadow:0 2px 10px rgba(0,0,0,.15);
}

.topbar h2{
    font-size:18px;
}

.topbar-controls{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:center;
    align-items:center;
}

/* sticky buttons apenas mobile */
#btnToggleCalendarSticky,
#btnToggleListaSticky{
    display:none;
    background:#0f172a;
    color:#fff;
    box-shadow:none;
}

#btnToggleCalendarSticky:hover,
#btnToggleListaSticky:hover{
    background:#1e293b;
    box-shadow:none;
}

#btnToggleCalendarSticky.is-active,
#btnToggleListaSticky.is-active{
    background:#2563eb;
}

/* ===============================
   FORM ELEMENTS
================================*/

select{
    padding:6px 10px;
    border-radius:8px;
    border:1px solid #ddd;
    font-size:14px;
    background:#fff;
    color:#111827;
}

button{
    padding:5px 10px;
    border-radius:8px;
    border:none;
    background:#3b82f6;
    color:white;
    font-size:13px;
    cursor:pointer;
    transition:background .2s ease, transform .15s ease, box-shadow .2s ease;
    box-shadow:0 1px 3px rgba(0,0,0,.10);
}

button:hover{
    background:#2563eb;
    box-shadow:0 3px 8px rgba(37,99,235,.22);
}

button:active{
    transform:translateY(1px);
}

.btn{
    display:inline-block;
    padding:8px 10px;
    background:#3b82f6;
    color:white;
    border-radius:10px;
    text-decoration:none;
    font-size:14px;
    cursor:pointer;
    transition:background .2s ease, box-shadow .2s ease;
    box-shadow:0 1px 3px rgba(0,0,0,.10);
}

.btn:hover{
    background:#2563eb;
    box-shadow:0 3px 8px rgba(37,99,235,.22);
}

/* ===============================
   DROPDOWNS
================================*/

.calendar-selector{
    position:relative;
    max-width:240px;
}

.calendar-selector input,
.input-ui{
    padding:3px 6px;
    border-radius:4px;
    border:1px solid #e5e7eb;
    max-width:160px;
    font-size:13px;
    height:26px;
    background:#fff;
    color:#111827;
    outline:none;
}

.calendar-selector input:focus,
.input-ui:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 2px rgba(37,99,235,.15);
}

.dropdown-list{
    position:absolute;
    top:100%;
    left:0;
    right:0;
    width:100%;
    background:white;
    border:1px solid #e5e7eb;
    max-height:240px;
    overflow-y:auto;
    border-radius:6px;
    z-index:9999;
    display:none;
    box-shadow:0 3px 10px rgba(0,0,0,.12);
}

.dropdown-list div{
    padding:4px;
    cursor:pointer;
    font-size:12px;
    color:#111827;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.dropdown-list div:hover{
    background:#f1f5f9;
}

.dropdown-list.open-up{
    top:auto;
    bottom:100%;
    margin-bottom:2px;
}

.dropdown-list.open-down{
    top:100%;
    bottom:auto;
    margin-top:2px;
}

/* ===============================
   CALENDAR
================================*/

#calendarTable{
    display:inline-block;
    max-width:100%;
    overflow:visible;
}

.calendar-shell{
    display:inline-block;
    background:#fff;
    border-radius:var(--radius-panel);
    box-shadow:var(--shadow-md);
    padding:4px;
    max-width:100%;
}

.calendar-split{
    display:flex;
    align-items:stretch;
    max-width:100%;
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius-inner);
    overflow:hidden;
}
/* desktop: usar só a coluna Hora da tabela principal */
.calendar-hours-pane{
    display:none;
    flex:0 0 var(--calendar-hour-col);
    width:var(--calendar-hour-col);
    min-width:var(--calendar-hour-col);
    background:#fff;
    border-right:none;
}

.calendar-grid-pane{
    flex:1 1 auto;
    min-width:0;
    background:#fff;
}

.calendar-scroll{
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    background:#fff;
    position:relative;
}

.calendar-hours-table,
.calendar-table{
    border-collapse:separate;
    border-spacing:0;
    background:#fff;
}

.calendar-hours-table{
    width:var(--calendar-hour-col);
    min-width:var(--calendar-hour-col);
}

.calendar-table{
    width:auto;
    min-width:calc(var(--calendar-hour-col) + (var(--calendar-day-col) * 6));
    position:relative;
}
.calendar-table tbody tr:nth-last-child(2) td.hour-cell[rowspan]{
    border-bottom:none;
}
.calendar-hours-table th,
.calendar-hours-table td,
.calendar-table th,
.calendar-table td{
    border-right:1px solid var(--line);
    border-bottom:1px solid var(--line);
    padding:1px;
    vertical-align:middle;
}

.calendar-hours-table th,
.calendar-hours-table td{
    border-right:1px solid var(--line);
}

.calendar-table th:last-child,
.calendar-table td:last-child{
    border-right:none;
}

.calendar-hours-table tbody tr:last-child td,
.calendar-table tbody tr:last-child td{
    border-bottom:none;
}

.calendar-hours-table thead th,
.calendar-table thead th{
    background:#e2e8f0;
    padding:3px 4px;
    font-weight:600;
    font-size:11px;
    text-align:center;
}

.hour-head{
    width:var(--calendar-hour-col);
    min-width:var(--calendar-hour-col);
    text-align:center;
    vertical-align:middle;
    background:#e2e8f0;
}

.hour-cell{
    width:var(--calendar-hour-col);
    min-width:var(--calendar-hour-col);
    height:48px;
    font-size:clamp(10px,0.8vw,13px);
    background:#f8fafc;
    text-align:center;
    font-weight:600;
    vertical-align:middle;
    padding:0 4px;
}
.calendar-hours-table .hour-head,
.calendar-hours-table .hour-cell,
.calendar-table .hour-head,
.calendar-table .hour-cell{
    width:var(--calendar-hour-col);
    min-width:var(--calendar-hour-col);
    max-width:var(--calendar-hour-col);
    box-sizing:border-box;
}
.calendar-table thead th{
    width:var(--calendar-day-col);
    min-width:var(--calendar-day-col);
}

.calendar-cell-td{
    width:var(--calendar-day-col);
    min-width:var(--calendar-day-col);
    height:24px;
    background:#fff;
}

.calendar-table tbody tr:nth-child(odd) .calendar-cell-td{
    background:#ffffff;
}

.calendar-table tbody tr:nth-child(even) .calendar-cell-td{
    background:#f1f5f9;
}

.calendar-table tbody tr:hover .calendar-cell-td{
    background:#e0ecff;
}

.cliente-selector{
    position:relative;
    overflow:visible;
    width:100%;
    height:100%;
}

.cell-select,
.cell-input{
    width:100%;
    border:none;
    background:transparent;
    font-size:12px;
    padding:1px 2px;
    outline:none;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.cliente-selector.is-jardim .cell-input{
    color:#166534;
    font-weight:600;
}

.cliente-selector.is-piscina .cell-input{
    color:#1d4ed8;
    font-weight:600;
}

/* calendário com coluna de horas separada */
#calendarTable.sticky-hours-enabled .calendar-hours-pane{
    box-shadow:none;
}

/* ===============================
   CALENDAR INFO
================================*/

#calendarInfo{
    margin-top:4px;
    display:grid;
    grid-template-columns:max-content 1fr;
    align-items:center;
    column-gap:5px;
    width:100%;
}

#calendarInfo .legend,
#calendarInfo .counts{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:8px;
    padding:6px 10px;
    font-size:13px;
    box-shadow:0 3px 10px rgba(0,0,0,.06);
}

#calendarInfo .legend{
    justify-self:start;
    margin:0;
}

#calendarInfo .counts{
    justify-self:end;
    margin:0;
    text-align:right;
}

#calendarInfo .tag{
    display:inline-block;
    padding:2px 8px;
    border-radius:4px;
    margin-left:6px;
    font-size:12px;
    font-weight:600;
}

#calendarInfo .tag-jardim{
    background:#dcfce7;
    color:#166534;
}

#calendarInfo .tag-piscina{
    background:#dbeafe;
    color:#1e3a8a;
}

/* ===============================
   LISTA CLIENTES
================================*/

.estado-cell-wrap{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:6px;
    min-height:24px;
}

.estado-data{
    font-size:12px;
    color:#6b7280;
    white-space:nowrap;
}

#viewListaClientes{
    display:none;
}

#listaClientesWrap{
    display:inline-block;
    background:#fff;
    border-radius:8px;
    padding:4px;
    box-shadow:0 3px 10px rgba(0,0,0,.06);
    max-width:100%;
    overflow:visible;
}

.lista-shell{
    border:1px solid #e5e7eb;
    border-radius:6px;
    overflow:visible;
    background:#fff;
}

.lista-clientes-scroll{
    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    border-radius:6px;
    position:relative;
}

.lista-clientes-table{
    width:auto;
    min-width:620px;
    border-collapse:separate;
    border-spacing:0;
    background:#fff;
    border-radius:6px;
}

.lista-clientes-table th,
.lista-clientes-table td{
    border-right:1px solid #e5e7eb;
    border-bottom:1px solid #e5e7eb;
    padding:2px 4px;
    font-size:12px;
}

.lista-clientes-table th{
    background:#e2e8f0;
    text-align:center;
    font-weight:600;
}

.lista-clientes-table th:last-child,
.lista-clientes-table td:last-child{
    border-right:none;
}

.lista-clientes-table tbody tr:last-child td{
    border-bottom:none;
}

.col-cliente-head,
.col-cliente{
    padding:0 !important;
}

.col-cliente-head{
    text-align:left;
    background:#e2e8f0 !important;
}

.col-cliente{
    width:105px;
    min-width:105px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.lista-clientes-table tbody tr:nth-child(odd) .col-cliente{
    background:#ffffff !important;
}

.lista-clientes-table tbody tr:nth-child(even) .col-cliente{
    background:#f8fafc !important;
}

.col-jardim{
    width:110px;
    min-width:110px;
    text-align:center;
}

.estado-btn{
    width:22px;
    height:20px;
    padding:0;
    border:1px solid #cbd5e1;
    background:#fff;
    color:#111827;
    border-radius:5px;
    cursor:pointer;
    font-size:12px;
    line-height:1;
    box-shadow:none;
}

.estado-btn:hover{
    background:#fff;
    box-shadow:none;
}

.estado-btn:active{
    transform:none;
}

.estado-btn.estado-ok{
    background:#dcfce7;
    color:#166534;
    border-color:#86efac;
}

.estado-btn.estado-pendente{
    background:#fef3c7;
    color:#92400e;
    border-color:#fcd34d;
}

/* sticky lista só mobile */
#listaClientesWrap.sticky-first-col-enabled .col-cliente-head,
#listaClientesWrap.sticky-first-col-enabled .col-cliente{
    box-shadow:none;
}

/* ===============================
   LISTA INFO
================================*/

#listaClientesInfo{
    margin-top:10px;
    text-align:left;
    width:100%;
}

.lista-info-wrap{
    display:grid;
    grid-template-columns:max-content 1fr;
    align-items:center;
    column-gap:10px;
    width:100%;
}

.lista-legend,
.lista-counts{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:8px;
    padding:6px 10px;
    font-size:13px;
    box-shadow:0 3px 10px rgba(0,0,0,.06);
}

.lista-legend{
    justify-self:start;
    margin:0;
}

.lista-counts{
    justify-self:end;
    margin:0;
    text-align:right;
}

.lista-legend .tag{
    display:inline-block;
    padding:2px 8px;
    border-radius:4px;
    margin-left:6px;
    font-size:12px;
    font-weight:600;
}

.tag-feito{
    background:#dcfce7;
    color:#166534;
}

.tag-incompleto{
    background:#fef3c7;
    color:#92400e;
}

.icon-feito{
    color:#16a34a;
    font-weight:600;
}

.icon-incompleto{
    color:#ea580c;
    font-weight:600;
}

/* ===============================
   LISTA CLIENTE EXTRA
================================*/

.cliente-linha-wrap{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
    width:100%;
}

.cliente-linha-nome{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.cliente-oculto-btn{
    width:22px;
    height:20px;
    padding:0;
    border-radius:5px;
    background:#e5e7eb;
    color:#111827;
    font-size:11px;
    box-shadow:none;
    flex-shrink:0;
}

.cliente-oculto-btn:hover{
    background:#d1d5db;
    box-shadow:none;
}

.cliente-oculto-btn:active{
    transform:none;
}

.cliente-oculto-row .cliente-linha-nome{
    opacity:.45;
}

.sticky-col-head-inner{
    padding:3px 4px;
    font-weight:600;
    text-align:left;
}

.sticky-col-inner{
    padding:2px 4px;
}

/* ===============================
   CURSOR QUANDO NÃO ESTÁ LOGIN
================================*/

.cell-input,
.estado-btn{
    cursor:pointer;
}

body:not(.admin-logged-in) .cell-input,
body:not(.admin-logged-in) .estado-btn{
    cursor:default;
}

/* ===============================
   MODAL APP
================================*/

.app-modal{
    position:fixed;
    inset:0;
    z-index:20000;
}

.app-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(15,23,42,.55);
    backdrop-filter:blur(2px);
}

.app-modal-box{
    position:relative;
    z-index:1;
    width:min(92vw, 420px);
    margin:8vh auto 0 auto;
    background:#fff;
    border-radius:14px;
    box-shadow:var(--shadow-lg);
    overflow:hidden;
}

.app-modal-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:14px 16px;
    border-bottom:1px solid #e5e7eb;
    background:#f8fafc;
}

.app-modal-header h3{
    font-size:16px;
    color:#111827;
}

.app-modal-close{
    width:30px;
    height:30px;
    padding:0;
    border-radius:8px;
    background:#e5e7eb;
    color:#111827;
    font-size:14px;
    box-shadow:none;
}

.app-modal-close:hover{
    background:#d1d5db;
    box-shadow:none;
}

.app-modal-close:active{
    transform:none;
}

.app-modal-body{
    padding:16px;
    font-size:14px;
    color:#374151;
    line-height:1.45;
}

.app-modal-body p + p{
    margin-top:10px;
}

.app-modal-input{
    width:100%;
    margin-top:10px;
    padding:10px 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    outline:none;
    font-size:14px;
    background:#fff;
    color:#111827;
}

.app-modal-input:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,.12);
}

.app-modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    padding:0 16px 16px 16px;
}

.app-btn-secondary{
    background:#e5e7eb;
    color:#111827;
    box-shadow:none;
}

.app-btn-secondary:hover{
    background:#d1d5db;
    box-shadow:none;
}

.app-btn-danger{
    background:#ef4444;
}

.app-btn-danger:hover{
    background:#dc2626;
}

/* ===============================
   PRINT
================================*/

.print-only-title{
    display:none;
}

@media print{
    *{
        -webkit-print-color-adjust:exact !important;
        print-color-adjust:exact !important;
    }

    body{
        background:#fff !important;
    }

    .topbar,
    .footer,
    .app-modal,
    #btnToggleCalendarSticky,
    #btnToggleListaSticky{
        display:none !important;
    }

    #viewCalendar,
    #viewListaClientes,
    #tituloCalendarioPrint,
    #listaTituloPrint{
        display:none !important;
    }

    body[data-print-view="calendar"]{
        --calendar-hour-col:44px !important;
        --calendar-day-col:92px !important;
    }

    body[data-print-view="calendar"] #viewCalendar{
        display:block !important;
        width:100% !important;
    }

    body[data-print-view="calendar"] #tituloCalendarioPrint{
        display:block !important;
        font-size:18px;
        font-weight:600;
        margin-bottom:10px;
        text-align:center;
    }

    body[data-print-view="list"] #viewListaClientes{
        display:block !important;
        width:100% !important;
    }

    body[data-print-view="list"] #listaTituloPrint{
        display:block !important;
        font-size:18px;
        font-weight:600;
        margin-bottom:10px;
        text-align:center;
    }

    #calendarTable,
    #listaClientesWrap{
        box-shadow:none !important;
    }

    /* =========================
       PRINT CALENDÁRIO
    ========================= */

    body[data-print-view="calendar"] .calendar-wrap{
        display:block !important;
        width:100% !important;
        max-width:100% !important;
    }

    body[data-print-view="calendar"] #calendarTable{
        display:block !important;
        width:100% !important;
    }

    body[data-print-view="calendar"] .calendar-shell{
        display:block !important;
        width:100% !important;
        padding:4px !important;
        border-radius:8px !important;
        overflow:hidden !important;
        box-shadow:none !important;
        background:#fff !important;
    }

    body[data-print-view="calendar"] .calendar-split{
        display:flex !important;
        width:100% !important;
        max-width:100% !important;
        overflow:hidden !important;
        border-radius:6px !important;
        box-shadow:none !important;
        background:#fff !important;
        border:1px solid #e5e7eb !important;
    }

    body[data-print-view="calendar"] .calendar-hours-pane{
        flex:0 0 var(--calendar-hour-col) !important;
        width:var(--calendar-hour-col) !important;
        min-width:var(--calendar-hour-col) !important;
        border-right:1px solid #e5e7eb !important;
        border-top-left-radius:6px !important;
        border-bottom-left-radius:6px !important;
        box-shadow:none !important;
        background:#fff !important;
    }

    body[data-print-view="calendar"] .calendar-grid-pane{
        flex:1 1 auto !important;
        min-width:0 !important;
        border-top-right-radius:6px !important;
        border-bottom-right-radius:6px !important;
        box-shadow:none !important;
        background:#fff !important;
    }

    body[data-print-view="calendar"] .calendar-scroll{
        width:100% !important;
        overflow:visible !important;
        border-radius:0 !important;
        box-shadow:none !important;
        background:#fff !important;
    }

    body[data-print-view="calendar"] .calendar-hours-table{
        width:var(--calendar-hour-col) !important;
        min-width:var(--calendar-hour-col) !important;
        border-radius:0 !important;
        box-shadow:none !important;
        border-right:1px solid #e5e7eb !important;
    }

    body[data-print-view="calendar"] .calendar-table{
        width:100% !important;
        min-width:0 !important;
        table-layout:fixed !important;
        border-radius:0 !important;
        box-shadow:none !important;
    }

    body[data-print-view="calendar"] .calendar-hours-table th,
    body[data-print-view="calendar"] .calendar-hours-table td{
        border-right:1px solid #e5e7eb !important;
        font-size:10px !important;
        padding:2px 3px !important;
    }

    body[data-print-view="calendar"] .calendar-table th,
    body[data-print-view="calendar"] .calendar-table td{
        font-size:10px !important;
        padding:2px 3px !important;
    }

    body[data-print-view="calendar"] .hour-head,
    body[data-print-view="calendar"] .hour-cell{
        position:static !important;
        box-shadow:none !important;
        width:var(--calendar-hour-col) !important;
        min-width:var(--calendar-hour-col) !important;
        font-size:10px !important;
    }

    body[data-print-view="calendar"] .calendar-table thead th,
    body[data-print-view="calendar"] .calendar-cell-td{
        width:auto !important;
        min-width:0 !important;
    }

    body[data-print-view="calendar"] .calendar-cell-td{
        height:22px !important;
    }

    body[data-print-view="calendar"] .hour-cell{
        height:44px !important;
    }

    body[data-print-view="calendar"] .cell-input{
        font-size:10px !important;
        padding:0 1px !important;
    }

    body[data-print-view="calendar"] #calendarInfo{
        display:grid !important;
        grid-template-columns:max-content 1fr !important;
        align-items:center !important;
        column-gap:10px !important;
        width:100% !important;
        max-width:100% !important;
        margin-top:10px !important;
        padding:0 4px !important;
        box-sizing:border-box !important;
    }

    body[data-print-view="calendar"] #calendarInfo .legend{
        justify-self:start !important;
        width:auto !important;
        text-align:left !important;
        margin:0 !important;
    }

    body[data-print-view="calendar"] #calendarInfo .counts{
        justify-self:end !important;
        width:auto !important;
        text-align:right !important;
        margin:0 !important;
    }

    /* =========================
       PRINT LISTA
    ========================= */

    body[data-print-view="list"] #listaClientesWrap{
        display:block !important;
        width:100% !important;
        padding:4px !important;
        border-radius:8px !important;
        overflow:hidden !important;
        box-shadow:none !important;
        background:#fff !important;
    }

    body[data-print-view="list"] .lista-shell{
        border-radius:6px !important;
        overflow:hidden !important;
        box-shadow:none !important;
        background:#fff !important;
    }

    body[data-print-view="list"] .lista-clientes-scroll{
        overflow:visible !important;
        border-radius:6px !important;
        box-shadow:none !important;
    }

    body[data-print-view="list"] .lista-clientes-table{
        width:100% !important;
        min-width:0 !important;
        table-layout:fixed;
        font-size:11px;
        border-radius:6px !important;
        box-shadow:none !important;
    }

    body[data-print-view="list"] .lista-clientes-table th,
    body[data-print-view="list"] .lista-clientes-table td{
        padding:3px 4px !important;
        font-size:11px !important;
    }

    body[data-print-view="list"] .col-cliente{
        width:30% !important;
    }

    body[data-print-view="list"] .col-jardim{
        width:14% !important;
    }

    body[data-print-view="list"] .estado-btn{
        width:20px !important;
        height:20px !important;
        font-size:12px !important;
        border-radius:4px !important;
    }

    body[data-print-view="list"] #listaClientesInfo{
        text-align:left !important;
        margin-top:10px !important;
        width:100% !important;
        max-width:100% !important;
        padding:0 4px !important;
        box-sizing:border-box !important;
    }

    body[data-print-view="list"] .lista-info-wrap{
        display:grid !important;
        grid-template-columns:max-content 1fr !important;
        align-items:center !important;
        column-gap:10px !important;
        width:100% !important;
    }

    body[data-print-view="list"] .lista-legend{
        justify-self:start !important;
        width:auto !important;
        text-align:left !important;
        margin:0 !important;
    }

    body[data-print-view="list"] .lista-counts{
        justify-self:end !important;
        width:auto !important;
        text-align:right !important;
        margin:0 !important;
    }
}

/* ===============================
   FOOTER
================================*/

.footer{
    margin-top:0;
    text-align:center;
    padding:14px;
    font-size:11px;
    color:#e5e7eb;
    background:linear-gradient(135deg,#1f2937,#111827);
    width:100%;
}

/* ===============================
   SETUP
================================*/

.setup-container{
    flex:1;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:40px 15px;
}

.setup-card{
    background:white;
    padding:32px;
    border-radius:18px;
    width:100%;
    max-width:420px;
    text-align:center;
    box-shadow:0 2px 15px rgba(0,0,0,.08);
}

.setup-card form{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.setup-card input{
    width:100%;
    padding:12px;
    border:1px solid #e5e7eb;
    border-radius:6px;
    outline:none;
    background:#ffffff;
    color:#111827;
    font-size:15px;
    transition:.2s ease;
}

.setup-card input:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 2px rgba(37,99,235,.15);
}

.setup-card input:-webkit-autofill{
    -webkit-box-shadow:0 0 0 50px white inset !important;
    -webkit-text-fill-color:#111827 !important;
}

/* ===============================
   LARGE SCREENS
================================*/

@media screen and (min-width:1400px){
    #viewCalendar .calendar-wrap{
        transform:scale(1.04);
        transform-origin:top center;
    }

    .container{
        padding-top:18px;
        padding-bottom:28px;
    }
}

@media screen and (min-width:1700px){
    #viewCalendar .calendar-wrap{
        transform:scale(1.08);
        transform-origin:top center;
    }

    .container{
        padding-bottom:40px;
    }
}

/* ===============================
   RESPONSIVE
================================*/

@media screen and (max-width:768px){

    :root{
        --calendar-hour-col:36px;
        --calendar-day-col:126px;
    }

    .topbar{
        flex-direction:column;
        align-items:stretch;
        padding:12px;
    }

    .topbar h2{
        text-align:center;
    }

    .calendar-selector{
        width:100% !important;
        max-width:none !important;
        display:block;
    }

    .calendar-selector input,
    .input-ui{
        width:100% !important;
        max-width:none !important;
        display:block;
    }

    .topbar-controls{
        width:100%;
        max-width:100%;
    }

    button{
        width:100%;
        max-width:100%;
        font-size:13px;
        height:26px;
    }

    #btnToggleCalendarSticky,
    #btnToggleListaSticky{
        display:inline-block;
    }

    .calendar-wrap,
    .lista-wrap{
        display:block;
        width:100%;
        max-width:100%;
    }

    #viewCalendar,
    #viewListaClientes{
        width:100%;
    }

    #calendarTable,
    #listaClientesWrap{
        display:block;
        width:100%;
    }

    .calendar-shell,
    .lista-shell{
        display:block;
        width:100%;
    }

    .calendar-shell{
        border-radius:var(--radius-panel);
        overflow:hidden;
        background:#fff;
        padding:4px;
        box-shadow:var(--shadow-md);
    }

    .calendar-split{
        display:flex;
        width:100%;
        align-items:stretch;
        border:1px solid var(--line);
        border-radius:var(--radius-inner);
        overflow:hidden;
        background:#fff;
    }

    .calendar-hours-pane{
        flex:0 0 var(--calendar-hour-col);
        width:var(--calendar-hour-col);
        min-width:var(--calendar-hour-col);
        border-right:none;
        border-top-left-radius:var(--radius-inner);
        border-bottom-left-radius:var(--radius-inner);
        overflow:hidden;
        background:#fff;
    }

    .calendar-grid-pane{
        flex:1 1 auto;
        min-width:0;
        border-top-right-radius:var(--radius-inner);
        border-bottom-right-radius:var(--radius-inner);
        overflow:hidden;
        background:#fff;
    }

    .calendar-scroll{
        width:100%;
        overflow-x:auto;
        overflow-y:hidden;
        background:#fff;
    }

    .calendar-table{
        min-width:calc(var(--calendar-hour-col) + (var(--calendar-day-col) * 6));
    }

    /* sticky OFF: esconder tabela esquerda e mostrar coluna Hora da tabela principal */
    #calendarTable:not(.sticky-hours-enabled) .calendar-hours-pane{
        display:none;
    }

    #calendarTable:not(.sticky-hours-enabled) .calendar-grid-pane .hour-head,
    #calendarTable:not(.sticky-hours-enabled) .calendar-grid-pane .hour-cell{
        display:table-cell;
    }

    /* sticky ON: mostrar tabela esquerda e esconder Hora da tabela principal */
    #calendarTable.sticky-hours-enabled .calendar-hours-pane{
        display:block;
    }

    #calendarTable.sticky-hours-enabled .calendar-grid-pane .hour-head,
    #calendarTable.sticky-hours-enabled .calendar-grid-pane .hour-cell{
        display:none;
    }

    #calendarTable.sticky-hours-enabled .calendar-table{
        min-width:calc(var(--calendar-day-col) * 6);
    }

    #listaClientesWrap{
        display:block;
        width:100%;
        overflow:visible;
    }

    .lista-clientes-table{
        min-width:620px;
    }

    .lista-clientes-table th,
    .lista-clientes-table td{
        padding:3px 5px;
        font-size:11px;
    }

    #listaClientesWrap.sticky-first-col-enabled .lista-clientes-table th.col-cliente-head{
        position:sticky;
        left:0;
        z-index:50;
        background:#e2e8f0 !important;
        border-right:none;
        box-shadow:inset -1px 0 0 #e5e7eb;
    }

    #listaClientesWrap.sticky-first-col-enabled .lista-clientes-table td.col-cliente{
        position:sticky;
        left:0;
        z-index:40;
        background:#fff !important;
        border-right:none;
        box-shadow:inset -1px 0 0 #e5e7eb;
    }

    #listaClientesWrap.sticky-first-col-enabled .lista-clientes-table tbody tr:nth-child(odd) td.col-cliente{
        background:#ffffff !important;
    }

    #listaClientesWrap.sticky-first-col-enabled .lista-clientes-table tbody tr:nth-child(even) td.col-cliente{
        background:#f8fafc !important;
    }

    .estado-btn{
        width:20px;
        height:18px;
        font-size:11px;
        border-radius:4px;
    }

    #calendarInfo{
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:4px;
    }

    #calendarInfo .legend,
    #calendarInfo .counts{
        width:auto;
        text-align:center;
    }

    #calendarInfo .counts{
        margin-left:0;
    }

    #calendarInfo .count-jardins,
    #calendarInfo .count-piscinas,
    #calendarInfo .count-clientes{
        font-size:0;
    }

    #calendarInfo .count-jardins::before{
        content:"🌿 ";
        font-size:13px;
    }

    #calendarInfo .count-piscinas::before{
        content:"💧 ";
        font-size:13px;
    }

    #calendarInfo .count-clientes::before{
        content:"👥 ";
        font-size:13px;
    }

    #calendarInfo .count-jardins span,
    #calendarInfo .count-piscinas span,
    #calendarInfo .count-clientes span{
        font-size:13px;
    }

    #listaClientesInfo{
        text-align:center;
    }

    .lista-info-wrap{
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:4px;
    }

    .lista-legend,
    .lista-counts{
        width:auto;
        text-align:center;
    }

    .lista-counts .count-feitos,
    .lista-counts .count-incompletos,
    .lista-counts .count-clientes{
        font-size:0;
    }

    .lista-counts .count-feitos::before{
        content:"✓ ";
        font-size:13px;
        color:#16a34a;
        font-weight:600;
    }

    .lista-counts .icon-feito,
    .lista-counts .icon-incompleto{
        display:none;
    }

    .lista-counts .count-incompletos::before{
        content:"◐ ";
        font-size:13px;
        color:#ea580c;
        font-weight:600;
    }

    .lista-counts .count-clientes::before{
        content:"👥 ";
        font-size:13px;
    }

    .lista-counts .count-feitos span,
    .lista-counts .count-incompletos span,
    .lista-counts .count-clientes span{
        font-size:13px;
    }

    .app-modal-box{
        width:min(94vw, 420px);
        margin:6vh auto 0 auto;
    }
}
/* ===============================
   MOBILE MENU / TOPBAR MOBILE
================================*/

.mobile-menu-btn,
.mobile-menu-overlay,
.mobile-dropdown-menu{
    display:none;
}

@media (max-width: 768px){

    .topbar{
        display:block;
        padding:12px;
    }

    .topbar-main-row{
        display:grid;
        grid-template-columns:40px minmax(0,1fr) auto;
        align-items:center;
        gap:10px;
    }

    .mobile-menu-btn{
        display:flex;
        align-items:center;
        justify-content:center;
        width:40px;
        height:40px;
        margin:0;
        padding:0;
        border:none;
        border-radius:10px;
        background:rgba(255,255,255,.14);
        color:#fff;
        font-size:20px;
        line-height:1;
        cursor:pointer;
    }

    .topbar-main-row h2{
        margin:0;
        min-width:0;
        font-size:18px;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
        line-height:1.2;
    }

    .mobile-view-switch{
        display:flex;
        align-items:center;
        justify-self:end;
        gap:4px;
    }

    .mobile-view-switch button{
        min-width:68px;
        height:36px;
        padding:0 8px;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        text-align:center;
        border:1px solid rgba(255,255,255,.22);
        background:rgba(255,255,255,.10);
        color:#fff;
        border-radius:9px;
        font-size:11px;
        font-weight:600;
        white-space:nowrap;
        cursor:pointer;
        line-height:1;
    }

    .mobile-view-switch button.is-active{
        background:#fff;
        color:#111827;
        border-color:#fff;
    }

    #calendarSelectorWrap{
        margin-top:10px;
        width:100%;
    }

    #listaCalendarioSelectorWrap{
        display:none;
        width:100%;
        margin-top:10px;
    }

    body.mobile-list-mode #calendarSelectorWrap{
        display:none;
    }

    body.mobile-list-mode #listaCalendarioSelectorWrap{
        display:block !important;
    }

    #calendarTopbarControls,
    #listaTopbarControls,
    .auth-controls{
        display:none !important;
    }

    .mobile-menu-overlay.open{
        display:block;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.22);
        z-index:1390;
    }

    .mobile-dropdown-menu{
        position:fixed;
        top:68px;
        left:12px;
        right:12px;
        z-index:1400;
        background:#fff;
        border:1px solid #e5e7eb;
        border-radius:16px;
        box-shadow:0 18px 50px rgba(0,0,0,.20);
        overflow:hidden;
        max-height:75vh;
        display:none;
    }

    .mobile-dropdown-menu.open{
        display:block;
    }

    .mobile-dropdown-header{
        display:flex;
        align-items:center;
        gap:10px;
        padding:10px 12px;
        border-bottom:1px solid #e5e7eb;
        background:#f8fafc;
    }

    .mobile-dropdown-header strong{
        font-size:14px;
        font-weight:700;
        color:#111827;
    }

    .mobile-dropdown-close{
        margin-left:auto;
        flex:0 0 auto;
        border:1px solid #d1d5db;
        background:#fff;
        color:#111827;
        border-radius:8px;
        height:28px;
        min-height:28px;
        padding:0 8px;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        font-size:12px;
        font-weight:600;
        line-height:1;
        cursor:pointer;
        width:auto;
        max-width:max-content;
    }

    .mobile-dropdown-body{
        display:flex;
        flex-direction:column;
        gap:10px;
        padding:14px;
    }

    .mobile-dropdown-body button{
        border:1px solid #e5e7eb;
        background:#fff;
        color:#111827;
        border-radius:12px;
        min-height:44px;
        padding:10px 12px;
        display:flex;
        align-items:center;
        justify-content:center;
        gap:8px;
        text-align:center;
        font-size:14px;
        font-weight:600;
        line-height:1.2;
        cursor:pointer;
    }

    .mobile-dropdown-auth{
        border-top:1px solid #e5e7eb;
        padding-top:12px;
    }

    .footer{
        display:block !important;
    }
}

@media (min-width: 769px){
    .mobile-menu-btn,
    .mobile-menu-overlay,
    .mobile-dropdown-menu,
    .mobile-view-switch{
        display:none !important;
    }
}