/* portal.css — hand-rolled, embedded in the binary (no Node, no CDN).
   Design tokens first; components below. */

:root {
  --ink: #1c2b33;
  --ink-soft: #52646e;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --line: #dde4e7;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --alert-bg: #fef2f2;
  --alert-ink: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.shell { width: min(960px, 100% - 2rem); margin-inline: auto; }

/* header */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 1.25rem; padding: .7rem 0; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.brand-sub { font-weight: 400; color: var(--ink-soft); font-size: .85em; margin-left: .35rem; }
.site-nav { display: flex; gap: 1rem; margin-right: auto; }
.site-nav a { color: var(--ink-soft); text-decoration: none; padding: .25rem 0; }
.site-nav a:hover { color: var(--ink); }
.header-tools { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.lang-switch { display: flex; gap: .35rem; font-size: .8rem; }
.lang-switch a {
  color: var(--ink-soft); text-decoration: none; padding: .15rem .4rem; border-radius: 6px;
}
.lang-switch a.active { background: var(--accent); color: var(--accent-ink); }

/* main + footer */
main { flex: 1; padding: 2rem 0 3rem; }
.site-footer {
  border-top: 1px solid var(--line); color: var(--ink-soft);
  font-size: .85rem; padding: 1rem 0; background: var(--panel);
}

/* components */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1.25rem;
}
.card.narrow { max-width: 26rem; margin: 3rem auto; }
h1 { font-size: 1.35rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }

label { display: block; font-size: .9rem; color: var(--ink-soft); margin-bottom: .3rem; }
input[type="email"], input[type="text"], input[type="number"], textarea, select {
  width: 100%; padding: .55rem .7rem; margin-bottom: 1rem;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
input:focus, textarea:focus, select:focus, button:focus, a:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 8px; padding: .55rem 1.1rem; font: inherit;
  cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: .35rem .8rem; font: inherit; font-size: .85rem;
  color: var(--ink-soft); cursor: pointer;
}
.btn-ghost:hover { color: var(--ink); }
.inline-form { display: inline; }

.alert {
  background: var(--alert-bg); color: var(--alert-ink);
  border-radius: 8px; padding: .6rem .8rem; font-size: .9rem;
}

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 600; font-size: .85rem; }

.alert-ok { background: #ecfdf5; color: #047857; }
.alert-err { background: var(--alert-bg); color: var(--alert-ink); }

.badge {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: .15rem .7rem; font-size: .85rem; font-weight: 600;
}
.muted { color: var(--ink-soft); font-size: .9rem; }
.stack { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.stack select, .stack textarea { width: min(28rem, 100%); }

/* dashboard: project cards, pipeline timeline, minutes meter */
.project-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.project-head h2 { margin-right: auto; }
.badge-warn { background: #fef3c7; color: #92400e; }
.alert-info { background: #eff6ff; color: #1d4ed8; }
.banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .8rem 0; }
.banner .btn { margin-left: auto; }

.timeline { list-style: none; padding: 0; margin: 1rem 0; }
.timeline li {
  position: relative; padding: .35rem 0 .35rem 1.9rem; color: var(--ink-soft);
}
.timeline li::before {
  content: "○"; position: absolute; left: .35rem; color: var(--line);
}
.timeline li.tl-done { color: var(--ink); }
.timeline li.tl-done::before { content: "✓"; color: #047857; }
.timeline li.tl-current { color: var(--ink); font-weight: 600; }
.timeline li.tl-current::before { content: "●"; color: var(--accent); }
.tl-date { color: var(--ink-soft); font-weight: 400; font-size: .85rem; margin-left: .5rem; }

.meter { max-width: 28rem; }
.meter-label { font-size: .85rem; color: var(--ink-soft); }
.meter-track {
  background: var(--line); border-radius: 999px; height: .55rem; margin-top: .3rem;
  overflow: hidden;
}
.meter-fill { background: var(--accent); height: 100%; border-radius: 999px; }
.meter-fill.meter-full { background: #b91c1c; }

/* request wizard */
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; }
legend { font-weight: 600; padding-inline: .3rem; }
.check { display: block; padding: .2rem 0; font-weight: 400; }
.wizard-nav { display: flex; gap: 1rem; align-items: center; margin-top: .5rem; }
.review dt { color: var(--ink-soft); font-size: .85rem; margin-top: .6rem; }
.review dd { margin: 0; }
.upload-items { list-style: none; padding: 0; }
.upload-items li { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.thumb { width: 3rem; height: 3rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* tickets */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .4rem; margin: .8rem 0; flex-wrap: wrap; }
.tabs a {
  text-decoration: none; color: var(--ink-soft); padding: .3rem .8rem;
  border-radius: 999px; border: 1px solid var(--line); font-size: .9rem;
}
.tabs a.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.prewrap { white-space: pre-line; }
.comment { margin-left: 1.5rem; }
.comment-admin { margin-left: 0; margin-right: 1.5rem; border-left: 3px solid var(--accent); }
.card-actions { margin-top: .8rem; }
.ts-OPEN { background: #dbeafe; color: #1d4ed8; }
.ts-IN_REVIEW { background: #e0e7ff; color: #4338ca; }
.ts-QUOTED { background: #fef3c7; color: #92400e; }
.ts-IN_PROGRESS { background: #fef9c3; color: #854d0e; }
.ts-DONE { background: #dcfce7; color: #047857; }
.ts-DECLINED { background: #fee2e2; color: #b91c1c; }
.ts-CLOSED { background: #e5e7eb; color: #4b5563; }

/* demo preview */
.demo-frame {
  width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
