/* Waypoint Planner - styles of the individual dialogs (js/ui/dialogs/*.js).
   Base dialog and form styles (.wp-dlg, .wp-dlg-field, .wp-input, .wp-table-editor, ...) live in css/app.css. */

/* ==========================================================================
   Shared form pieces (js/ui/dialogs/common.js)
   ========================================================================== */
.wp-dlg-formerror:empty { display: none; }
.wp-dlg-formerror { margin: 8px 0 0; padding: 6px 10px; border-radius: var(--wp-radius-sm); background: #fdecee; line-height: 1.4; }
.wp-dlg-formerror.is-info { background: var(--wp-accent-weak); color: var(--wp-accent-strong); }
.wp-dlg-status { min-height: 18px; margin-top: 4px; color: var(--wp-muted); }

.wp-dlg-date { position: relative; display: flex; align-items: center; min-width: 0; }
.wp-dlg-date .wp-input { padding-right: 28px; }
.wp-dlg-datebtn {
  position: absolute; right: 2px; top: 50%; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 22px; margin-top: -11px; padding: 0; border: 0; border-radius: var(--wp-radius-sm);
  background: none; color: var(--wp-muted); cursor: pointer;
}
.wp-dlg-datebtn:hover:not(:disabled) { background: var(--wp-hover); color: var(--wp-accent); }
.wp-dlg-datebtn:disabled { opacity: 0.4; cursor: default; }
.wp-table-editor .wp-dlg-date .wp-input { padding-right: 26px; }

.wp-dlg-static {
  min-height: 28px; padding: 5px 8px; overflow: hidden; border: 1px solid transparent; border-radius: var(--wp-radius-sm);
  background: var(--wp-panel-2); color: var(--wp-text); line-height: 16px; text-overflow: ellipsis; white-space: nowrap;
}
.wp-input.wp-dlg-num { text-align: right; }
.wp-dlg-rec .wp-input.wp-dlg-num, .wp-dlg-rec-line .wp-input.wp-dlg-num, .wp-dlg-opt .wp-input.wp-dlg-num { width: 64px; }
.wp-dlg-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.wp-dlg-inline > .wp-dlg-label { margin-right: 4px; }
.wp-dlg-vertical { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.wp-dlg-radios.wp-dlg-vertical .wp-dlg-check { margin-bottom: 2px; }
.wp-dlg-cell { display: flex; align-items: center; min-height: 28px; margin: 0 0 8px; }
.wp-dlg-indent { margin-left: 22px; }
.wp-dlg-ro { color: var(--wp-muted); white-space: nowrap; }
td.wp-dlg-ro { padding-left: 8px !important; padding-right: 8px !important; }
td.wp-dlg-num { text-align: right; }
.wp-dlg-notes { min-height: 220px; font-family: inherit; }

/* Custom field values (Task / Resource Information) */
.wp-dlg-cfedit td.wp-dlg-cf-name { width: 42%; padding: 4px 8px; white-space: nowrap; }
.wp-dlg-cfedit .wp-te-actions .wp-select { width: auto; min-width: 220px; }

/* ==========================================================================
   Task Information
   ========================================================================== */
.wp-dlg-ti-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 18px; align-items: start; margin-bottom: 10px; }
.wp-dlg-ti-head > .wp-dlg-field { grid-template-columns: 56px minmax(0, 1fr); }
.wp-dlg-ti-head > .wp-dlg-note { grid-column: 1 / -1; margin-bottom: 8px; }
.wp-dlg-ti-dur { display: flex; align-items: center; gap: 4px; }
.wp-dlg-ti-dur .wp-dlg-field { grid-template-columns: 60px 110px; margin-bottom: 8px; }
.wp-dlg-ti-dur .wp-dlg-check { margin: 0 0 8px 4px; }
.wp-dlg-taskinfo .wp-dlg-panels { min-height: 318px; }
.wp-dlg-taskinfo .wp-dlg-section .wp-dlg-field { grid-template-columns: 110px minmax(0, 1fr); }
.wp-dlg-predtable td:first-child .wp-input { text-align: right; }

/* ==========================================================================
   Project Information / Statistics
   ========================================================================== */
.wp-dlg-projectinfo .wp-dlg-panels { min-height: 260px; }
.wp-dlg-stats { width: 100%; border-collapse: collapse; }
.wp-dlg-stats th, .wp-dlg-stats td { padding: 6px 8px; border-bottom: 1px solid var(--wp-grid-line); text-align: right; white-space: nowrap; }
.wp-dlg-stats thead th { background: var(--wp-panel-2); border-bottom-color: var(--wp-border); font-weight: 600; }
.wp-dlg-stats tbody th { color: var(--wp-muted); font-weight: 600; text-align: left; }
.wp-dlg-stats tr[data-row="current"] td { font-weight: 600; }
.wp-dlg-stats-pct { display: flex; gap: 24px; margin: 12px 0 6px; }
.wp-dlg-stats-pct > span:first-child { color: var(--wp-muted); }

/* ==========================================================================
   Change Working Time
   ========================================================================== */
.wp-dlg-wt-head { margin-bottom: 8px; }
.wp-dlg-wt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 10px; align-items: start; }
.wp-dlg-wt-row + .wp-dlg-wt-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wp-dlg-wt-row .wp-dlg-field { grid-template-columns: 100px minmax(0, 1fr); }
.wp-dlg-wt-info { min-height: 16px; margin: 0; }
.wp-dlg-wt-preview { display: grid; grid-template-columns: 170px 300px minmax(0, 1fr); gap: 16px; margin: 4px 0 14px; padding: 12px; border: 1px solid var(--wp-border); border-radius: var(--wp-radius); background: var(--wp-panel-2); }
.wp-dlg-legend { display: flex; flex-direction: column; gap: 6px; }
.wp-dlg-legend-title { margin-top: 4px; color: var(--wp-muted); font-weight: 600; }
.wp-dlg-legend-item { display: flex; align-items: center; gap: 8px; }
.wp-dlg-sw {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 20px;
  border: 1px solid var(--wp-border-strong); border-radius: 3px; background: #fff; font-size: 10px;
}
.wp-dlg-sw.is-nonworking, .wp-dlg-cal-cell.is-nonworking { background: #dfe2ea; color: #5b6276; }
.wp-dlg-sw.is-edited, .wp-dlg-cal-cell.is-edited {
  background: repeating-linear-gradient(135deg, #fff 0 4px, #dde4ff 4px 7px);
}
.wp-dlg-sw.is-exception, .wp-dlg-cal-cell.is-exception { font-weight: 700; text-decoration: underline; text-decoration-color: var(--wp-slack); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.wp-dlg-sw.is-exception { color: var(--wp-slack); }
.wp-dlg-sw.is-workweek, .wp-dlg-cal-cell.is-workweek { text-decoration: underline dotted var(--wp-status-date); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.wp-dlg-sw.is-workweek { color: var(--wp-status-date); }
.wp-dlg-cal { user-select: none; }
.wp-dlg-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wp-dlg-cal-title { font-weight: 600; }
.wp-dlg-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.wp-dlg-cal-dow { padding: 2px 0; color: var(--wp-muted); font-size: 11px; text-align: center; }
.wp-dlg-cal-cell {
  height: 28px; padding: 0; border: 1px solid var(--wp-border); border-radius: 3px; background: #fff;
  color: var(--wp-text); font: inherit; cursor: pointer;
}
.wp-dlg-cal-cell.is-other { opacity: 0.45; }
.wp-dlg-cal-cell.is-today { box-shadow: inset 0 0 0 1px var(--wp-today); }
.wp-dlg-cal-cell.is-selected { border-color: var(--wp-accent); box-shadow: 0 0 0 2px var(--wp-accent); position: relative; z-index: 1; }
.wp-dlg-cal-cell:hover { border-color: var(--wp-accent); }
.wp-dlg-cal-day { min-width: 0; line-height: 1.5; }
.wp-dlg-cal-daytitle { margin-bottom: 4px; font-weight: 600; }
.wp-dlg-cal-shifts { margin: 0 0 8px; padding-left: 18px; }
.wp-dlg-cal-nonworking { margin-bottom: 8px; color: var(--wp-muted); }
.wp-dlg-cal-source { color: var(--wp-muted); font-size: 11px; }
.wp-dlg-workingtime .wp-dlg-panels { min-height: 200px; }
.wp-dlg-wk-default td { color: var(--wp-muted); }
.wp-dlg-extable td:nth-child(4) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* Working-times editor */
.wp-dlg-shifts { max-width: 360px; margin-top: 6px; }
.wp-dlg-shifts .wp-table-editor .wp-input { border-color: var(--wp-border); }

/* Exception details */
.wp-dlg-rec-wrap { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.wp-dlg-rec-wrap > .wp-dlg-radios { padding-right: 12px; border-right: 1px solid var(--wp-border); }
.wp-dlg-rec { display: flex; flex-direction: column; gap: 8px; }
.wp-dlg-rec:not(:has(> .wp-dlg-rec-line)) { flex-direction: row; align-items: center; gap: 8px; }
.wp-dlg-rec-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wp-dlg-rec-line .wp-dlg-check { margin: 0; min-width: 72px; }
.wp-dlg-rec-line .wp-select { width: auto; }
.wp-dlg-rec-line .wp-dlg-date { width: 150px; }
.wp-dlg-rec-days { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; }
.wp-dlg-rec-end { display: flex; flex-direction: column; gap: 6px; }

/* Work week details */
.wp-dlg-wk { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; }
.wp-dlg-wk-days { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--wp-border); border-radius: var(--wp-radius-sm); }
.wp-dlg-wk-day {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 9px;
  border: 0; border-bottom: 1px solid var(--wp-grid-line); background: #fff; font: inherit; text-align: left; cursor: pointer;
}
.wp-dlg-wk-day:last-child { border-bottom: 0; }
.wp-dlg-wk-day:hover { background: var(--wp-hover); }
.wp-dlg-wk-day.is-selected { background: var(--wp-select); color: var(--wp-select-text); }
.wp-dlg-wk-name { font-weight: 600; }
.wp-dlg-wk-times { color: var(--wp-muted); font-size: 11px; }
.wp-dlg-wk-day.is-selected .wp-dlg-wk-times { color: inherit; }
.wp-dlg-wk-edit .wp-dlg-radios { margin-bottom: 4px; }

/* ==========================================================================
   Options
   ========================================================================== */
.wp-dlg-options .wp-dlg-panels { min-height: 380px; }
.wp-dlg-options .wp-dlg-section .wp-dlg-field { grid-template-columns: 130px minmax(0, 1fr); }
.wp-dlg-opt { margin: 0 0 6px; }
.wp-dlg-opt > .wp-dlg-check { margin-bottom: 0; }
.wp-dlg-opt-hint { margin: 0 0 4px 22px; color: var(--wp-muted); font-size: 11px; line-height: 1.35; }
.wp-dlg-opt label.wp-dlg-inline { gap: 6px; }

/* ==========================================================================
   Assign Resources
   ========================================================================== */
.wp-dlg-ar-task { margin-bottom: 8px; font-weight: 600; }
.wp-dlg-ar-list { margin-top: 8px; }
.wp-dlg-ar-row { cursor: pointer; }
.wp-dlg-ar-row:hover td { background: var(--wp-hover); }
.wp-dlg-ar-row.is-selected td { background: var(--wp-select); color: var(--wp-select-text); }
.wp-dlg-ar-row td { padding: 3px 6px; }
.wp-dlg-ar-mark { color: var(--wp-success); font-weight: 700; text-align: center; }
.wp-dlg-ar-row.is-assigned .wp-dlg-ar-name { font-weight: 600; }
.wp-dlg-ar-add { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; margin-top: 4px; }

/* ==========================================================================
   Columns, Sort, Filter, Find
   ========================================================================== */
.wp-dlg-fieldpicker { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wp-dlg-fieldlist { height: auto; padding: 2px; }
.wp-dlg-fielddesc { min-height: 30px; color: var(--wp-muted); font-size: 11px; line-height: 1.35; }
.wp-dlg-columns .wp-dlg-field { align-items: start; }
.wp-dlg-columns .wp-dlg-field > .wp-dlg-label { padding-top: 6px; }
.wp-dlg-sortrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 6px; }
.wp-dlg-filtervals { display: flex; gap: 4px; }
.wp-dlg-find .wp-dlg-inline { margin: 2px 0 6px; }

/* ==========================================================================
   Leveling, Custom Fields
   ========================================================================== */
.wp-dlg-reslist { height: auto; margin-bottom: 8px; padding: 2px; }
.wp-dlg-leveling .wp-dlg-rec-line { margin-bottom: 6px; }
.wp-dlg-cf { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
.wp-dlg-cf-left .wp-dlg-field { grid-template-columns: 40px minmax(0, 1fr); }
.wp-dlg-cflist { height: auto; padding: 2px; }
.wp-dlg-cf-title { margin-bottom: 10px; font-weight: 600; }
.wp-dlg-cf-right .wp-dlg-field { grid-template-columns: 60px minmax(0, 1fr); }
.wp-dlg-cf-ops { white-space: nowrap; text-align: right; }

/* ==========================================================================
   About, Keyboard Shortcuts
   ========================================================================== */
.wp-dlg-about { display: flex; gap: 18px; }
.wp-dlg-about-logo { color: var(--wp-accent); }
.wp-dlg-about-text h3 { margin: 4px 0 6px; font-size: 16px; font-weight: 600; }
.wp-dlg-about-text p { margin: 0 0 10px; line-height: 1.5; }
.wp-dlg-about-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 0 10px; }
.wp-dlg-about-facts dt { color: var(--wp-muted); }
.wp-dlg-about-facts dd { margin: 0; }
.wp-dlg-keys { max-height: 56vh; margin-top: 10px; overflow: auto; }
.wp-dlg-keygroup h4 { margin: 10px 0 4px; color: var(--wp-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.wp-dlg-keytable { width: 100%; border-collapse: collapse; }
.wp-dlg-keytable td { padding: 4px 6px; border-bottom: 1px solid var(--wp-grid-line); }
.wp-dlg-keycombo { white-space: nowrap; text-align: right; }
.wp-dlg-keycombo kbd { margin: 0 1px; }
.wp-dlg-keyor { margin: 0 6px; color: var(--wp-muted); font-size: 11px; }
