:root{
  --bg:#f7f9fc;
  --card:#ffffff;
  --border:#d9e2ef;
  --text:#111827;
  --muted:#4b5563;
  --accent:#1a73e8;
  --accent2:#1558b0;
  --danger:#d93025;
  --shadow: 0 10px 28px rgba(17,24,39,.10);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
*{ box-sizing:border-box; }
body{ margin:0; background:var(--bg); color:var(--text); }
.wrap{ width:min(1500px, calc(100vw - 32px)); margin:18px auto; }

.header{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:12px; }
.headerLeft{ display:grid; gap:6px; }
.header h1{ margin:0; font-size:22px; letter-spacing:.2px; }
.meta{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); }

.pill{ display:inline-block; padding:4px 10px; border:1px solid var(--border); border-radius:999px; background:var(--card); font-size:12px; }
.linkbtn{ border:none; background:transparent; color:var(--accent); cursor:pointer; padding:0; font-size:13px; }

.card{ background:var(--card); border:1px solid var(--border); border-radius:14px; padding:12px; box-shadow:var(--shadow); }

.entryGrid{
  display:grid;
  grid-template-columns: repeat(10, minmax(110px, 1fr)) 260px;
  gap:10px;
  align-items:end;
}

.field{ display:grid; gap:6px; min-width:0; }
.lbl{ font-size:12px; color:var(--muted); }

input, select{
  width:100%;
  font-size:16px;
  padding:10px 12px;
  border:1px solid #c9d6ea;
  border-radius:10px;
  outline:none;
  background:#fff;
  min-width:0;
}
input:focus, select:focus{ border-color: rgba(26,115,232,.55); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }

.buttons{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; align-self:end; }

.btn{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #c9d6ea;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-size:14px;
  line-height:1;
  user-select:none;
}
.btn.primary{ background:var(--accent); border-color:var(--accent); color:#fff; }
.btn.primary:hover{ background:var(--accent2); border-color:var(--accent2); }
.btn.ghost{ background:#fff; }
.btn.danger{ border-color: rgba(217,48,37,.25); color: var(--danger); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }

.tableWrap{ margin-top:12px; overflow-x:auto; border-radius:14px; border:1px solid var(--border); }
.table{ width:100%; border-collapse:collapse; min-width: 1100px; }
.table th,.table td{ border-bottom:1px solid #edf1f7; padding:9px 10px; font-size:13px; white-space:nowrap; }
.table th{ text-align:left; color:var(--muted); background:#f8fafc; position:sticky; top:0; z-index:1; }
.actionsCol{ width: 170px; }
.rowActions{ display:flex; gap:8px; }
.rowActions .btn{ padding:8px 10px; font-size:13px; border-radius:10px; }
tr.selected td{ background: rgba(26,115,232,.06); }

/* Always-visible status */
.statusBar{
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.statusBarInner{ display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13px; color:var(--muted); }
.statusDot{ width:10px; height:10px; border-radius:999px; background: rgba(26,115,232,.55); }
.statusBar[data-error="1"] .statusDot{ background: rgba(217,48,37,.75); }
.statusBar[data-error="1"] .statusText{ color: var(--danger); }

/* Dialog */
.dialog{ border:none; padding:0; background:transparent; }
.dialog::backdrop{ background: rgba(17,24,39,.45); }
.dialogCard{
  width:min(520px, calc(100vw - 24px));
  border-radius:16px;
  border:1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding:16px;
}
.dialogCard h2{ margin:0 0 8px; font-size:18px; }
.dialogCard p{ margin:0 0 12px; color:var(--muted); font-size:13px; }
.dialogBtns{ display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }

@media (max-width: 1150px){
  .entryGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buttons{ grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .wrap{ width:calc(100vw - 20px); margin:12px auto; }
  .header{ flex-direction:column; align-items:flex-start; }
  .buttons{ grid-template-columns: 1fr 1fr; }
  .table{ min-width: 900px; }
}

.table thead{ box-shadow: 0 1px 0 rgba(17,24,39,.06); }
