:root {
    --primary: #1A1A2E;
    --accent: #059669;
    --text-secondary: #8A8FA8;
    --bg: #F4F6F9;
    --card: #FFFFFF;
    --text: #1A1A2E;
    --border: #E4E7EF;
    --danger: #DC2626;
    --success: #10B981;
    --warning: #D97706;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    --radius: 10px;
    --radius-lg: 14px;
    --bg-secondary: #ECEEF3;
    --brand: #5E59FD;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ================================================
   AUTH PAGES — Split Layout
   ================================================ */
.auth-body {
    background: var(--bg);
}

.auth-split {
    display: flex;
    min-height: 100vh;
}

/* -- Lado esquerdo: visual -- */
.auth-visual {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: #EDEAE6;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.auth-visual-content {
    position: relative;
    width: 100%;
    height: 100vh;
    max-width: none;
}

.auth-visual-img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    border-radius: 0;
    margin: 0;
}

.auth-visual-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.62) 100%);
}

.auth-visual-text h2 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.auth-visual-text p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
}

/* -- Lado direito: formulário -- */
.auth-form-side {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    padding: 3rem 2rem;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 380px;
}

.auth-form-wrapper .logo {
    margin-bottom: 1.5rem;
}

.auth-form-wrapper .logo img {
    height: 40px;
    width: auto;
}

.auth-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.auth-form-wrapper .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.auth-form-wrapper .form-control {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--card);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form-wrapper .form-control::placeholder {
    color: #B0AEAB;
}

.auth-form-wrapper .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(94, 89, 253, 0.12);
    outline: none;
}

.btn-primary {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #fff;
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent);
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.btn-primary:disabled {
    background: #d1d5db;
    color: #9ca3af;
    opacity: 1;
    cursor: not-allowed;
    border-color: #d1d5db;
    box-shadow: none;
    transform: none;
    filter: none;
}

.btn-secondary {
    background: #e5e7eb;
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.9375rem;
    color: #9ca3af;
    transition: opacity 0.15s;
    cursor: not-allowed;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: #e5e7eb;
    color: #9ca3af;
    opacity: 1;
}

.auth-form-wrapper .btn-primary {
    background: var(--brand);
    box-shadow: 0 1px 3px rgba(94, 89, 253, 0.3);
}

.auth-form-wrapper .btn-primary:hover,
.auth-form-wrapper .btn-primary:focus {
    background: var(--brand);
    box-shadow: 0 4px 12px rgba(94, 89, 253, 0.35);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--brand);
    font-weight: 500;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ================================================
   ALERTS
   ================================================ */
.alert-custom {
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
    background: var(--card);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    z-index: 100;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
}

.sidebar .brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.sidebar .brand img {
    height: 26px;
    width: auto;
}

.sidebar nav {
    flex: 1;
    padding: 0.375rem 0;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.5rem 0.875rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: color 0.15s, background 0.15s;
    border-radius: 8px;
    margin: 2px 10px;
}

.sidebar .nav-link:hover {
    color: var(--text);
    background: var(--bg);
}

.sidebar .nav-link.active {
    color: var(--brand);
    background: rgba(94, 89, 253, 0.08);
    font-weight: 600;
}

.sidebar .nav-link.active i {
    color: var(--brand);
}

.sidebar .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: color 0.15s;
}

.sidebar-bottom {
    padding: 0.75rem 0.625rem;
    border-top: 1px solid var(--border);
}

.sidebar-bottom .nav-link {
    padding: 0.5rem 0.875rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: 8px;
    margin: 0;
}

.sidebar-bottom .nav-link:hover {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.06);
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
    margin-left: 240px;
    padding: 0 2rem 2rem;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    padding: 1.125rem 0;
    border-bottom: 1px solid var(--border);
}

.topbar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    letter-spacing: -0.25px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5e59fd 0%, #5752e5 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: -0.25px;
    box-shadow: 0 2px 8px rgb(34 5 150 / 30%);
}

.user-details {
    line-height: 1.25;
}

.user-details .name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.user-details .role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ================================================
   STAT CARDS
   ================================================ */
.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.375rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: 0.875rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.icon-dark { background: rgba(26, 26, 46, 0.07); color: var(--primary); }
.icon-accent { background: rgba(5, 150, 105, 0.1); color: var(--accent); }
.icon-warning { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.icon-success { background: rgba(16, 185, 129, 0.12); color: var(--success); }

/* ================================================
   DASHBOARD — Resumo de atendimentos
   ================================================ */
.atend-resumo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
@media (max-width: 767px) {
    .atend-resumo { grid-template-columns: 1fr; }
}
.atend-col {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}

.atend-col:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.atend-col-hoje {
    background: #f2f2ff;
    border-color: rgb(106 102 253);
    box-shadow: 0 6px 18px rgba(44, 44, 46, 0.08);
}
.atend-col-hoje .atend-col-header,
.atend-col-hoje .atend-col-total small {
    color: #6a67e9;
}
.atend-col-hoje .atend-col-total {
    color: #6a67e9;
}
.atend-col-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.atend-col-header i { font-size: 0.8125rem; }
.atend-col-total {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.625rem;
    color: var(--primary);
}
.atend-col-total small {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}
.atend-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3125rem 0;
    font-size: 0.75rem;
}
.atend-status-row + .atend-status-row { border-top: 1px dashed var(--border); }
.atend-status-row .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}
.atend-status-row .qtd {
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.dot-pendente    { background: var(--warning); }
.dot-confirmado  { background: var(--accent); }
.dot-concluido   { background: var(--success); }
.dot-cancelado   { background: var(--danger); }

.atend-filter {
    min-width: 180px;
    font-size: 0.8125rem;
}
.atend-empty {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    padding: 2rem 0;
    text-align: center;
}

/* ================================================
   RELATÓRIOS
   ================================================ */
.report-chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    min-height: 340px;
}

.report-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.report-chart-header h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary);
}

.report-chart-header .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.report-chart-card canvas {
    display: block;
    width: 100% !important;
    height: 270px !important;
}

/* ================================================
   BADGES
   ================================================ */
.badge-admin {
    background: rgba(26, 26, 46, 0.08);
    color: var(--primary);
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 5px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid rgba(26, 26, 46, 0.1);
}

.badge-colaborador {
    background: rgba(5, 150, 105, 0.1);
    color: #065f46;
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 5px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid rgba(5, 150, 105, 0.15);
}

.badge-trial {
    background: rgba(217, 119, 6, 0.1);
    color: #92400e;
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 5px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(217, 119, 6, 0.15);
}

.badge-ativa {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 5px;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ================================================
   TABLE CARDS
   ================================================ */
.table-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-card .card-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--primary);
    letter-spacing: -0.1px;
}

.table-card .table {
    margin: 0;
}

.table-card .table th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom-width: 1px;
    border-color: var(--border);
    padding: 0.75rem 1.375rem;
    background: rgba(244, 246, 249, 0.6);
}

.table-card .table td {
    padding: 0.8125rem 1.375rem;
    vertical-align: middle;
    font-size: 0.875rem;
    border-color: var(--border);
}

.table-card .table tbody tr {
    transition: background 0.12s;
}

.table-card .table tbody tr:hover {
    background: rgba(5, 150, 105, 0.03);
}

.info-table td {
    padding: 0.5rem 0 !important;
    border: none !important;
    font-size: 0.875rem !important;
}

.info-table .info-label {
    color: var(--text-secondary);
    font-weight: 500;
    width: 140px;
}

/* ================================================
   MODAL
   ================================================ */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.125rem 1.375rem;
}

.modal-header .modal-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.1px;
}

.modal-body {
    padding: 1.25rem;
}

.modal-body .form-control {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
}

.modal-body .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.modal-body .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 0.875rem 1.25rem;
}

/* ================================================
   SWEETALERT2
   ================================================ */
.swal2-popup {
    border-radius: 14px !important;
    padding: 1.25rem 1.375rem !important;
    width: min(30rem, calc(100% - 2rem)) !important;
}

.swal2-title {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    color: var(--primary) !important;
    padding: 0 !important;
}

.swal2-html-container {
    font-size: 0.875rem !important;
    line-height: 1.55 !important;
    margin: 0.75rem 0 0 !important;
}

.swal2-icon {
    transform: scale(0.82);
    margin: 0.75rem auto 0.5rem !important;
}

.swal2-actions {
    gap: 0.5rem;
    margin-top: 1.125rem !important;
}

.swal2-styled {
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

.swal2-input,
.swal2-textarea {
    font-size: 0.875rem !important;
    border-radius: 8px !important;
}

.btn-light {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-light:hover {
    background: var(--bg);
    box-shadow: var(--shadow-sm);
}

/* ================================================
   MOBILE
   ================================================ */
.mobile-toggle {
    display: none;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Auth split: stack on mobile */
    .auth-split {
        flex-direction: column;
    }

    .auth-visual {
        display: none;
    }

    .auth-form-side {
        min-height: 100vh;
        width: 100%;
        padding: 2rem 1.5rem;
    }
}

/* ================================================
   APP FOOTER
   ================================================ */
.app-footer {
    margin-top: 2.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.app-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.app-footer a:hover {
    color: var(--brand);
}

.app-footer .bi-whatsapp {
    color: #25D366;
}

.app-footer-sep {
    color: var(--border);
    font-weight: 300;
}

/* ================================================
   LOADING
   ================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 2rem;
    height: 2rem;
    color: var(--primary);
    border-width: 2px;
}

/* ================================================
   INPUT GROUP FIX
   ================================================ */
.input-group .form-control {
    border-right: none;
}

.input-group .btn-toggle-senha {
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: var(--card);
    color: var(--text-secondary);
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
}

.input-group .btn-toggle-senha:hover {
    color: var(--text);
}

.input-group .form-control:focus + .btn-toggle-senha {
    border-color: var(--brand);
}

/* Toastr overrides */
#toast-container > .toast-success {
    background-color: var(--success);
    opacity: 1;
}
#toast-container > .toast-error {
    background-color: #d9534f;
    opacity: 1;
}
#toast-container > .toast-warning {
    background-color: #f0ad4e;
    opacity: 1;
}
#toast-container > .toast-info {
    background-color: var(--primary);
    opacity: 1;
}
#toast-container > div {
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    padding: 14px 18px 14px 50px;
}

/* ================================================
   CALENDAR TIME GRID
   ================================================ */
.cal-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.cal-toolbar .cal-nav-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cal-toolbar .cal-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.875rem;
    transition: background 0.12s;
}

.cal-toolbar .cal-nav-btn:hover {
    background: var(--bg);
}

.cal-toolbar .cal-period {
    font-weight: 600;
    font-size: 0.9375rem;
    min-width: 200px;
    text-align: center;
    color: var(--primary);
}

.cal-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.cal-scroll {
    max-height: 680px;
    overflow-y: auto;
    position: relative;
}

.cal-header {
    display: grid;
    grid-template-columns: 52px repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 5;
}

.cal-header-cell {
    text-align: center;
    padding: 0.625rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    border-left: 1px solid var(--border);
}

.cal-header-cell:first-child {
    border-left: none;
}

.cal-header-cell .cal-day-num {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
}

.cal-header-cell.cal-today .cal-day-num {
    background: var(--accent);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.cal-body {
    display: grid;
    grid-template-columns: 52px repeat(7, 1fr);
    position: relative;
}

.cal-time-col {
    border-right: 1px solid var(--border);
}

.cal-time-slot {
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 6px 0 0;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    top: -6px;
}

.cal-day-col {
    border-left: 1px solid var(--border);
    position: relative;
}

.cal-day-col:first-of-type {
    border-left: none;
}

.cal-hour-line {
    height: 60px;
    border-bottom: 1px solid var(--border);
}

.cal-hour-line:last-child {
    border-bottom: none;
}

.cal-slot {
    cursor: pointer;
    transition: background 0.1s;
}

.cal-slot:hover {
    background: var(--bg-secondary, #f5f5f5);
}

.cal-event {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 0.6875rem;
    line-height: 1.25;
    overflow: hidden;
    cursor: pointer;
    z-index: 2;
    transition: opacity 0.12s, box-shadow 0.12s;
    border-left: 3px solid rgba(0,0,0,0.2);
}

.cal-event:hover {
    opacity: 0.88;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 3;
}

.cal-event .cal-ev-time {
    font-weight: 600;
    font-size: 0.625rem;
    opacity: 0.9;
}

.cal-event .cal-ev-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-event .cal-ev-prof {
    font-size: 0.5625rem;
    opacity: 0.8;
}

.cal-event .cal-ev-badge {
    position: absolute;
    top: 2px;
    right: 3px;
    line-height: 1;
    z-index: 1;
}

.cal-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #E74C3C;
    z-index: 4;
    pointer-events: none;
}

.cal-now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E74C3C;
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--card);
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Color picker swatches */
.color-swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--primary);
}

/* Agenda view toggle */
.view-toggle {
    display: inline-flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.view-toggle-btn.active {
    background: var(--card);
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-weight: 600;
}

.view-toggle-btn:hover:not(.active) {
    color: var(--text);
}

@media (max-width: 768px) {
    .cal-header {
        grid-template-columns: 36px repeat(7, 1fr);
    }
    .cal-body {
        grid-template-columns: 36px repeat(7, 1fr);
    }
    .cal-header-cell {
        font-size: 0.5625rem;
        padding: 0.5rem 0.125rem;
    }
    .cal-header-cell .cal-day-num {
        font-size: 0.875rem;
    }
    .cal-time-slot {
        font-size: 0.5rem;
    }
    .cal-event {
        font-size: 0.5625rem;
        padding: 1px 3px;
    }
    .cal-event .cal-ev-prof {
        display: none;
    }
    .cal-toolbar .cal-period {
        font-size: 0.8125rem;
        min-width: 140px;
    }
}

/* ================================================
   CONFIG OPTION CARDS
   ================================================ */
.config-option-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.config-option-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
}

.config-option-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--primary);
    margin-bottom: 0.375rem;
}

.config-option-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.config-option-body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 0;
    background: rgba(5, 150, 105, 0.02);
}

.config-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: rgba(5, 150, 105, 0.06);
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    line-height: 1.5;
}

.config-summary {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.config-summary-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 0.625rem;
}

.config-summary ul {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.config-summary li strong {
    color: var(--primary);
}

.config-option-header .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.config-option-header .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.config-option-header .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
    border-color: var(--accent);
}

/* Ficha do Cliente - Config */
.ficha-config-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.ficha-config-block-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.ficha-campo-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s;
}

.ficha-campo-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ficha-opcao-row .btn-outline-danger {
    border-color: var(--border);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
}

.ficha-opcao-row .btn-outline-danger:hover {
    background: #fce4ec;
    color: #c62828;
    border-color: #c62828;
}

/* Novo Agendamento Manual - Steps */
.nag-step {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nag-step.active {
    background: var(--primary);
    color: #fff;
}

.nag-step.done {
    background: #d4edda;
    color: #155724;
}

.nag-cliente-item:hover {
    background: var(--bg-secondary);
}

.nag-horario-btn.active,
.nag-horario-btn.btn-dark {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
