:root {
    --primary: #EA580C;
    --primary-dark: #C2410C;
    --primary-light: #FFF7ED;
    --primary-lighter: #FFEDD5;
    --secondary: #FCD34D;
    --secondary-dark: #F59E0B;
    --white: #FFFFFF;
    --black: #1F2937;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--black);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--black);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    display: block;
    width: 100%;
}

.landing-header {
    background: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.landing-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.logo span {
    color: var(--black);
}

.nav-links a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--black);
    font-weight: 500;
}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 180px 0 100px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero .subtitle {
    font-size: 24px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.hero .price {
    font-size: 56px;
    font-weight: 700;
    color: var(--secondary);
    margin: 30px 0;
}

.hero .price span {
    font-size: 20px;
    opacity: 0.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.features {
    padding: 80px 0;
    background: var(--gray-100);
}

.features h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--black);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.feature-card .icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary);
}

.cta {
    background: var(--secondary);
    padding: 60px 0;
    text-align: center;
}

.cta h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: var(--black);
}

.landing-footer {
    background: var(--black);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.auth-box {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
}

.auth-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 15px;
    background: #EAECEF;
    color: var(--black);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    background: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 5px;
    line-height: 1.4;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #FEE2E2;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-success {
    background: #D1FAE5;
    color: var(--success);
    border: 1px solid var(--success);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .hero .price {
        font-size: 40px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
}

/* Correção limpa: produtos sem quebrar colunas e sem cortar ações */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.main-content,
.content,
.page-content,
.dashboard-content {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.card,
.table-card,
.content-card {
    max-width: 100%;
    min-width: 0;
    overflow: visible !important;
}

.card:has(table),
.table-responsive,
.table-container {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Não transformar table em block. Isso quebra as colunas. */
table {
    border-collapse: collapse;
    width: 100%;
}

/* Só no desktop: dá largura mínima para caber as ações */
@media (min-width: 900px) {
    .card:has(table) table,
    .table-responsive table,
    .table-container table {
        min-width: 1220px;
    }

    table th,
    table td {
        padding: 9px 10px;
        font-size: 0.9rem;
        vertical-align: middle;
    }

    table th:last-child,
    table td:last-child {
        min-width: 280px;
        width: 280px;
        white-space: nowrap;
    }

    table td:last-child .btn,
    table td:last-child button,
    table td:last-child a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 6px;
        white-space: nowrap;
    }
}

.page-header,
.content-header,
.card-header {
    overflow: visible !important;
}

/* Produtos: manter botões de ações sempre visíveis */
body:has(a[href="/produtos"].active) .card:has(table) {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

body:has(a[href="/produtos"].active) table {
    width: max-content !important;
    min-width: 1180px !important;
}

body:has(a[href="/produtos"].active) table th:last-child,
body:has(a[href="/produtos"].active) table td:last-child {
    position: sticky !important;
    right: 0 !important;
    z-index: 5 !important;
    background: #fff !important;
    min-width: 260px !important;
    width: 260px !important;
    white-space: nowrap !important;
    box-shadow: -8px 0 12px rgba(15, 23, 42, 0.06);
}

body:has(a[href="/produtos"].active) table th:last-child {
    background: #f3f4f6 !important;
    z-index: 6 !important;
}

body:has(a[href="/produtos"].active) table td:last-child a,
body:has(a[href="/produtos"].active) table td:last-child button,
body:has(a[href="/produtos"].active) table td:last-child .btn {
    display: inline-flex !important;
    margin-right: 6px !important;
    white-space: nowrap !important;
}