/* ---- base ---- */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1e2430;
  background: #f4f5f7;
}
body { display: flex; flex-direction: column; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: #1d2b45;
  color: #fff;
  flex-shrink: 0;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 600; letter-spacing: 0.2px; }
.client-badge {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
}
.user-email { font-size: 13px; opacity: 0.85; }
.topbar form { margin: 0; }
.nav-link {
  color: #fff;
  opacity: 0.85;
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 6px;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }

/* ---- staff stats page ---- */
.staff-badge {
  background: #fdf3d7;
  color: #8a6116;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  vertical-align: middle;
  margin-left: 8px;
}
.client-select {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid #c8cdd6;
  border-radius: 6px;
  background: #fff;
}
.stats-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.tile {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  padding: 16px 18px;
}
.tile-value { font-size: 28px; font-weight: 650; color: #1e2430; line-height: 1.2; }
.tile-label { font-size: 13px; color: #454f5f; margin-top: 4px; }
.tile-sub { font-size: 12px; color: #8b94a3; margin-top: 2px; }
.stats-section {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  padding: 18px 20px;
  max-width: 720px;
}
.stats-section h2 {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #66707f;
}
.stats-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stats-columns .stats-section { max-width: none; }
.stats-wide { max-width: none; }
.chased-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chased-table th {
  text-align: left;
  color: #66707f;
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 1px solid #dde1e7;
}
.chased-table td { padding: 7px 10px; border-bottom: 1px solid #f0f2f5; }
.chased-table .num { text-align: right; width: 70px; }
.chased-table td.num { font-weight: 600; }
.sb-value { white-space: nowrap; }
.status-bars { display: flex; flex-direction: column; gap: 8px; }

/* ---- users admin + security ---- */
.flash-info {
  background: #e8f4ea;
  color: #1d7a3f;
  border: 1px solid #bfe3c8;
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 12px;
}
.magic-box {
  background: #f2f7ff;
  border: 1px solid #d7e4fa;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.magic-url {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid #c8cdd6;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th {
  text-align: left;
  color: #66707f;
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 1px solid #dde1e7;
}
.users-table td { padding: 7px 10px; border-bottom: 1px solid #f0f2f5; }
.users-table .num { text-align: right; }
.users-table .actions { display: flex; gap: 6px; }
.users-table .actions form { margin: 0; }
.row-blocked td { color: #8b94a3; }
.btn-mini {
  font: inherit;
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid #c8cdd6;
  border-radius: 5px;
  background: #fff;
  color: #454f5f;
  cursor: pointer;
}
.btn-mini:hover { border-color: #98a3b3; }
.btn-warn { color: #8a6116; border-color: #e5c983; }
.btn-danger { color: #a02929; border-color: #e7b3b3; }
.btn-danger:hover { background: #fdecec; }
.add-user { margin-top: 16px; }
.add-user-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-user-form input[type="email"], .add-user-form input[type="text"] {
  padding: 8px 10px;
  border: 1px solid #c8cdd6;
  border-radius: 6px;
  font: inherit;
  min-width: 210px;
}
.add-user-form select {
  padding: 8px 10px;
  border: 1px solid #c8cdd6;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.staff-check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.btn.btn-inline { width: auto; margin-top: 0; padding: 8px 22px; }
.add-user-note { margin: 10px 0 0; font-size: 12.5px; }
.jql-cell { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; max-width: 260px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}
.form-grid label { font-size: 13px; font-weight: 500; color: #454f5f; }
.form-grid .hint { font-weight: 400; color: #8b94a3; }
.form-grid input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #c8cdd6;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}
.form-actions { display: flex; align-items: center; gap: 12px; }
a.btn-mini { text-decoration: none; display: inline-block; }
.security-card { max-width: 640px; }
.security-card h2 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #66707f;
}
.enroll-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.btn-passkey {
  width: 100%;
  background: #1d2b45;
  color: #fff;
  margin-bottom: 4px;
}
.btn-passkey:hover { background: #16213a; }
.passkey-msg { font-size: 12.5px; min-height: 16px; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8b94a3;
  font-size: 12px;
  margin: 10px 0 2px;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e3e6eb;
}
.sb-row { display: flex; align-items: center; gap: 12px; }
.sb-label { width: 180px; font-size: 13px; color: #1e2430; text-align: right; }
.sb-track { flex: 1; height: 14px; background: #f0f2f5; border-radius: 4px; }
.sb-fill {
  height: 100%;
  background: #2457c5;
  border-radius: 4px 4px 4px 4px;
  min-width: 2px;
}
.sb-value { min-width: 44px; font-size: 13px; font-weight: 600; color: #454f5f; }

/* ---- buttons ---- */
.btn {
  font: inherit;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
}
.btn-primary { background: #2457c5; color: #fff; width: 100%; margin-top: 16px; }
.btn-primary:hover { background: #1c479f; }
.btn-quiet {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 5px 12px;
  font-size: 13px;
}
.btn-quiet:hover { background: rgba(255, 255, 255, 0.12); }

/* ---- login ---- */
.login-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(20, 30, 60, 0.1);
  padding: 32px;
  width: 100%;
  max-width: 380px;
}
.brand-banner {
  background: #1d2b45;
  border-radius: 8px;
  padding: 14px 18px;
  margin: -8px 0 18px;
  display: flex;
  justify-content: center;
}
.brand-logo { max-height: 56px; max-width: 100%; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-sub { margin: 0 0 20px; color: #66707f; }
.login-card label { display: block; margin: 14px 0 4px; font-weight: 500; }
.login-card input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #c8cdd6;
  border-radius: 6px;
  font: inherit;
}
.login-card input:focus { outline: 2px solid #2457c5; outline-offset: 0; border-color: transparent; }
.flash {
  background: #fdecec;
  color: #a02929;
  border: 1px solid #f3c1c1;
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 6px;
}

/* ---- dashboard layout ---- */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  min-height: 0;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.toolbar h1 { margin: 0; font-size: 18px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
#quick-filter {
  width: 280px;
  padding: 8px 12px;
  border: 1px solid #c8cdd6;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.btn-reset {
  background: #fff;
  border: 1px solid #c8cdd6;
  color: #454f5f;
  font-size: 13px;
  padding: 7px 12px;
}
.btn-reset:hover { background: #f4f5f7; }

/* ---- header filter row ---- */
.slick-headerrow { background: #fbfcfd; border-bottom: 1px solid #dde1e7; }
.slick-headerrow-column { padding: 4px 6px !important; }
.hf-input {
  width: 100%;
  height: 27px;
  padding: 3px 8px;
  border: 1px solid #c8cdd6;
  border-radius: 5px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
  box-sizing: border-box;
}
.hf-input:focus { outline: 2px solid #2457c5; outline-offset: -1px; }
.hf-btn {
  width: 100%;
  height: 27px;
  padding: 3px 8px;
  border: 1px solid #c8cdd6;
  border-radius: 5px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
  color: #454f5f;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hf-btn:hover { border-color: #98a3b3; }
.hf-btn-active { border-color: #2457c5; color: #1c479f; background: #f2f7ff; }
.hf-panel {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid #c8cdd6;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(20, 30, 60, 0.18);
  padding: 10px 12px;
  min-width: 200px;
  max-width: 300px;
}
.hf-actions { margin-bottom: 6px; font-size: 12.5px; }
.hf-actions a { color: #2457c5; text-decoration: none; }
.hf-actions a:hover { text-decoration: underline; }
.hf-check-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hf-check-list label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}
.hf-check-list label:hover { background: #f4f7fd; }
.hf-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #454f5f;
}
.hf-date-row input {
  border: 1px solid #c8cdd6;
  border-radius: 5px;
  padding: 3px 6px;
  font: inherit;
  font-size: 12.5px;
}
.layout {
  flex: 1;
  display: flex;
  gap: 16px;
  min-height: 0;
}
.grid-pane {
  flex: 3;
  min-width: 0;
  position: relative;
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  overflow: hidden;
}
.slick-container { width: 100%; height: 100%; }
.empty-state[hidden] { display: none; }
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: #66707f;
  background: #fff;
}

/* ---- grid skin ---- */
.slick-header-columns { background: #f7f8fa; border-bottom: 1px solid #dde1e7; }
.slick-header-column {
  font-weight: 600;
  color: #454f5f;
  border-right: 1px solid #eceef2 !important;
}
.slick-row { border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.slick-cell {
  border: none;
  border-right: 1px solid #f5f6f8;
  padding: 9px 8px;
  line-height: 20px;
}
.grid-pane .slick-cell.active { border: none; box-shadow: none; }
.slick-row:hover { background: #f4f7fd; }
.slick-row.row-active, .slick-row.row-active:hover { background: #e8effb; }
.cell-key { font-weight: 600; color: #2457c5; }
.jira-link { color: #2457c5; text-decoration: none; }
.jira-link:hover { text-decoration: underline; }
.cell-summary { color: #66707f; }

.chip {
  display: inline-block;
  border-radius: 10px;
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}
.chip-open { background: #e3ecfd; color: #1c479f; }
.chip-progress { background: #fdf3d7; color: #8a6116; }
.chip-waiting { background: #f1e6fb; color: #6b3fa0; }
.chip-done { background: #ddf3e4; color: #1d7a3f; }

/* ---- detail pane ---- */
.detail-pane {
  flex: 2;
  min-width: 300px;
  max-width: 520px;
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  padding: 18px 20px;
  overflow-y: auto;
}
.detail-placeholder { color: #8b94a3; padding: 24px 0; text-align: center; }
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.detail-pane h2 { margin: 0 0 12px; font-size: 16px; line-height: 1.4; }
.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0 0 16px;
  font-size: 13px;
}
.detail-meta dt { color: #8b94a3; }
.detail-meta dd { margin: 0; }
.summary-box {
  background: #f2f7ff;
  border: 1px solid #d7e4fa;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.summary-box h3, .body-box h3 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #66707f;
}
.summary-box p { margin: 0 0 8px; line-height: 1.5; }
.summary-box p:last-of-type { margin-bottom: 0; }
.summary-when { margin-top: 8px; font-size: 12px; color: #8b94a3; }
.body-text {
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: #454f5f;
  line-height: 1.5;
}
.muted { color: #8b94a3; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .grid-pane { min-height: 320px; }
  .detail-pane { max-width: none; }
}
