/* dialog.css -- T+ 18.0 modal dialog (UI-SPEC v2 section 10, screenshot 9)
 *
 * Separate from ui-kit.css so pages that never open a dialog skip these rules.
 * All colour/geometry values follow v2 measured conventions where available;
 * the find dialog itself was only available as a screenshot, so its internal
 * paddings are matched by eye against that screenshot and marked as such.
 *
 * ASCII-only comments so no tool can corrupt this file.
 */

.tj-dlg-mask {
  --tj-blue: #2b7de1;
  --tj-blue-hover: #1f6fd0;
  --brand-red: rgb(254, 81, 87);
  --text-1: rgb(51, 51, 51);
  --text-2: rgb(153, 153, 153);
  --border: rgb(204, 204, 204);

  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.14s ease;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text-1, rgb(51, 51, 51));
}

.tj-dlg-mask.tj-dlg-visible {
  opacity: 1;
}

.tj-dlg-panel {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  box-sizing: border-box;
  transform: translateY(-6px) scale(0.99);
  transition: transform 0.14s ease;
}

.tj-dlg-mask.tj-dlg-visible .tj-dlg-panel {
  transform: none;
}

/* ---- title bar ---- */
.tj-dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border, rgb(204, 204, 204));
  flex: 0 0 auto;
}

.tj-dlg-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1, rgb(51, 51, 51));
}

.tj-dlg-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tj-dlg-tool {
  width: 22px;
  height: 22px;
  line-height: 20px;
  padding: 0;
  font-size: 14px;
  color: rgb(102, 102, 102);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
}

.tj-dlg-tool:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-1, rgb(51, 51, 51));
}

.tj-dlg-close {
  font-size: 18px;
  line-height: 18px;
}

/* ---- content: left column + body ---- */
.tj-dlg-content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tj-dlg-left {
  flex: 0 0 auto;
  border-right: 1px solid var(--border, rgb(204, 204, 204));
  overflow: auto;
  box-sizing: border-box;
}

.tj-dlg-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  padding: 12px 16px;
  box-sizing: border-box;
}

/* ---- left plan tree ---- */
.tj-dlg-leftwrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tj-dlg-lefttools {
  display: flex;
  gap: 2px;
  padding: 5px 6px;
  border-bottom: 1px solid rgb(232, 232, 232);
  flex: 0 0 auto;
}

.tj-dlg-ltool {
  width: 24px;
  height: 22px;
  line-height: 20px;
  padding: 0;
  font-size: 12px;
  color: rgb(102, 102, 102);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.tj-dlg-ltool:hover {
  background: rgba(0, 0, 0, 0.06);
}

.tj-dlg-tree {
  padding: 6px 0;
  overflow: auto;
  flex: 1 1 auto;
}

.tj-dlg-tree-group {
  padding: 6px 12px 3px;
  font-size: 12px;
  color: var(--text-2, rgb(153, 153, 153));
  font-weight: 600;
  white-space: nowrap;
}

.tj-dlg-tree-item {
  padding: 5px 12px 5px 22px;
  font-size: 13px;
  color: var(--text-1, rgb(51, 51, 51));
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tj-dlg-tree-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* selected plan: blue background + white text (screenshot 9) */
.tj-dlg-tree-item.tj-active {
  background: var(--tj-blue, #2b7de1);
  color: #fff;
}

/* ---- right form ---- */
.tj-dlg-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tj-dlg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.tj-dlg-row-inline {
  gap: 4px;
}

.tj-dlg-label {
  flex: 0 0 auto;
  min-width: 76px;
  font-size: 13px;
  color: var(--text-1, rgb(51, 51, 51));
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.tj-dlg-req {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-red, rgb(254, 81, 87));
  margin-right: 3px;
}

.tj-dlg-ctl {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tj-dlg-input {
  height: 26px;
  line-height: 26px;
  padding: 0 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1, rgb(51, 51, 51));
  border: 1px solid var(--border, rgb(204, 204, 204));
  background: #fff;
  box-sizing: border-box;
  outline: none;
  width: 100%;
  max-width: 300px;
}

.tj-dlg-input:focus {
  border-color: var(--tj-blue, #2b7de1);
}

.tj-dlg-select {
  height: 26px;
  line-height: 24px;
  padding: 0 4px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1, rgb(51, 51, 51));
  border: 1px solid var(--border, rgb(204, 204, 204));
  background: #fff;
  box-sizing: border-box;
  outline: none;
  width: 100%;
  max-width: 300px;
}

.tj-dlg-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.tj-dlg-range .tj-dlg-input {
  flex: 1 1 0;
  min-width: 0;
  max-width: 150px;
}

.tj-dlg-rangesep {
  color: var(--text-2, rgb(153, 153, 153));
  flex: 0 0 auto;
}

/* boxed group (period / date) */
.tj-dlg-box {
  border: 1px solid rgb(224, 224, 224);
  border-radius: 3px;
  padding: 8px 10px 10px;
  margin: 2px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tj-dlg-box-title {
  font-size: 12px;
  color: var(--text-2, rgb(153, 153, 153));
  margin-bottom: 2px;
}

.tj-dlg-radios {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.tj-dlg-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-1, rgb(51, 51, 51));
  white-space: nowrap;
  cursor: pointer;
}

.tj-dlg-radio input[type="radio"] {
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
}

/* add-filter link: blue text */
.tj-dlg-addlink {
  margin-top: 2px;
  padding-left: 84px;
  font-size: 13px;
  color: var(--tj-blue, #2b7de1);
  cursor: pointer;
  user-select: none;
}

.tj-dlg-addlink:hover {
  text-decoration: underline;
}

/* ---- footer ---- */
.tj-dlg-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border-top: 1px solid var(--border, rgb(204, 204, 204));
  flex: 0 0 auto;
}

.tj-dlg-btn {
  min-width: 76px;
  height: 30px;
  line-height: 28px;
  padding: 0 16px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1, rgb(51, 51, 51));
  background: #fff;
  border: 1px solid var(--border, rgb(204, 204, 204));
  border-radius: 2px;
  cursor: pointer;
  box-sizing: border-box;
}

.tj-dlg-btn:hover {
  border-color: var(--tj-blue, #2b7de1);
  color: var(--tj-blue, #2b7de1);
}

/* primary confirm button: blue fill, white text */
.tj-dlg-btn.tj-dlg-btn-primary {
  color: #fff;
  background: var(--tj-blue, #2b7de1);
  border-color: var(--tj-blue, #2b7de1);
}

.tj-dlg-btn.tj-dlg-btn-primary:hover {
  background: var(--tj-blue-hover, #1f6fd0);
  border-color: var(--tj-blue-hover, #1f6fd0);
  color: #fff;
}

/* respects the OS reduced-motion setting */
@media (prefers-reduced-motion: reduce) {
  .tj-dlg-mask,
  .tj-dlg-panel {
    transition: none;
  }
}
