:root {
    --bg-color-main: #0f172a;
    --bg-color-alt: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --accent: #f59e0b; /* Laranja madeirado moderno */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 2rem;
}

/* Background Shapes for Glassmorphism Context */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    bottom: -200px;
    right: -100px;
    opacity: 0.2;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 40%;
    left: 40%;
    opacity: 0.15;
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.app-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.logo i {
    color: var(--accent);
}

.logo span {
    color: var(--primary);
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-glass);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h2 i {
    color: var(--primary);
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.btn-icon {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.23);
}

.btn-secondary {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.8rem;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--danger);
    color: white;
}

.btn-remove {
    background: transparent;
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.w-100 { width: 100%; }
.mt-4 { margin-top: 2rem; }
.mt-2 { margin-top: 1rem; }

/* Item Rows */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.item-row:hover {
    background: rgba(0,0,0,0.3);
}

.flex-2 {
    flex: 2;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol, .qty-symbol {
    position: absolute;
    left: 12px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
}

.input-with-icon input {
    padding-left: 36px;
}

/* Espaçamento extra para "Qtd" que é mais largo que "R$" */
.input-with-icon input.item-qty {
    padding-left: 45px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

input[type="number"] {
    text-align: right;
}

.item-total {
    min-width: 100px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

.subtotal-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    padding-top: 1rem;
    border-top: 1px dashed var(--glass-border);
}

/* Configs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.highlight-input input {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: bold;
}

.highlight-input input:focus {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Dashboard Panel */
.sticky-panel {
    position: sticky;
    top: 2rem;
}

.dashboard-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

.summary-item strong {
    color: var(--text-main);
    font-weight: 500;
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

.primary-cost {
    font-size: 1.1rem;
}

.profit-margin strong {
    color: var(--success);
}

.final-price-box {
    background: linear-gradient(135deg, rgba(14,165,233,0.1) 0%, rgba(139,92,246,0.1) 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.final-price-box h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Responsive */
@media (max-width: 992px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    .sticky-panel {
        position: static;
    }
}

@media (max-width: 600px) {
    .item-row {
        flex-wrap: wrap;
    }
    
    .flex-2 {
        flex: 1 1 100%;
    }

    .item-total {
        flex: 1;
        text-align: left;
    }
}

/* Impressão */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .bg-shape, #print-btn, #clear-btn, .btn-icon, .btn-remove {
        display: none !important;
    }

    .glass-panel {
        border: 1px solid #ddd;
        box-shadow: none;
        background: transparent;
        color: black;
    }
    
    * {
        color: black !important;
    }
    
    input {
        border: none;
        background: transparent;
        padding: 0;
    }
}
