/*
 * Gracklepad Stylesheet
 */

/* ---- Reset & Base ---- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  line-height: 1.5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a2e;
  background-color: #f5f5f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a:link, a:visited {
  color: #4a5899;
  text-decoration: none;
}

a:hover {
  color: #2e3a6e;
  text-decoration: none;
}

h1 { font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 1.8rem; font-weight: 600; }
h2 { font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

ul { list-style: none; }
img { border: 0; }


/* ---- Site Header ---- */

.Header {
  background-color: #1a1a2e;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.2rem;
  flex-wrap: wrap;
}

.Header .SiteBrand {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.Header .SiteBrand .DebugBranch {
  font-size: 0.6em;
  font-weight: 400;
  color: #777;
}

.Header .SiteBrand a:link,
.Header .SiteBrand a:visited,
.Header .SiteBrand a:hover {
  color: #c8c8e0;
  text-decoration: none;
}

.AccountNavigation {
  position: static;
  background: none;
  padding: 0;
  border-radius: 0;
  margin: 0;
}

.AccountNavigation ul {
  display: flex;
  gap: 0.2rem;
}

.AccountNavigation ul li {
  font-size: 0.85rem;
  padding: 0 0.6rem;
  border-left: 1px solid #3a3a5e;
}

.AccountNavigation ul li:first-child {
  border-left: none;
}

.AccountNavigation ul li {
  color: #a0a0c0;
}

.AccountNavigation ul a:link,
.AccountNavigation ul a:visited {
  color: #a0a0c0;
}

.AccountNavigation ul a:hover {
  color: #ffffff;
  text-decoration: none;
}


/* ---- Main Navigation ---- */

.MainNavigation {
  background-color: #16213e;
  padding: 0 2rem;
}

.MainNavigation ul {
  display: flex;
  gap: 0;
  transform: none;
  padding: 0;
}

.MainNavigation ul li {
  float: none;
  transform: none;
  font-size: 0.95rem;
  padding: 0.55rem 1.2rem;
  text-transform: none;
  font-weight: 500;
  background: none;
  border-bottom: 3px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

.MainNavigation ul li div.FixTransform {
  transform: none;
}

.MainNavigation ul li.tab-active {
  border-bottom-color: #7c83db;
  background-color: rgba(124, 131, 219, 0.1);
}

.MainNavigation ul a:link,
.MainNavigation ul a:visited {
  color: #b0b0d0;
}

.MainNavigation ul a:hover {
  color: #ffffff;
  text-decoration: none;
}

.MainNavigation ul li.tab-active a:link,
.MainNavigation ul li.tab-active a:visited {
  color: #e0e0ff;
}

.MainNavigation .anchor {
  display: none;
}


/* ---- Content Area ---- */

.Content {
  flex: 1;
  position: relative;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

#ContentBody {
  padding: 0;
}


/* ---- Sub-Header (project name, etc.) ---- */

#SubHeader {
  padding: 0 0 1rem 0;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1rem;
}

#SubHeader .PrimaryInformation {
  float: none;
  margin: 0;
}

#SubHeader .PrimaryInformation h1 {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.6rem;
  color: #1a1a2e;
}

#SubHeader .PrimaryInformation h2 {
  font-size: 1.1rem;
  color: #666;
  font-weight: 400;
}


/* ---- Sub-Content Layout (sidebar + main) ---- */

#SubContent {
  display: flex;
  gap: 2rem;
  clear: both;
  padding-top: 0;
}


/* ---- Sidebar Navigation (Triage / Worklog / Categories tabs) ---- */

.SubNavigation {
  float: none;
  width: 180px;
  min-width: 180px;
}

.SubNavigation ul {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.SubNavigation ul li {
  font-size: 0.95rem;
  color: #1a1a2e;
  text-align: left;
  padding: 0.45rem 0.8rem;
  text-transform: none;
  border-radius: 0.3rem;
  transition: background-color 0.15s;
}

.SubNavigation ul li:hover {
  background-color: #e8e8f4;
  border-radius: 0.3rem;
}

.SubNavigation ul li.selected {
  background-color: #4a5899;
  color: #ffffff;
  border-radius: 0.3rem;
}

.SubNavigation ul li.selected a,
.SubNavigation ul li.selected a:visited {
  color: #ffffff;
}

.SubNavigation a:visited,
.SubNavigation a:link,
.SubNavigation a:hover {
  color: inherit;
  text-decoration: none;
  background: none;
}


/* ---- Content Panel (was RatingContainer) ---- */

.SubNavigated {
  flex: 1;
  padding-left: 0;
  min-width: 0;
}

.SubNavigated .ContentPanel {
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  padding: 1.2rem 1.5rem;
  min-height: 200px;
}


/* ---- Nested Log (triage + worklog hierarchy display) ---- */

.NestedLog {}

.NestedLog .Date {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a1a2e;
  padding: 0.6rem 0 0.3rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.4rem;
}

.Category {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #333;
}

.NestedLog .SubTriage .SubTriage {
  padding-left: 1.5rem;
}

.NestedLog .SubTriage .SubTriage .Category {
  font-size: 1.25rem;
}

.NestedLog .Description {
  padding-left: 1.5rem;
}

.NestedLog .Description > li {
  list-style-type: disc;
  font-size: 0.95rem;
  padding: 0.15rem 0;
  margin-left: 1rem;
}

#WorkLogPage .SubTriage {
  padding-left: 1.5rem;
}


/* ---- Status Board ---- */

.TriageDetail h2 { margin-bottom: 0.3rem; }

.TriageDetailCategory {
  font-size: 1.1rem;
  color: #666;
}


.BumpStatus {
  margin: 0.8rem 0;
}

.BumpButton {
  padding: 0.3rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 0.2rem;
  background: #f8f8f8;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 0.3rem;
}

.BumpButton:hover { background: #eee; }

.BumpButton.Critical { border-color: #dc3545; }
.BumpButton.Urgent { border-color: #ffc107; }
.BumpButton.Normal { border-color: #b4b4b4; }
.BumpButton.Resolve { border-color: #2e7d32; }

.BumpStatusLabel {
  font-weight: 500;
  margin-right: 0.3rem;
}


.BumpPopup {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin: 0.5rem 0;
  max-width: 500px;
}

.TimelineControls { margin-bottom: 0.5rem; }

.ItemDetailCreation {
  color: #999;
  font-size: 0.8rem;
  margin: -0.2rem 0 0.5rem;
}

.TriageTimeline {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.TriageTimeline > li {
  margin-bottom: 0.8rem;
}

.TriageTimeline ul {
  list-style: none;
  padding-left: 1rem;
  margin: 0.3rem 0;
}

.TriageTimelineWorklog {
  margin: 0.4rem 0;
  border: 1px solid #ddd;
  border-radius: 0.3rem;
}

.TriageTimelineWorklog .EditableItem {
  padding: 0.6rem 0.8rem;
}

.TriageTimelineWorklog .AdditionalDiscussion {
  list-style: none;
  padding-left: 1.2rem;
}

.TriageTimeline .ItemTimestamp {
  display: block;
}

.HideTimestamps .TriageTimeline .ItemTimestamp {
  display: none;
}

.TriageTimelineChange {
  margin: 0.3rem 0;
  list-style: none;
}

.TimelineStatus {
  margin: 0.3rem 0;
}

.TimelineDescription {
  font-size: 0.9rem;
  color: #555;
  margin: 0.2rem 0;
}

.ItemTimestamp {
  display: none;
  color: #999;
  font-size: 0.75rem;
  margin: 0.3rem 0 0.15rem;
}

.ShowTimestamps .ItemTimestamp {
  display: block;
}


.BumpPopup label { font-weight: 500; }
.BumpPopup textarea { margin-top: 0.3rem; }
.BumpPopup input[type="submit"] { margin-top: 0.5rem; }

span.UnknownStatus {
  background-color: #d4edda;
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  border-left: 3px solid #28a745;
}

.AdditionalDiscussion {
  margin: 0.2rem 0 0 1.5rem;
  color: #555;
  font-size: 0.9rem;
}


/* ---- Projects List ---- */

#Projects ul {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

#Projects a {
  font-size: 1rem;
}

#Projects .AddItem {
  padding-top: 1rem;
}

#Projects #AddProject {
  font-weight: 600;
  color: #4a5899;
}

#Projects .SharedHeader {
  margin-top: 1.5rem;
}

.empty-row {
  color: #999;
}


/* ---- Forms ---- */

.TriageAddStatusRow {
  margin-bottom: 0.3rem;
}

#triageAddPopup .PopupContent label {
  display: block;
  margin: 0.6rem 0;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

#triageAddPopup select,
#triageAddPopup .PopupContent input[type="text"],
#triageAddPopup .PopupContent input[type="date"],
#triageAddPopup .PopupContent textarea {
  display: block;
  width: 100%;
  margin: 0.4rem 0;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.FieldHint {
  font-size: 0.8rem;
  color: #999;
  font-weight: normal;
}

.FormPage {
  max-width: 480px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  padding: 2rem;
}

.FormPage h2 {
  margin-bottom: 1rem;
  text-align: center;
}

form ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

form ul li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

form label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="number"],
form input[type="date"],
form select,
form textarea {
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.15s;
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: #4a5899;
  box-shadow: 0 0 0 2px rgba(74, 88, 153, 0.15);
}

form textarea {
  min-height: 6rem;
  resize: vertical;
}

form input[type="submit"],
form button[type="submit"] {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  background-color: #4a5899;
  color: #fff;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: background-color 0.15s;
  align-self: flex-start;
  margin-top: 0.5rem;
}

form input[type="submit"]:hover,
form button[type="submit"]:hover {
  background-color: #3a4578;
}

.FormPageFooter {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.errorlist {
  color: #dc3545;
  font-size: 0.85rem;
}

h2.Warning { color: #dc3545; }


/* ---- Add-Item Links ---- */

.NestedLog a,
#Projects a {
  font-size: 0.95rem;
}

.NestedLog .Category a {
  font-size: inherit;
}


/* ---- Map Container (used by settings/timezone) ---- */

#MapContainer {
  padding: 0 0 1rem 0;
}

#MapContainer #map_canvas {
  display: block;
  height: 200px;
  width: 100%;
  border-radius: 0.3rem;
}


/* ---- About Page ---- */

#AboutPage {
  max-width: 640px;
  margin: 0 auto;
}

#AboutPage h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

#AboutPage p {
  font-size: 1rem;
  margin: 0.6rem 0;
  color: #444;
  line-height: 1.6;
}


/* ---- Tables ---- */

table.DataTable {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

table.DataTable th {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 2px solid #ddd;
}

table.DataTable td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #eee;
}

table.DataTable .empty-row td {
  color: #999;
}

table.DataTable .action-btn {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
}

table.DataTable .action-group {
  display: inline;
}

table.DataTable .accept-btn,
table.DataTable .decline-btn {
  font-size: 0.85rem;
  padding: 0.25rem 0.7rem;
}

table.DataTable .accept-btn {
  margin-right: 0.3rem;
}


/* ---- Success Message ---- */

.SuccessMessage {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  background-color: #d4edda;
  border-radius: 0.3rem;
}


/* ---- Invite Banner ---- */

.InviteBanner {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 0.3rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.InviteBanner a {
  font-weight: 600;
  margin-left: 0.5rem;
}

.SettingsLayout {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.SettingsImage { text-align: center; }

.SettingsAvatar {
  border-radius: 0.3rem;
  cursor: pointer;
}

.SettingsAvatar:hover { opacity: 0.8; }

.SettingsImageHint {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.3rem;
}

.SettingsForm { flex: 1; }

.SettingsForm h3 {
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}

.SettingsForm h3:first-child { margin-top: 0; }

.TimezoneBanner {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 0.3rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}


/* ---- Footer ---- */

#Footer {
  text-align: center;
  padding: 1.5rem 0;
  color: #999;
  font-size: 0.8rem;
  clear: both;
}


/* ---- Utility ---- */

.anchor { clear: both; }

img.thumbnail { width: 50px; height: 50px; border-radius: 0.2rem; }

.SubmitForm { cursor: pointer; color: #4a5899; }

.CategoryEditLink {
  font-size: 0.75rem;
  color: #999;
  text-decoration: none;
  margin-left: 0.3rem;
}

.CategoryEditLink:hover { color: #666; }

.ProjectAddLink {
  font-size: 0.85rem;
  font-weight: normal;
  margin-left: 0.5rem;
}

.DateDisplay {
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
}

.DateDisplay:hover {
  background: #f0f0f4;
}

.DateHidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.SectionDivider {
  border-bottom: 1.5px solid #ddd;
  margin: 0.5rem 0;
}

.InviteMessage {
  display: block;
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}


/* ---- Quick Add Review ---- */

.CategoryLabel {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.CategoryLabel.exact, .CategoryLegend.exact { color: #2e7d32; }
.CategoryLabel.fuzzy, .CategoryLegend.fuzzy { color: #1565c0; }
.CategoryLabel.tree,  .CategoryLegend.tree  { color: #1565c0; }
.CategoryLabel.none,  .CategoryLegend.none  { color: #c62828; font-style: italic; }

.MatchLabel {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.3rem;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.MatchLabel.fuzzy {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.MatchLabel.tree {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.MatchLabel.none {
  background: #fce4ec;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.AcceptButton {
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 0.2rem;
  cursor: pointer;
  font-size: 0.85rem;
  margin: 0.3rem 0;
}

.AcceptButton:hover { background: #1b5e20; }

.CategoryPopup {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 280px;
}

.CategoryPopup.visible { display: block; }
.CategoryPopup select { width: 100%; margin-bottom: 6px; }

.PopupClose {
  float: right;
  cursor: pointer;
  font-size: 1.2rem;
  color: #999;
  line-height: 1;
  padding: 0 4px;
}

.PopupClose:hover { color: #333; }

.CategoryPopup .NewCategorySection {
  margin-top: 8px;
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.CategoryPopup .NewCategorySection input { width: 70%; }
.CategoryPopup .NewCategorySection select { width: 100%; margin-top: 4px; }
.CategoryPopup button { margin-top: 6px; }

.QuickAddTable td { position: relative; }

.QuickAddWarning {
  color: #c62828;
  font-weight: 500;
  margin: 0.5rem 0;
}

.QuickAddHelp {
  margin-top: 1.5rem;
  color: #666;
  font-size: 0.85rem;
}

.QuickAddHelp ul { margin-left: 1.5rem; }

.QuickAddLegend {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}


.PathPart.exact { color: #2e7d32; pointer-events: none; }
.PathPart.fuzzy { color: #1565c0; pointer-events: none; }
.PathPart.tree  { color: #1565c0; pointer-events: none; }
.PathPart.new   { color: #c62828; font-style: italic; pointer-events: none; }

.CategoryPathCreate {
  list-style: none;
  margin: 0.3rem 0;
  padding: 0;
}

.CategoryPathCreate li {
  margin: 0.2rem 0;
  padding-left: 0.5rem;
}

.CategoryPathCreate li::before {
  content: '\2192 ';
  color: #999;
}

.CategoryPathCreate li:first-child::before {
  content: '';
}

.PathNameInput { font-size: 0.9rem; }

.ReviewEntry {
  border: 1px solid #ddd;
  border-radius: 0.3rem;
  padding: 0.6rem;
  margin: 0.5rem 0;
}

.ReviewTriage {
  border-color: #ccc;
  background: #fafafa;
}

.ReviewWorklog {
  border-color: #eee;
}

.ReviewLinkedWorklog {
  margin: 0.4rem 0 0 1.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid #ddd;
}

.ReviewLinkedItem {
  margin: 0.3rem 0;
}

.ReviewDiscussion textarea {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.3rem;
  width: 100%;
}


/* ---- Worklog Items ---- */

a.EditableItem {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
}

a.EditableItem:link,
a.EditableItem:visited {
  color: inherit;
  text-decoration: none;
}

a.EditableItem:hover {
  background: #e8edf8;
  border-radius: 0.3rem;
  text-decoration: none;
}

.EditedMarker {
  font-size: 0.75rem;
  color: #999;
  text-decoration: none;
  margin-left: 0.3rem;
}

.EditedMarker:hover { color: #666; }

.StatusLabel {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  vertical-align: middle;
  min-width: 4.8rem;
  text-align: center;
}

.StatusLabel.Critical {
  background: #ffc3c3;
  color: #000;
  border: 1px solid #dc3545;
}

.StatusLabel.Urgent {
  background: #fff3cd;
  color: #000;
  border: 1px solid #ffc107;
}

/* The "Normal" status is displayed as "Routine" (model label change).
   The CSS class name stays .Normal because triage_urgency_class is an
   internal identifier — no behavioral coupling to the displayed text. */
.StatusLabel.Normal {
  background: #eeeeee;
  color: #000;
  border: 1px solid #b4b4b4;
}

.StatusLabel.Resolved {
  background: #f0f0f0;
  color: #999;
  border: 1px solid #ccc;
  text-decoration: line-through;
}

.DeletedItem { text-decoration: line-through; color: #999; }

/* Toggle visibility via CSS classes on body */
body.HideDeleted .DeletedEntry { display: none; }
body.HideTriage .TriageEntry { display: none; }

/* Hide category groups when all children are hidden */
body.HideDeleted .CategoryGroup.hasDeleted:not(.hasTriage):not(.hasVisible) { display: none; }
body.HideTriage .CategoryGroup.hasTriage:not(.hasDeleted):not(.hasVisible) { display: none; }
body.HideDeleted.HideTriage .CategoryGroup.hasDeleted.hasTriage:not(.hasVisible) { display: none; }

/* Hide date groups when all children are hidden */
body.HideDeleted .DateGroup.hasDeleted:not(.hasTriage):not(.hasVisible) { display: none; }
body.HideTriage .DateGroup.hasTriage:not(.hasDeleted):not(.hasVisible) { display: none; }
body.HideDeleted.HideTriage .DateGroup.hasDeleted.hasTriage:not(.hasVisible) { display: none; }

.ResolvedItem { text-decoration: line-through; color: #999; }

.TriageEntry { margin: 0.3rem 0 0.3rem 1rem; }

.LinkedWorklog { margin-top: 0.2rem; }

.ShowDeletedLink {
  font-size: 0.7rem;
  color: #999;
  font-weight: normal;
  text-decoration: none;
}

.ShowDeletedLink:hover {
  color: #666;
  background: #f0f0f4;
  border-radius: 0.2rem;
}

.EditActions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.DeleteLink {
  color: #c62828;
  text-decoration: none;
  font-size: 0.9rem;
}

.DeleteLink:hover { text-decoration: underline; }

.RestoreLink {
  color: #2e7d32;
  text-decoration: none;
  font-size: 0.9rem;
}

.RestoreLink:hover { text-decoration: underline; }

.ItemMeta {
  color: #999;
  font-size: 0.8rem;
  margin-top: 1rem;
}

.EditHistory { margin-top: 0.5rem; }

.EditHistoryMeta {
  color: #999;
  font-size: 0.8rem;
  list-style: none;
  margin: 0.5rem 0 0.2rem;
}

/* ----- Popup overlay infrastructure ----- */
/* Pattern in templates:                                                    */
/*   <div class="Popup" id="myPopup" style="display:none">                  */
/*     <div class="PopupContent">                                           */
/*       <button type="button" class="PopupClose">&times;</button>          */
/*       ...body...                                                         */
/*     </div>                                                               */
/*   </div>                                                                 */
/* Open with gracklepad.openPopup('myPopup'). The .Popup itself is the      */
/* dark overlay; clicking it (outside .PopupContent) closes the popup.      */

.Popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
  overflow-y: auto;
}

.PopupContent {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 1.5rem 1.5rem 1rem;
  max-width: 600px;
  width: 100%;
  position: relative;
}

.PopupClose {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 0 0.3rem;
  line-height: 1;
}

.PopupClose:hover { color: #333; }

/* The Edit popup gets a red highlighter border to warn the user that they're
   modifying an existing entry rather than adding a new one. Used by the
   shared common/_item_edit_popup.html partial. */
.EditWarning {
  border: 5px solid #ff8a9b;
  border-radius: 4px;
  padding: 1rem;
  margin: 0.5rem 0;
  background: #fff5f6;
}

.EditWarningText {
  color: #b03040;
  font-size: 0.9rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  background: #ffe8ec;
  border-radius: 3px;
}

.EditWarning label {
  display: block;
  margin: 0.6rem 0;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.EditWarning input[type="text"],
.EditWarning textarea,
.EditWarning select,
.EditWarning input[type="date"] {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.EditPopupActions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0;
}

.EditPopupActionsTop { margin-bottom: 1rem; }
.EditPopupActionsBottom { margin-top: 1rem; }

.EditPopupActions input[type="submit"] {
  padding: 0.4rem 1rem;
  background: #4a5899;
  color: #fff;
  border: 1px solid #3a4880;
  border-radius: 3px;
  cursor: pointer;
}

.EditPopupActions .DeleteButton {
  padding: 0.4rem 1rem;
  background: #c62828;
  color: #fff;
  border: 1px solid #a02020;
  border-radius: 3px;
  cursor: pointer;
  margin-left: auto;  /* push delete to the far right */
}

.EditPopupActions .DeleteButton:hover { background: #a02020; }

.EditPopupActions .PopupClose {
  position: static;
  background: none;
  border: none;
  font-size: 0.9rem;
  color: #4a5899;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
}

.EditPopupActions .PopupClose:hover {
  color: #333;
  text-decoration: underline;
}

/* ----- Edit history list (worklog detail page) ----- */
/* Used by the <details> wrapper on the worklog detail page so the user
   can expand the supplants chain. Description on top, meta below. */

.EditHistoryEntry {
  margin: 0.6rem 0;
  padding: 0.4rem 0.6rem;
  background: #f8f8f8;
  border-radius: 3px;
  border-left: 3px solid #ccc;
}

.EditHistoryEntry-current { border-left-color: #4a5899; }
.EditHistoryEntry-created { border-left-color: #2e7d32; }
.EditHistoryEntry-deleted { border-left-color: #c62828; }
.EditHistoryEntry-edited { border-left-color: #999; }

.EditHistoryDescription {
  color: #222;
  margin-bottom: 0.2rem;
}

.EditHistoryEntry .EditHistoryMeta {
  margin: 0;
}

/* ----- + Add Update button (per category section) ----- */
/* Sits next to each category header in nested_list.html. Subtle by
   default so it doesn't compete with the category name; brightens on
   hover so it's discoverable. */

/* The per-category-section "+ Add" button is a smaller variant of the
   detail page's PrimaryButton — same primary color but compact so it
   doesn't overwhelm the category header. */
.UpdateButton {
  background: #4a5899;
  color: #fff;
  border: 1px solid #3a4880;
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.UpdateButton:hover {
  background: #3a4880;
}

/* ----- Update popup form ----- */

.UpdatePopupTitle {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #4a5899;
}

#worklogUpdatePopup .PopupContent label {
  display: block;
  margin: 0.6rem 0;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

#worklogUpdatePopup .PopupContent select,
#worklogUpdatePopup .PopupContent input[type="date"],
#worklogUpdatePopup .PopupContent textarea {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

#worklogUpdatePopup .PopupContent textarea {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", monospace;
}

.UpdatePopupActions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.UpdatePopupActions input[type="submit"] {
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  background: #4a5899;
  color: #fff;
  border: 1px solid #3a4880;
  border-radius: 3px;
  cursor: pointer;
}

.UpdatePopupActions .PopupClose {
  position: static;
  background: none;
  border: 1px solid transparent;
  font-size: 0.9rem;
  color: #4a5899;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
}

.UpdatePopupActions .PopupClose:hover {
  color: #333;
  text-decoration: underline;
}

/* ----- Item detail page (worklog/triage) ----- */
/* Both worklog/detail.html and the upcoming triage detail page share
   this skeleton: title at top, meta line beneath, then optional
   additional discussion, action buttons, and edit history. */

.ItemDetail {
  max-width: 760px;
}

.ItemDetailTitleRow {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M12.1 1.3a1 1 0 011.4 0l1.2 1.2a1 1 0 010 1.4L5.4 13.2 1 15l1.8-4.4L12.1 1.3z' fill='%23fff' stroke='%23333' stroke-width='1'/%3E%3C/svg%3E") 0 16, pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 0.3rem;
}

.ItemDetailTitleRow:hover {
  background: #fff8e1;
}

.ItemDetailTitleRow .ItemDetailActions {
  margin: 0;
}

.ItemDetailTitleRow .PrimaryButton {
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
}

.ItemDetailTitle {
  margin: 0.5rem 0 0.3rem;
  font-size: 1.6rem;
}

.ItemDetailTitle .StatusLabel {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ItemDetailMeta {
  color: #666;
  font-size: 1rem;
  margin: 0.2rem 0 1rem;
}


.ItemDetailActions {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.EditHistoryDetails {
  margin-top: 1.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid #eee;
}

.EditHistoryDetails summary {
  cursor: pointer;
  color: #4a5899;
  font-size: 0.9rem;
  padding: 0.2rem 0;
}

.EditHistoryDetails summary:hover {
  text-decoration: underline;
}

.EditHistoryDetails .EditHistory {
  margin-top: 0.6rem;
  padding-left: 0;
  list-style: none;
}

/* Primary button style — used for "+ Add" / "+ Update" on item detail
   pages. The most prominent action on the page. */
.PrimaryButton {
  background: #4a5899;
  color: #fff;
  border: 1px solid #3a4880;
  border-radius: 3px;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.PrimaryButton:hover {
  background: #3a4880;
}

/* Secondary button style — used for "Edit" alongside the primary action
   buttons on item detail pages. Less visually loud than primary buttons. */
.SecondaryButton {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  color: #4a5899;
  font-size: 0.9rem;
}

.SecondaryButton:hover {
  background: #f0f3ff;
  border-color: #4a5899;
}

.EditPopupTitle {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #b03040;
}

/* ----- Status button row (inside + Update popup) ----- */
/* Replaces the dropdown for picking a triage status. The currently
   selected button gets a thick border so it's visually obvious which
   one is "active". Click toggles .Selected and updates the hidden
   #updatePopupStatus input. */

.UpdatePopupStatusLabel {
  display: block;
  margin: 0.6rem 0 0.3rem;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.StatusButtonRow {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.StatusButton {
  flex: 1;
  background: #f8f8f8;
  border: 2px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
}

.StatusButton:hover {
  background: #eee;
}

/* Each status button gets a colored border that matches its severity, so
   even an unselected button shows what it is. */
.StatusButton.Critical { border-color: #d8a0a0; color: #b03040; }
.StatusButton.Urgent   { border-color: #d8c890; color: #8a6c00; }
.StatusButton.Normal   { border-color: #b0b0b0; color: #333; }
.StatusButton.Resolve  { border-color: #a8c8a8; color: #2e5a2e; }

/* Selected gets a thick border + filled background to look "active". */
.StatusButton.Selected {
  border-width: 4px;
  padding: calc(0.5rem - 2px) calc(0.6rem - 2px);  /* keep size constant */
}

.StatusButton.Critical.Selected { background: #fadddd; }
.StatusButton.Urgent.Selected   { background: #fbf2cf; }
.StatusButton.Normal.Selected   { background: #e8e8e8; }
.StatusButton.Resolve.Selected  { background: #d8efd8; }

/* ----- Update popup title pill (triage context) ----- */
/* The pill sits before the description text in the popup header so
   the user sees "[CRITICAL] AC stuck in low speed" as the title. */

.UpdatePopupTitle .StatusLabel {
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* ----- Item detail page sizing tweaks ----- */
/* Per UI review: triage category should be more prominent than the meta
   line; clicking it goes to the worklog filtered to that category. */

.Category a {
  color: #4a5899;
}

.Category a:hover {
  background: #e8edf8;
  border-radius: 0.2rem;
}

/* ----- Inline quick edit affordances on the triage detail page ----- */
/* Click the status pill in the title row → opens a small menu of
   alternative pills (gracklepad.openQuickStatusMenu). Click an
   alternative → submits #quickEditForm with the new status, server
   creates a new triage version. */

.ClickableStatus {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M12.1 1.3a1 1 0 011.4 0l1.2 1.2a1 1 0 010 1.4L5.4 13.2 1 15l1.8-4.4L12.1 1.3z' fill='%23fff' stroke='%23333' stroke-width='1'/%3E%3C/svg%3E") 0 16, pointer;
  position: relative;
}

.ClickableStatus:hover {
  outline: 2px solid #e0c860;
  outline-offset: 1px;
}

.QuickStatusMenu {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0.4rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.4rem 0;
  width: max-content;
}

.QuickStatusMenu button {
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  padding: 0.2rem 0.6rem;
  font: inherit;
}

.QuickStatusMenu button:hover {
  border-color: #4a5899;
}

/* Click the title text → swap to a text input for inline rename. */
.ClickableTitle {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M12.1 1.3a1 1 0 011.4 0l1.2 1.2a1 1 0 010 1.4L5.4 13.2 1 15l1.8-4.4L12.1 1.3z' fill='%23fff' stroke='%23333' stroke-width='1'/%3E%3C/svg%3E") 0 16, text;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
}

.ClickableTitle:hover {
  background: #fff8e1;
}

.QuickTitleInput {
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border: 2px solid #4a5899;
  border-radius: 3px;
  width: 60%;
  font-family: inherit;
}

/* ----- Clickable category in the + Update popup ----- */
/* Shown by default as a blue link-styled label. Click → swap to the
   actual <select> dropdown for re-selection. */

.ClickableCategory {
  display: inline-block;
  margin-top: 0.2rem;
  color: #4a5899;
  cursor: pointer;
  border-bottom: 1px dashed #4a5899;
  padding: 0.1rem 0.2rem;
  font-weight: 500;
}

.ClickableCategory:hover {
  background: #f0f3ff;
}

/* ----- + Update popup inline error box ----- */
/* Appears above the form when the server returns parser errors via
   the AJAX path. Preserves the user's typed text so they can fix
   the problem without losing their work. */

.UpdatePopupErrors {
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  background: #ffe8ec;
  border: 2px solid #ff8a9b;
  border-radius: 4px;
  color: #b03040;
}

.UpdatePopupErrors p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

/* ----- Link-to-Status-Board popup ----- */

.LinkTriageHelp {
  color: #555;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

#linkTriagePopup .PopupContent label {
  display: block;
  margin: 0.6rem 0;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

#linkTriagePopup .PopupContent select {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}


/* ---- Search ---- */

.SearchForm {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.SearchForm input[type="text"] {
  flex: 1;
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 0.3rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.SearchForm input[type="text"]:focus {
  outline: none;
  border-color: #4a5899;
  box-shadow: 0 0 0 2px rgba(74, 88, 153, 0.15);
}

.SearchForm input[type="submit"] {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.45rem 1.2rem;
  background-color: #4a5899;
  color: #fff;
  border: none;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.SearchForm input[type="submit"]:hover {
  background-color: #3a4578;
}

.SearchResults h3 {
  margin: 1rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #eee;
}

.SearchResults .Description > li {
  list-style-type: disc;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  margin-left: 1rem;
}

.SearchMeta {
  font-size: 0.8rem;
  color: #888;
  margin-left: 0.4rem;
}

.SearchEmpty {
  color: #888;
  font-size: 0.9rem;
  padding: 0.3rem 0;
}
