:root{
  --bg:#f3f4f6;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --shadow:0 1px 2px rgba(15,23,42,.05),0 8px 30px rgba(15,23,42,.04);
  --radius:14px;
  --orange:#f97316;
  --orange-dark:#ea580c;
  --green:#16a34a;
  --red:#e11d48;
  --yellow:#f59e0b;
  --blue:#2563eb;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--text);
}

a{color:inherit; text-decoration:none}

.container{
  width:min(1200px, 92vw);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar__inner{
  width:min(1200px, 92vw);
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
}

.brand{display:flex;align-items:center;gap:12px}
.brand__icon{
  width:44px;height:44px;
  border-radius:12px;
  background:#0f172a;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}
.brand__title{font-weight:800;font-size:18px;line-height:1.1}
.brand__subtitle{font-size:12px;color:var(--muted);margin-top:2px}

.topbar__right{display:flex;align-items:center;gap:14px}
.sitecode{
  font-size:12px;
  letter-spacing:.08em;
  color:var(--muted);
  font-weight:700;
}

.userchip{display:flex;align-items:center;gap:10px}
.userchip__meta{display:none; text-align:right}
.userchip__name{font-size:13px;font-weight:700}
.userchip__role{font-size:11px;color:var(--muted)}
.avatar{
  width:34px;height:34px;
  border-radius:10px;
  background:#e2e8f0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  color:#0f172a;
}

.iconbtn{
  width:34px;height:34px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  background:#fff;
}
.iconbtn:hover{background:#f8fafc}

@media (min-width: 720px){
  .userchip__meta{display:block}
}

.pagehead{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-top:8px}
.pagehead__title{font-size:34px; font-weight:900; margin:0}
.pagehead__desc{margin:6px 0 0;color:var(--muted)}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 11px 14px;
  border-radius: 12px;
  border:1px solid transparent;
  font-weight:800;
  font-size:13px;
  cursor:pointer;
}
.btn--primary{background:var(--orange); color:#111827; box-shadow:var(--shadow)}
.btn--primary:hover{background:var(--orange-dark)}
.btn--ghost{background:#fff;border-color:var(--border)}
.btn--ghost:hover{background:#f8fafc}

.btn svg{display:block}

.grid{display:grid;gap:14px}
.grid--4{grid-template-columns: repeat(4, minmax(0,1fr))}
@media (max-width: 980px){
  .grid--4{grid-template-columns: repeat(2, minmax(0,1fr))}
}
@media (max-width: 560px){
  .grid--4{grid-template-columns: 1fr}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat{
  padding:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.stat__label{font-size:12px;color:var(--muted);font-weight:700}
.stat__value{font-size:34px;font-weight:900;margin-top:4px}
.stat__icon{
  width:44px;height:44px;
  border-radius: 12px;
  background:#eef2ff;
  color:#1f2937;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.stat__icon--warn{background:#fff7ed;color:var(--orange-dark)}
.stat__icon--ok{background:#ecfdf5;color:var(--green)}
.stat__icon--risk{background:#fef2f2;color:var(--red)}

.searchwrap{
  margin-top:18px;
  background: #eef2f7;
  border:1px solid var(--border);
  border-radius: 12px;
  display:flex;
  align-items:center;
  padding: 10px 12px;
  gap:10px;
}
.searchwrap svg{color:var(--muted)}
.searchwrap input{
  border:none;
  outline:none;
  width:100%;
  background:transparent;
  font-size:13px;
}

.tablecard{margin-top:12px; overflow:hidden}
.table{
  width:100%;
  border-collapse: collapse;
}
.table th,
.table td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align:left;
  vertical-align: top;
  font-size: 13px;
}
.table th{
  background:#f8fafc;
  color: #334155;
  font-size: 12px;
  letter-spacing: .02em;
  font-weight: 800;
}
.table tr:hover td{background:#f8fafc}
.table a.rowlink{display:block}

.badge{
  display:inline-flex;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space:nowrap;
}

.badge-critical{background:#ef4444;color:#fff}
.badge-high{background:#fb7185;color:#fff}
.badge-medium{background:#fbbf24;color:#111827}
.badge-low{background:#60a5fa;color:#0b1220}

.badge-open{background:#fde68a;color:#111827}
.badge-investigating{background:#cbd5e1;color:#111827}
.badge-resolved{background:#bbf7d0;color:#14532d}
.badge-closed{background:#e2e8f0;color:#111827}

.kicker{margin-top:22px;color:#334155;font-weight:800;font-size:14px}

.form{
  margin-top:16px;
}
.form .row{display:grid; grid-template-columns: 1fr 1fr; gap:14px}
@media (max-width: 720px){
  .form .row{grid-template-columns:1fr}
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.field label{font-size:12px;color:#334155;font-weight:800}
.field input,
.field select,
.field textarea{
  border:1px solid var(--border);
  border-radius:12px;
  padding: 10px 12px;
  font-size:13px;
  background:#fff;
}
.field textarea{min-height:120px; resize:vertical}

.actions{display:flex; gap:10px; justify-content:flex-end; margin-top:18px}

.notice{
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background:#ecfeff;
  border:1px solid #a5f3fc;
  color:#0e7490;
}

.notice--error{
  background:#fef2f2;
  border-color:#fecaca;
  color:#991b1b;
}

.footer{
  border-top:1px solid var(--border);
  background:#fff;
}
.footer__inner{
  width:min(1200px, 92vw);
  margin:0 auto;
  padding: 18px 0;
  color:var(--muted);
  font-size:12px;
}

.detail{
  margin-top:18px;
  padding:18px;
}
.detail__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
@media (max-width: 720px){.detail__grid{grid-template-columns:1fr}}
.detail__item .label{color:var(--muted);font-weight:800;font-size:12px}
.detail__item .value{margin-top:6px;font-size:14px}

.comment{border-top:1px solid var(--border); padding:12px 0}
.comment:first-child{border-top:none}
.comment__meta{display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:12px}
.comment__text{margin-top:6px;white-space:pre-wrap}

.small{font-size:12px;color:var(--muted)}
