/* Order Board -- clean, modern, matches the Studio Lande site: soft
   periwinkle background, borderless white cards, confident navy type,
   generously rounded corners. No ledger lines, no monospace-everywhere,
   no vintage paper texture. */

:root {
  --bg: #cfe0f9;
  --surface: #ffffff;
  --surface-soft: #eef4fd;
  --ink: #16233f;
  --ink-soft: #5c6c8a;
  --line: #e3ebf9;
  --accent: #16233f;
  --accent-hover: #0e1830;
  --accent-ink: #ffffff;
  --warn: #c0392b;
  --warn-soft: #fbe4e1;
  --complete: #2f8f5b;
  --complete-soft: #e2f3e9;
  --starting: #7c889f;
  --starting-soft: #eef1f6;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

h1, h2 { font-weight: 700; letter-spacing: -0.01em; }
a { color: inherit; }

/* --- Top bar / nav ---------------------------------------------------- */

.topbar {
  background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 1px 0 rgba(22, 35, 63, 0.06);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 999px;
}
.tab {
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}
.tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}
.tab-count { font-size: 0.85em; opacity: 0.75; }
.tab-count--warn { color: var(--warn); font-weight: 700; opacity: 1; }
.tab.is-active .tab-count--warn { color: #ffb4a8; }

.search { flex: 1; min-width: 180px; }
.search input {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 0.9rem;
  color: var(--ink);
}
.search input::placeholder { color: var(--ink-soft); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.whoami { font-size: 0.85rem; color: var(--ink-soft); margin-left: 4px; }

.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--surface-soft);
  padding: 3px;
  border-radius: 999px;
}
.lang-option {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-soft);
}
.lang-option.is-active { background: var(--accent); color: var(--accent-ink); }
.lang-switch--floating { position: fixed; top: 20px; right: 20px; }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { background: #e2eaf8; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; border: 1px solid var(--line); }
.btn--danger { background: var(--warn); color: #fff; }
.btn--danger:hover { background: #9c2e22; }
.btn--small { padding: 6px 12px; font-size: 0.82rem; }
.btn--block { width: 100%; text-align: center; }

/* --- Page shell ----------------------------------------------------------- */

.page { max-width: 1400px; margin: 0 auto; padding: 28px 24px 60px; }
.page-title { margin: 0 0 4px; font-size: 1.5rem; }
.page-title-note { font-weight: 400; font-size: 0.7em; color: var(--ink-soft); }
.page-sub { color: var(--ink-soft); margin: 0 0 18px; max-width: 640px; }
.section-title { margin-top: 36px; margin-bottom: 12px; font-size: 1.1rem; }
.empty-state { color: var(--ink-soft); padding: 30px 0; }
.back-link { display: inline-block; color: var(--ink-soft); text-decoration: none; font-size: 0.88rem; margin-bottom: 14px; }
.back-link:hover { color: var(--ink); }

/* --- Table ---------------------------------------------------------------- */

.table-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--radius-lg); padding: 4px; }
table.orders { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.orders th {
  text-align: left;
  padding: 12px 16px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: none;
  white-space: nowrap;
}
table.orders td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
table.orders tbody tr.order-row { cursor: pointer; }
table.orders tbody tr.order-row:hover { background: var(--surface-soft); }
table.orders tbody tr:first-child td { border-top: none; }
.cell-order { white-space: nowrap; font-weight: 600; }
.cell-dates { white-space: nowrap; font-size: 0.85rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-size: 0.85em; }

tr.is-archived { opacity: 0.5; }
tr.is-overdue-row { background: var(--warn-soft); }

.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.tag--manual { background: var(--surface-soft); color: var(--ink-soft); }
.tag--archived { background: var(--line); color: var(--ink); }
.tag--backlog { background: var(--warn); color: #fff; }

.status, .status-select {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
}
.status--starting, .status-select--starting { background: var(--starting-soft); color: var(--starting); }
.status--working, .status-select--working { background: #dde6fb; color: var(--accent); }
.status--complete, .status-select--complete { background: var(--complete-soft); color: var(--complete); }
.status-select { cursor: pointer; appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2316233f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }

/* --- Forms / cards -------------------------------------------------------- */

.card, .card-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 560px;
}
.card-form { display: flex; flex-direction: column; gap: 16px; }
.card-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; color: var(--ink-soft); }
.card-form input, .card-form select, .card-form textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
}
.form-row { display: flex; gap: 14px; }
.form-row label { flex: 1; }
.form-error { color: var(--warn); font-weight: 600; }

/* --- Order detail page ----------------------------------------------------- */

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-order-number { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 6px; }
.detail-title { margin: 0 0 4px; font-size: 1.5rem; }
.detail-sub { margin: 0; color: var(--ink-soft); }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.detail-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.detail-card--wide { grid-column: 1 / -1; }
.detail-card h2 { margin: 0 0 12px; font-size: 0.95rem; color: var(--ink-soft); text-transform: none; }
.detail-dates { font-size: 1.05rem; margin: 0 0 4px; }
.detail-flag { margin: 4px 0; font-size: 0.85rem; color: var(--ink-soft); }
.detail-flag--warn { color: var(--warn); font-weight: 600; }
.detail-actions { display: flex; gap: 8px; margin-top: 14px; }
.detail-form { display: flex; flex-direction: column; gap: 12px; }
.detail-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; color: var(--ink-soft); }
.detail-form input {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
}

.note-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.note-form textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.note-list li { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.note-list li:last-child { border-bottom: none; padding-bottom: 0; }
.note-list p { margin: 0 0 4px; }

/* --- Admin panel ------------------------------------------------------------ */

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 8px; }
.admin-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
}
.admin-card:hover { background: var(--surface-soft); }
.admin-card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.admin-card p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }

.danger-card {
  background: var(--warn-soft);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  max-width: 560px;
}
.danger-card p { margin: 0 0 14px; color: #7a2a20; }

/* --- Login ---------------------------------------------------------------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(22, 35, 63, 0.12);
}
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-sub { margin: 0 0 8px; color: var(--ink-soft); font-size: 0.85rem; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; color: var(--ink-soft); }
.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}
