/* Wild Card Dugout design system — shared by the workspace and the help desk. */
:root {
  --bg: #fafaf9; --bg2: #f4f4f2; --panel: #ffffff; --panel2: #fbfbfa; --hover: rgba(24, 24, 27, .045); --active: rgba(24, 24, 27, .075);
  --line: rgba(24, 24, 27, .09); --line2: rgba(24, 24, 27, .14);
  --text: #18181b; --text2: #52525b; --muted: #8b8b94; --faint: #b4b4bb;
  --accent: #b7860b; --accent-ink: #1a1405; --accent-bg: #f5c542; --accent-soft: rgba(214, 160, 20, .12);
  --blue: #2f6fdf; --violet: #7c5cdb; --gold: #c58f0b; --orange: #dd6b20; --green: #1f9d5b; --red: #dc3b3b; --slate: #7a7f8c; --teal: #138a8a; --rose: #d6457a;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -8px rgba(0,0,0,.08);
  --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.05);
  --r: 10px; --r-lg: 14px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --bg2: #0e0e11; --panel: #131316; --panel2: #17171b; --hover: rgba(255,255,255,.045); --active: rgba(255,255,255,.08);
    --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.12);
    --text: #ededef; --text2: #b4b4bc; --muted: #80808a; --faint: #55555e;
    --accent: #f2c14e; --accent-ink: #1a1405; --accent-bg: #f2c14e; --accent-soft: rgba(242, 193, 78, .12);
    --blue: #6b9bff; --violet: #a68bff; --gold: #f2c14e; --orange: #ff9a4d; --green: #45d08a; --red: #ff6b6b; --slate: #9097a6; --teal: #3fd0c9; --rose: #ff7aa8;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 80px -12px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --bg2: #0e0e11; --panel: #131316; --panel2: #17171b; --hover: rgba(255,255,255,.045); --active: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.12);
  --text: #ededef; --text2: #b4b4bc; --muted: #80808a; --faint: #55555e;
  --accent: #f2c14e; --accent-ink: #1a1405; --accent-bg: #f2c14e; --accent-soft: rgba(242, 193, 78, .12);
  --blue: #6b9bff; --violet: #a68bff; --gold: #f2c14e; --orange: #ff9a4d; --green: #45d08a; --red: #ff6b6b; --slate: #9097a6; --teal: #3fd0c9; --rose: #ff7aa8;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 80px -12px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--mono); font-feature-settings: "zero"; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); cursor: pointer; font-weight: 500; font-size: 13px; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
a.btn { text-decoration: none; }
.btn:hover { background: var(--panel2); border-color: var(--line2); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent-bg); color: var(--accent-ink); border-color: transparent; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 1px 2px rgba(0,0,0,.15); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.dark { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14px; border-radius: 11px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 26px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line2); color: var(--muted); background: var(--panel2); }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 500; color: var(--text2); }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line2); background: var(--panel); border-radius: 9px; padding: 9px 11px; outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid var(--line); background: var(--panel2); color: var(--text2); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { color: var(--blue); } .st-open { color: var(--violet); } .st-in_progress { color: var(--gold); } .st-waiting { color: var(--orange); } .st-resolved { color: var(--green); } .st-closed { color: var(--slate); }
.pr-urgent { color: var(--red); } .pr-high { color: var(--orange); } .pr-normal { color: var(--text2); } .pr-low { color: var(--muted); }
.c-gold { --c: var(--gold); } .c-blue { --c: var(--blue); } .c-green { --c: var(--green); } .c-violet { --c: var(--violet); } .c-rose { --c: var(--rose); } .c-teal { --c: var(--teal); } .c-orange { --c: var(--orange); } .c-slate { --c: var(--slate); }

/* Status ring icon */
.ring { width: 14px; height: 14px; flex: none; }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .22s cubic-bezier(.2,.9,.3,1.2); pointer-events: auto; display: flex; gap: 10px; align-items: center; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.97); } }

/* Drop zone */
.drop { border: 1.5px dashed var(--line2); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; font-size: 13px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text2); }
.drop b { color: var(--text); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 84px; height: 64px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2) center/cover no-repeat; overflow: hidden; display: flex; align-items: flex-end; }
.thumb .nm { font-size: 10px; padding: 3px 5px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 18px; cursor: pointer; padding: 0; }
.thumb.file { align-items: center; justify-content: center; flex-direction: column; color: var(--muted); }

/* Attachments in timelines */
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; text-decoration: none; background: var(--panel2); font-size: 12.5px; max-width: 260px; }
.att:hover { border-color: var(--line2); }
.att .ic { width: 30px; height: 30px; border-radius: 7px; background: var(--hover); display: grid; place-items: center; color: var(--muted); flex: none; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-img { display: block; width: 150px; height: 104px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2) center/cover no-repeat; cursor: zoom-in; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(6px); z-index: 90; display: grid; place-items: center; padding: 30px; cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow-lg); }
@keyframes fade { from { opacity: 0; } }

/* Markdown */
.md { line-height: 1.62; word-wrap: break-word; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { line-height: 1.25; letter-spacing: -.015em; margin: 1.3em 0 .5em; }
.md h1 { font-size: 1.6em; } .md h2 { font-size: 1.3em; } .md h3 { font-size: 1.08em; }
.md p { margin: .55em 0; } .md ul, .md ol { padding-left: 1.4em; margin: .5em 0; }
.md li { margin: .2em 0; } .md li.check { list-style: none; margin-left: -1.3em; }
.md code { font: .88em var(--mono); background: var(--hover); padding: .1em .35em; border-radius: 5px; }
.md pre { background: var(--bg2); border: 1px solid var(--line); padding: 12px 14px; border-radius: 10px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: .6em 0; padding: .1em 0 .1em 14px; border-left: 3px solid var(--accent); color: var(--text2); }
.md a { color: var(--accent); text-underline-offset: 2px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md input[type=checkbox] { accent-color: var(--accent); margin-right: 6px; transform: translateY(1px); }

.spin { width: 16px; height: 16px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
