/* ──────────────────────────────────────────────────────────────────────────
   Hamilton Design System — Claude desktop palette
   Shared tokens + base components for all internal pages.
   Source of truth: projects.html / project.html / chat.html
   ────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces */
  --bg:         #FAF9F5;
  --surface:    #FFFFFF;
  --surface-2:  #F4F2EC;
  --surface-3:  #EBE9DF;

  /* Borders */
  --border:     #E5E3D8;
  --border-2:   #D4D2C7;

  /* Text */
  --text:       #1F1E1D;
  --light:      #2C2B28;
  --muted:      #6B695F;
  --muted-2:    #95918A;

  /* Coral accent (named --blue for legacy compat with chat.html) */
  --blue:       #C15F3C;
  --blue-hover: #A8512F;
  --blue-dim:   rgba(193,95,60,0.07);
  --blue-border:rgba(193,95,60,0.22);

  /* Semantic */
  --green:      #5B8C5A;
  --green-dim:  rgba(91,140,90,0.10);
  --green-border:rgba(91,140,90,0.30);
  --amber:      #C19A4C;
  --amber-dim:  rgba(193,154,76,0.12);
  --amber-border:rgba(193,154,76,0.30);
  --red:        #B5403A;
  --red-dim:    rgba(181,64,58,0.08);
  --red-border: rgba(181,64,58,0.25);

  /* Project accent palette */
  --c-blue:   #C15F3C;
  --c-coral:  #E07B5F;
  --c-green:  #5B8C5A;
  --c-purple: #7B6CA8;
  --c-teal:   #4A8B8C;
  --c-amber:  #C19A4C;
  --c-slate:  #6B7280;
  --c-pink:   #C26B8C;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
}

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

/* ── Top nav (Hamilton brand + centered pill nav + right actions) ───────── */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; border-bottom: 1px solid var(--border);
  background: var(--bg); position: sticky; top: 0; z-index: 50;
}
.topnav-left { display: flex; align-items: center; gap: 16px; }
.topnav-brand {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.topnav-brand:hover { text-decoration: none; }
.topnav-brand em { font-style: normal; color: var(--muted); font-weight: 500; margin-left: 2px; }
.ham-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #8FD4C4, #C15F3C);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.topnav-right { display: flex; align-items: center; gap: 4px; }
.topnav-right a, .topnav-right button {
  background: none; border: none; color: var(--muted); font-family: inherit;
  font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 8px;
  cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.topnav-right a:hover, .topnav-right button:hover {
  background: var(--surface-3); color: var(--text); text-decoration: none;
}
.topnav-right .danger { color: var(--red); }
.topnav-right .danger:hover { background: var(--red-dim); color: var(--red); }

/* ── Centered pill nav under topnav ─────────────────────────────────────── */
.pillnav-wrap {
  display: flex; justify-content: center;
  padding: 18px 20px 4px;
}
.pillnav {
  display: inline-flex; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.pillnav a {
  padding: 7px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all 0.15s; text-decoration: none;
}
.pillnav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.pillnav a.active { background: var(--blue); color: white; }
.pillnav a.active:hover { background: var(--blue-hover); }

/* ── Page container ─────────────────────────────────────────────────────── */
.page { max-width: 1080px; margin: 0 auto; padding: 40px 32px 80px; }
.page-narrow { max-width: 760px; margin: 0 auto; padding: 40px 32px 80px; }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 10px;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 28px; gap: 20px;
}
.page-title {
  font-size: 32px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); line-height: 1.1;
}
.page-sub  { font-size: 14px; color: var(--muted); margin-top: 6px; max-width: 640px; line-height: 1.5; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--blue); color: white; padding: 10px 18px; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface); color: var(--text); padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-2); }

.btn-ghost {
  background: none; color: var(--muted); padding: 8px 14px; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger {
  background: var(--surface); color: var(--red); padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.btn-danger:hover { background: var(--red-dim); border-color: var(--red-border); }

/* ── Cards / surfaces ───────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px;
}
.card-hover { transition: all 0.15s; cursor: pointer; }
.card-hover:hover {
  transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: var(--border-2);
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.card-sub   { font-size: 13px; color: var(--muted); }

/* Mono labels for metadata */
.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted-2); }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid;
}
.pill.active  { color: var(--green); border-color: var(--green-border); background: var(--green-dim); }
.pill.paused  { color: var(--muted); border-color: var(--border-2); background: var(--surface-2); }
.pill.warn    { color: var(--amber); border-color: var(--amber-border); background: var(--amber-dim); }
.pill.danger  { color: var(--red);   border-color: var(--red-border);   background: var(--red-dim); }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--light); margin-bottom: 6px;
}
.field label .optional { color: var(--muted-2); font-weight: 400; font-size: 12px; margin-left: 4px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(31,30,29,0.5); align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 16px; padding: 28px;
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.modal-sub   { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 80px 20px; color: var(--muted);
  border: 1px dashed var(--border-2); border-radius: 12px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; line-height: 1.5; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 200;
  display: none;
}
.toast.show { display: block; }

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
