* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red-primary: #DC2626;
    --red-dark: #B91C1C;
    --red-darker: #991B1B;
    --red-light: #FEE2E2;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --sidebar-width: 280px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ERP Container */
.erp-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--red-primary) 0%, var(--red-darker) 100%);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Sidebar Header */
.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo-icon {
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.sidebar .logo-icon:hover {
    transform: scale(1.05) rotate(-5deg);
}

.sidebar .logo-icon svg {
    width: 28px;
    height: 28px;
}

.sidebar .logo-text h1 {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0;
}

.sidebar .logo-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(255, 255, 255, 0.1);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-item.active .nav-link {
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
    border-left-color: var(--white);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--white);
    color: var(--red-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-details {
    flex: 1;
}

.user-name {
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.user-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2.5rem;
    background: var(--gray-50);
    min-height: 100vh;
}

/* Page Content */
.page-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Header */
.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-100);
}

.page-header h1 {
    color: var(--gray-900);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--gray-600);
    font-size: 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--red-primary), var(--red-dark));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.dashboard-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.card-icon svg {
    width: 32px;
    height: 32px;
    color: var(--white);
    position: relative;
    z-index: 1;
}

.card-icon.red {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
}

.card-icon.orange {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
}

.card-icon.blue {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.card-icon.green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.card-info h3 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.card-info p {
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Coming Soon */
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
}

.coming-soon svg {
    width: 120px;
    height: 120px;
    color: var(--red-primary);
    opacity: 0.3;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.5;
    }
}

.coming-soon h2 {
    color: var(--gray-700);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.coming-soon p {
    color: var(--gray-500);
    font-size: 1rem;
}

/* Form Group Title */
.form-group-title {
    margin: 2.5rem 0 1.5rem;
}

.form-group-title:first-child {
    margin-top: 0;
}

.form-group-title h3 {
    color: var(--red-primary);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--red-light);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease;
}

.form-group.flex-2 {
    grid-column: span 2;
}

.form-group label {
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    background: var(--white);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px var(--red-light);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23DC2626'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    justify-content: center;
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-2px);
}

.btn-text,
.btn-loader {
    position: relative;
    z-index: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 3rem;
    font-weight: bold;
}

.modal-content.success .modal-icon {
    background: var(--red-light);
    color: var(--red-primary);
    animation: scaleIn 0.5s ease;
}

.modal-content.error .modal-icon {
    background: #FEE2E2;
    color: #DC2626;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.modal-content h3 {
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-content .btn {
    margin: 0 auto;
}

/* Modal de Detalhes */
.details-modal {
    max-width: 800px;
    width: 100%;
    text-align: left;
    padding: 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.modal-avatar {
    width: 70px;
    height: 70px;
    background: var(--white);
    color: var(--red-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.modal-title-section h2 {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: left;
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: var(--white);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-title {
    color: var(--red-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--red-light);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.modal-section-title svg {
    width: 22px;
    height: 22px;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.modal-info-item.full-width {
    grid-column: span 2;
}

.modal-label {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-value {
    color: var(--gray-900);
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
}

/* Modal Fotos Grid */
.modal-fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.modal-foto-item {
    position: relative;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-50);
    transition: all 0.3s ease;
    cursor: pointer;
}

.modal-foto-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--red-primary);
}

.modal-foto-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.modal-foto-label {
    padding: 0.625rem;
    background: var(--white);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    border-top: 2px solid var(--gray-100);
}

.modal-foto-item:hover .modal-foto-label {
    background: var(--red-light);
    color: var(--red-primary);
}

.modal-foto-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
    font-style: italic;
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: 12px;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--gray-100);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: var(--gray-50);
    border-radius: 0 0 20px 20px;
}

.modal-footer .btn {
    min-width: 150px;
}


/* Loading State */
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary:disabled:hover {
    transform: none;
}

/* ========================================
   PÁGINA DE EXTRAÇÃO OCR
   ======================================== */

.extracao-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed var(--gray-300);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--gray-50);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--red-primary);
    background: var(--red-light);
    transform: translateY(-2px);
}

.upload-area.dragging {
    border-color: var(--red-primary);
    background: var(--red-light);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: var(--gray-400);
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: var(--red-primary);
    transform: scale(1.1);
}

.upload-content h3 {
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.upload-content p {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin: 0;
}

/* Image Preview */
.image-preview {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
}

.preview-header h3 {
    color: var(--gray-900);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: auto;
}

.image-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-md);
}

.btn-extract {
    width: 100%;
    justify-content: center;
    font-size: 1.05rem;
    padding: 1rem 2rem;
}

/* Extraction Loading */
.extraction-loading {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.extraction-loading .loader {
    margin: 0 auto 1.5rem;
}

.extraction-loading p {
    color: var(--gray-700);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.extraction-loading small {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Results Section */
.results-section {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
}

.results-header h3 {
    color: var(--gray-900);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
}

.extracted-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--gray-900);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.extracted-text:empty::before {
    content: 'Nenhum texto extraído ainda...';
    color: var(--gray-400);
    font-style: italic;
}


/* Page Header Content */
.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.refresh-icon {
    width: 20px;
    height: 20px;
}

/* Motoristas Controls */
.motoristas-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 12px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    background: var(--white);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px var(--red-light);
}

.motoristas-count {
    color: var(--gray-600);
    font-weight: 600;
    white-space: nowrap;
}

.motoristas-count span {
    color: var(--red-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid var(--red-light);
    border-top-color: var(--red-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: var(--gray-600);
    font-size: 1rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
}

.empty-state svg {
    width: 100px;
    height: 100px;
    color: var(--gray-300);
    margin-bottom: 1.5rem;
}

.empty-state h2 {
    color: var(--gray-700);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 1rem;
}

/* Motoristas Grid */
.motoristas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Motorista Card */
.motorista-card {
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.4s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.motorista-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--red-primary), var(--red-dark));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.motorista-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--red-light);
}

.motorista-card:hover::before {
    transform: scaleX(1);
}

/* Card Header */
.motorista-card-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--gray-100);
}

.motorista-avatar {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    color: var(--white);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    position: relative;
    overflow: hidden;
}

/* Estilo quando tem imagem */
.motorista-avatar.has-image {
    background: transparent;
    padding: 0;
}

/* A imagem em si */
.motorista-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.motorista-avatar::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    /* Esconder o brilho se tiver imagem */
    display: var(--avatar-overlay-display, block);
}

.motorista-avatar.has-image::before {
    display: none;
}

.motorista-card-title {
    flex: 1;
    min-width: 0;
}

.motorista-card-title h3 {
    color: var(--gray-900);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.motorista-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--red-light);
    color: var(--red-primary);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Card Info */
.motorista-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.motorista-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.motorista-info-icon {
    width: 20px;
    height: 20px;
    color: var(--red-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.motorista-info-text {
    flex: 1;
    min-width: 0;
}

.motorista-info-label {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.125rem;
}

.motorista-info-value {
    display: block;
    color: var(--gray-900);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Footer */
.motorista-card-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--gray-100);
    display: flex;
    gap: 0.75rem;
}

.motorista-card-footer .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-view {
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
}

.btn-view:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

.btn-edit {
    background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
    color: var(--white);
    font-weight: 600;
}

.btn-edit:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .main-content {
        padding: 2rem;
    }

    .motoristas-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header {
        padding: 1.5rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .sidebar .logo-text {
        display: none;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 1rem;
    }

    .sidebar-footer {
        padding: 1rem;
    }

    .user-details {
        display: none;
    }

    .user-info {
        justify-content: center;
        padding: 0.5rem;
    }

    .main-content {
        margin-left: 70px;
        padding: 1.5rem;
    }

    .page-content {
        padding: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header-content .btn {
        width: 100%;
    }

    .motoristas-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .motoristas-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group.flex-2 {
        grid-column: span 1;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 1rem;
        padding: 2rem;
    }

    .details-modal {
        max-height: 95vh;
        margin: 0.5rem;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-header-content {
        gap: 1rem;
    }

    .modal-avatar {
        width: 55px;
        height: 55px;
        font-size: 1.35rem;
    }

    .modal-title-section h2 {
        font-size: 1.25rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-info-item.full-width {
        grid-column: span 1;
    }

    .modal-footer {
        flex-direction: column;
        padding: 1.25rem;
    }

    .modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .main-content {
        margin-left: 60px;
        padding: 1rem;
    }

    .sidebar {
        width: 60px;
    }

    .sidebar .logo-icon {
        width: 40px;
        height: 40px;
    }

    .sidebar .logo-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* Estilos para Uploads no Cadastro (Dashboard) */
.upload-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.upload-card-item {
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: 16px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-card-item:hover {
    border-color: var(--red-primary);
    background: var(--red-light);
}

.upload-card-item.has-file {
    border-color: #059669;
    background: #ECFDF5;
}

.upload-icon-large {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-card-text h4 {
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.upload-card-text p {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.upload-preview-dashboard {
    width: 100%;
    height: 150px;
    object-fit: contain;
    display: none;
    margin-top: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

/* Toggle Proprietário Dashboard */
#dados_proprietario_dashboard {
    background: #FEF2F2;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #FECACA;
    margin-bottom: 1.5rem;
    display: none;
}

/* Galeria de Fotos nos Cards de Motoristas */
.motorista-fotos-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-100);
}

.motorista-fotos-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.motorista-fotos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.motorista-foto-mini {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.motorista-foto-mini:hover {
    background: var(--red-light);
    border-color: var(--red-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.motorista-foto-mini-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.motorista-foto-mini-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-600);
    line-height: 1.2;
}

.motorista-foto-mini:hover .motorista-foto-mini-label {
    color: var(--red-primary);
}

.motorista-fotos-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.85rem;
    font-style: italic;
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: 10px;
}

/* Botão de Logout */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-logout svg {
    width: 20px;
    height: 20px;
}

/* ======================================== */
/* CHAT STYLES - Sistema de Chat em Tempo Real */
/* ======================================== */
