:root { 
  --bg: #ffffff; 
  --ink: #0a0a0a; 
  --ink-soft: #6b7280; 
  --line: #e5e7eb; 
  --line-soft: #f3f4f6; 
  --hover: #f9fafb; 
  --radius: 10px; 
  --radius-sm: 6px; 
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; 
  background: #f8f9fa; 
  color: var(--ink); 
  font-size: 14px; 
  line-height: 1.5; 
  -webkit-font-smoothing: antialiased; 
}

/* APP BAR */
.app-bar { 
  position: sticky; top: 0; z-index: 100; 
  background: rgba(255,255,255,0.92); 
  backdrop-filter: blur(10px); 
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); 
}
.app-bar-inner { 
  max-width: 1100px; margin: 0 auto; padding: 14px 24px; 
  display: flex; align-items: center; justify-content: space-between; gap: 16px; 
}
.app-bar-brand { display: flex; align-items: center; gap: 12px; }
.app-bar-brand img { height: 34px; width: auto; display: block; }
.brand-text { line-height: 1.1; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 10px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }
.app-nav { display: flex; gap: 12px; align-items: center; }
.btn-logout { 
  background: transparent; border: 1px solid var(--line); 
  padding: 8px 14px; border-radius: 6px; cursor: pointer; 
  font-family: inherit; color: var(--ink); text-decoration: none; 
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 500;
  transition: all 0.15s ease;
}
.btn-logout:hover { background: var(--hover); border-color: #d1d5db; }

/* CONTAINER */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px 96px; }

/* PAGE HEADER */
.page-header { margin-bottom: 24px; }
.page-header h1 { margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.header-line { border: 0; border-top: 2px solid var(--ink); margin: 0 0 24px; }

/* ENTRY TABLE */
.entry-wrapper { 
  background: #fff; border: 1px solid var(--line); 
  border-radius: var(--radius); padding: 16px; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.02); 
  margin-bottom: 40px; 
}
.sales-entry-table { width: 100%; border-collapse: collapse; }
.sales-entry-table th { 
  text-align: left; padding: 10px 12px; font-size: 11px; 
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); 
  border-bottom: 2px solid var(--line); 
}
.sales-entry-table th.num { text-align: right; }
.sales-entry-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); }
.sales-entry-table td.num { text-align: right; }
.sales-entry-table input { 
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); 
  border-radius: 4px; font: inherit; font-size: 14px; background: #fff; 
  box-sizing: border-box;
}
.sales-entry-table input:focus { outline: none; border-color: var(--ink); }
.sales-entry-table input[type="number"] { text-align: right; max-width: 150px; margin-left: auto; }
.sales-entry-table input[type="date"] { max-width: 180px; }

.act-col { width: 100px; text-align: right; }
.btn-save { 
  background: var(--ink); color: #fff; border: none; 
  padding: 8px 16px; border-radius: 6px; cursor: pointer; 
  font-family: inherit; font-size: 13px; font-weight: 500; 
  transition: background 0.15s ease;
}
.btn-save:hover { background: #262626; }

/* HISTORY SECTION */
.history-section h2 { font-size: 18px; font-weight: 600; margin: 0 0 16px; }

.filters-bar { 
  display: flex; gap: 16px; margin-bottom: 20px; 
  background: #fff; border: 1px solid var(--line); 
  border-radius: var(--radius); padding: 16px; 
  align-items: flex-end; 
  flex-wrap: wrap;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { 
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; 
  color: var(--ink-soft); font-weight: 600; 
}
.filter-field input { 
  border: 1px solid var(--line); border-radius: var(--radius-sm); 
  padding: 9px 12px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); 
}
.filter-field input:focus { outline: none; border-color: var(--ink); }

.btn-clear { 
  background: #fff; color: var(--ink); border: 1px solid var(--line); 
  padding: 9px 16px; border-radius: 6px; cursor: pointer; 
  font-family: inherit; font-size: 14px; font-weight: 500; 
  height: 38px; 
  transition: all 0.15s ease;
}
.btn-clear:hover { background: var(--hover); border-color: #d1d5db; }

/* HISTORY TABLE */
.history-table { 
  width: 100%; border-collapse: collapse; background: #fff; 
  border: 1px solid var(--line); border-radius: var(--radius); 
  overflow: hidden; 
}
.history-table th { 
  text-align: left; padding: 12px 16px; font-size: 11px; 
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); 
  border-bottom: 2px solid var(--line); background: var(--hover); 
}
.history-table th.num { text-align: right; }
.history-table td { 
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft); 
  font-size: 14px; vertical-align: middle; 
}
.history-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: var(--hover); }

/* TOAST */
.toast { 
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; 
  padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); transform: translateY(100px); 
  opacity: 0; transition: all 0.25s ease; z-index: 1000; max-width: 320px; 
}
.toast.show { transform: translateY(0); opacity: 1; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .app-bar-inner { padding: 12px 16px; }
  .container { padding: 20px 16px 80px; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .btn-clear { width: 100%; }
  .sales-entry-table { font-size: 12px; }
  .sales-entry-table th, .sales-entry-table td { padding: 8px; }
  .sales-entry-table input { font-size: 12px; padding: 6px 8px; }
}