/**
 * Rural Café - Tecnologia Orgânica Design System
 * Sistema de Gestão de Café
 *
 * Cores Principais:
 * - Café Expresso: #4A2C2A
 * - Verde Folha Seca: #7E9A7C
 * - Terracota Torra: #B55A30
 * - Creme Juta: #F4F1EA
 * - Carvão Suave: #333333
 * - Bege Areia: #E0D8C8
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* Cores Primárias */
    --cafe-expresso: #4A2C2A;
    --verde-folha: #7E9A7C;
    --terracota: #B55A30;
    --creme-juta: #F4F1EA;
    --carvao: #333333;
    --bege-areia: #E0D8C8;

    /* Status Colors */
    --status-pendente: #D4A574;
    --status-analise: #7E9A7C;
    --status-aprovado: #5D8A5E;
    --status-rejeitado: #C44536;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(74, 44, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(74, 44, 42, 0.1), 0 2px 4px -2px rgba(74, 44, 42, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(74, 44, 42, 0.1), 0 4px 6px -4px rgba(74, 44, 42, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(74, 44, 42, 0.1), 0 8px 10px -6px rgba(74, 44, 42, 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================
   Alpine.js Cloak
   ============================================ */
[x-cloak] {
    display: none !important;
}

/* ============================================
   Typography
   ============================================ */
body {
    font-family: 'Inter', 'Open Sans', system-ui, sans-serif;
    color: var(--carvao);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.font-heading {
    font-family: 'Montserrat', system-ui, sans-serif;
}

/* ============================================
   Texture Backgrounds
   ============================================ */
.texture-paper {
    background-color: var(--creme-juta);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23d4c4a8' fill-opacity='0.15'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.texture-juta {
    background-color: var(--bege-areia);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%238a7a5a' fill-opacity='0.08' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
}

.texture-grain {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--creme-juta);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #C7B299;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cafe-expresso);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* ============================================
   Card Styles
   ============================================ */
.card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid #E0D8C8;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

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

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E0D8C8;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E0D8C8;
    background: #FAFAF8;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Summary Cards */
.summary-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid #E0D8C8;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--cafe-expresso);
    transition: width var(--transition-fast);
}

.summary-card:hover::before {
    width: 6px;
}

.summary-card.accent-green::before {
    background: var(--verde-folha);
}

.summary-card.accent-orange::before {
    background: var(--terracota);
}

/* ============================================
   Button Styles
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button - Terracota */
.btn-primary {
    background: linear-gradient(135deg, var(--terracota) 0%, #964A28 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(181, 90, 48, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #C46A40 0%, var(--terracota) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(181, 90, 48, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary Button - Verde Folha */
.btn-secondary {
    background: linear-gradient(135deg, var(--verde-folha) 0%, #5F7A5D 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(126, 154, 124, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #8EAA8C 0%, var(--verde-folha) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(126, 154, 124, 0.4);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--cafe-expresso);
    border: 2px solid var(--cafe-expresso);
}

.btn-outline:hover:not(:disabled) {
    background: var(--cafe-expresso);
    color: white;
    transform: translateY(-1px);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--carvao);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(74, 44, 42, 0.08);
}

/* Icon Button */
.btn-icon {
    padding: 0.625rem;
    width: 2.5rem;
    height: 2.5rem;
}

/* ============================================
   Status Chips
   ============================================ */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Pendente - Dourado */
.chip-pendente {
    background: linear-gradient(135deg, #FDF3E7 0%, #FAE7D0 100%);
    color: #8B6914;
    border: 1px solid #E8D4B8;
}

/* Em Análise - Verde Claro */
.chip-analise {
    background: linear-gradient(135deg, #E8F0E8 0%, #D4E4D4 100%);
    color: #4A6B4A;
    border: 1px solid #B8D4B8;
}

/* Aprovado - Verde Escuro */
.chip-aprovado {
    background: linear-gradient(135deg, #D4E8D4 0%, #B8D4B8 100%);
    color: #2D5A2D;
    border: 1px solid #8CC28C;
}

/* Rejeitado - Vermelho */
.chip-rejeitado {
    background: linear-gradient(135deg, #FEE8E8 0%, #FCCFCF 100%);
    color: #8B2020;
    border: 1px solid #E8A8A8;
}

/* Badge Styles (alternative to chips) */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #D1E8D4;
    color: #2D5A2D;
}

.badge-warning {
    background-color: #FEF3E7;
    color: #8B6914;
}

.badge-danger {
    background-color: #FEE8E8;
    color: #8B2020;
}

.badge-info {
    background-color: #E0EBF0;
    color: #1E5A7A;
}

/* ============================================
   Table Styles
   ============================================ */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

table thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #FAFAF8 0%, #F4F1EA 100%);
    padding: 0.875rem 1rem;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cafe-expresso);
    border-bottom: 2px solid #E0D8C8;
    z-index: 10;
}

table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #E0D8C8;
    color: var(--carvao);
    font-size: 0.875rem;
}

table tbody tr {
    transition: background-color var(--transition-fast);
}

table tbody tr:hover {
    background-color: #FAF8F5;
}

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

/* Table with alternating rows */
table.table-striped tbody tr:nth-child(even) {
    background-color: #FAFAF8;
}

table.table-striped tbody tr:nth-child(even):hover {
    background-color: #F4F1EA;
}


/* ============================================
   Form Inputs
   ============================================ */
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--carvao);
    background: white;
    border: 1px solid #D4C8B8;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

/* ============================================
   FIX GLOBAL - Cores de Texto em Inputs
   ============================================ */
input, select, textarea,
input[type="text"], input[type="number"], input[type="email"], input[type="password"],
input[type="tel"], input[type="url"], input[type="search"], input[type="date"] {
    color: #333333 !important;
    -webkit-text-fill-color: #333333 !important;
}

/* Placeholders */
input::placeholder, textarea::placeholder {
    color: #888888 !important;
    -webkit-text-fill-color: #888888 !important;
    opacity: 1 !important;
}

/* Fix para selects e options */
select option {
    color: #333333 !important;
    background: white !important;
}

/* Override Tailwind classes que podem interferir */
[class*="border-"][class*="rounded-"] input,
[class*="border-"][class*="rounded-"] select,
[class*="border-"][class*="rounded-"] textarea,
[class*="bg-white"] input,
[class*="bg-gray-"] input,
[class*="bg-cafe-"] input {
    color: #333333 !important;
    -webkit-text-fill-color: #333333 !important;
}



.input:focus {
    outline: none;
    border-color: var(--verde-folha);
    box-shadow: 0 0 0 3px rgba(126, 154, 124, 0.2);
}

.input:disabled {
    background: #F4F1EA;
    cursor: not-allowed;
}

.input::placeholder {
    color: #A89882;
}

/* Select */
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A2C2A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Textarea */
textarea.input {
    min-height: 120px;
    resize: vertical;
}

/* Form Label */
.label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--cafe-expresso);
    margin-bottom: 0.5rem;
}

/* Form Group */
.form-group {
    margin-bottom: 1.25rem;
}

/* ============================================
   Sidebar Styles
   ============================================ */
.sidebar {
    transition: width var(--transition-normal);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-lg);
    color: #E5E0DA;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-item:hover {
    background-color: rgba(126, 154, 124, 0.15);
    color: white;
}

.sidebar-item.active {
    background: linear-gradient(135deg, var(--verde-folha) 0%, #5F7A5D 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(126, 154, 124, 0.4);
}

.sidebar-item i {
    width: 1.25rem;
    text-align: center;
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(74, 44, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E0D8C8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--cafe-expresso);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E0D8C8;
    background: #FAFAF8;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    animation: slideIn 0.3s ease-out;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid var(--verde-folha);
}

.toast-success {
    border-left-color: var(--verde-folha);
}

.toast-error {
    border-left-color: #C44536;
}

.toast-warning {
    border-left-color: var(--terracota);
}

.toast-info {
    border-left-color: #5A8B8C;
}

/* ============================================
   Status Colors
   ============================================ */
.status-pendente {
    color: #D4A574;
}

.status-processando,
.status-analise {
    color: var(--verde-folha);
}

.status-concluido,
.status-aprovado {
    color: #5D8A5E;
}

.status-erro,
.status-rejeitado {
    color: #C44536;
}

.status-cancelado {
    color: #8B8178;
}

/* ============================================
   Loading & Skeleton
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #E8E2D8 25%, #D4CEC4 50%, #E8E2D8 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 8rem;
}

/* ============================================
   Chart Container
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ============================================
   Grid Layouts
   ============================================ */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ============================================
   Utility Classes
   ============================================ */
.transition-all {
    transition: all var(--transition-normal);
}

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

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

/* ============================================
   Focus States
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--verde-folha);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--verde-folha);
    outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .print-full-width {
        width: 100% !important;
        max-width: 100% !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .card {
        border-radius: var(--radius-lg);
    }

    .modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 640px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    table thead th,
    table tbody td {
        padding: 0.625rem 0.75rem;
    }
}

/* ============================================
   Animations for Amostras Enhanced
   ============================================ */

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0.5;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.counter-animation {
    animation: countUp 0.6s ease-out;
}

/* Gradient Card Shine Effect */
@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.bg-gradient-to-br {
    position: relative;
    overflow: hidden;
    background-size: 200% 200%;
}

.bg-gradient-to-br:hover {
    animation: shine 2s linear infinite;
}

/* Hover Effects for Table Rows */
table tbody tr {
    transition: all 0.3s ease;
}

table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Pulse Effect for Important Elements */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Custom Scrollbar for Amostras */
.amostras-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.amostras-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.amostras-container::-webkit-scrollbar-thumb {
    background: var(--terracota);
    border-radius: 10px;
}

.amostras-container::-webkit-scrollbar-thumb:hover {
    background: var(--cafe-expresso);
}

/* ============================================
   Animações para Médias Modern
   ============================================ */

@keyframes slide-in-right {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.8);
    }
}

.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out;
}

.animate-fade-out {
    animation: fade-out 0.3s ease-out;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Glassmorphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Excel-like cell styles */
.excel-cell {
    transition: all 0.15s ease;
}

.excel-cell:hover {
    background-color: rgba(251, 191, 36, 0.1);
}

.excel-cell:focus-within {
    background-color: white;
    box-shadow: 0 0 0 2px #3b82f6;
    z-index: 10;
}

/* Drag and drop visual feedback */
.dragging {
    opacity: 0.5;
    background: linear-gradient(to right, #dbeafe, #e0f2fe);
}

.drag-over {
    border-top: 3px solid #3b82f6;
}

/* Custom scrollbar for medias table */
.medias-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.medias-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.medias-table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #f59e0b, #f97316);
    border-radius: 4px;
}

.medias-table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #d97706, #ea580c);
}

/* Dark mode support */
.dark .glass-effect {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.2);
}

.dark .excel-cell:hover {
    background-color: rgba(251, 191, 36, 0.15);
}

.dark .medias-table-container::-webkit-scrollbar-track {
    background: #1f2937;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: linear-gradient(to right, #059669, #10b981);
    color: white;
}

.badge-warning {
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    color: white;
}

.badge-danger {
    background: linear-gradient(to right, #dc2626, #ef4444);
    color: white;
}

.badge-info {
    background: linear-gradient(to right, #3b82f6, #60a5fa);
    color: white;
}

/* Chart container */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* Tooltip custom */
.custom-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(251, 191, 36, 0.3);
    border-top: 3px solid #f59e0b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Logística - Mapa e Rastreamento
   ============================================ */

/* Custom icon para caminhão no mapa Leaflet */
.custom-truck-icon {
    background: transparent !important;
    border: none !important;
}

.custom-truck-icon > div {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-truck 2s infinite;
}

@keyframes pulse-truck {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Popup do Leaflet estilizado */
.leaflet-popup-content {
    margin: 8px 12px;
    font-family: 'Inter', system-ui, sans-serif;
}

.leaflet-popup-content h4 {
    margin-bottom: 4px;
}

/* Timeline do embarque */
.timeline-event {
    position: relative;
    padding-left: 30px;
    padding-bottom: 16px;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: #E5E7EB;
}

.timeline-event:last-child::before {
    display: none;
}

/* FullCalendar customização */
.fc {
    font-family: 'Inter', system-ui, sans-serif;
}

.fc .fc-button-primary {
    background-color: var(--cafe-expresso) !important;
    border-color: var(--cafe-expresso) !important;
}

.fc .fc-button-primary:hover {
    background-color: #3a2220 !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--terracota) !important;
    border-color: var(--terracota) !important;
}

.fc-event {
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
}

.fc-daygrid-day.fc-day-today {
    background-color: rgba(126, 154, 124, 0.1) !important;
}

/* ============================================
   Diferenciais OFI - Breakdown de Ajustes
   ============================================ */

.diferenciais-breakdown {
    background: var(--creme-juta);
    border: 1px solid var(--bege-areia);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Inter', sans-serif;
}

.diferenciais-breakdown .preco-base {
    font-size: 0.875rem;
    color: var(--carvao);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bege-areia);
}

.diferenciais-breakdown .ajustes-lista {
    margin: 0.75rem 0;
}

.diferenciais-breakdown .ajuste-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.813rem;
    border-bottom: 1px dashed rgba(126, 154, 124, 0.2);
}

.diferenciais-breakdown .ajuste-item:last-child {
    border-bottom: none;
}

.diferenciais-breakdown .ajuste-item .parametro {
    font-weight: 500;
    color: var(--carvao);
    min-width: 100px;
}

.diferenciais-breakdown .ajuste-item .valor {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.diferenciais-breakdown .ajuste-item .valor.positivo {
    color: #5D8A5E;
}

.diferenciais-breakdown .ajuste-item .valor.negativo {
    color: #C44536;
}

.diferenciais-breakdown .ajuste-item .detalhe {
    font-size: 0.75rem;
    color: #666;
    margin-left: auto;
    padding-left: 1rem;
    text-align: right;
}

.diferenciais-breakdown .ajuste-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
    border-top: 2px solid var(--verde-folha);
    font-size: 0.938rem;
}

.diferenciais-breakdown .ajuste-total strong {
    font-size: 1.125rem;
    font-weight: 700;
}

.diferenciais-breakdown .ajuste-total strong.positivo {
    color: #5D8A5E;
}

.diferenciais-breakdown .ajuste-total strong.negativo {
    color: #C44536;
}

.diferenciais-breakdown .preco-final {
    background: linear-gradient(135deg, var(--verde-folha), #5D8A5E);
    color: white;
    padding: 0.875rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-top: 0.75rem;
    font-size: 1rem;
}

.diferenciais-breakdown .preco-final strong {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-top: 0.25rem;
}

/* Diferenciais - Info Badge */
.diferenciais-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(126, 154, 124, 0.1);
    border: 1px solid var(--verde-folha);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: var(--cafe-expresso);
    margin-left: 0.5rem;
}

.diferenciais-info-badge i {
    color: var(--verde-folha);
}

/* Loader para carregamento de diferenciais */
.diferenciais-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--verde-folha);
}

.diferenciais-loading i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Diferenciais - Tooltip */
.diferenciais-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--verde-folha);
}

.diferenciais-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cafe-expresso);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.25rem;
}

/* Diferenciais - Alert Box */
.diferenciais-alert {
    background: #FFF3CD;
    border: 1px solid #FFE69C;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.diferenciais-alert i {
    color: #856404;
    margin-top: 0.125rem;
}

.diferenciais-alert p {
    margin: 0;
    color: #856404;
    font-size: 0.875rem;
    line-height: 1.5;
}
