:root{
  --bg:#f6f7f9; --card:#ffffff; --muted:#d9dce3; --muted-2:#e6e8ee;
  --text:#1f2937; --sub:#6b7280; --acc:#b8860b; --acc-2:#c69a16;
  --ok:#2e7d32; --warn:#c47f17; --err:#c0392b;
  --border:#e5e7eb;
}

*{box-sizing:border-box}

/* Source Sans 3 — import + body */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600&display=swap');
/* Body font */
body{
  margin:0;
  font:14px/1.45 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  font-weight:300;
}


.wrap{max-width:80vw; margin:32px auto; padding:0 16px}

/* Toolbar & search */
.toolbar{display:flex; flex-direction:column; gap:6px; margin-bottom:10px}
.search{flex:1}
.search input{
  width:100%; padding:12px 14px;
  border:1px solid var(--muted); border-radius:10px;
  background:#fff; color:var(--text); outline:none;
  font-family:inherit
}
.search input:focus{border-color:var(--acc); box-shadow:0 0 0 3px rgba(184,134,11,.20)}

/* /home/whiterav/API/public/styles.css  (append near toolbar styles) */
.limit-chooser{display:flex; align-items:center; gap:8px; user-select:none}
.limit-chooser .opt{
  border:none; background:transparent; color:inherit; padding:0 2px; cursor:pointer;
  text-decoration:none; font-weight:400
}
.limit-chooser .opt:hover{ text-decoration:underline }
.limit-chooser .opt.active{ font-weight:700; text-decoration:underline }


/* Button row */
.button-row,.row-actions{display:flex; gap:10px; align-items:center; margin:8px 0 12px}

/* top bar layout */
.row-top{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.row-top .spacer{flex:1 1 auto}
.row-top .limit-chooser,
.row-top .pager{display:inline-flex;align-items:center;gap:.5rem}

/* Pager */
.spacer{flex:1}
.pager{display:flex; gap:10px; align-items:center; margin-top:10px; justify-content:flex-end}


/* Table */
.table-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px; overflow:hidden;
  box-shadow:0 8px 24px rgba(20,24,40,.08)
}
table{width:100%; border-collapse:separate; border-spacing:0}

/* header/body paddings per spec */
thead th{
  background:var(--muted-2); color:#374151; text-align:left; font-weight:600;
  padding:6px 8px; position:sticky; top:0; z-index:1;
  border:1px solid var(--border)
}
tbody td{
  padding:5px 5px; vertical-align:middle;
  border:1px solid var(--border)
}
tbody tr:hover{background:#fafbfc}

/* Alignments + widths */
thead th:nth-child(1), tbody td:nth-child(1){ text-align:center } /* ID centered */
thead th:nth-child(5), tbody td:nth-child(5),
thead th:nth-child(6), tbody td:nth-child(6),
thead th:nth-child(7), tbody td:nth-child(7),
thead th:nth-child(8), tbody td:nth-child(8){
  text-align:center; width:110px; max-width:110px; min-width:90px;
}

/* group headers */
.group-header td{ background:#f1f3f7; border-color:#e5e7eb }
.group-bar{ display:flex; align-items:center; justify-content:space-between; padding:6px 8px }
.group-info strong{ font-weight:700 }
.group-info .dim{ margin-left:6px }

/* Inputs in table */
table td input, table td select{
  width:100%; padding:6px 8px;
  background:#fff; color:var(--text);
  border:1px solid var(--border); border-radius:6px;
  font-family:inherit; font-size:14px
}
table td input:focus, table td select:focus{
  outline:none; border:1px solid var(--acc); box-shadow:0 0 0 3px rgba(184,134,11,.18); background:#fffdf5
}

/* match numeric columns center */
tbody td:nth-child(5) input,
tbody td:nth-child(6) input,
tbody td:nth-child(7) input,
tbody td:nth-child(8) input{ text-align:center }

/* Pretty select: remove native arrow and add custom */
table td select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, #222 50%),
    linear-gradient(135deg, #222 50%, transparent 50%),
    linear-gradient(#ddd, #ddd);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px),
    calc(100% - 28px) 50%;
  background-size:5px 5px,5px 5px,1px 60%;
  background-repeat:no-repeat;
  padding-right:32px; /* room for chevron */
}
table td select::-ms-expand{ display:none; } /* IE */

/* Actions & buttons */
.actions{width:200px; text-align:right}
.btn{
  appearance:none; border:1px solid var(--muted);
  background:#ffffff; color:var(--text);
  padding:8px 12px; border-radius:10px; cursor:pointer;
  transition:border-color .15s, box-shadow .15s, background .15s;
  font-family:inherit
}
.btn:hover{border-color:#cfd3dc; box-shadow:0 2px 8px rgba(20,24,40,.06)}
.btn.save{border-color:transparent; background:linear-gradient(180deg,var(--acc),var(--acc-2)); color:#fff; font-weight:700}
.btn.save:hover{box-shadow:0 4px 14px rgba(184,134,11,.25)}
.btn.save[disabled]{opacity:.55; cursor:not-allowed; box-shadow:none}
.btn.danger{border-color:transparent; background:linear-gradient(180deg,#d64545,var(--err)); color:#fff; font-weight:700}
.btn.danger:hover{box-shadow:0 4px 14px rgba(192,57,43,.25)}

/* Toast & status */
.toast{
  position:fixed; right:16px; bottom:16px; background:#ffffff;
  border:1px solid var(--muted); color:var(--text);
  padding:10px 12px; border-radius:10px;
  box-shadow:0 10px 30px rgba(20,24,40,.12); display:none
}
.dim{color:var(--sub)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

/* Modal */
.modal{position:fixed; inset:0; background:rgba(0,0,0,.35); display:grid; place-items:center; z-index:10}
.modal[hidden]{display:none}
.modal-card{width:min(900px,90vw); background:#ffffff; border:1px solid var(--muted); border-radius:14px; box-shadow:0 20px 60px rgba(20,24,40,.20); overflow:hidden}
.modal-header{display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid var(--muted); background:#fafbfc}
.modal-body{padding:14px; display:grid; gap:12px}
#pasteBox{width:100%; padding:10px; background:#fff; color:var(--text); border:1px solid #cfd3dc; border-radius:8px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
#pasteBox:focus{outline:none; border:1px solid var(--acc); box-shadow:0 0 0 3px rgba(184,134,11,.18); background:#fffdf5}
.modal-actions{display:flex; gap:8px}
.preview{max-height:260px; overflow:auto; border:1px solid var(--muted); border-radius:10px; padding:8px; background:#fff}
.preview table{width:100%; border-collapse:collapse}
.preview th,.preview td{border:1px solid #e2e5ed; padding:6px 8px; text-align:left}
.preview th{background:#f1f3f7}
