/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta shadcn/ui inspirada */
    --primary-color: #0f172a;
    --primary-hover: #1e293b;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --background: #ffffff;
    --card-background: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --yellow: #FFD500;
    --dark-gray: #3a3a3a;
    --accent: #2563eb;
    --muted: #f1f5f9;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Banner de Aviso de Expiração */
.expiration-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideDown 0.3s ease-out;
}

.expiration-banner.urgent {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.expiration-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.expiration-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.expiration-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

.expiration-close {
    position: absolute;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: bold;
}

.expiration-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.expiration-close:active {
    transform: scale(0.95);
}

/* Ajuste do body quando banner está visível */
body:has(.expiration-banner:not(.hidden)) {
    padding-top: 52px;
}

@media (max-width: 768px) {
    .expiration-banner {
        padding: 10px 16px;
    }

    .expiration-message {
        font-size: 13px;
    }

    .expiration-icon {
        font-size: 20px;
    }

    .expiration-close {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }

    body:has(.expiration-banner:not(.hidden)) {
        padding-top: 48px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.screen.active {
    display: block;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: var(--text-primary);
}

.user-menu-btn:hover {
    background: var(--muted);
    border-color: var(--secondary-color);
}

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

.user-name {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chevron-down {
    transition: transform 0.2s ease;
    color: var(--text-secondary);
}

.user-menu-btn:hover .chevron-down {
    color: var(--text-primary);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 1000;
}

.user-menu-dropdown.hidden {
    display: none;
}

.dropdown-header {
    padding: 12px 12px 8px;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.dropdown-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.dropdown-version {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: 12px;
}

.version-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.version-number {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: var(--muted);
    padding: 2px 8px;
    border-radius: 4px;
}

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: var(--text-primary);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--muted);
}

.dropdown-item.danger {
    color: var(--error-color);
}

.dropdown-item.danger:hover {
    background: #fef2f2;
}

.dropdown-item svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.dropdown-item.danger svg {
    color: var(--error-color);
}

/* Seção do dropdown com header */
.dropdown-section {
    padding: 4px 0;
}

.dropdown-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.dropdown-section-header svg {
    opacity: 0.7;
    width: 14px;
    height: 14px;
}

/* Item aninhado (nested) */
.dropdown-item-nested {
    padding-left: 36px;
    position: relative;
}

/* Conteúdo do item com título e descrição */
.dropdown-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.dropdown-item-title {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Descrição do item (texto secundário) */
.dropdown-item-description {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.2;
}

/* Badge de notificação */
.dropdown-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.dropdown-badge.hidden {
    display: none;
}

.dropdown-item-with-badge {
    justify-content: space-between;
}

/* Badge ADMIN */
.admin-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.admin-badge.hidden {
    display: none;
}

/* Logo PicStone */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.logo-image {
    max-width: 100%;
    width: 300px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.app-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .logo-image {
        width: 250px;
    }
}

/* Cards */
.form-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--muted);
}

.btn-capture {
    background: var(--primary-color);
    color: white;
    font-size: 15px;
    font-weight: 500;
    padding: 16px;
    margin: 20px 0;
}

.btn-capture:hover {
    background: var(--primary-hover);
}

.camera-icon {
    font-size: 20px;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.btn-icon:hover {
    background: var(--muted);
    border-color: var(--secondary-color);
}

/* Photo Preview */
.photo-preview {
    position: relative;
    background: var(--card-background);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.photo-preview.hidden {
    display: none;
}

.photo-preview img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.btn-clear {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1000;
}

.btn-clear:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.btn-crop-icon {
    position: absolute;
    top: 24px;
    right: 74px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.8;
}

.btn-crop-icon:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    opacity: 1;
}

.btn-reset-icon {
    position: absolute;
    top: 24px;
    right: 120px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.8;
}

.btn-reset-icon:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    opacity: 1;
}

/* Image Container for Crop Overlay */
.image-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Crop Overlay Canvas */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    z-index: 10;
    border-radius: 12px;
    pointer-events: all;
}

.crop-overlay.hidden {
    display: none;
}

/* Indicador Visual de Crop Ativo */
.crop-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    z-index: 15;
    pointer-events: none;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease;
}

.crop-indicator.hidden {
    display: none;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Desktop: cursor de cruz visível */
@media (hover: hover) and (pointer: fine) {
    .crop-overlay {
        cursor: crosshair;
    }
}

/* Mobile: esconde cursor, mas mostra indicador */
@media (hover: none) and (pointer: coarse) {
    .crop-overlay {
        cursor: default;
    }
}

.btn-reset-icon.hidden {
    display: none;
}

/* Ensure image and canvas are aligned */
.image-container img {
    display: block;
    pointer-events: none;
}


/* Progress */
.upload-progress {
    margin-top: 20px;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #3b82f6 100%);
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
}

.message.hidden {
    display: none;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.error-message {
    color: var(--error-color);
    background: #fee2e2;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
}

.error-message.hidden {
    display: none;
}

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

.history-item {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.history-item h3 {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 8px;
}

.history-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.history-item small {
    color: var(--text-secondary);
    font-size: 12px;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.info-text {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

/* Main Options Cards */
.main-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 40px 0;
}

@media (min-width: 600px) {
    .main-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

.option-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.option-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.option-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    min-height: 96px;
}

.option-icon img {
    max-width: 128px;
    max-height: 96px;
    height: auto;
    object-fit: contain;
}

.option-icon-image {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    min-height: 96px;
}

.option-icon-image img {
    max-width: 128px;
    max-height: 96px;
    height: auto;
    object-fit: contain;
}

.option-card h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.option-card .btn {
    width: 100%;
}

/* Ambiente Options */
.ambiente-options {
    margin-top: 24px;
}

.ambiente-options.hidden {
    display: none;
}

.ambiente-options h3 {
    text-align: center;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.ambiente-options .btn {
    margin-bottom: 12px;
}

.btn-ambiente {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    padding: 14px;
    margin-top: 10px;
    width: 100% !important;
    display: block;
}

.btn-ambiente:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .header h1 {
        font-size: 24px;
    }

    .form-card {
        padding: 20px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 15px;
    }

    /* Garantir que botões Cavalete, Bancadas, Bathrooms e Floors tenham tamanho idêntico no mobile/tablet */
    .btn-ambiente,
    .btn-countertops,
    .btn-bathrooms,
    .btn-livingrooms,
    .btn-stairs,
    .btn-kitchens,
    .btn-floors {
        font-size: 16px !important;
        padding: 14px !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.5 !important;
        text-align: center !important;
        min-height: 52px !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }

    .option-card {
        padding: 24px 20px;
    }

    .option-icon {
        font-size: 48px;
    }

    .option-card h2 {
        font-size: 20px;
    }
}

/* Capture Section */
.capture-section {
    margin: 20px 0;
}

/* Crop Screen Styles */
.crop-instructions {
    text-align: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.crop-instructions p {
    margin: 0 0 8px 0;
}

.crop-instructions small {
    display: block;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
}

.crop-container {
    background: #000000;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

#cropCanvas {
    max-width: 100%;
    max-height: 70vh;
    cursor: crosshair;
    border-radius: 8px;
    touch-action: none;
    display: block;
}

.crop-info {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 16px;
}

.crop-info.hidden {
    display: none;
}

.crop-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.crop-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.crop-info-item span:last-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.crop-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.crop-actions .btn {
    flex: none;
    width: auto;
    min-width: 200px;
}

/* Mockup Styles */
.btn-mockup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 10px;
}

.btn-mockup:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(102, 126, 234, 0.4);
}

.btn-nicho {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    margin-top: 10px;
}

.btn-nicho:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(17, 153, 142, 0.4);
}

.btn-countertops {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    font-size: 18px;
    padding: 14px;
    margin-top: 10px;
    width: 100% !important;
    display: block;
}

.btn-countertops:hover {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(160, 82, 45, 0.4);
}

.btn-bathrooms {
    background: linear-gradient(135deg, #1E90FF 0%, #00BFFF 100%);
    color: white;
    font-size: 18px;
    padding: 14px;
    margin-top: 10px;
    width: 100% !important;
    display: block;
}

.btn-bathrooms:hover {
    background: linear-gradient(135deg, #00BFFF 0%, #1E90FF 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(30, 144, 255, 0.4);
}

.btn-livingrooms {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    color: white;
    font-size: 18px;
    padding: 14px;
    margin-top: 10px;
    width: 100% !important;
    display: block;
}

.btn-livingrooms:hover {
    background: linear-gradient(135deg, #32CD32 0%, #228B22 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(34, 139, 34, 0.4);
}

.btn-stairs {
    background: linear-gradient(135deg, #8B008B 0%, #9932CC 100%);
    color: white;
    font-size: 18px;
    padding: 14px;
    margin-top: 10px;
    width: 100% !important;
    display: block;
}

.btn-stairs:hover {
    background: linear-gradient(135deg, #9932CC 0%, #8B008B 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(139, 0, 139, 0.4);
}

.btn-kitchens {
    background: linear-gradient(135deg, #D2691E 0%, #CD853F 100%);
    color: white;
    font-size: 18px;
    padding: 14px;
    margin-top: 10px;
    width: 100% !important;
    display: block;
}

.btn-kitchens:hover {
    background: linear-gradient(135deg, #CD853F 0%, #D2691E 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(210, 105, 30, 0.4);
}

.btn-floors {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    font-size: 18px;
    padding: 14px;
    margin-top: 10px;
    width: 100% !important;
    display: block;
}

.btn-floors:hover {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(139, 69, 19, 0.4);
}

.ambiente-config-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.info-box {
    background: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.info-box p {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-size: 16px;
}

.info-box ul {
    margin: 0;
    padding-left: 24px;
    color: #334155;
}

.info-box li {
    margin: 6px 0;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

.radio-option span {
    font-size: 16px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.checkbox-option:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.checkbox-option input[type="checkbox"] {
    margin-right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.checkbox-option input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

.checkbox-option span {
    font-size: 16px;
}

/* Mockups Gallery */
.ambientes-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.ambiente-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ambiente-item h3 {
    margin: 0;
    font-size: 1rem;
    color: #333;
    text-align: center;
}

.ambiente-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.ambiente-actions {
    display: flex !important;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.ambiente-actions .btn {
    flex: 1;
    font-size: 14px;
    padding: 12px 16px;
    min-width: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile específico */
@media (max-width: 768px) {
    .ambiente-actions {
        flex-direction: column;
        gap: 10px;
    }

    .ambiente-actions .btn {
        width: 100%;
        font-size: 16px;
        padding: 14px;
    }

    .loading-overlay {
        padding: 20px;
    }

    .spinner {
        width: 80px;
        height: 80px;
        border: 6px solid rgba(255, 255, 255, 0.2);
        border-top-color: #ffffff;
    }

    .loading-message {
        font-size: 22px;
    }

    .loading-submessage {
        font-size: 16px;
    }
}

#mockupPreview img {
    width: 100%;
    border-radius: 12px;
}

/* Photo Indicator */
.photo-indicator {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid var(--success-color);
}

.photo-indicator.hidden {
    display: none;
}

.photo-indicator p {
    color: var(--success-color);
    font-weight: 600;
    font-size: 16px;
    margin: 0 0 8px 0;
}

.photo-indicator small {
    color: var(--text-secondary);
    font-size: 13px;
    display: block;
}

/* ========== GERENCIAMENTO DE USUÁRIOS ========== */

.users-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.user-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.user-card.inactive {
    opacity: 0.6;
    background: var(--background);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.user-info strong {
    color: var(--text-primary);
    font-size: 16px;
}

.user-username {
    color: var(--primary-color);
    font-size: 14px;
}

.user-info small {
    color: var(--text-secondary);
    font-size: 12px;
}

.user-status {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

.user-status.active {
    color: var(--success-color);
}

.user-status.inactive {
    color: var(--text-secondary);
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.admin-badge {
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.info-box {
    background: var(--background);
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.info-box p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-box strong {
    color: var(--primary-color);
}

/* Responsividade para cards de usuário */
@media (max-width: 600px) {
    .user-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-actions {
        width: 100%;
    }

    .user-actions .btn {
        flex: 1;
    }
}

/* Countertop Selection Styles - 8 Bancadas Responsivas */
.countertop-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

/* Desktop: força 4 colunas quando há espaço */
@media (min-width: 900px) {
    .countertop-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Tablet: 3 colunas */
@media (min-width: 600px) and (max-width: 899px) {
    .countertop-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Mobile: 1 coluna */
@media (max-width: 599px) {
    .countertop-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.countertop-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    background: #DBDBEA;
}

.countertop-preview {
    width: 100%;
    aspect-ratio: 1 / 1; /* Força proporção quadrada */
    background: #DBDBEA;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Mobile: mantém aspect-ratio quadrado */
@media (max-width: 599px) {
    .countertop-preview {
        /* aspect-ratio 1/1 já definido no desktop - mantém quadrado */
    }
}

.countertop-preview:hover {
    border-color: #8B4513;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
    transform: scale(1.02);
}

.countertop-preview:active {
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(139, 69, 19, 0.2);
}

.preview-placeholder {
    font-size: 48px;
    font-weight: bold;
    color: #9ca3af;
}

.countertop-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* contain mostra a imagem completa */
    background-color: #f5f5f5; /* fundo suave para preencher espaços vazios */
}

.countertop-preview.no-thumb {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

.thumb-placeholder {
    font-size: 48px;
}

.countertop-card h4 {
    margin: 12px 0 8px 0;
    font-size: 18px;
    color: #1f2937;
    font-weight: 600;
}

.countertop-card p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.btn-select-countertop {
    width: 100%;
    padding: 10px;
    font-size: 14px;
}

/* Aumenta largura do container da tela de seleção para acomodar 8 cards */
#countertopSelectionScreen .container {
    max-width: 1200px;
}

/* Living Room, Bathroom, Stairs, Kitchen, Floor e Testes: grid de 2 colunas (DESKTOP APENAS) - PADRÃO UNIVERSAL */
@media (min-width: 600px) {
    #livingRoomSelectionScreen .countertop-options,
    #livingRoomTestSelectionScreen .countertop-options,
    #bathroomSelectionScreen .countertop-options,
    #stairsSelectionScreen .countertop-options,
    #kitchenSelectionScreen .countertop-options,
    #floorSelectionScreen .countertop-options,
    #testesSelectionScreen .countertop-options {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 600px;
        margin: 20px auto;
    }
}

/* Aumenta largura do container para Bathroom, Living Room, Stairs, Kitchen, Floor e Testes (DRY - PADRÃO UNIVERSAL) */
#bathroomSelectionScreen .container,
#livingRoomSelectionScreen .container,
#livingRoomTestSelectionScreen .container,
#stairsSelectionScreen .container,
#kitchenSelectionScreen .container,
#floorSelectionScreen .container,
#testesSelectionScreen .container {
    max-width: 1200px;
}

/* Tela de usuários ocupa largura total em desktop (apenas admin usa) */
#usersScreen .container {
    max-width: 100%;
    padding: 0 20px;
}

/* Garante scroll suave em mobile */
@media (max-width: 599px) {
    #countertopSelectionScreen .container,
    #floorSelectionScreen .container {
        padding-bottom: 40px;
    }

    /* Floor selection cards em mobile: 1 coluna */
    #floorSelectionScreen .countertop-options {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
}

/* Loading Overlay Global */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    -webkit-backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.loading-submessage {
    font-size: 14px;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* Barra de Progresso */
.progress-container {
    margin-top: 24px;
    width: 100%;
    max-width: 400px;
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
}

/* ========== TELA DE VERIFICAÇÃO DE EMAIL ========== */
.verification-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    margin: 100px auto;
}

.verification-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.verification-icon.loading {
    color: #2563eb;
    animation: pulse 1.5s ease-in-out infinite;
}

.verification-icon.success {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.verification-icon.error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

#verificationTitle {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.verification-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.verification-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.verification-actions button {
    min-width: 160px;
}

/* ========== MODAIS DE APROVAÇÃO/REJEIÇÃO ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-content p {
    margin: 0 0 24px 0;
    color: var(--text-secondary);
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-actions button {
    min-width: 120px;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

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

/* Modal de Verificação de Email */
.email-verification-modal {
    max-width: 450px;
    padding: 40px 32px;
}

.modal-logo-container {
    width: 100%;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-logo {
    width: 160px;
    height: auto;
    max-width: 70%;
}

.modal-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

.modal-message {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.modal-highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon-inline {
    flex-shrink: 0;
    stroke: #0284c7;
    stroke-width: 2;
}

.modal-highlight strong {
    color: #0c4a6e;
    font-weight: 600;
    font-size: 15px;
}

.modal-submessage {
    text-align: center;
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 0 0 28px 0;
    line-height: 1.6;
}

/* Estilos para lista de usuários pendentes */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}

.user-card.pending {
    border-left-color: #f59e0b;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.user-info strong {
    font-size: 18px;
    color: var(--text-primary);
}

.user-email {
    color: var(--text-secondary);
    font-size: 14px;
}

.user-info small {
    color: var(--text-secondary);
    font-size: 13px;
}

.user-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    width: fit-content;
}

.user-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.user-actions {
    display: flex;
    gap: 12px;
}

.btn-approve-user,
.btn-reject-user {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-approve-user {
    background: var(--success-color);
    color: white;
}

.btn-approve-user:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-reject-user {
    background: var(--error-color);
    color: white;
}

.btn-reject-user:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.users-list .loading,
.users-list .empty,
.users-list .error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.users-list .error {
    color: var(--error-color);
}

/* ========== MENSAGEM DE CRIAR CONTA NO LOGIN ========== */
.info-message {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.info-message p {
    margin: 0 0 16px 0;
    color: #1e40af;
    font-weight: 500;
}

.info-message button {
    width: 100%;
    max-width: 300px;
}

/* ========== SISTEMA DE ABAS DE AUTENTICAÇÃO (QUERO BITCOIN STYLE) ========== */
.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.auth-tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-full {
    width: 100%;
}

.hidden-screen {
    display: none !important;
}

/* Ajustes no form-card para auth */
.form-card {
    background: white;
    border-radius: var(--radius);
    padding: 0;
    box-shadow: none;
}

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

.form-card .form-group:last-of-type {
    margin-bottom: 24px;
}

.form-card label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-card input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-card input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-card input::placeholder {
    color: #94a3b8;
}

/* ========== HISTÓRICO DE USO - HISTORY FEATURE ========== */

/* History Tabs (Todos os Usuários / Meu Histórico) */
.history-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--muted);
    padding: 4px;
    border-radius: var(--radius);
}

.history-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.history-tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

/* History Views */
.history-view {
    display: none;
}

.history-view.active {
    display: block;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

/* View Toggle (Cards/Table) */
.view-toggle-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.view-toggle-btn svg {
    flex-shrink: 0;
}

/* User Stats Cards (Admin View) */
.users-stats-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.user-stats-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.user-stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.user-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.user-avatar-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.user-details h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.user-status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* User Stats Mini Grid */
.user-stats-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-mini {
    text-align: center;
    padding: 12px;
    background: var(--muted);
    border-radius: 8px;
}

.stat-mini-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-mini-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats Grid (My History View) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.stats-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Sub-tabs (Logins / Ambientes) */
.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--muted);
    padding: 4px;
    border-radius: var(--radius);
}

.sub-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sub-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.sub-tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

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

.history-list.active {
    display: flex;
}

.history-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.history-item:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

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

.history-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-time {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.history-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.history-item-detail {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--muted);
    border-radius: 6px;
    white-space: nowrap;
}

/* Table View (Admin) */
.users-stats-table {
    display: none;
}

.users-stats-table.active {
    display: block;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.data-table thead {
    background: var(--muted);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: var(--muted);
}

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

.data-table td.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Mobile Responsiveness for History */
@media (max-width: 768px) {
    .users-stats-list {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-stats-mini {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-mini {
        padding: 8px;
    }

    .stat-mini-value {
        font-size: 20px;
    }

    .stat-mini-label {
        font-size: 10px;
    }

    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-item-details {
        flex-direction: column;
        gap: 8px;
    }

    .table-responsive {
        margin: 0 -20px;
        border-radius: 0;
    }

    .data-table th,
    .data-table td {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Tabela responsiva com múltiplas linhas por usuário */
    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
    }

    .data-table tr {
        margin-bottom: 20px;
        padding: 16px;
        background: white;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        border: 1px solid var(--border-color);
    }

    .data-table td {
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
        text-align: left !important;
    }

    .data-table td:last-child {
        border-bottom: none;
        padding-top: 12px;
    }

    /* Labels para cada campo no mobile */
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-primary);
        display: block;
        margin-bottom: 4px;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Remove hover effect no mobile */
    .data-table tbody tr:hover {
        background: white;
    }
}

@media (max-width: 480px) {
    .history-tabs {
        flex-direction: column;
        gap: 6px;
    }

    .history-tab {
        padding: 10px 16px;
    }

    .view-toggle-container {
        flex-direction: column;
    }

    .view-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .user-stats-card {
        padding: 16px;
    }

    .user-stats-mini {
        grid-template-columns: 1fr;
    }
}

/* ===== BOOKMATCH STYLES ===== */

.bookmatch-options {
    margin: 24px 0;
    padding: 20px;
    background: var(--card-background);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.bookmatch-options h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.bookmatch-results {
    margin: 24px 0;
}

.bookmatch-results h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.result-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.result-item h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-item img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 12px;
    display: block;
}

.result-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-action {
    flex: 1;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-action:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-action:active {
    transform: translateY(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
    }
}

/* ========== EDITOR DE IMAGENS ========== */

/* Card do Editor - Ícone laranja */
#editorCard .option-icon svg {
    color: #f97316;
    transition: all 0.3s ease;
}

#editorCard:hover .option-icon svg {
    color: #ea580c;
    transform: rotate(15deg) scale(1.1);
}

/* Container do editor */
.editor-container {
    max-width: 1200px;
}

/* Preview Lado-a-Lado */
.editor-preview-section {
    margin: 24px 0;
    background: var(--card-background);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.editor-preview-section.hidden {
    display: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.preview-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-column h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.preview-image-container {
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
}

.preview-image-container canvas {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Controles de Ajuste */
.editor-controls {
    margin: 12px 0 24px 0;
    padding: 0;
    background: transparent;
}

.editor-controls.hidden {
    display: none;
}

/* Slider Group */
.slider-group {
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
}

/* Slider Header (Clicável) */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.slider-header:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.slider-header:active {
    background-color: rgba(37, 99, 235, 0.1);
}

.slider-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

/* Collapse Icon */
.collapse-icon {
    margin-left: 12px;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.collapsible.expanded .collapse-icon {
    transform: rotate(180deg);
}

/* Slider Content (Colapsável) */
.slider-content {
    max-height: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    padding: 0 16px;
}

.collapsible.expanded .slider-content {
    max-height: 100px;
    height: auto;
    opacity: 1;
    padding: 0 16px 16px 16px;
}

/* Manter estilos antigos de label para retrocompatibilidade */
.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.slider-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--accent);
    min-width: 40px;
    text-align: right;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Track (Firefox) */
.slider-group input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
}

/* Thumb (Chrome/Safari) */
.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.6);
}

/* Thumb (Firefox) */
.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.slider-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.6);
}

/* Botão Zerar Todos */
.btn-reset-all {
    width: 100%;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.btn-reset-all svg {
    flex-shrink: 0;
}

/* Actions (Botões Baixar e Compartilhar) */
.editor-actions {
    margin: 24px 0;
    display: flex;
    gap: 12px;
}

.editor-actions.hidden {
    display: none;
}

.editor-actions .btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.editor-actions .btn svg {
    flex-shrink: 0;
}

/* Botão Toggle de Visualização */
.editor-view-toggle {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.editor-view-toggle.hidden {
    display: none;
}

.btn-toggle-view {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-toggle-view:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-toggle-view svg {
    transition: transform 0.3s ease;
}

.btn-toggle-view:hover svg {
    transform: rotate(90deg);
}

/* Slider Comparativo (Before/After) */
.editor-slider-section {
    margin: 24px 0;
    background: var(--card-background);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.editor-slider-section.hidden {
    display: none;
}

.comparison-slider {
    width: 100%;
    max-width: 100%;
}

.comparison-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* Imagem Editada (fundo) */
.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-after canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Wrapper da Imagem Original (com clip) */
.comparison-before-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    transition: clip-path 0.1s ease-out;
    will-change: clip-path;
}

.comparison-before {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-before canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Divisor Arrastável */
.comparison-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: transparent;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
    transition: left 0.1s ease-out;
    will-change: left;
}

.divider-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: white;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.divider-handle svg {
    color: #1e293b;
    transition: transform 0.2s ease;
}

.comparison-divider:hover .divider-handle {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.comparison-divider:hover .divider-line {
    width: 3px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.comparison-divider:active .divider-handle {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Labels Original/Editado */
.comparison-label {
    position: absolute;
    top: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.comparison-label-before {
    left: 20px;
}

.comparison-label-after {
    right: 20px;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .editor-container {
        max-width: 100%;
        padding: 0 16px;
    }

    .preview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .preview-image-container {
        min-height: 300px;
    }

    .editor-controls {
        padding: 20px;
    }

    .slider-group {
        margin-bottom: 20px;
    }

    .slider-group label {
        font-size: 13px;
    }

    .slider-value {
        font-size: 13px;
        min-width: 35px;
    }

    .comparison-container {
        min-height: 300px;
    }

    .comparison-label {
        font-size: 12px;
        padding: 6px 12px;
    }

    .divider-handle {
        width: 40px;
        height: 40px;
    }

    /* Garante visibilidade do botão limpar em mobile */
    .btn-clear {
        display: flex !important;
        width: 44px;
        height: 44px;
        font-size: 22px;
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .preview-column h3 {
        font-size: 14px;
    }

    .preview-image-container {
        min-height: 250px;
    }

    .editor-actions {
        flex-direction: column;
    }

    .editor-actions .btn {
        width: 100%;
    }
}
