/* ============================================================
   Doc StarEstate — design system (light, modern, restrained).
   Anthropic-inspired palette: ivory background, warm orange accent.
   ============================================================ */

:root {
  --bg:           #faf9f6;
  --surface:      #ffffff;
  --surface-2:    #f4f3ef;
  --surface-hi:   #ecebe5;
  --text:         #2a2723;
  --text-muted:   #7a756e;
  --text-soft:    #b6b1a8;
  --border:       #e6e2d8;
  --border-hi:    #d6d2c5;
  --accent:       #cc785c;
  --accent-hi:    #b86a50;
  --accent-soft:  #f5e1d6;
  --ok:           #6ba872;
  --warn:         #c69539;
  --err:          #c45a4a;

  --radius:       8px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.06);

  --font-stack:   "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-stack);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }

p  { margin: 0 0 12px; color: var(--text); }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.btn:hover    { background: var(--surface-2); border-color: var(--border-hi); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

.btn-ghost   { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn-danger:hover { color: var(--err); border-color: var(--err); }

/* ---------- inputs ---------- */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea, select {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 120ms, box-shadow 120ms;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 80px; font-family: inherit; }

label.field {
  display: block;
  margin-bottom: 12px;
}
label.field > .label-text {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.card h3 { margin-top: 0; }

.section {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px;
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabs .tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.tabs .tab:hover  { color: var(--text); }
.tabs .tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.topbar .brand .dot { color: var(--accent); }
.topbar .spacer { flex: 1; }
.topbar .user   { font-size: 13px; color: var(--text-muted); }

/* ---------- entry list ---------- */
.entry-list { display: flex; flex-direction: column; gap: 8px; }
.entry-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  font-size: 13px;
}
.entry-row .kind {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}
.entry-row .title { font-weight: 500; }
.entry-row .meta  { color: var(--text-muted); font-size: 12px; }

/* ---------- login screen ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 0%,  rgba(204,120,92,0.07), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(204,120,92,0.05), transparent 55%),
    var(--bg);
}
.login-card {
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
}
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}
.login-card .stub-hint {
  background: var(--accent-soft);
  border: 1px solid #e6c4b1;
  color: #8a4a35;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
}
.login-card .err {
  color: var(--err);
  font-size: 12.5px;
  margin-top: 6px;
  min-height: 1em;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  right: 16px; bottom: 16px;
  padding: 10px 14px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms, transform 160ms;
  pointer-events: none;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- empty / loading states ---------- */
.empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.dim { opacity: 0.6; }

/* ---------- code-style chips ---------- */
.chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
}
.chip.ok    { background: #e6f1e3; color: #3f6b46; }
.chip.warn  { background: #fbeed7; color: #8a6720; }
.chip.err   { background: #f4ddd9; color: #843a30; }
.chip.pend  { background: var(--surface-2); color: var(--text-muted); }
