/* ===== Prontuário Digital - Clinic Theme ===== */
:root {
    --primary: #0D9488;
    --primary-dark: #0F766E;
    --primary-light: #CCFBF1;
    --accent: #2DD4BF;
    --bg: #F8FAFB;
    --bg-card: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #0EA5E9;
    --sidebar-width: 260px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

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

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 12px 8px;
    margin-top: 8px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 2px;
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.sidebar-user .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--text-light);
}

.btn-logout {
    color: var(--text-light);
    font-size: 16px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-logout:hover { color: var(--danger); }

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px 40px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
}

.card-body { padding: 20px; }

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: var(--radius);
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.stat-card .stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-card.stat-primary { background: linear-gradient(135deg, #F0FDFA, #CCFBF1); }
.stat-card.stat-primary .stat-icon { background: var(--primary); color: #fff; }
.stat-card.stat-primary .stat-value { color: var(--primary-dark); }

.stat-card.stat-info { background: linear-gradient(135deg, #F0F9FF, #E0F2FE); }
.stat-card.stat-info .stat-icon { background: var(--info); color: #fff; }
.stat-card.stat-info .stat-value { color: #0369A1; }

.stat-card.stat-success { background: linear-gradient(135deg, #F0FDF4, #DCFCE7); }
.stat-card.stat-success .stat-icon { background: var(--success); color: #fff; }
.stat-card.stat-success .stat-value { color: #166534; }

/* ===== Tables ===== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: var(--shadow);
}

.table-container .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.table-container .table-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.table {
    margin: 0;
    font-size: 14px;
}

.table thead th {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 20px;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

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

.table tbody tr:hover { background: #F8FAFB; }

/* ===== Status Badges ===== */
.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-agendado { background: #DBEAFE; color: #1E40AF; }
.badge-confirmado { background: #D1FAE5; color: #065F46; }
.badge-atendido { background: #CCFBF1; color: #0F766E; }
.badge-cancelado { background: #FEE2E2; color: #991B1B; }
.badge-faltou { background: #FEF3C7; color: #92400E; }

/* ===== Buttons ===== */
.btn {
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-success { background: var(--success); color: #fff; border: none; }
.btn-success:hover { background: #059669; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; border: none; }
.btn-warning:hover { background: #D97706; color: #fff; }

.btn-danger { background: #FEE2E2; color: var(--danger); border: none; }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-info { background: #E0F2FE; color: var(--info); border: none; }
.btn-info:hover { background: var(--info); color: #fff; }

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 15px;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-card);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    max-width: 800px;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar .form-control {
    max-width: 300px;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    padding: 14px 20px;
}

.alert-success { background: #D1FAE5; color: #065F46; }
.alert-danger { background: #FEE2E2; color: #991B1B; }
.alert-warning { background: #FEF3C7; color: #92400E; }
.alert-info { background: #E0F2FE; color: #075985; }

/* ===== Login / Landing Pages (no sidebar) ===== */
.page-standalone { margin-left: 0; }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    .mobile-toggle {
        display: flex !important;
    }
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 1001;
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--text);
}

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

.overlay.show { display: block; }

/* ===== Action Row ===== */
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
    margin: 0;
}

/* ===== Prontuario History ===== */
.timeline-item {
    position: relative;
    padding-left: 28px;
    padding-bottom: 28px;
    border-left: 2px solid var(--border);
    margin-left: 12px;
}

.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
}

.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.timeline-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.timeline-section h6 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-section p {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 12px;
}

/* ===== LANDING PAGE ===== */
.landing-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-nav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.landing-nav .brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 16px;
}

.landing-nav .brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.landing-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.landing-nav .nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.landing-nav .nav-links a:hover { color: var(--primary); }

.landing-hero {
    padding: 160px 40px 100px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.landing-hero .badge-pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.landing-hero h1 {
    font-size: 52px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.landing-hero h1 span { color: var(--primary); }

.landing-hero p {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto 36px;
}

.landing-hero .hero-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-hero .btn-hero {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
}

.landing-features {
    padding: 80px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.landing-features .section-title {
    text-align: center;
    margin-bottom: 56px;
}

.landing-features .section-title h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.landing-features .section-title p {
    font-size: 16px;
    color: var(--text-muted);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.feature-card .feature-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.icon-teal { background: #CCFBF1; color: var(--primary); }
.icon-blue { background: #DBEAFE; color: #2563EB; }
.icon-green { background: #D1FAE5; color: #059669; }
.icon-amber { background: #FEF3C7; color: #D97706; }
.icon-purple { background: #EDE9FE; color: #7C3AED; }
.icon-rose { background: #FFE4E6; color: #E11D48; }

.landing-pricing {
    padding: 80px 40px;
    background: #F1F5F9;
}

.landing-pricing .section-title {
    text-align: center;
    margin-bottom: 48px;
}

.landing-pricing .section-title h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.landing-pricing .section-title p {
    font-size: 16px;
    color: var(--text-muted);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    text-align: center;
    transition: var(--transition);
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    position: relative;
}

.pricing-card.featured::before {
    content: 'Popular';
    position: absolute;
    top: -12px;
    left: 50%; transform: translateX(-50%);
    padding: 4px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pricing-card .price {
    font-size: 40px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.pricing-card .price span {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-card .price-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    text-align: left;
}

.pricing-card ul li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-card ul li i { color: var(--primary); font-size: 16px; }

.landing-cta {
    padding: 100px 40px;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.landing-cta h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.landing-cta p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.landing-footer {
    padding: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
}

.login-card .login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.login-card .login-brand .brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 20px;
}

.login-card .login-brand h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.login-card .login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-card .form-group { margin-bottom: 20px; }

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}

.login-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.login-footer-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

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

@media (max-width: 768px) {
    .landing-hero h1 { font-size: 32px; }
    .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
    .landing-nav { padding: 0 20px; }
    .landing-hero, .landing-features, .landing-pricing, .landing-cta { padding-left: 20px; padding-right: 20px; }
}

/* ===== AGENDA ===== */

/* Toolbar */
.agenda-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.agenda-views {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    border-right: 1px solid var(--border);
}

.view-tab:last-child { border-right: none; }
.view-tab:hover { background: var(--bg); color: var(--text); }
.view-tab.active { background: var(--primary); color: #fff; }

.agenda-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    min-width: 160px;
    text-align: center;
}

/* Filters */
.agenda-filters {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); }

.status-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.pill:hover { border-color: var(--text-light); color: var(--text); }
.pill.active { background: var(--text); color: #fff; border-color: var(--text); }

.pill-agendado.active { background: #1E40AF; border-color: #1E40AF; }
.pill-confirmado.active { background: #065F46; border-color: #065F46; }
.pill-atendido.active { background: #0F766E; border-color: #0F766E; }
.pill-cancelado.active { background: #991B1B; border-color: #991B1B; }
.pill-faltou.active { background: #92400E; border-color: #92400E; }

.pill-count {
    background: rgba(255,255,255,0.2);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.pill:not(.active) .pill-count {
    background: var(--border);
    color: var(--text-muted);
}

/* Status badge dot (in dropdown) */
.badge-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.badge-dot-agendado { background: #3B82F6; }
.badge-dot-confirmado { background: #10B981; }
.badge-dot-atendido { background: #0D9488; }
.badge-dot-cancelado { background: #EF4444; }
.badge-dot-faltou { background: #F59E0B; }

.dropdown-menu-sm { font-size: 13px; min-width: 160px; }
.dropdown-menu-sm .dropdown-item { padding: 6px 14px; display: flex; align-items: center; }

.row-cancelled td { opacity: 0.5; }

/* Payment toggle button */
.btn-pgto {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-pgto-pago {
    background: #D1FAE5;
    color: #065F46;
}
.btn-pgto-pago:hover { background: #A7F3D0; }

.btn-pgto-aberto {
    background: #FEF3C7;
    color: #92400E;
}
.btn-pgto-aberto:hover { background: #FDE68A; }

/* ===== WEEK VIEW ===== */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.week-column {
    background: var(--bg-card);
    min-height: 300px;
}

.week-today { background: #F0FDFA; }

.week-day-header {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.week-day-name {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.week-day-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.week-today .week-day-num {
    background: var(--primary);
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.week-day-body { padding: 8px; }

.week-card {
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    border-left: 3px solid var(--border);
    background: var(--bg);
}

.week-card-agendado { border-left-color: #3B82F6; }
.week-card-confirmado { border-left-color: #10B981; }
.week-card-atendido { border-left-color: #0D9488; }
.week-card-cancelado { border-left-color: #EF4444; opacity: 0.6; }
.week-card-faltou { border-left-color: #F59E0B; opacity: 0.7; }

.week-card-time {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.week-card-patient {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-card-prof {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 4px;
}

.week-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.week-card-actions a {
    color: var(--text-light);
    font-size: 14px;
    transition: var(--transition);
}
.week-card-actions a:hover { color: var(--primary); }

.week-empty {
    text-align: center;
    color: var(--border);
    padding: 20px 0;
    font-size: 14px;
}

/* ===== MONTH VIEW ===== */
.month-grid {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.month-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.month-header-cell {
    padding: 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.month-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
}

.month-week-row:last-child { border-bottom: none; }

.month-cell {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--border);
    position: relative;
}

.month-cell:last-child { border-right: none; }

.month-cell-outside {
    background: #FAFBFC;
    opacity: 0.5;
}

.month-cell-today {
    background: #F0FDFA;
}

.month-cell-today .month-cell-num {
    background: var(--primary);
    color: #fff;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.month-cell-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.month-cell-dots { display: flex; flex-direction: column; gap: 2px; }

.month-dot {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 2px;
}

.month-dot span {
    font-weight: 600;
    margin-right: 4px;
}

.month-dot-edit {
    margin-left: auto;
    flex-shrink: 0;
    color: inherit;
    opacity: 0;
    font-size: 12px;
    line-height: 1;
    transition: opacity .15s;
}
.month-dot:hover .month-dot-edit { opacity: .7; }
.month-dot-edit:hover { opacity: 1 !important; }

.month-dot-agendado { background: #DBEAFE; color: #1E40AF; }
.month-dot-confirmado { background: #D1FAE5; color: #065F46; }
.month-dot-atendido { background: #CCFBF1; color: #0F766E; }
.month-dot-cancelado { background: #FEE2E2; color: #991B1B; }
.month-dot-faltou { background: #FEF3C7; color: #92400E; }

.month-dot-more {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1px 6px;
}

@media (max-width: 992px) {
    .week-grid { grid-template-columns: 1fr; }
    .week-column { min-height: auto; }
    .month-cell { min-height: 60px; }
    .agenda-toolbar { flex-direction: column; align-items: stretch; }
    .agenda-nav { justify-content: center; }
}

/* ===== DASHBOARD CHARTS ===== */

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.chart-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
}

.chart-body {
    padding: 12px 16px;
    position: relative;
    min-height: 180px;
}

/* Professional Ranking */
.prof-ranking { padding: 12px 0; }

.prof-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 10px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}

.prof-row:last-child { border-bottom: none; }

.prof-rank {
    grid-row: 1 / 3;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prof-name {
    font-weight: 600;
    font-size: 12px;
    color: var(--text);
}

.prof-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.prof-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.prof-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
}

.prof-bar {
    grid-column: 2 / 4;
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.prof-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.6s ease;
}

@media (max-width: 768px) {
    .chart-body { min-height: 150px; padding: 10px; }
    .prof-row { grid-template-columns: 30px 1fr; }
    .prof-stats { grid-column: 2; }
    .prof-bar { grid-column: 2; }
}

/* ===== HIST SIDEBAR (prontuario/form.html) ===== */
.hist-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    position: sticky;
    top: 80px;
}
.hist-sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.hist-sidebar-body {
    overflow-y: auto;
    padding: 10px 14px;
    flex: 1;
}
.hist-entry {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.hist-entry:last-child { border-bottom: none; }
.hist-entry-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    background: var(--border);
}
.hist-entry-dot.has-record { background: var(--primary); }
.hist-entry-dot.status-cancelado { background: #EF4444; }
.hist-entry-dot.status-faltou { background: #F59E0B; }
.hist-entry-content { flex: 1; min-width: 0; }
.hist-entry-date { font-size: 12px; font-weight: 600; color: var(--text); }
.hist-entry-prof { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.hist-entry-serv { font-size: 11px; color: var(--primary); margin-top: 2px; }
.hist-entry-details { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.hist-detail { margin-bottom: 2px; }
.hist-detail strong { color: var(--text); }
.hist-anexos {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
    font-size: 10px;
    background: #F0FDFA;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== FULL TIMELINE (prontuario/historico.html) ===== */
.timeline-full { position: relative; padding-left: 32px; margin-left: 8px; }
.timeline-full::before {
    content: '';
    position: absolute;
    left: 12px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.tl-item {
    position: relative;
    margin-bottom: 24px;
}
.tl-marker {
    position: absolute;
    left: -32px; top: 16px;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-muted);
    z-index: 1;
}
.tl-atendido .tl-marker { border-color: var(--primary); color: var(--primary); background: #F0FDFA; }
.tl-cancelado .tl-marker { border-color: #EF4444; color: #EF4444; background: #FEF2F2; }
.tl-faltou .tl-marker { border-color: #F59E0B; color: #F59E0B; background: #FFFBEB; }
.tl-confirmado .tl-marker { border-color: #3B82F6; color: #3B82F6; background: #EFF6FF; }
.tl-agendado .tl-marker { border-color: #6B7280; color: #6B7280; }

.tl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: box-shadow .15s;
}
.tl-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.tl-atendido .tl-card { border-left: 3px solid var(--primary); }
.tl-cancelado .tl-card { border-left: 3px solid #EF4444; }
.tl-faltou .tl-card { border-left: 3px solid #F59E0B; }
.tl-confirmado .tl-card { border-left: 3px solid #3B82F6; }

.tl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
}
.tl-date { font-size: 14px; color: var(--text); }
.tl-date strong { color: var(--primary); }

.badge-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 100px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-atendido { background: #CCFBF1; color: #0F766E; }
.badge-cancelado { background: #FEE2E2; color: #991B1B; }
.badge-faltou { background: #FEF3C7; color: #92400E; }
.badge-confirmado { background: #DBEAFE; color: #1D4ED8; }
.badge-agendado { background: #F3F4F6; color: #374151; }

.tl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.tl-meta i { color: var(--primary); }
.tl-meta .badge { vertical-align: middle; }

.tl-record { margin-top: 8px; }
.tl-field { margin-bottom: 10px; }
.tl-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.tl-field-label i { color: var(--primary); }
.tl-field-value {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
}
.tl-pending {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 6px;
}
.tl-obs {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    background: #F9FAFB;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--border);
}
.tl-obs i { color: var(--primary); }

/* Anexo grid */
.tl-anexos { margin-top: 10px; }
.tl-anexo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.tl-anexo-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #F0FDFA;
    border: 1px solid #99F6E4;
    border-radius: 6px;
    padding: 6px 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 12px;
    transition: background .15s;
}
.tl-anexo-item:hover { background: #CCFBF1; color: var(--text); }
.tl-anexo-icon { font-size: 18px; flex-shrink: 0; }
.tl-icon-pdf { color: #EF4444; }
.tl-icon-doc { color: #3B82F6; }
.tl-icon-img { color: var(--primary); }
.tl-anexo-name { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-anexo-tipo { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }

@media (max-width: 768px) {
    .timeline-full { padding-left: 24px; margin-left: 4px; }
    .tl-marker { left: -24px; width: 20px; height: 20px; font-size: 12px; }
    .tl-header { flex-direction: column; align-items: flex-start; }
    .tl-meta { flex-direction: column; gap: 4px; }
    .tl-anexo-grid { flex-direction: column; }
    .hist-sidebar { max-height: 50vh; position: static; margin-top: 16px; }
}

/* ===== MODAL DETALHES CONSULTA ===== */
.modal-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}
.modal-info-card > i { font-size: 20px; color: var(--primary); }
.modal-info-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.modal-info-value { font-size: 14px; font-weight: 600; color: var(--text); }
.modal-obs {
    font-size: 13px;
    color: var(--text-muted);
    background: #F9FAFB;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 3px solid var(--border);
}
.modal-obs i { color: var(--primary); }
.modal-field { margin-bottom: 14px; }
.modal-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.modal-field-label i { color: var(--primary); }
.modal-field-value {
    font-size: 13px;
    color: var(--text);
    line-height: 1.55;
    white-space: pre-wrap;
    background: #F9FAFB;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ===== RETORNO PANEL ===== */
.retorno-panel {
    background: #F0FDFA;
    border: 1px solid #99F6E4;
    border-radius: var(--radius);
    padding: 16px;
}
.retorno-panel .form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.retorno-toggle .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===== SELETOR DE CLÍNICA ===== */
.clinica-selector {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.clinica-selector-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.clinica-selector-label i {
    font-size: 12px;
}

.clinica-dropdown {
    position: relative;
}

.clinica-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clinica-dropdown-btn:hover {
    background: #B2F5EA;
    border-color: var(--primary);
}

.clinica-nome-ativa {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
}

.clinica-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.clinica-dropdown.open .clinica-arrow {
    transform: rotate(180deg);
}

.clinica-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.clinica-dropdown-menu.show {
    display: block;
}

.clinica-option-form {
    margin: 0;
}

.clinica-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.clinica-option:hover {
    background: var(--bg);
    color: var(--text);
}

.clinica-option.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.clinica-option i:first-child {
    font-size: 14px;
    flex-shrink: 0;
    color: var(--text-light);
}

.clinica-option.active i:first-child {
    color: var(--primary);
}

.clinica-option span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clinica-check {
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ===== MINHA CONTA ===== */
.conta-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.conta-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.conta-section-header > i {
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

.conta-section-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.conta-section-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.conta-section-body {
    padding: 24px;
}

/* Plano Badge */
.conta-plano-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.conta-plano-badge.plano-starter {
    background: #F3F4F6;
    color: #374151;
}

.conta-plano-badge.plano-profissional {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.conta-plano-badge.plano-clinica {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Planos Grid */
.conta-planos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.conta-plano-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.conta-plano-card:hover {
    box-shadow: var(--shadow-md);
}

.conta-plano-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    background: #FAFFFE;
}

.conta-plano-atual-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.conta-plano-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 8px 0 4px;
}

.conta-plano-preco {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.conta-plano-preco span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.conta-plano-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.conta-plano-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
}

.conta-plano-features li {
    font-size: 13px;
    color: var(--text);
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.conta-plano-features li i {
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

/* Tipo badge */
.conta-tipo-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.conta-tipo-badge.tipo-admin,
.conta-tipo-badge.tipo-administrador {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.conta-tipo-badge.tipo-supervisor {
    background: #FEF3C7;
    color: #92400E;
}

.conta-tipo-badge.tipo-atendente,
.conta-tipo-badge.tipo-usuario {
    background: #DBEAFE;
    color: #1E40AF;
}

/* User avatar small */
.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .conta-planos-grid {
        grid-template-columns: 1fr;
    }
    .conta-section-body {
        padding: 16px;
    }
}
