* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; min-height: 100vh; }

/* LOGIN */
#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #185FA5, #0C447C); padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-title { font-size: 16px; font-weight: 700; color: #111; }
.login-sub { font-size: 12px; color: #888; }
.logo-circle { width: 44px; height: 44px; background: #FFD700; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #185FA5; font-size: 16px; flex-shrink: 0; }

/* TOPBAR */
.topbar { background: #185FA5; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-circle-sm { width: 32px; height: 32px; background: #FFD700; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #185FA5; font-size: 12px; flex-shrink: 0; }
.topbar-title { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.2; }
.topbar-sub { color: #B5D4F4; font-size: 10px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.btn-logout { background: rgba(255,255,255,0.15); border: none; border-radius: 6px; padding: 5px 12px; color: #fff; font-size: 12px; cursor: pointer; }
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* APP */
.app-body { max-width: 900px; margin: 0 auto; padding: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 8px; border: 1px solid #0C447C; background: #E6F1FB; font-size: 12px; cursor: pointer; color: #0C447C; font-weight: 600; }
.tab.active { background: #185FA5; color: #fff; }
.tab:hover:not(.active) { background: #B5D4F4; }

/* COMPONENTS */
.section { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.section h3 { font-size: 14px; font-weight: 600; color: #111; margin-bottom: 10px; }
.field { margin-bottom: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
label { font-size: 11px; color: #666; display: block; margin-bottom: 3px; font-weight: 500; }
input, select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #ddd; font-size: 13px; background: #fff; color: #111; }
input:focus, select:focus { outline: none; border-color: #185FA5; }

.btn { border: none; border-radius: 8px; padding: 9px 20px; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn-green { background: #1D9E75; color: #fff; }
.btn-blue { background: #185FA5; color: #fff; }
.btn-orange { background: #BA7517; color: #fff; }
.btn:hover { opacity: 0.9; }

.toggle-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.toggle-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid #0C447C; font-size: 12px; cursor: pointer; background: #E6F1FB; color: #0C447C; font-weight: 600; }
.toggle-btn.active { background: #185FA5; color: #fff; }

.info-box { background: #E6F1FB; border-radius: 8px; padding: 10px 14px; font-size: 12px; color: #0C447C; margin-bottom: 12px; border-left: 3px solid #185FA5; }
.alert-error { background: #FCEBEB; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #A32D2D; margin-bottom: 12px; }
.alert-success { background: #EAF3DE; color: #27500A; border-radius: 8px; padding: 9px 14px; font-size: 13px; }

/* UPLOAD */
.upload-area { border: 2px dashed #B5D4F4; border-radius: 12px; padding: 28px 16px; text-align: center; cursor: pointer; background: #F4F8FD; transition: all 0.2s; }
.upload-area:hover { border-color: #185FA5; background: #E6F1FB; }
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { font-size: 14px; font-weight: 600; color: #185FA5; margin-bottom: 4px; }
.upload-sub { font-size: 12px; color: #888; }

/* STATS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.stat-label { font-size: 11px; color: #666; margin-bottom: 4px; }
.stat-val { font-size: 22px; font-weight: 700; color: #185FA5; }

/* TABLES */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #E6F1FB; margin-bottom: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead tr { background: #185FA5; }
th { padding: 9px 11px; text-align: left; font-weight: 600; font-size: 11px; color: #fff; white-space: nowrap; border-bottom: 1px solid #0C447C; }
th.th-sim { background: #BA7517; }
td { padding: 8px 11px; color: #222; border-bottom: 1px solid #f0f4f8; white-space: nowrap; font-size: 12px; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #F8FAFD; }
tr:hover td { background: #EFF5FB; }
.empty { text-align: center; padding: 2rem; color: #aaa; font-size: 13px; }

/* BADGES & TAGS */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-up { background: #FCEBEB; color: #A32D2D; }
.badge-down { background: #EAF3DE; color: #27500A; }
.badge-eq { background: #F0F0F0; color: #888; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 99px; font-size: 10px; font-weight: 600; margin-left: 4px; }
.tag-app { background: #FAEEDA; color: #854F0B; }
.tag-bomba { background: #EEEDFE; color: #3C3489; }
.tag-herdado { background: #FEF3C7; color: #92400E; }

/* COLORS */
.pos-cas { color: #185FA5; font-weight: 700; }
.pos-gua { color: #3C3489; font-weight: 700; }
.var-pos { color: #A32D2D; font-weight: 700; font-size: 11px; }
.var-neg { color: #27500A; font-weight: 700; font-size: 11px; }
.var-eq { color: #aaa; font-size: 11px; }
.margem-pos { color: #27500A; font-weight: 700; }
.margem-neg { color: #A32D2D; font-weight: 700; }
.sim-input { border: 1px solid #BA7517 !important; background: #FAEEDA !important; width: 100px !important; }
.td-sim { background: #FAEEDA22 !important; }

/* POSTO HEADER */
.posto-hdr { display: flex; align-items: center; gap: 8px; padding: 10px 0 6px; }
.posto-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.posto-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* FILTERS */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: flex-end; }
.filters > div { display: flex; flex-direction: column; gap: 3px; }
.filters select { width: auto; font-size: 12px; padding: 5px 8px; }

/* LOTE MANUAL */
.lote-row { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.lote-hdr { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-bottom: 6px; font-size: 11px; color: #888; font-weight: 600; }

/* EXTRAIDOS */
.extraido-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.extraido-hdr { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; margin-bottom: 6px; font-size: 11px; color: #888; font-weight: 600; }

/* WHATSAPP CARD */
.wpp-tipo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.wpp-tipo-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid #185FA5; font-size: 12px; cursor: pointer; background: #E6F1FB; color: #185FA5; font-weight: 600; }
.wpp-tipo-btn.active { background: #185FA5; color: #fff; }
.wpp-hint { text-align: center; font-size: 12px; color: #888; margin-top: 10px; padding: 10px; background: #f9f9f9; border-radius: 8px; }
.wpp-card { background: #fff; border-radius: 16px; overflow: hidden; max-width: 420px; margin: 0 auto; box-shadow: 0 4px 24px rgba(0,0,0,0.18); font-family: 'Segoe UI', Arial, sans-serif; }
.wpp-header { background: linear-gradient(135deg, #185FA5, #0C447C); padding: 16px 18px; }
.wpp-htop { display: flex; justify-content: space-between; align-items: center; }
.wpp-logo { display: flex; align-items: center; gap: 10px; }
.wpp-logo-circle { width: 38px; height: 38px; background: #FFD700; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #185FA5; font-size: 14px; flex-shrink: 0; }
.wpp-logo-text { color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2; }
.wpp-logo-sub { color: #B5D4F4; font-size: 10px; }
.wpp-date { background: rgba(255,255,255,0.18); border-radius: 20px; padding: 4px 12px; color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.wpp-legenda { display: flex; gap: 12px; padding: 7px 14px 3px; flex-wrap: wrap; }
.wpp-leg { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #555; }
.wpp-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wpp-posto-hdr { display: flex; align-items: center; gap: 8px; padding: 8px 14px 3px; }
.wpp-posto-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wpp-posto-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.wpp-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.wpp-tbl thead tr { background: #185FA5; }
.wpp-tbl thead th { color: #fff; padding: 5px 10px; font-weight: 600; font-size: 10px; text-align: left; }
.wpp-tbl thead th:not(:first-child) { text-align: right; }
.wpp-tbl tbody tr:nth-child(even) { background: #F4F8FD; }
.wpp-tbl tbody tr:nth-child(odd) { background: #fff; }
.wpp-tbl tbody td { padding: 6px 10px; color: #222; vertical-align: middle; }
.wpp-tbl tbody td:not(:first-child) { text-align: right; }
.wpp-pname { font-weight: 700; font-size: 11px; color: #111; }
.wpp-pprazo { font-size: 9px; color: #999; }
.wpp-preco { font-weight: 800; color: #0C447C; font-size: 11px; }
.wpp-vup { color: #A32D2D; font-weight: 700; font-size: 10px; }
.wpp-vdown { color: #27500A; font-weight: 700; font-size: 10px; }
.wpp-veq { color: #bbb; font-size: 10px; }
.wpp-sep { height: 6px; background: #F0F4F8; }
.wpp-footer { background: #F4F8FD; padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #E6F1FB; }
.wpp-fnote { font-size: 9px; color: #aaa; }
.wpp-fbrand { font-size: 11px; color: #185FA5; font-weight: 700; }

/* RESPONSIVE */
@media (max-width: 480px) {
  .app-body { padding: 10px; }
  .form-row3 { grid-template-columns: 1fr; }
  .tabs { gap: 4px; }
  .tab { padding: 6px 10px; font-size: 11px; }
}
