/* style.css */
/* Reset simples */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --bg:#f4f7fb; --card:#ffffff; --muted:#6b7280; --accent:#007acc; --accent-2:#0b84ff;
  --text:#0f1724; --success:#16a34a; --danger:#ef4444; --glass: rgba(255,255,255,0.6);
  --shadow: 0 6px 18px rgba(15,23,36,0.08);
}
[data-theme="dark"]{
  --bg:#0b1220; --card:#071126; --muted:#9aa4b2; --accent:#2ea3ff; --accent-2:#4fb3ff;
  --text:#e6eef8; --glass: rgba(255,255,255,0.03); --shadow: 0 6px 18px rgba(0,0,0,0.6);
}

/* Layout */
body{ font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; background:linear-gradient(180deg,var(--bg),#ffffff 1200px); color:var(--text); min-height:100vh; }
.app{ max-width:1200px; margin:28px auto; padding:18px; }
.header{ display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:18px; }
.header-left{ display:flex; gap:14px; align-items:center; }
.logo-wrap img{ width:120px; height:60px; object-fit:contain; border-radius:6px; background:var(--card); box-shadow:var(--shadow); }
.company-info h1{ font-size:20px; margin-bottom:4px; }
.company-info p{ color:var(--muted); font-size:13px; }

.header-right .controls{ display:flex; gap:8px; align-items:center; }
.file-btn{ background:var(--card); border-radius:8px; padding:6px 10px; cursor:pointer; box-shadow:var(--shadow); display:inline-flex; align-items:center; gap:8px; }
.file-btn input{ display:none; }
.file-btn.import span{ padding:6px 10px; }

#themeToggle{ background:transparent; border:1px solid var(--glass); padding:6px 8px; border-radius:8px; cursor:pointer; }
.header-right button{ cursor:pointer; }

.main{ display:grid; grid-template-columns: 1fr 420px; gap:18px; align-items:start; }
.left-panel .card, .right-panel .card{ background:var(--card); padding:14px; border-radius:10px; box-shadow:var(--shadow); }
.card h2{ margin-bottom:10px; font-size:16px; }

.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.form-grid label{ display:block; font-size:13px; color:var(--muted); }
.form-grid input{ width:100%; padding:8px 10px; margin-top:6px; border-radius:8px; border:1px solid #e6eef8; background:transparent; color:var(--text); }

textarea#notes{ width:100%; min-height:90px; padding:10px; border-radius:8px; border:1px solid #e6eef8; margin-top:8px; resize:vertical; background:transparent; color:var(--text); }

.table-wrap{ overflow:auto; }
table{ width:100%; border-collapse:collapse; font-size:14px; }
table thead th{ text-align:left; padding:8px; border-bottom:1px solid #e6eef8; color:var(--muted); font-weight:600; }
table tbody td{ padding:8px; border-bottom:1px dashed #eef3fb; vertical-align:middle; }
.table-actions{ display:flex; gap:8px; margin-top:8px; }
.table-actions button{ padding:8px 10px; border-radius:8px; cursor:pointer; background:var(--accent); color:white; border:none; }

.items-input{ width:100%; padding:6px 8px; border-radius:6px; border:1px solid #e6eef8; background:transparent; color:var(--text); }

.right-panel{ position:relative; }
.summary-card{ display:flex; flex-direction:column; gap:12px; }
.summary-header{ display:flex; justify-content:space-between; align-items:center; }
.summary-company{ display:flex; gap:10px; align-items:center; }
.summary-company img{ width:56px; height:36px; object-fit:contain; border-radius:6px; background:var(--card); }
.summary-client, .summary-meta{ font-size:13px; color:var(--muted); display:grid; gap:6px; }
.summary-table-wrap{ max-height:220px; overflow:auto; }
#summaryTable{ width:100%; border-collapse:collapse; margin-top:6px; }
#summaryTable th, #summaryTable td{ padding:6px; border-bottom:1px solid #eef3fb; font-size:13px; text-align:left; }
.summary-totals{ margin-top:8px; }
.summary-totals .line{ display:flex; justify-content:space-between; padding:6px 0; color:var(--muted); }
.summary-totals .total-line{ font-size:18px; color:var(--text); }
.discount-controls{ display:flex; gap:6px; align-items:center; }
.discount-controls input{ width:110px; padding:6px; border-radius:6px; border:1px solid #e6eef8; }

.signature{ margin-top:12px; text-align:center; color:var(--muted); }
.signature .sig-line{ margin-bottom:6px; }

.actions{ display:flex; gap:8px; margin-top:8px; }
.actions button{ flex:1; padding:10px; border-radius:8px; border:none; cursor:pointer; background:var(--accent); color:white; }

.footer{ margin-top:18px; text-align:center; color:var(--muted); font-size:13px; }

/* Responsividade */
@media (max-width:980px){
  .main{ grid-template-columns: 1fr; }
  .right-panel{ order:2; }
  .left-panel{ order:1; }
}

/* Pequenos ajustes visuais */
button:active{ transform:translateY(1px); }
