/* Estilos customizados para ARES ADEGAS */

:root {
    --wine-700: #4c1f26;
    --wine-600: #722f37;
    --wine-100: #fce7e7;
    --wine-50: #fdf4f4;
    --slate-900: #0f172a;
    --slate-700: #334155;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Body e base */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #1f2937;
}

/* Cards com sombra hover */
.card {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(114, 47, 55, 0.15);
    transform: translateY(-2px);
}

/* Botões */
button, a.btn {
    transition: all 0.3s ease;
}

button:active, a.btn:active {
    transform: scale(0.98);
}

/* Toast/Alert animations */
.alert {
    animation: slideIn 0.3s ease;
}

/* Touch-friendly spacing */
@media (max-width: 640px) {
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Tab bar para mobile */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    z-index: 40;
}

@media (max-width: 640px) {
    .mobile-tab-bar {
        display: flex;
    }
    
    main {
        margin-bottom: 60px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #722f37;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4c1f26;
}

/* Tabelas responsivas */
table {
    width: 100%;
}

@media (max-width: 768px) {
    table thead {
        display: none;
    }
    
    table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: white;
    }
    
    table td {
        display: block;
        padding: 0.75rem;
        text-align: right;
        border: none;
    }
    
    table td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #722f37;
    }
}

/* Focus states para acessibilidade */
button:focus, input:focus, select:focus, textarea:focus, a:focus {
    outline: 2px solid #722f37;
    outline-offset: 2px;
}

/* Loading spinner */
.spinner {
    border: 4px solid #e5e7eb;
    border-top: 4px solid #722f37;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Layout helpers */
.page-section {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.page-header__top {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-header__title {
    font-size: clamp(1.75rem, 1.4rem + 1vw, 2.5rem);
    font-weight: 800;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header__subtitle {
    font-size: 0.95rem;
    color: #6b7280;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(114, 47, 55, 0.95), rgba(76, 31, 38, 0.95));
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 20px 45px rgba(114, 47, 55, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-header__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 52px rgba(114, 47, 55, 0.4);
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(114, 47, 55, 0.1);
    color: #722f37;
    border-radius: 9999px;
}

/* Cards */
.surface-card {
    display: block;
    position: relative;
    background: #ffffff;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    padding: 1.75rem;
}

.surface-card--gradient {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
}

.surface-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.surface-card__subtitle {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #64748b;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #ffffff;
    padding: 1.75rem;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
}

.stat-card__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.stat-card__value {
    margin-top: 0.5rem;
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
}

.stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.5rem;
    width: 3.5rem;
    border-radius: 1.25rem;
    background: rgba(114, 47, 55, 0.08);
    color: #722f37;
    font-size: 1.4rem;
}

.card-grid {
    display: grid;
    gap: 1.5rem;
}

/* Filter chips & badges */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    border-color: #d1d5db;
    color: #722f37;
    box-shadow: 0 2px 8px rgba(114, 47, 55, 0.15);
}

.filter-chip.is-active {
    background: #722f37;
    border-color: #722f37;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(114, 47, 55, 0.25);
}

.filter-chip.is-active.planeado {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.25);
}

.filter-chip.is-active.em-producao {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.filter-chip.is-active.concluido {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.25);
}

.status-badge,
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #374151;
    letter-spacing: 0.02em;
}

.status-badge i,
.priority-badge i {
    font-size: 0.65rem;
}

.status-badge.concluido {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.em_producao {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.planeado {
    background: #fef3c7;
    color: #b45309;
}

.status-badge.pendente {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.em_preparacao {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.pronto {
    background: #dcfce7;
    color: #15803d;
}

.status-badge.recolhido {
    background: #ede9fe;
    color: #5b21b6;
}

.status-steps {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem 1.5rem 0;
    position: relative;
}

@media (max-width: 768px) {
    .status-steps {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: space-between;
        padding: 1.5rem 1rem 0;
    }
}

.status-step {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}

.status-step::after {
    content: "";
    position: absolute;
    top: 0.85rem;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.status-step:last-child::after {
    display: none;
}

.status-step__dot {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-step.complete {
    color: #047857;
}

.status-step.complete .status-step__dot {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(5, 150, 105, 0.95));
    border-color: rgba(16, 185, 129, 0.92);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.25);
}

.status-step.complete::after {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.55), rgba(16, 185, 129, 0.15));
}

.status-step.current {
    color: #722f37;
}

.status-step.current .status-step__dot {
    background: linear-gradient(135deg, rgba(114, 47, 55, 0.95), rgba(76, 31, 38, 0.95));
    border-color: rgba(114, 47, 55, 0.95);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(114, 47, 55, 0.28);
}

.status-step.current::after {
    background: linear-gradient(135deg, rgba(114, 47, 55, 0.55), rgba(114, 47, 55, 0.15));
}

.status-step__label {
    text-align: center;
}

.item-card {
    position: relative;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    padding: 1.15rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.item-card:hover {
    border-color: rgba(114, 47, 55, 0.25);
    box-shadow: 0 24px 55px rgba(114, 47, 55, 0.16);
    transform: translateY(-2px);
}

.item-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.item-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
}

.item-card__meta strong {
    color: #0f172a;
}

.mini-progress {
    width: 100%;
    height: 6px;
    border-radius: 9999px;
    background: #e5e7eb;
    overflow: hidden;
}

.mini-progress__bar {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(114, 47, 55, 0.95), rgba(114, 47, 55, 0.65));
    transition: width 0.4s ease;
}

.item-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.item-card__location {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.item-card__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .item-card__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
}

.priority-badge.alta {
    background: #fee2e2;
    color: #b91c1c;
}

.priority-badge.normal {
    background: #f3f4f6;
    color: #374151;
}

.priority-badge.baixa {
    background: #dcfce7;
    color: #15803d;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-pill.primary {
    background: #2563eb;
    color: #ffffff;
}

.action-pill.primary:hover {
    background: #1d4ed8;
}

.action-pill.info {
    background: #7c3aed;
    color: #ffffff;
}

.action-pill.info:hover {
    background: #6d28d9;
}

.action-pill.success {
    background: #22c55e;
    color: #ffffff;
}

.action-pill.success:hover {
    background: #16a34a;
}

.action-pill.accent {
    background: #722f37;
    color: #ffffff;
}

.action-pill.accent:hover {
    background: #601f28;
}

.action-pill.danger {
    background: #dc2626;
    color: #ffffff;
}

.action-pill.danger:hover {
    background: #b91c1c;
}

button.action-pill {
    border: none;
}

.progress-bar {
    transition: width 0.4s ease;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    border-radius: var(--radius-xl);
    border: 2px dashed #e5e7eb;
    background: #ffffff;
}

.empty-state__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4rem;
    width: 4rem;
    border-radius: 9999px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 1.5rem;
}

.empty-state__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.empty-state__subtitle {
    max-width: 22rem;
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid #e5e7eb;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-shell:focus-within {
    border-color: rgba(114, 47, 55, 0.5);
    box-shadow: 0 8px 25px rgba(114, 47, 55, 0.18);
}

.input-shell input,
.input-shell select,
.input-shell textarea {
    flex: 1 1 auto;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
}

.input-shell i {
    color: #999;
}

.pill-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 9999px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pill-button--primary {
    background: linear-gradient(135deg, rgba(114, 47, 55, 0.95), rgba(76, 31, 38, 0.95));
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(114, 47, 55, 0.25);
}

.pill-button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 46px rgba(114, 47, 55, 0.32);
}

.pill-button--ghost {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #4b5563;
}

.pill-button--ghost:hover {
    border-color: #d1d5db;
    color: #1f2937;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

/* Safe area insets para notch devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .shadow, .shadow-lg {
        box-shadow: none !important;
    }
}
