/* Bloomwell internal tools — black & white identity */
:root {
  --ink: #111111;          /* primary text / black */
  --ink-soft: #3a3f44;
  --muted: #6b7280;        /* secondary text */
  --faint: #9aa0a6;
  --line: #e6e8eb;         /* borders */
  --line-strong: #d6d9dd;
  --bg: #f7f8f9;           /* app background */
  --surface: #ffffff;      /* cards / header */
  --hover: #f0f1f3;        /* row / item hover */
  --active: #eceef0;       /* active nav */
  --mark-bg: #111111;      /* signet square */
  --mark-fg: #ffffff;      /* lotus */
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Brand lockup (signet square + stacked wordmark) */
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 36px; height: 36px; display: block; flex: none; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.brand-name small { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Topbar — white, subtle bottom border */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar .brand:hover { text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; }

.container { max-width: 980px; margin: 28px auto; padding: 0 22px; }
.footer { max-width: 980px; margin: 48px auto; padding: 16px 22px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; color: #fff; text-decoration: none; }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 10px; }

/* Login */
.login-card {
  max-width: 480px; margin: 7vh auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px; text-align: center; box-shadow: 0 6px 24px rgba(17,17,17,.05);
}
.login-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.login-logo .brand-mark { width: 44px; height: 44px; }
.login-logo .brand-name strong { font-size: 19px; }
.login-logo .brand-name small { font-size: 13px; }
.login-card h1 { margin: 0 0 10px; font-size: 22px; color: var(--ink); }
.ms-logo { width: 16px; height: 16px; display: inline-block;
  background:
    linear-gradient(#f25022,#f25022) 0 0/7px 7px no-repeat,
    linear-gradient(#7fba00,#7fba00) 9px 0/7px 7px no-repeat,
    linear-gradient(#00a4ef,#00a4ef) 0 9px/7px 7px no-repeat,
    linear-gradient(#ffb900,#ffb900) 9px 9px/7px 7px no-repeat; }

/* Search */
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbar input {
  flex: 1; padding: 12px 15px; font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
}
.searchbar input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.resultmeta { margin: 4px 0 16px; color: var(--ink-soft); }

/* Results table */
table.tickets { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.tickets th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 15px; border-bottom: 1px solid var(--line); background: #fbfbfc; }
table.tickets td { padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tickets tbody tr:last-child td { border-bottom: none; }
table.tickets tbody tr:hover { background: var(--hover); cursor: pointer; }
td.id { color: var(--muted); font-variant-numeric: tabular-nums; }

.tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11px; background: #f2f3f5; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }

/* Status pills — monochrome, differentiated by a small dot */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #f2f3f5; color: var(--ink-soft); text-transform: capitalize; font-weight: 600; border: 1px solid var(--line); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.status-open::before, .status-new::before { background: #111; }
.status-pending::before, .status-hold::before { background: #9aa0a6; border: 1px solid #6b7280; }
.status-solved::before, .status-closed::before { background: #fff; border: 1px solid #9aa0a6; }

.pager { display: flex; align-items: center; gap: 16px; margin: 18px 0; }
.empty { padding: 44px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* Ticket detail */
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); }
.ticket-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.ticket-head h1 { margin: 0 0 16px; font-size: 23px; color: var(--ink); }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 22px; }
.meta-grid .label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 18px; }
.block h2 { margin-top: 0; font-size: 16px; color: var(--ink); }
.body { white-space: pre-wrap; word-wrap: break-word; }

.comment { border-top: 1px solid var(--line); padding: 16px 0; }
.comment:first-of-type { border-top: none; }
.comment.internal { background: #fafafa; margin: 0 -24px; padding: 16px 24px; border-left: 3px solid var(--ink); }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.badge { font-size: 11px; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 8px; font-weight: 600; }

.attachments { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.attachment { font-size: 13px; background: #f2f3f5; border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; color: var(--ink-soft); }
a.attachment:hover { background: var(--hover); text-decoration: none; }
.attachment.missing { opacity: .55; }
.att-thumb { display: inline-block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; line-height: 0; }
.att-thumb:hover { border-color: var(--line-strong); text-decoration: none; }
.att-thumb img { max-width: 160px; max-height: 160px; object-fit: cover; display: block; }

details.raw summary { cursor: pointer; color: var(--muted); }
details.raw pre { background: #111111; color: #e6e8eb; padding: 16px; border-radius: 9px; overflow: auto; font-size: 12px; max-height: 480px; }
