/* ============================================================
   Aurora Ops — Airtable recreation · base tokens & primitives
   ============================================================ */

:root {
  /* brand */
  --blue: #2d7ff9;
  --blue-hover: #1e6fe8;
  --blue-active: #1859c0;
  --blue-bg-soft: #e8f1ff;
  --blue-ring: rgba(45, 127, 249, 0.35);

  /* text */
  --t1: #333333;
  --t2: #666666;
  --t3: #8c8c8c;
  --t4: #a8a8a8;

  /* borders & fills */
  --b1: #e0e0e0;
  --b2: #e9e9e9;
  --b3: #efefef;
  --b4: #f5f5f5;
  --bg-app: #ffffff;
  --bg-subtle: #f7f7f8;
  --bg-sidebar: #fafafa;

  /* selection */
  --row-hover: #f6f7f9;
  --row-selected: #edf3ff;
  --range-fill: rgba(45, 127, 249, 0.07);
  --range-fill-strong: rgba(45, 127, 249, 0.13);
  --search-hit: rgba(255, 214, 10, 0.45);

  /* effects */
  --shadow-pop: 0 0 1px rgba(0,0,0,0.18), 0 2px 10px rgba(0,0,0,0.16);
  --shadow-modal: 0 4px 24px rgba(0,0,0,0.22), 0 0 1px rgba(0,0,0,0.18);
  --shadow-card: 0 0 1px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.10);

  --radius-s: 3px;
  --radius-m: 6px;
  --radius-l: 8px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --grid-header-h: 32px;
  --rownum-w: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--t1);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { height: 100%; }

button {
  font-family: var(--font);
  font-size: 13px;
  color: var(--t1);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

input, textarea, select {
  font-family: var(--font);
  font-size: 13px;
  color: var(--t1);
}

::selection { background: rgba(45, 127, 249, 0.22); }

/* scrollbars */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d3d3d5;
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #b8b8bb; background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- generic buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-m);
  font-weight: 500;
  color: var(--t1);
  white-space: nowrap;
  transition: background 90ms ease, box-shadow 90ms ease, color 90ms ease;
}
.btn:hover { background: var(--bg-subtle); }
.btn:active { background: #ededee; }
.btn.primary {
  background: var(--blue);
  color: #fff;
}
.btn.primary:hover { background: var(--blue-hover); }
.btn.primary:active { background: var(--blue-active); }
.btn.danger { color: #d02b20; }
.btn.danger:hover { background: #fdeceb; color: #b3251c; }
.btn.subtle { color: var(--t2); }
.btn.disabled, .btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn svg { flex: 0 0 auto; }

.link-btn {
  color: var(--blue);
  cursor: pointer;
  font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- inputs ---------- */
.text-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cbcbd0;
  border-radius: var(--radius-m);
  outline: none;
  background: #fff;
  transition: border-color 90ms ease, box-shadow 90ms ease;
}
.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-ring);
}
.text-input.invalid { border-color: #d02b20; box-shadow: 0 0 0 2px rgba(208,43,32,0.25); }
textarea.text-input { height: auto; padding: 8px 10px; resize: vertical; }

/* ---------- select (native, styled) ---------- */
.select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #cbcbd0;
  border-radius: var(--radius-m);
  background: #fff;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 24px;
}
.select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-ring); }

/* ---------- checkboxes ---------- */
.check {
  width: 15px; height: 15px;
  border: 1px solid #cfd0d3;
  border-radius: var(--radius-s);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background 90ms ease, border-color 90ms ease;
  cursor: pointer;
}
.check:hover { border-color: #a9aab0; box-shadow: 0 0 0 2px rgba(51,51,51,0.06); }
.check svg { opacity: 0; }
.check.on { background: #2f9e44; border-color: #2f9e44; }
.check.on svg { opacity: 1; }
.check.sm { width: 13px; height: 13px; }

/* ---------- misc primitives ---------- */
.divider-v { width: 1px; align-self: stretch; background: var(--b2); margin: 6px 4px; }

.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--b1);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fafafa;
  font-size: 11px;
  color: var(--t2);
  font-family: var(--font);
  line-height: 15px;
}

.muted { color: var(--t3); }

/* animation keyframes */
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(-2px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pop-in-below {
  from { opacity: 0; transform: scale(0.96) translateY(3px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.app {
  display: flex;
  flex-direction: column;
}

.offscreen-positioner {
  position: fixed;
  left: -99999px;
  top: -99999px;
}
