/* ============================================================
   ENCAIXEI — DESIGN SYSTEM v2.0
   SaaS Premium · Mobile-First · Feminino Sofisticado
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ============================================================
   DESIGN TOKENS — variáveis globais
   ============================================================ */
:root {
    /* Paleta principal */
    --rose-nude:    #E8C5B8;
    --rose-medium:  #D4A090;
    --rose-deep:    #B87A6B;
    --rose-dark:    #9A6055;
    --mauve:        #7D5A5A;
    --mauve-dark:   #4A2E2E;
    --cream:        #FAF6F3;
    --cream-dark:   #F0E8E3;
    --white:        #FFFFFF;

    /* Semântica */
    --success:       #4E9A72;
    --success-light: #EBF7F1;
    --success-dark:  #3A7A58;
    --warning:       #D4926A;
    --warning-light: #FDF0E8;
    --danger:        #C45252;
    --danger-light:  #FDEAEA;
    --info:          #5A82C8;
    --info-light:    #EAF0FD;

    /* Texto */
    --text-primary:   #2D1F1F;
    --text-secondary: #6B4F4F;
    --text-light:     #9E7E7E;
    --text-muted:     #BBA8A8;

    /* Bordas & Sombras */
    --border:       #E8D5CF;
    --border-light: #F2E8E5;
    --border-focus: #D4A090;

    --shadow-xs: 0 1px 4px rgba(45,31,31,0.04);
    --shadow-sm: 0 2px 10px rgba(45,31,31,0.07);
    --shadow-md: 0 4px 24px rgba(45,31,31,0.11);
    --shadow-lg: 0 8px 48px rgba(45,31,31,0.15);
    --shadow-xl: 0 16px 64px rgba(45,31,31,0.18);

    /* Raios */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --radius-full: 9999px;

    /* Tipografia */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;

    /* Layout */
    --nav-height:     62px;
    --sidebar-width:  248px;
    --page-max:       1200px;
    --content-pad:    28px;
    --content-pad-sm: 16px;

    /* Animações */
    --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in:   cubic-bezier(0.4, 0, 1, 1);
    --transition: all 0.2s var(--ease-out);
    --transition-slow: all 0.35s var(--ease-out);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-primary);
    background: var(--cream);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    color: var(--mauve-dark);
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.2rem); font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { line-height: 1.7; }

a {
    color: var(--rose-deep);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--mauve); }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
    box-shadow: var(--shadow-xs);
    will-change: transform;
}

.sidebar-logo {
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border-light);
}

.logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--rose-nude) 0%, var(--rose-deep) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(184,122,107,0.3);
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--mauve-dark);
    letter-spacing: -0.03em;
}
.logo-text span { color: var(--rose-deep); }

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 10px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary) !important;
    -webkit-text-fill-color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 1px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: var(--cream);
    color: var(--mauve-dark) !important;
    -webkit-text-fill-color: var(--mauve-dark);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(232,197,184,0.5), rgba(237,213,204,0.7));
    color: var(--mauve-dark) !important;
    -webkit-text-fill-color: var(--mauve-dark);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 25%; bottom: 25%;
    width: 3px;
    background: var(--rose-deep);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.sidebar-bottom {
    padding: 14px 10px 16px;
    border-top: 1px solid var(--border-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    background: var(--cream);
    cursor: pointer;
    transition: var(--transition);
}
.user-info:hover { background: var(--cream-dark); }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-nude), var(--rose-deep));
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    color: white; flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-details { flex: 1; min-width: 0; }
.user-name {
    font-size: 0.84rem; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-plan { font-size: 0.68rem; color: var(--text-light); }

/* ============================================================
   CONTEÚDO PRINCIPAL
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--cream);
}

.page-header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-light);
    padding: 18px var(--content-pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky; top: 0; z-index: 50;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--mauve-dark);
    font-weight: 700;
}

.page-body { padding: var(--content-pad); flex: 1; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
}
.card-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--mauve-dark);
    font-weight: 700;
}
.card-body { padding: 20px; }
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--cream);
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card.verde::before  { background: var(--success); }
.stat-card.laranja::before { background: var(--warning); }
.stat-card.rosa::before    { background: var(--rose-deep); }
.stat-card.azul::before    { background: var(--info); }

.stat-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 12px;
}
.stat-icon.verde   { background: var(--success-light); }
.stat-icon.laranja { background: var(--warning-light); }
.stat-icon.rosa    { background: #fde8e3; }
.stat-icon.azul    { background: var(--info-light); }

.stat-valor {
    font-family: var(--font-display);
    font-size: 1.7rem; font-weight: 700;
    color: var(--text-primary); line-height: 1.1;
}
.stat-label {
    font-size: 0.76rem; color: var(--text-light);
    margin-top: 4px; font-weight: 500;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.01em;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rose-deep) 0%, var(--mauve) 100%);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    box-shadow: 0 2px 14px rgba(180,122,107,0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--rose-dark) 0%, var(--mauve-dark) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(180,122,107,0.45);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--white);
    color: var(--mauve-dark) !important;
    -webkit-text-fill-color: var(--mauve-dark);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover {
    background: var(--cream);
    border-color: var(--rose-nude);
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: white !important;
    -webkit-text-fill-color: white;
    box-shadow: 0 2px 12px rgba(78,154,114,0.3);
}
.btn-success:hover { background: var(--success-dark); transform: translateY(-1px); }

.btn-danger {
    background: var(--danger);
    color: white !important;
    -webkit-text-fill-color: white;
}
.btn-danger:hover { background: #b04a4a; transform: translateY(-1px); }

.btn-whatsapp {
    background: #25D366;
    color: white !important;
    -webkit-text-fill-color: white;
    box-shadow: 0 2px 12px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover { background: #1ebe59; transform: translateY(-1px); }

.btn-sm  { padding: 6px 14px; font-size: 0.8rem; min-height: 34px; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.015em;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--white);
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
    min-height: 44px;
    -webkit-appearance: none;
}
.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(212,160,144,0.18);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--cream); opacity: 0.7; cursor: not-allowed; }

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239E7E7E' stroke-width='1.5' stroke-linecap='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.form-hint  { font-size: 0.74rem; color: var(--text-light); margin-top: 5px; }
.form-error { font-size: 0.76rem; color: var(--danger); margin-top: 5px; font-weight: 500; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    border-left: 3px solid transparent;
}
.alert-success { background: var(--success-light); color: #2d6e4a; border-color: var(--success); }
.alert-danger   { background: var(--danger-light);  color: #8b3030; border-color: var(--danger); }
.alert-warning  { background: var(--warning-light); color: #7a4a1e; border-color: var(--warning); }
.alert-info     { background: var(--info-light);    color: #2a4a8b; border-color: var(--info); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.badge-success { background: var(--success-light); color: #2d6e4a; }
.badge-danger   { background: var(--danger-light);  color: #8b3030; }
.badge-warning  { background: var(--warning-light); color: #7a4a1e; }
.badge-info     { background: var(--info-light);    color: #2a4a8b; }
.badge-rose     { background: #fde8e3; color: var(--mauve-dark); }
.badge-neutral  { background: var(--cream-dark); color: var(--text-secondary); }

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { border-bottom: 2px solid var(--border); background: var(--cream); }
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    white-space: nowrap;
}
td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--cream); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(45,31,31,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.22s, visibility 0.22s;
}
.modal-overlay.ativo { opacity: 1; visibility: visible; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s var(--ease-out);
}
.modal-overlay.ativo .modal { transform: translateY(0) scale(1); }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-display); font-size: 1.05rem; color: var(--mauve-dark); }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%; border: none;
    background: var(--cream);
    color: var(--text-secondary);
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    font-size: 18px; transition: var(--transition);
}
.modal-close:hover { background: var(--cream-dark); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex; gap: 10px; justify-content: flex-end;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 52px 24px; }
.empty-icon  { font-size: 3rem; margin-bottom: 16px; opacity: 0.45; }
.empty-title { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc  { font-size: 0.875rem; color: var(--text-light); margin-bottom: 20px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--mauve-dark);
    color: white;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    display: flex; align-items: center; gap: 10px;
    min-width: 260px; max-width: 380px;
    animation: toastIn 0.3s var(--ease-out);
}
.toast.success { background: var(--success); }
.toast.danger  { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--mauve-dark); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================================
   NOTIFICAÇÃO IN-APP
   ============================================================ */
.notif-alarm {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(110px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 18px 22px;
    min-width: 300px; max-width: 380px;
    z-index: 8000;
    border: 2px solid var(--rose-nude);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notif-alarm.ativo { transform: translateX(-50%) translateY(0); }

.notif-alarm-header {
    display: flex; align-items: center;
    gap: 10px; margin-bottom: 8px;
}
.notif-alarm-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-nude), var(--rose-deep));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(184,122,107,0.4); }
    50%       { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(184,122,107,0); }
}
.notif-alarm-title { font-weight: 700; font-size: 0.875rem; color: var(--mauve-dark); }
.notif-alarm-msg   { font-size: 0.825rem; color: var(--text-secondary); margin-bottom: 14px; }
.notif-alarm-actions { display: flex; gap: 8px; }

/* ============================================================
   AGENDA — PREMIUM
   ============================================================ */
.agenda-grid { display: grid; grid-template-columns: auto 1fr; }
.agenda-hora { width: 56px; font-size: 0.7rem; color: var(--text-light); padding: 6px 10px 0 0; text-align: right; font-weight: 600; }
.agenda-slot { min-height: 56px; border-top: 1px solid var(--border-light); padding: 4px; position: relative; }
.agenda-slot:hover { background: var(--cream); cursor: pointer; }

.agendamento-card {
    background: linear-gradient(135deg, var(--rose-nude) 0%, #EDD5CC 100%);
    border-left: 3px solid var(--rose-deep);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
}
.agendamento-card:hover { box-shadow: var(--shadow-md); transform: scale(1.01); }
.agendamento-card.confirmado { border-left-color: var(--success); background: linear-gradient(135deg, var(--success-light), #d5ede0); }
.agendamento-card.cancelado  { opacity: 0.5; border-left-color: var(--text-light); }
.agendamento-card.vinculado  { border-left-color: var(--info); background: linear-gradient(135deg, var(--info-light), #d5e0f5); }

.agendamento-nome    { font-weight: 700; color: var(--mauve-dark); }
.agendamento-servico { color: var(--text-secondary); margin-top: 1px; }

/* ABAS MOBILE DA AGENDA */
.agenda-tabs-mobile {
    display: none;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.agenda-tabs-mobile::-webkit-scrollbar { display: none; }

.agenda-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 46px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    gap: 2px;
    flex-shrink: 0;
}
.agenda-tab .tab-dia   { font-size: 0.62rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; }
.agenda-tab .tab-num   { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--text-secondary); }
.agenda-tab .tab-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--rose-deep); color: white;
    font-size: 0.6rem; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--white);
}
.agenda-tab.ativa {
    border-color: var(--rose-deep);
    background: linear-gradient(135deg, rgba(232,197,184,0.4), rgba(237,213,204,0.6));
}
.agenda-tab.ativa .tab-num { color: var(--mauve-dark); }
.agenda-tab.hoje .tab-num  { color: var(--rose-deep); }

.agenda-lista-mobile { display: none; }

.dia-conteudo { display: none; }
.dia-conteudo.ativo { display: block; }

.dia-vazio {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
}

/* Card de agendamento na lista mobile */
.ag-card-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.ag-card-mobile:last-child { border-bottom: none; }
.ag-card-mobile:hover, .ag-card-mobile:active { background: var(--cream); }

.ag-hora {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--rose-deep);
    min-width: 46px;
    text-align: center;
}
.ag-info { flex: 1; }
.ag-nome    { font-weight: 700; font-size: 0.875rem; color: var(--mauve-dark); }
.ag-servico { font-size: 0.76rem; color: var(--text-secondary); margin-top: 1px; }
.ag-acoes   { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.btn-whatsapp-mini {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: #25D366; color: white !important;
    -webkit-text-fill-color: white;
    border-radius: 50%;
    font-size: 16px;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.btn-whatsapp-mini:hover { background: #1ebe59; transform: scale(1.1); }

/* ============================================================
   COBRANÇA
   ============================================================ */
.cobranca-col { background: var(--cream); border-radius: var(--radius-md); padding: 14px; min-height: 160px; }
.cobranca-col-header { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cobranca-item {
    background: var(--white); border-radius: var(--radius-sm);
    padding: 13px; margin-bottom: 8px;
    box-shadow: var(--shadow-xs);
    border-left: 3px solid transparent;
    transition: var(--transition);
}
.cobranca-item:hover { box-shadow: var(--shadow-md); }
.cobranca-item.pendente { border-left-color: var(--warning); }
.cobranca-item.atrasado { border-left-color: var(--danger); }
.cobranca-item.pago     { border-left-color: var(--success); }

/* ============================================================
   TRIAL BANNER
   ============================================================ */
.trial-banner {
    background: linear-gradient(135deg, var(--rose-nude) 0%, var(--cream-dark) 100%);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    font-size: 0.82rem;
    color: var(--mauve-dark);
    font-weight: 500;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(250,246,243,0.92);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 16px;
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--rose-deep);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }

/* ============================================================
   PROGRESSO
   ============================================================ */
.progress-bar {
    height: 6px; background: var(--cream-dark);
    border-radius: var(--radius-full); overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--rose-deep), var(--rose-nude));
    transition: width 0.8s var(--ease-out);
}

/* ============================================================
   MOBILE RESPONSIVO
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --content-pad: var(--content-pad-sm);
    }

    .sidebar {
        transform: translateX(-100%);
        width: 268px;
    }
    .sidebar.aberta {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content { margin-left: 0; padding-bottom: 72px; }

    .page-header { padding: 13px 16px; }
    .page-body   { padding: 14px 16px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .modal { max-height: 95vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-overlay { align-items: flex-end; padding: 0; }

    /* NAV MOBILE */
    .nav-mobile {
        position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--white);
        border-top: 1px solid var(--border-light);
        display: flex; z-index: 100;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -4px 20px rgba(45,31,31,0.08);
    }
    .nav-mobile-item {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; padding: 9px 4px 7px;
        font-size: 0.58rem; color: var(--text-light);
        font-weight: 700; cursor: pointer;
        transition: color 0.15s; gap: 3px;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }
    .nav-mobile-item .nav-mobile-icon { font-size: 22px; }
    .nav-mobile-item.active { color: var(--rose-deep); }

    /* AGENDA MOBILE — mostrar abas, esconder tabela */
    .agenda-tabs-mobile  { display: flex; }
    .agenda-lista-mobile { display: block; }

    table { display: block; }
    thead { display: none; }
    tbody, tr { display: block; }
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        border-bottom: none;
    }
    td::before {
        content: attr(data-label);
        font-weight: 600; font-size: 0.7rem;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    tbody tr { border-bottom: 1px solid var(--border-light); }
}

@media (min-width: 769px) {
    /* Desktop — esconder abas e lista mobile da agenda */
    .agenda-tabs-mobile  { display: none !important; }
    .agenda-lista-mobile { display: none !important; }
}

@media (max-width: 768px) {
    /* Mobile — ocultar grade semanal desktop (lista mobile já cobre tudo) */
    .agenda-grade-desktop { display: none !important; }
}

@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-valor { font-size: 1.4rem; }
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.justify-center { justify-content: center; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-5  { gap: 20px; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.p-4   { padding: 16px; }
.w-full   { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm  { font-size: 0.82rem; }
.text-xs  { font-size: 0.72rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-muted   { color: var(--text-light); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-rose    { color: var(--rose-deep); }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Microinterações */
.hover-lift { transition: transform 0.18s var(--ease-out), box-shadow 0.18s; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Sidebar overlay mobile */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(45,31,31,0.35);
    z-index: 99;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
}
