/* History Premium Styles */
.history-sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(248, 249, 250, 0.85); /* fallback */
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Scroll horizontal suave para os filtros */
.history-filters-scroll {
    overflow-x: auto;
    width: 100%;
    margin-top: 12px;
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
}
.history-filters-scroll::-webkit-scrollbar {
    display: none; /* Safari e Chrome */
}

.history-filters {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    width: max-content;
}

.filter-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.filter-chip:active {
    transform: scale(0.95);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.filter-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--r-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-chip.active .filter-badge {
    background: #0a0a0a;
    color: var(--accent);
}

.barber-avatar-mini {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-light);
    color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: var(--font-brand);
    border: 2px solid var(--accent-border);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.history-main-title {
    font-family: var(--font-brand);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.history-sub-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.history-header-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.history-section-title {
    font-family: var(--font-brand);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hero Card */
.history-hero-scroll {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-hero-card {
    position: relative;
    border-radius: var(--r-xl);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--t-normal), box-shadow var(--t-normal);
    background: var(--bg-surface);
    border: 1px solid var(--accent-border);
}

.history-hero-card:active {
    transform: scale(0.97);
}

.hhc-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201,169,110,0.1) 0%, rgba(201,169,110,0.02) 100%);
    z-index: 0;
}

.hhc-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hhc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.hhc-date {
    color: var(--accent-dark);
    background: var(--bg-surface);
    padding: 4px 10px;
    border-radius: var(--r-full);
    box-shadow: var(--shadow-sm);
}

.hhc-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: badgePulse 2s infinite;
}

.hhc-barber {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 4px 0 0 0;
    color: var(--text-primary);
}

.hhc-service {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.hhc-footer {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(201,169,110,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hhc-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 65%;
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hhc-btn {
    border-radius: var(--r-full);
    padding: 6px 16px;
}

/* History List Items */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-light);
    gap: 16px;
    cursor: pointer;
    transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.history-list-item:active {
    transform: scale(0.98);
}

.hli-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hli-icon.completed {
    background: var(--success-bg);
    color: var(--success);
}

.hli-icon.cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}

.hli-icon.expired {
    background: var(--warning-bg);
    color: var(--warning);
}

.hli-info {
    flex: 1;
    overflow: hidden;
}

.hli-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hli-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hli-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.hli-status {
    font-size: 0.75rem;
    font-weight: 700;
}

.hli-status.completed { color: var(--success); }
.hli-status.cancelled { color: var(--danger); }
.hli-status.expired { color: var(--warning); }

.hli-arrow {
    color: var(--border);
    transition: color var(--t-fast);
}

.history-list-item:hover .hli-arrow {
    color: var(--text-muted);
}

/* Modal Premium Details */
.modal--premium-details {
    background: var(--bg-primary);
    border-radius: 28px 28px 0 0;
}

.m-header-premium {
    padding: 24px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: none;
    background: linear-gradient(to bottom, var(--bg-surface) 0%, transparent 100%);
}

.m-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.m-header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-full);
    background: rgba(201,169,110,0.15);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn-glass {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    border-radius: 50%;
}

.m-body-premium {
    padding: 0 20px 24px;
}

.det-hero-info {
    text-align: center;
    margin-bottom: 24px;
}

.det-barber-name {
    font-family: var(--font-brand);
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.det-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--accent);
    color: #0a0a0a;
    box-shadow: 0 4px 12px rgba(201,169,110,0.3);
}

.det-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.det-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dic-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: rgba(201,169,110,0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dic-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dic-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dic-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.det-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.det-section-header h4 {
    font-family: var(--font-brand);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.det-map-view {
    height: 180px;
    border-radius: var(--r-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

.det-record-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: 20px;
    margin-top: 24px;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px;
}

.det-record-block {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
    width: 100%;
}

.drb-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.drb-notes {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--r-lg);
    border: 1px dashed var(--border);
}

.drb-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

/* Photo card wrapper inside record */
.drb-photo-card {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--r-md);
    border: 1.5px solid var(--border-light);
    cursor: pointer;
    background: #1e1e1e;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease, border-color var(--t-fast) ease;
}

.drb-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--t-normal) ease;
}

.drb-photo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.drb-photo-card:hover img {
    transform: scale(1.06);
}

.det-cancel-section {
    padding-top: 24px;
    border-top: 1px dashed var(--border);
}

.input-glass {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
}

.btn-cancel-appt {
    background: #fff0f2;
    color: #e11d48;
    border-color: #ffe4e6;
    font-weight: 700;
}

.btn-cancel-appt:hover {
    background: #ffe4e6;
}

.btn-whatsapp {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-whatsapp:hover {
    background: #d1fae5;
}

/* Enhanced Record Section (Prontuário) */
.det-record-section--enhanced {
    background: linear-gradient(145deg, var(--bg-surface) 0%, rgba(201,169,110,0.03) 100%);
    border: 1px solid var(--accent-border);
    box-shadow: 0 4px 20px rgba(201,169,110,0.08);
}

.drb-notes--enhanced {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent);
    color: var(--text-primary);
    font-style: italic;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
}

/* ════════════════════════════════════════
   ✦  GUEST WELCOME CARD (Modo Visitante)  ✦
   ════════════════════════════════════════ */
.guest-welcome-card {
    background: var(--bg-surface, #ffffff);
    border: 1.5px solid var(--accent-border, rgba(201, 169, 110, 0.35));
    border-radius: 24px;
    padding: 36px 24px;
    text-align: center;
    max-width: 480px;
    margin: 24px auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(201, 169, 110, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.4s ease forwards;
}

.guest-welcome-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 130px;
    height: 130px;
    background: radial-gradient(circle, rgba(201,169,110,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.guest-welcome-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(201,169,110,0.18) 0%, rgba(201,169,110,0.05) 100%);
    border: 1.5px solid var(--accent-border, rgba(201, 169, 110, 0.4));
    color: var(--accent, #c9a96e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(201, 169, 110, 0.15);
}

.guest-welcome-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.guest-welcome-text {
    font-size: 0.92rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.guest-welcome-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 28px;
    background: var(--bg-primary, #f8f9fa);
    border: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
    border-radius: 16px;
    padding: 16px 20px;
}

.guest-benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-primary, #1f2937);
    font-weight: 500;
}

.guest-benefit-icon {
    color: var(--accent, #c9a96e);
    flex-shrink: 0;
    font-weight: bold;
}

.guest-welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guest-btn-primary {
    background: linear-gradient(135deg, #c9a96e 0%, #b89558 100%);
    color: #0a0a0a !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 14px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guest-btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(201, 169, 110, 0.45);
}

.guest-btn-secondary {
    background: var(--bg-primary, #f3f4f6);
    color: var(--text-primary, #1f2937) !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 13px 24px;
    border-radius: 50px;
    border: 1px solid var(--border-light, #e5e7eb);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.guest-btn-secondary:hover {
    background: var(--border-light, #e5e7eb);
    transform: translateY(-1px);
}

