/* ============================================================
   RedTask — design system
   Light, warm, orange-accented. Not banal.
   Swap --brand tokens to rebrand in one place.
   ============================================================ */

:root {
  /* brand */
  --brand:        #f5551d;
  --brand-hi:     #ff8a3d;
  --brand-soft:   #fff1e9;
  --brand-line:   #ffd9c2;

  /* surfaces */
  --bg:           #faf7f3;
  --bg-2:         #f3ede6;
  --card:         #ffffff;
  --line:         #ece5dc;
  --line-2:       #e0d7cb;

  /* text */
  --ink:          #1c1813;
  --ink-2:        #5f574c;
  --ink-3:        #938a7d;

  /* status */
  --ok:           #1f9d5b;
  --ok-soft:      #e6f6ec;
  --warn:         #c9861a;
  --warn-soft:    #fdf3e0;
  --info:         #3b6fd6;
  --info-soft:    #e9f0fd;
  --bad:          #d4453a;
  --bad-soft:     #fdecea;

  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(60,42,20,.04), 0 8px 24px rgba(60,42,20,.06);
  --shadow-lg:    0 20px 60px rgba(60,42,20,.14);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 100% -10%, var(--brand-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #eef4ff, transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1,h2,h3 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }

/* layout ---------------------------------------------------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grow { flex: 1; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }

/* topbar ---------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 18px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-hi));
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px;
  box-shadow: 0 4px 12px rgba(245,85,29,.35);
}
.brand small { color: var(--ink-3); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

/* cards ----------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-h .sub { font-size: 12px; color: var(--ink-3); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px){ .grid-2,.grid-3 { grid-template-columns: 1fr; } }

/* stat tiles ------------------------------------------------ */
.stat { padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.stat .v small { font-size: 15px; font-weight: 600; color: var(--ink-3); }

/* buttons --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 650; font-size: 14px; cursor: pointer; transition: .14s ease;
  background: var(--card); color: var(--ink); border-color: var(--line-2);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-hi));
  color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(245,85,29,.30);
}
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* inputs ---------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font-size: 14px; font-family: inherit; outline: none; transition: .14s;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea.input { resize: vertical; min-height: 84px; }
.hint { font-size: 12px; color: var(--ink-3); }

/* segmented ------------------------------------------------- */
.seg { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  border: none; background: transparent; padding: 8px 14px; border-radius: 9px;
  font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* pills / badges -------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  border: 1px solid transparent;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.open  { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-line); }
.pill.claimed { color: var(--warn); background: var(--warn-soft); border-color: #f2e0be; }
.pill.review { color: var(--info); background: var(--info-soft); border-color: #cfdcf8; }
.pill.done  { color: var(--ok); background: var(--ok-soft); border-color: #cdebd8; }
.pill.rejected { color: var(--bad); background: var(--bad-soft); border-color: #f6d3cf; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }

/* task cards ------------------------------------------------ */
.task { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; }
.task + .task { margin-top: 12px; }
.task .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.task .price { margin-left: auto; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.task .price small { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.task .body { font-size: 14px; color: var(--ink-2); }
.task .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0; font-size: 13px; }
.task .meta b { color: var(--ink); font-weight: 600; }
.task .txt { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink); white-space: pre-wrap; margin: 8px 0; }
.task .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.type-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 14px; }

/* timer ----------------------------------------------------- */
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--warn); }

/* table ----------------------------------------------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }

/* toast / notifications ------------------------------------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast {
  background: #221b12; color: #fff; padding: 12px 15px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 330px;
  display: flex; gap: 10px; align-items: flex-start; animation: pop .2s ease;
}
.toast.good { background: #12331f; } .toast.bad { background: #3a1714; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* modal ----------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(30,20,8,.42); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.overlay.on { display: flex; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal .m-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .m-b { padding: 20px; max-height: 70vh; overflow: auto; }
.modal .m-f { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.x { margin-left: auto; cursor: pointer; color: var(--ink-3); font-size: 20px; line-height: 1; background: none; border: none; }

/* chat ------------------------------------------------------ */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.fab .btn { border-radius: 999px; padding: 13px 20px; box-shadow: var(--shadow-lg); }
.chat-panel { position: fixed; right: 20px; bottom: 78px; width: 340px; max-width: calc(100vw - 40px); height: 440px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); display: none; flex-direction: column; z-index: 41; overflow: hidden; }
.chat-panel.on { display: flex; }
.chat-h { padding: 14px 16px; background: linear-gradient(135deg, var(--brand), var(--brand-hi)); color: #fff; font-weight: 700; display: flex; align-items: center; }
.chat-log { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 13px; font-size: 13.5px; }
.msg.them { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-in { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

/* misc ------------------------------------------------------ */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.spark { display: block; width: 100%; height: 150px; }
.list-reset { list-style: none; padding: 0; margin: 0; }
.copy { cursor: pointer; }
.link { color: var(--brand); font-weight: 600; }
.link:hover { text-decoration: underline; }
