/* ============================================================
   Sistema de Orçamentos WD Máquinas
   CSS Completo - Responsivo
   ============================================================ */

/* ============================================================
   CSS Variables / Variáveis
   ============================================================ */
:root {
    --primary: #1a56db;
    --primary-dark: #1244b0;
    --primary-light: #e8effc;
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-width: 260px;
    --header-height: 64px;
    --transition: all 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   Layout: Sidebar + Main
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--white);
    flex-shrink: 0;
}

.sidebar-logo-text h1 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-logo-text span {
    font-size: 11px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    padding: 8px 12px;
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--gray-300);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.sidebar-link.active {
    background: var(--primary);
    color: var(--white);
}

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

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.main-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botão hamburger mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
}

.menu-toggle:hover {
    background: var(--gray-100);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* --- Page Content --- */
.page-content {
    flex: 1;
    padding: 32px;
}

/* ============================================================
   Cards de Dashboard
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.stat-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ============================================================
   Tabela / Listagem
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body {
    padding: 24px;
}

.card-body-no-pad {
    padding: 0;
}

/* --- Barra de ações --- */
.actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

/* --- Tabela --- */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

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

.data-table tbody tr:hover {
    background: var(--gray-50);
}

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

/* ============================================================
   Botões
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-success:hover {
    background: #059669;
}

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-icon.edit:hover { color: var(--info); }
.btn-icon.delete:hover { color: var(--danger); }
.btn-icon.view:hover { color: var(--success); }

/* ============================================================
   Badges / Status
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-pendente { background: var(--warning-light); color: var(--secondary-dark); }
.badge-aprovado { background: var(--success-light); color: #059669; }
.badge-recusado { background: var(--danger-light); color: #dc2626; }
.badge-expirado { background: var(--gray-200); color: var(--gray-600); }

/* ============================================================
   Formulários
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    color: var(--gray-800);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

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

.form-group input:disabled,
.form-group select:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================================
   Toast / Notificações
   ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 4px;
}

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

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

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-400);
    margin-bottom: 20px;
}

/* ============================================================
   Loading Spinner
   ============================================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 40px auto;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   Preview do Orçamento (página de impressão)
   ============================================================ */
.preview-page {
    background: var(--white);
    max-width: 900px;
    margin: 32px auto;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.preview-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.preview-content {
    padding: 48px;
}

/* Header do orçamento */
.orc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 3px solid var(--primary);
}

.orc-empresa h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.orc-empresa p {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
}

.orc-meta {
    text-align: right;
}

.orc-meta h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.orc-meta .orc-numero {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 12px;
}

.orc-meta-row {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.orc-meta-row strong {
    color: var(--gray-800);
}

/* Cliente info */
.orc-cliente-section {
    background: var(--gray-50);
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.orc-cliente-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.orc-cliente-section .nome {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.orc-cliente-section .info {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Tabela de itens */
.orc-tabela {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.orc-tabela thead {
    background: var(--primary);
    color: var(--white);
}

.orc-tabela th {
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-align: left;
}

.orc-tabela th:last-child,
.orc-tabela td:last-child {
    text-align: right;
}

.orc-tabela th:nth-child(3),
.orc-tabela td:nth-child(3) {
    text-align: center;
}

.orc-tabela th:nth-child(4),
.orc-tabela td:nth-child(4) {
    text-align: right;
}

.orc-tabela td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.orc-tabela .nome-produto {
    font-weight: 600;
    color: var(--gray-900);
}

/* Total */
.orc-total-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
}

.orc-total-box {
    background: var(--primary);
    color: var(--white);
    padding: 16px 32px;
    border-radius: var(--radius);
    text-align: right;
}

.orc-total-box span {
    font-size: 13px;
    display: block;
    opacity: 0.8;
}

.orc-total-box strong {
    font-size: 28px;
    font-weight: 800;
}

/* Info boxes */
.orc-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.orc-info-box {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
}

.orc-info-box h5 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.orc-info-box p {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.5;
}

/* Especificações do produto */
.orc-specs {
    margin-bottom: 32px;
}

.orc-specs h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.orc-specs p {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 8px;
}

/* Dimensões */
.orc-dimensoes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.orc-dim-item {
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
}

.orc-dim-item .dim-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.orc-dim-item .dim-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 4px;
}

.orc-dim-item .dim-unit {
    font-size: 12px;
    color: var(--gray-500);
}

/* Imagem do produto */
.orc-produto-imagem {
    text-align: center;
    margin-bottom: 24px;
}

.orc-produto-imagem img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

/* Footer orçamento */
.orc-footer {
    border-top: 2px solid var(--gray-200);
    padding-top: 24px;
    text-align: center;
}

.orc-footer p {
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================================
   Itens dinâmicos do orçamento (formulário)
   ============================================================ */
.item-row {
    display: grid;
    grid-template-columns: 1fr 100px auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.item-row .form-group {
    margin-bottom: 0;
}

.item-row .btn-icon {
    margin-bottom: 2px;
}

.item-info {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.item-valor {
    font-weight: 700;
    color: var(--primary);
}

.add-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.add-item-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ============================================================
   Confirm dialog
   ============================================================ */
.confirm-dialog {
    text-align: center;
    padding: 12px 0;
}

.confirm-dialog svg {
    width: 56px;
    height: 56px;
    color: var(--danger);
    margin-bottom: 16px;
}

.confirm-dialog h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.confirm-dialog p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .orc-info-grid {
        grid-template-columns: 1fr;
    }
    .orc-dimensoes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Sidebar se esconde no mobile */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Overlay sidebar mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        display: none;
    }
    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .main-header {
        padding: 0 16px;
    }

    .page-content {
        padding: 16px;
    }

    .orc-header {
        flex-direction: column;
        gap: 20px;
    }

    .orc-meta {
        text-align: left;
    }

    .preview-content {
        padding: 24px;
    }

    .orc-dimensoes {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .item-row {
        grid-template-columns: 1fr;
    }

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

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .orc-total-box strong {
        font-size: 22px;
    }

    .orc-dimensoes {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    body {
        background: white;
    }

    .sidebar,
    .main-header,
    .preview-actions,
    .sidebar-overlay,
    .toast-container {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .preview-page {
        box-shadow: none;
        margin: 0;
        border-radius: 0;
    }

    .preview-content {
        padding: 24px;
    }

    .orc-total-box {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .orc-tabela thead {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
