:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --panel2:#f5f7fb;
  --line:rgba(0,0,0,.18);
  --text:#0b1220;
  --muted:#556070;
  --blue:#0b76b7;
  --blue2:#095f94;
  --pill:#eef3ff;
  --danger:#b42318;
  --ok:#027a48;
  --warn:#b54708;
  --shadow: 0 6px 18px rgba(2,8,23,.08);
  --radius: 14px;
  --btnH: 44px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
}

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

.container{
  max-width:1600px;
  margin:0 auto;
  padding:20px 16px 40px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(245,247,251,.88);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--line);
}

.topbar .inner{
  max-width:1600px;
  margin:0 auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.brand img{
  width:28px;
  height:28px;
  border-radius:10px;
}

.brand .title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}

.brand .title b{
  font-size:16px;
  letter-spacing:.3px;
}

.brand .title span{
  font-size:12px;
  color:var(--muted);
}

.nav{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn{
  height:var(--btnH);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 14px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-weight:700;
  box-shadow:0 1px 0 rgba(2,8,23,.04);
}

.btn:hover{ border-color:rgba(0,0,0,.30); }
.btn:active{ transform: translateY(1px); }
.btn.primary{ background:var(--blue); color:#fff; border-color:rgba(0,0,0,.08); }
.btn.primary:hover{ background:var(--blue2); }
.btn.danger{ background:#fff; color:var(--danger); border-color:rgba(180,35,24,.35); }
.btn.small{ height:38px; border-radius:10px; padding:0 12px; font-size:13px; }
.btn.pill{ border-radius:999px; }

.grid2{
  display:grid;
  grid-template-columns:1.9fr .72fr;
  gap:16px;
}

@media (max-width:980px){ .grid2{ grid-template-columns:1fr; } }

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

.card .hd{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.card .hd h1,
.card .hd h2{ margin:0; font-size:16px; letter-spacing:.2px; }
.card .bd{ padding:14px 16px; }

.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
label{ font-size:12px; color:var(--muted); font-weight:400; }

input, textarea, select{
  width:100%;
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
  font-weight:400;
  background:#fff;
}
textarea{ min-height:120px; resize:vertical; }

.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.row.end{ justify-content:flex-end; }

.table{ width:100%; border-collapse:separate; border-spacing:0; }
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  font-size:14px;
}
.table th{ text-align:left; font-size:12px; color:var(--blue); letter-spacing:.3px; text-transform:uppercase; }
.table tr.ticket-row{ cursor:pointer; }
.table tr.ticket-row:hover td{ background:#fafcff; }
.table tr.expanded-row td{ background:#fbfcff; }
.table .muted{ color:var(--muted); font-size:12px; }

.pill{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--pill);
  font-size:12px;
  font-weight:400;
  white-space:nowrap;
}
.pill.blue{ background:#e8f0ff; border-color:rgba(31,111,235,.25); color:var(--blue2); }
.pill.ok{ background:#ecfdf3; border-color:rgba(2,122,72,.25); color:var(--ok); }
.pill.warn{ background:#fffaeb; border-color:rgba(181,71,8,.25); color:var(--warn); }
.pill.danger{ background:#fef3f2; border-color:rgba(180,35,24,.25); color:var(--danger); }
.pill.muted{ background:#e5e7eb; border-color:rgba(0,0,0,.25); color:#374151; }

.kbd{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  border:1px solid var(--line);
  border-bottom-color:rgba(0,0,0,.26);
  background:#fff;
  border-radius:10px;
  padding:3px 8px;
  font-size:12px;
}

.hr{ height:1px; background:var(--line); margin:12px 0; }
.note{ font-size:12px; color:var(--muted); }

.toast{
  position:fixed;
  bottom:14px;
  left:50%;
  transform:translateX(-50%);
  background:#0b1220;
  color:#fff;
  padding:10px 12px;
  border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  display:none;
  max-width:92vw;
}
.toast.show{ display:block; }

.checklist{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 10px; }
@media (max-width:520px){ .checklist{ grid-template-columns:1fr; } }

.chk{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  user-select:none;
}
.chk input{ width:18px; height:18px; }

.badges{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:26px;
  padding:0 8px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:400;
  letter-spacing:.3px;
  font-size:12px;
}
.badge.blue{ background:#e8f0ff; border-color:rgba(31,111,235,.25); color:var(--blue2); }
.badge.ok{ background:#ecfdf3; border-color:rgba(2,122,72,.25); color:var(--ok); }
.badge.warn{ background:#fffaeb; border-color:rgba(181,71,8,.25); color:var(--warn); }
.badge.danger{ background:#fef3f2; border-color:rgba(180,35,24,.25); color:var(--danger); }
.badge.muted{ background:#f7f7f7; }

.inline-select{
  width:auto;
  min-width:120px;
  padding:6px 30px 6px 10px;
  font-size:13px;
  font-weight:400;
  border-radius:10px;
}

.ticket-title{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  font-weight:700;
}
.ticket-meta{ margin-top:6px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.ticket-meta .note{ font-size:12px; }

.expand-wrap{ padding:14px 16px; }
.expand-grid{ display:grid; grid-template-columns:minmax(0,1.45fr) minmax(280px,.95fr); gap:16px; }
@media (max-width:1080px){ .expand-grid{ grid-template-columns:1fr; } }

.ticket-panel{
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  padding:12px;
}
.ticket-panel h3{ margin:0 0 10px; font-size:14px; }

.comment-list{ display:flex; flex-direction:column; gap:10px; }
.comment-item{
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  padding:10px 12px;
}
.comment-item .top{ display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.comment-item .body{ margin-top:6px; white-space:pre-wrap; }

.link-row{ display:flex; gap:10px; flex-wrap:wrap; }
.link-row > *{ flex:1; min-width:140px; }

.slim-note{ font-size:11px; color:var(--muted); margin-top:4px; }
.hidden{ display:none !important; }

.hidden-disabled{opacity:.55;pointer-events:none;}
