:root {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --text: #16342d;
  --muted: #688079;
  --line: #dce7e3;
  --primary: #08745d;
  --primary-dark: #055c4a;
  --primary-soft: #e5f5f0;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #9a6700;
  --warning-soft: #fff7dd;
  --success: #18794e;
  --success-soft: #e9f8ef;
  --shadow: 0 16px 45px rgba(18, 56, 47, .08);
  --radius: 16px;
  --radius-small: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); }
.header-inner { max-width: 1480px; min-height: 72px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, #0a8168, #075b4a); box-shadow: 0 8px 18px rgba(8, 116, 93, .22); font-size: 23px; line-height: 1; }
.brand-mark.large { width: 54px; height: 54px; border-radius: 17px; font-size: 32px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.primary-nav { display: flex; align-items: stretch; align-self: stretch; gap: 6px; }
.primary-nav a { display: flex; align-items: center; padding: 0 15px; color: var(--muted); font-size: 14px; font-weight: 700; border-bottom: 3px solid transparent; text-decoration: none; }
.primary-nav a:hover, .primary-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-account { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.admin-identity { text-align: right; }
.admin-identity strong, .admin-identity small { display: block; }
.admin-identity strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.admin-identity small { color: var(--muted); font-size: 11px; margin-top: 2px; }

.page-shell { max-width: 1480px; margin: 0 auto; padding: 34px 28px 60px; }
.public-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.site-footer { max-width: 1480px; margin: 0 auto; padding: 0 28px 28px; color: var(--muted); font-size: 12px; text-align: center; }
.page-heading { margin-bottom: 25px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 2px 0 5px; font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.page-heading p { margin: 0; }
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.button { min-height: 40px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; font-size: 13px; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary { color: white; background: var(--primary); border-color: var(--primary); }
.button-primary:hover { color: white; background: var(--primary-dark); border-color: var(--primary-dark); }
.button-ghost { color: var(--text); background: white; border-color: var(--line); }
.button-ghost:hover { color: var(--primary); border-color: #a6c9c0; background: var(--surface-soft); }
.button-danger { color: white; background: var(--danger); border-color: var(--danger); }
.button-danger:hover { color: white; background: #8f1d14; }
.button-small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button-full { width: 100%; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 10px rgba(20, 59, 49, .025); padding: 22px; }
.panel h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.panel-heading { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-heading > a { font-size: 13px; font-weight: 700; white-space: nowrap; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 138px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, white 45%, #f0f8f5); box-shadow: 0 3px 10px rgba(20, 59, 49, .025); display: flex; flex-direction: column; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { margin: 10px 0 7px; font-size: 34px; line-height: 1; letter-spacing: -.04em; }
.metric-card small { margin-top: auto; color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.dashboard-grid .span-two { grid-column: span 2; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .055em; font-size: 9px; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #edf2f0; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
.reference { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .015em; }
.large-reference { margin-top: 8px !important; font-size: 13px; }
.table-summary, .table-subject { max-width: 360px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-subject { margin-bottom: 4px; color: var(--text); font-size: 12px; }
td small, .cell-meta { margin-top: 5px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }

.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; background: #eef2f1; color: #526761; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.neutral { background: #eff3f2; color: #526761; }
.status-new { background: #e8f3ff; color: #145ea8; }
.status-triaged { background: #f2ecff; color: #6842a8; }
.status-in_progress { background: #fff4d6; color: #8b5d00; }
.status-resolved { background: var(--success-soft); color: var(--success); }
.status-duplicate { background: #f0f1f2; color: #5e666d; }
.status-spam { background: var(--danger-soft); color: var(--danger); }
.priority-low { background: #eff3f2; color: #61736e; }
.priority-normal { background: var(--primary-soft); color: var(--primary); }
.priority-high { background: var(--warning-soft); color: var(--warning); }
.priority-urgent { background: var(--danger-soft); color: var(--danger); }
.dot { width: 9px; height: 9px; display: inline-block; margin-right: 8px; padding: 0; border-radius: 50%; }
.text-warning { color: var(--warning); }

.distribution-list { margin: 0; padding: 0; list-style: none; }
.distribution-list li { border-bottom: 1px solid #edf2f0; }
.distribution-list li:last-child { border-bottom: 0; }
.distribution-list a { min-height: 43px; display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: 12px; text-decoration: none; }
.distribution-list a:hover span { color: var(--primary); }
.definition-list { margin: 4px 0 0; }
.definition-list > div { padding: 11px 0; border-bottom: 1px solid #edf2f0; }
.definition-list > div:last-child { border-bottom: 0; }
.definition-list dt { margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.definition-list dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.definition-list.compact > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.definition-list.compact dt { margin: 0; }

.filter-panel { margin-bottom: 20px; padding: 18px; }
.filter-grid { display: grid; grid-template-columns: 2fr repeat(3, minmax(135px, 1fr)); gap: 13px; align-items: end; }
.filter-grid label, .stack-form label, .inline-action label { display: flex; flex-direction: column; gap: 6px; }
.filter-grid label > span, .stack-form label > span, .inline-action label > span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.filter-search { grid-column: span 1; }
.filter-actions { display: flex; gap: 8px; }
input, select, textarea { width: 100%; border: 1px solid #cfded9; border-radius: 9px; outline: none; color: var(--text); background: white; }
input, select { min-height: 40px; padding: 8px 10px; }
textarea { padding: 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8, 116, 93, .11); }
.report-table-panel { padding: 0; overflow: hidden; }
.report-table-panel .empty-state { min-height: 300px; }
.report-table td:nth-child(2) { min-width: 250px; }
.pagination { min-height: 62px; padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.pagination > div { display: flex; gap: 8px; }
.empty-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--text); font-size: 16px; }
.empty-state .button { margin-top: 8px; }

.breadcrumb { margin-bottom: 16px; display: flex; gap: 8px; color: var(--muted); font-size: 12px; }
.report-heading { align-items: flex-start; }
.heading-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.heading-times { min-width: 260px; padding-top: 8px; display: grid; grid-template-columns: auto auto; gap: 5px 13px; text-align: right; font-size: 11px; }
.heading-times span { color: var(--muted); }
.heading-times strong { font-size: 11px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.detail-main, .detail-sidebar { display: grid; gap: 20px; }
.detail-sidebar { position: sticky; top: 92px; }
.message-content { font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.contact-box { margin-top: 20px; padding: 13px 15px; border-radius: var(--radius-small); background: var(--primary-soft); display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 12px; }
.contact-box span { color: var(--muted); font-weight: 700; }
.privacy-note { margin: 20px 0 0; color: var(--muted); font-size: 11px; }
.screenshot-frame { min-height: 280px; max-height: 700px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #e9efed; }
.screenshot-frame img { max-width: 100%; max-height: 680px; display: block; object-fit: contain; }
details { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
details + details { margin-top: 12px; }
summary { padding: 12px 14px; cursor: pointer; background: var(--surface-soft); font-size: 12px; font-weight: 800; }
.code-block { max-height: 520px; margin: 0; padding: 16px; overflow: auto; border-top: 1px solid var(--line); color: #29443d; background: #fbfdfc; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.notes-list { display: grid; gap: 12px; }
.note { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.note-meta strong { color: var(--text); }
.note-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.stack-form { display: grid; gap: 15px; }
.stack-form .button { justify-self: start; }
.compact-form { gap: 11px; }
.action-panel { display: grid; gap: 15px; }
.inline-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.action-panel > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.identifiers dd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; word-break: break-all; }
.danger-panel { border-color: #f0b9b3; background: #fffafa; }
.danger-panel h2 { color: var(--danger); }
.danger-panel p { color: #7d514d; font-size: 11px; line-height: 1.5; }
.check-label { display: grid !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 8px !important; }
.check-label input { width: 16px; min-height: 16px; margin-top: 1px; }
.check-label span { color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 600 !important; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 18px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; top: 11px; bottom: -1px; left: 5px; width: 1px; background: var(--line); }
.timeline-dot { z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 3px solid var(--primary-soft); border-radius: 50%; background: var(--primary); }
.timeline strong { font-size: 12px; }
.timeline p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.timeline code { max-height: 150px; margin-top: 8px; padding: 8px; display: block; overflow: auto; border-radius: 7px; background: var(--surface-soft); white-space: pre-wrap; font-size: 9px; }

.alert { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.alert-error { color: var(--danger); border-color: #f2b8b2; background: var(--danger-soft); }
.alert-success { color: var(--success); border-color: #b8dfc7; background: var(--success-soft); }
.alert-warning { color: #765000; border-color: #ead18d; background: var(--warning-soft); }
.compact-alert { margin: 0 0 12px; }

.login-page { background: radial-gradient(circle at 15% 10%, #dff3ed 0, transparent 35%), radial-gradient(circle at 85% 85%, #e8f1ee 0, transparent 34%), #f5f8f7; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .97); box-shadow: var(--shadow); }
.login-brand { margin-bottom: 32px; display: flex; align-items: center; gap: 14px; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { font-size: 18px; }
.login-brand span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.login-card h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.035em; }
.login-card > .muted { margin: 0 0 22px; font-size: 13px; }
.login-help { margin: 23px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; text-align: center; }
.login-card .stack-form .button { justify-self: stretch; }
.error-card { width: min(680px, 100%); margin: 80px auto; padding: 50px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); text-align: center; }
.error-number { margin: 0; color: var(--primary); font-size: 72px; font-weight: 900; letter-spacing: -.07em; }
.error-card h1 { margin: 8px 0 12px; font-size: 25px; }
.error-card code { font-size: 10px; }
.error-actions { margin-top: 25px; display: flex; justify-content: center; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .filter-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .filter-search { grid-column: span 2; }
}

@media (max-width: 820px) {
  .header-inner { min-height: auto; padding: 12px 18px; flex-wrap: wrap; gap: 12px; }
  .brand { order: 1; }
  .admin-account { order: 2; }
  .admin-identity { display: none; }
  .primary-nav { order: 3; width: 100%; height: 42px; }
  .primary-nav a { padding: 0 12px; }
  .page-shell { padding: 25px 17px 45px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .detail-layout { grid-template-columns: 1fr; }
  .dashboard-grid .span-two { grid-column: auto; }
  .detail-sidebar { position: static; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: span 2; }
  .heading-times { width: 100%; text-align: left; }
}

@media (max-width: 520px) {
  .metric-grid, .filter-grid { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
  .filter-actions { grid-column: auto; }
  .metric-card { min-height: 125px; }
  .panel { padding: 17px; }
  .login-card { padding: 28px 22px; }
  .admin-account .button { font-size: 0; width: 38px; padding: 0; }
  .admin-account .button::after { content: "↪"; font-size: 18px; }
  .pagination { align-items: flex-start; flex-direction: column; }
}
