/* ============================================================
   MOLDAR - Design System
   Tema azul moderno com glassmorphism, gradientes e animações
   ============================================================ */

/* === Reset & Custom Properties === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    --blue-950: #0f2057;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;

    --gradient-main: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-800) 50%, var(--blue-950) 100%);
    --gradient-card: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
    --gradient-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(160deg, var(--blue-950) 0%, var(--blue-800) 40%, var(--blue-600) 100%);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-blue: 0 4px 14px rgba(37,99,235,0.25);
    --shadow-blue-lg: 0 10px 30px rgba(37,99,235,0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Base === */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    color: var(--slate-800);
    background: var(--slate-100);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a { color: var(--blue-600); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--blue-700); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* === Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

.animate-in { animation: fadeInUp 0.6s ease-out both; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }

/* === Navbar === */
.navbar {
    background: var(--gradient-main);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(15, 32, 87, 0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.logo::before {
    content: '';
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.logo::after {
    content: '';
    position: absolute;
    left: 6px;
    width: 20px;
    height: 20px;
    border: 2.5px solid white;
    border-radius: 4px;
    transform: rotate(45deg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.15);
}

.user-info {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--success);
}

.nav-links .btn-logout {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.nav-links .btn-logout:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.4);
    color: #fca5a5;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: var(--slate-700);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
    transform: scale(10);
    opacity: 0;
    transition: transform 0.4s, opacity 0.5s;
}

.btn:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

.btn:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--gradient-card);
    color: white;
    border: none;
    box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
    box-shadow: var(--shadow-blue-lg);
    transform: translateY(-2px);
    color: white;
}

.btn-primary::after {
    background: radial-gradient(circle, rgba(255,255,255,0.2) 10%, transparent 10.01%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    backdrop-filter: blur(4px);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
    color: white;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }

/* === Alerts === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 4px 0 0 4px;
}

.alert-sucesso {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.alert-sucesso::before { background: var(--success); }

.alert-erro {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-erro::before { background: var(--danger); }

.alert-info {
    background: var(--blue-50);
    color: var(--blue-800);
    border: 1px solid var(--blue-200);
}
.alert-info::before { background: var(--blue-500); }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ===================================================================
   HERO SECTION - Landing page
   =================================================================== */
.hero-section {
    background: var(--gradient-hero);
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Animated background grid */
.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg .grid-line {
    position: absolute;
    background: rgba(255,255,255,0.03);
}
.hero-bg .grid-line.horizontal {
    width: 100%;
    height: 1px;
}
.hero-bg .grid-line.vertical {
    width: 1px;
    height: 100%;
}

/* Floating geometric shapes */
.hero-bg .shape {
    position: absolute;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    animation: float 6s ease-in-out infinite;
}
.hero-bg .shape-1 {
    width: 80px; height: 80px;
    top: 15%; right: 10%;
    animation-delay: 0s;
    transform: rotate(15deg);
}
.hero-bg .shape-2 {
    width: 120px; height: 120px;
    top: 60%; right: 20%;
    animation-delay: 2s;
    transform: rotate(30deg);
    border-radius: 50%;
}
.hero-bg .shape-3 {
    width: 60px; height: 60px;
    top: 30%; left: 8%;
    animation-delay: 4s;
    background: rgba(255,255,255,0.02);
}
.hero-bg .shape-4 {
    width: 100px; height: 100px;
    bottom: 15%; left: 15%;
    animation-delay: 1s;
    border-radius: 50%;
    background: rgba(59,130,246,0.1);
}
.hero-bg .shape-5 {
    width: 40px; height: 40px;
    top: 50%; right: 35%;
    animation-delay: 3s;
    background: rgba(255,255,255,0.03);
    transform: rotate(60deg);
}

/* Gradient orb */
.hero-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}
.hero-bg .orb-1 {
    width: 400px; height: 400px;
    background: var(--blue-500);
    top: -100px; right: -100px;
}
.hero-bg .orb-2 {
    width: 300px; height: 300px;
    background: #7c3aed;
    bottom: -50px; left: -50px;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    color: var(--blue-200);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out both;
}

.hero-badge .dot {
    width: 6px; height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s ease-in-out infinite;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: white;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-content h1 .gradient-text {
    background: linear-gradient(135deg, var(--blue-300), #a78bfa, var(--blue-300));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--blue-200);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 520px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-visual {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Stats row at bottom of hero */
.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.hero-stat {
    text-align: left;
}

.hero-stat .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.hero-stat .stat-label {
    font-size: 0.8rem;
    color: var(--blue-300);
    margin-top: 0.25rem;
}

/* Floating card in hero */
.floating-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 320px;
    animation: float 6s ease-in-out infinite, fadeIn 1s ease-out 0.6s both;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.floating-card .fc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.floating-card .fc-title {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.floating-card .fc-badge {
    background: rgba(16,185,129,0.15);
    color: #6ee7b7;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.floating-card .fc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.floating-card .fc-row:last-child { border-bottom: none; }

.floating-card .fc-label {
    color: var(--blue-300);
    font-size: 0.8rem;
}

.floating-card .fc-value {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===================================================================
   DASHBOARD
   =================================================================== */
.page-title {
    margin: 2rem 0 0.5rem;
    animation: fadeInUp 0.5s ease-out;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--slate-900);
}

.page-title p {
    color: var(--slate-500);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--slate-500);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Stat card color variants */
.stat-card.blue::before { background: var(--gradient-card); }
.stat-card.blue .stat-icon { background: var(--blue-50); color: var(--blue-600); }

.stat-card.green::before { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.green .stat-icon { background: var(--success-bg); color: var(--success); }

.stat-card.amber::before { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.amber .stat-icon { background: var(--warning-bg); color: var(--warning); }

.stat-card.red::before { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-card.red .stat-icon { background: var(--danger-bg); color: var(--danger); }

/* Dashboard cards grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* ===================================================================
   CARDS
   =================================================================== */
.card {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--slate-100);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--slate-800);
}

.card-icon {
    width: 44px;
    height: 44px;
    background: var(--blue-50);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-600);
    font-size: 1.2rem;
}

.card-body p {
    color: var(--slate-500);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* Feature card with gradient border on hover */
.feature-card {
    position: relative;
    background: white;
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--slate-200);
    transition: var(--transition);
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-card);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.feature-card:hover::before { transform: scaleX(1); }

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

.feature-card .feature-icon {
    width: 56px;
    height: 56px;
    background: var(--blue-50);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    background: var(--gradient-card);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-blue);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--slate-500);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

/* Quick action list inside cards */
.quick-actions {
    list-style: none;
}

.quick-actions li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--slate-100);
    transition: var(--transition);
}

.quick-actions li:last-child { border-bottom: none; }

.quick-actions li:hover { padding-left: 0.5rem; }

.quick-actions .qa-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.quick-actions .qa-text {
    font-size: 0.9rem;
    color: var(--slate-700);
    font-weight: 500;
}

.quick-actions .qa-meta {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--slate-400);
}

/* ===================================================================
   FORMS - Modern glassmorphism forms
   =================================================================== */
.auth-wrapper {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-wrapper .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
}
.auth-wrapper .orb-1 {
    width: 300px; height: 300px;
    background: var(--blue-400);
    top: -50px; right: -50px;
}
.auth-wrapper .orb-2 {
    width: 250px; height: 250px;
    background: #7c3aed;
    bottom: -50px; left: -50px;
}

.auth-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 2;
}

.auth-card .auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--blue-700);
    margin-bottom: 0.5rem;
}

.auth-card .auth-subtitle {
    color: var(--slate-500);
    font-size: 0.9rem;
}

.form-container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease-out;
}

.form-container h2 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--slate-900);
}

.form-container .form-subtitle {
    color: var(--slate-500);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--slate-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--slate-50);
    color: var(--slate-800);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    background: white;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}

.form-group input::placeholder { color: var(--slate-400); }

.form-group textarea { resize: vertical; min-height: 100px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--slate-500);
}

.form-footer a {
    color: var(--blue-600);
    font-weight: 600;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--slate-400);
    font-size: 0.8rem;
}
.form-divider::before, .form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--slate-200);
}

/* === Google Button === */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1.25rem;
    background: white;
    color: var(--slate-700);
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-google:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--slate-700);
}

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

/* ===================================================================
   TABLES - Modern data tables
   =================================================================== */
.table-wrapper {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-top: 1.25rem;
    animation: fadeInUp 0.5s ease-out;
}

/* === Search Bar === */
.search-bar {
    position: relative;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.75rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: var(--slate-800);
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}

.search-bar input::placeholder {
    color: var(--slate-400);
}

.search-bar .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    pointer-events: none;
    transition: var(--transition);
}

.search-bar input:focus ~ .search-icon {
    color: var(--blue-500);
}

.search-bar .search-clear {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--slate-400);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: none;
    transition: var(--transition);
}

.search-bar .search-clear:hover {
    color: var(--slate-600);
    background: var(--slate-100);
}

.search-bar .search-clear.visible {
    display: flex;
}

.search-results-info {
    font-size: 0.8rem;
    color: var(--slate-400);
    margin-top: 0.5rem;
}

.table tbody tr.search-hidden {
    display: none;
}

.table td .highlight {
    background: var(--warning-bg);
    color: var(--slate-900);
    border-radius: 2px;
    padding: 0 1px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--slate-50);
    text-align: left;
    padding: 0.9rem 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-500);
    font-weight: 600;
    border-bottom: 2px solid var(--slate-200);
}

.table td {
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
    transition: var(--transition);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover td {
    background: var(--blue-50);
}

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

.table td a {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.table td a:hover {
    gap: 0.5rem;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-pendente {
    background: var(--slate-100);
    color: var(--slate-600);
}
.badge-pendente::before { background: var(--slate-400); }

.badge-em_producao {
    background: var(--blue-100);
    color: var(--blue-800);
}
.badge-em_producao::before { background: var(--blue-500); animation: pulse 2s ease-in-out infinite; }

.badge-pausada {
    background: var(--warning-bg);
    color: #92400e;
}
.badge-pausada::before { background: var(--warning); }

.badge-concluida {
    background: var(--success-bg);
    color: #065f46;
}
.badge-concluida::before { background: var(--success); }

.badge-cancelada {
    background: var(--danger-bg);
    color: #991b1b;
}
.badge-cancelada::before { background: var(--danger); }

.badge-baixa { background: var(--slate-100); color: var(--slate-600); }
.badge-baixa::before { background: var(--slate-400); }

.badge-normal { background: var(--blue-100); color: var(--blue-700); }
.badge-normal::before { background: var(--blue-500); }

.badge-alta { background: var(--warning-bg); color: #92400e; }
.badge-alta::before { background: var(--warning); }

.badge-urgente { background: var(--danger-bg); color: #991b1b; }
.badge-urgente::before { background: var(--danger); animation: pulse 1.5s ease-in-out infinite; }

.badge-aguardando { background: var(--slate-100); color: var(--slate-600); }
.badge-aguardando::before { background: var(--slate-400); }

.badge-ativo { background: var(--success-bg); color: #065f46; }
.badge-ativo::before { background: var(--success); }

.badge-inativo { background: var(--slate-100); color: var(--slate-600); }
.badge-inativo::before { background: var(--slate-400); }

.badge-planejamento { background: var(--blue-100); color: var(--blue-700); }
.badge-planejamento::before { background: var(--blue-500); }

.badge-em_andamento { background: var(--blue-100); color: var(--blue-800); }
.badge-em_andamento::before { background: var(--blue-500); animation: pulse 2s ease-in-out infinite; }

.badge-entregue { background: var(--success-bg); color: #065f46; }
.badge-entregue::before { background: var(--success); }

/* ===================================================================
   DETAIL PAGE
   =================================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.detail-card {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.detail-card-header {
    background: var(--slate-50);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--slate-700);
}

.detail-card-body {
    padding: 1.5rem;
}

dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0;
}

dl dt, dl dd {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--slate-100);
}

dl dt:last-of-type, dl dd:last-of-type { border-bottom: none; }

dt {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

dd {
    font-size: 0.9rem;
    color: var(--slate-800);
}

.status-atual {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--slate-50);
    border-radius: var(--radius-sm);
}

.status-atual .badge {
    font-size: 0.85rem;
    padding: 0.4rem 1.25rem;
}

/* ===================================================================
   PAGE HEADER
   =================================================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1rem;
    animation: fadeInUp 0.5s ease-out;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--slate-900);
}

/* ===================================================================
   EMPTY STATE
   =================================================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--slate-500);
    animation: fadeIn 0.5s ease-out;
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    background: var(--blue-50);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--slate-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ===================================================================
   FOOTER
   =================================================================== */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    color: var(--slate-500);
    font-size: 0.8rem;
    border-top: 1px solid var(--slate-200);
    background: white;
}

.footer .footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--slate-400);
    font-size: 0.8rem;
    transition: var(--transition);
}

.footer-links a:hover { color: var(--blue-600); }

/* ===================================================================
   PROGRESS BAR
   =================================================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--slate-200);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar .progress-fill {
    height: 100%;
    background: var(--gradient-card);
    border-radius: 10px;
    transition: width 1s ease-out;
    position: relative;
}

.progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
    background-size: 200% 100%;
}

/* ===================================================================
   TOOLTIP
   =================================================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--slate-900);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===================================================================
   SIDEBAR
   =================================================================== */
.app-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--slate-200);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--slate-100);
}

.sidebar-empresa {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-empresa-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-blue);
}

.sidebar-empresa-info {
    overflow: hidden;
}

.sidebar-empresa-nome {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-empresa-slug {
    font-size: 0.75rem;
    color: var(--slate-400);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section {
    margin-top: 1rem;
}

.sidebar-section:first-child {
    margin-top: 0;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--slate-400);
    padding: 0.5rem 0.75rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--slate-600);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-link:hover {
    background: var(--slate-50);
    color: var(--slate-800);
}

.sidebar-link.active {
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--gradient-card);
    border-radius: 0 3px 3px 0;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active svg {
    opacity: 1;
    color: var(--blue-600);
}

.sidebar-link .sidebar-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.sidebar-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--slate-100);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-user-info {
    overflow: hidden;
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: var(--slate-400);
    text-transform: capitalize;
}

.sidebar-logout {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-200);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-400);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    background: var(--danger-bg);
    border-color: #fecaca;
    color: var(--danger);
}

/* App content area (ao lado do sidebar) */
.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content .main-content {
    flex: 1;
    padding: 0 1.5rem 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Sidebar mobile toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-card);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: var(--shadow-blue-lg);
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.05);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 90;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }

    .hero-section { flex-direction: column; text-align: center; padding: 2rem 1rem; }
    .hero-section .container { flex-direction: column; }
    .hero-content { max-width: 100%; }
    .hero-content h1 { font-size: 2.2rem; }
    .hero-actions { justify-content: center; flex-wrap: wrap; }
    .hero-stats { justify-content: center; gap: 2rem; }
    .hero-visual { display: none; }
    .floating-card { display: none; }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }

    .nav-links { display: none; }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--blue-950);
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        animation: fadeIn 0.2s ease;
    }
    .nav-links.active a { padding: 0.75rem 1rem; }

    .nav-toggle { display: block; }

    .page-header { flex-direction: column; gap: 1rem; align-items: flex-start; }

    .table-wrapper { overflow-x: auto; }

    .footer .footer-inner { flex-direction: column; gap: 0.75rem; }

    /* Sidebar mobile */
    .sidebar {
        position: fixed;
        left: -260px;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 100;
        box-shadow: none;
        transition: left 0.3s ease, box-shadow 0.3s ease;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }

    .app-content .main-content {
        padding: 0 1rem 2rem;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 1.75rem; }
}

/* =============================================
   INSUMOS - Pagina de Configuracao
   ============================================= */

.insumo-section {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.insumo-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--slate-50);
    border-bottom: 2px solid var(--slate-200);
}

.insumo-section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--slate-800);
    margin: 0;
}

.insumo-card {
    border-bottom: 1px solid var(--slate-100);
    overflow: hidden;
}

.insumo-card:last-child {
    border-bottom: none;
}

.insumo-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
}

.insumo-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--slate-700);
    margin: 0;
}

/* Precos dos materiais */
.preco-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1.25rem 1rem;
}

.preco-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--slate-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-100);
}

.preco-item-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--slate-700);
    min-width: 100px;
}

.preco-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.preco-dot-cimento { background: var(--slate-500); }
.preco-dot-areia { background: var(--warning); }
.preco-dot-brita { background: var(--slate-400); }
.preco-dot-aditivo { background: var(--blue-500); }
.preco-dot-agua { background: var(--blue-300); }

.preco-item-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preco-prefix {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--slate-500);
}

.preco-input {
    width: 110px;
    padding: 0.4rem 0.6rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
    background: white;
    color: var(--slate-800);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.preco-input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.preco-suffix {
    font-size: 0.8rem;
    color: var(--slate-400);
    min-width: 70px;
}

/* FCK badge */
.fck-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    background: var(--blue-100);
    color: var(--blue-800);
    border: 1px solid var(--blue-200);
}

/* Proporcoes do traco */
.traco-proporcoes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1.25rem;
    flex-wrap: wrap;
}

.traco-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--slate-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-100);
    min-width: 65px;
}

.traco-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-500);
    margin-bottom: 0.15rem;
}

.traco-valor {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue-700);
}

.traco-separador {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--slate-300);
}

/* Accordion */
.accordion-item {
    border-bottom: 1px solid var(--slate-200);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: white;
    transition: background 0.2s ease;
    user-select: none;
}

.accordion-header:hover {
    background: var(--slate-50);
}

.accordion-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--slate-700);
    margin: 0;
}

.accordion-chevron {
    color: var(--slate-400);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-body {
    padding: 1.25rem;
    border-top: 1px solid var(--slate-100);
    background: white;
    animation: fadeIn 0.2s ease-out;
}

/* Tabela de bitolas */
.bitola-table {
    padding: 0;
}

.bitola-header {
    display: grid;
    grid-template-columns: 100px 1fr 100px 100px 110px;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-500);
    border-bottom: 2px solid var(--slate-200);
    margin-bottom: 0.5rem;
}

.bitola-row {
    display: grid;
    grid-template-columns: 100px 1fr 100px 100px 110px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--slate-100);
    transition: background 0.2s;
}

.bitola-row:hover {
    background: var(--blue-50);
}

.bitola-row:last-child {
    border-bottom: none;
}

.bitola-col-nome {
    font-size: 0.9rem;
    color: var(--slate-700);
}

.bitola-col-toggle {
    display: flex;
    justify-content: center;
}

.bitola-col-preco .preco-input {
    width: 90px;
}

.bitola-col-calc {
    font-size: 0.85rem;
}

.valor-calculado {
    font-weight: 600;
    color: var(--slate-600);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--slate-300);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--blue-500);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* Bitola chips (para estribos e consoles) */
.bitola-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1.25rem;
}

.bitola-chip {
    cursor: pointer;
}

.bitola-chip input {
    display: none;
}

.bitola-chip-label {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid var(--slate-200);
    background: var(--slate-50);
    color: var(--slate-500);
    transition: all 0.2s ease;
    user-select: none;
}

.bitola-chip input:checked + .bitola-chip-label {
    background: var(--blue-50);
    border-color: var(--blue-400);
    color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bitola-chip-label:hover {
    border-color: var(--blue-300);
    background: var(--blue-50);
}

/* Console drawing */
.console-drawing {
    margin-bottom: 0.5rem;
}

/* ===== Overlay / Modal ===== */
.overlay-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.overlay-backdrop.active {
    display: flex;
    animation: overlayFadeIn 0.25s ease-out;
}

.overlay-content {
    background: white;
    border-radius: var(--radius-xl, 16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    animation: overlaySlideIn 0.3s ease-out;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--slate-200);
}

.overlay-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--slate-800);
    margin: 0;
}

.overlay-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--slate-100);
    border-radius: 50%;
    cursor: pointer;
    color: var(--slate-500);
    transition: all 0.2s ease;
}

.overlay-close:hover {
    background: var(--slate-200);
    color: var(--slate-700);
}

.overlay-body {
    padding: 1.5rem;
}

.overlay-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--slate-600);
    background: white;
    border: 1.5px solid var(--slate-300);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-outline:hover {
    background: var(--slate-50);
    border-color: var(--slate-400);
    color: var(--slate-700);
}

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

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

/* ===== Pecas ===== */
.empty-state-pecas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem 1rem;
    text-align: center;
}

.empty-state-pecas p {
    color: var(--slate-400);
    font-size: 0.95rem;
    margin: 0;
}

.peca-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--slate-100);
    transition: background 0.15s ease;
}

.peca-card:last-child {
    border-bottom: none;
}

.peca-card:hover {
    background: var(--slate-50);
}

.peca-card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--slate-700);
}

/* Responsivo overlay */
@media (max-width: 768px) {
    .overlay-backdrop {
        padding: 1rem;
    }

    .overlay-content {
        max-height: 95vh;
        border-radius: var(--radius-lg, 12px);
    }
}

/* Form rows com 3 colunas para insumos */
.insumo-section .form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Responsivo insumos */
@media (max-width: 768px) {
    .bitola-header,
    .bitola-row {
        grid-template-columns: 80px 1fr 80px;
    }

    .bitola-col-calc:nth-child(n+4) {
        display: none;
    }

    .preco-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .insumo-section .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .accordion-body > div[style*="flex"] {
        flex-direction: column;
    }

    .bitola-chips {
        padding: 0.75rem 0;
    }
}

/* === Form Validation Errors === */
.form-errors {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: fadeInUp 0.3s ease;
}

.error-message::before {
    content: "⚠";
    font-size: 1rem;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--danger);
    background-color: var(--danger-bg);
}

.form-group input:invalid:not(:focus),
.form-group select:invalid:not(:focus),
.form-group textarea:invalid:not(:focus) {
    border-color: var(--danger);
}

/* Validation feedback */
.form-group input:valid:not(:placeholder-shown),
.form-group select:valid,
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: var(--success);
}
