:root {
  --primary: #006858;
  --primary-deep: #004d42;
  --primary-light: #2aa18a;
  --accent: #3dbda0;
  --card: #ffffff;
  --text: #1a2e28;
  --muted: #4a6a62;
  --border: #b8ddd6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI Variable", "Segoe UI", "Roboto", sans-serif;
  background: #f0faf7;
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--primary);
  color: #fff;
  padding: 1.2rem;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 104, 88, 0.30);
  border-bottom: 3px solid #2aa18a;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
  text-align: center;
  grid-column: 1 / -1;
}

header p {
  margin: 0.4rem 0 0.1rem;
  opacity: 0.9;
}

.brand-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  width: min(1760px, 100%);
  margin: 0 auto;
}

.brand-logo-accenture {
  width: 180px;
  max-width: 34vw;
  height: auto;
  flex-shrink: 0;
  justify-self: start;
  align-self: center;
  position: relative;
  top: 2.45rem;
}

.brand-logo-app {
  width: 240px;
  max-width: 40vw;
  height: auto;
  flex-shrink: 0;
  background: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  justify-self: end;
  align-self: center;
  position: relative;
  top: 2.45rem;
}

nav {
  margin-top: 0.4rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 0.55rem 0.9rem;
}

nav a:hover { background: rgba(255, 255, 255, 0.22); }

nav a.nav-active {
  background: rgba(255, 255, 255, 0.34);
  border: 3px solid #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.info.header-session-info {
  position: absolute;
  top: 1.35rem;
  right: 9.4rem;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: #e9fffa;
  background: transparent;
  border: none;
  white-space: nowrap;
  display: inline-block;
  width: auto;
  max-width: calc(100% - 12rem);
}

header nav .nav-back {
  position: absolute;
  top: 1rem;
  left: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.42);
}

header nav .nav-back:hover {
  border-color: rgba(255, 255, 255, 0.78);
}

header nav #logoutLink {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.42);
}

header nav #logoutLink:hover {
  border-color: rgba(255, 255, 255, 0.78);
}

.wrap {
  width: min(980px, 100%);
  margin: 1rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 104, 88, 0.08);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

label {
  display: block;
  font-size: 0.92rem;
  color: #2e5048;
}

input,
select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid #a8ccc5;
  border-radius: 4px;
  background: #ffffff;
  font-family: inherit;
  color: var(--text);
}

.actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-toggle {
  margin-top: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #9ecdc4;
  border-radius: 6px;
  background: #f7fcfb;
  color: #1a3a30;
  font-size: 0.9rem;
}

.filter-toggle input {
  width: auto;
  margin: 0;
}

.password-visibility-control {
  display: flex;
  align-items: end;
}

button.password-visibility-btn {
  background: #ffffff;
  color: #111111;
  border: 2px solid #111111;
  border-radius: 999px;
  min-width: 7.5rem;
  padding: 0.5rem 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

button.password-visibility-btn::before {
  content: "";
  display: inline-block;
  width: 1.05rem;
  height: 0.72rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  margin-right: 0.45rem;
  vertical-align: -0.1rem;
  box-sizing: border-box;
}

button.password-visibility-btn:hover,
button.password-visibility-btn:focus-visible {
  background: #111111;
  color: #ffffff;
}

button.password-visibility-btn[aria-pressed="true"] {
  background: #111111;
  color: #ffffff;
}

button,
a.btn {
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  text-decoration: none;
  background: var(--primary);
  transition: background 0.15s;
}

button:hover,
a.btn:hover {
  background: var(--primary-light);
}

button.secondary,
a.btn.secondary {
  background: #4a7a6e;
}

button.secondary:hover,
a.btn.secondary:hover {
  background: #346058;
}

button.secondary.secondary-danger {
  margin-left: 1rem;
  color: #8b1a2e;
  background: none;
  border: 1px solid #e8a0b0;
}

.info {
  margin-top: 0.9rem;
  color: #1a3a30;
  background: #d5ede8;
  border: 1px solid #9ecdc4;
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.92rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.7rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 104, 88, 0.06);
}

th,
td {
  border-bottom: 1px solid #dfe6e3;
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.92rem;
}

th {
  background: linear-gradient(135deg, #d5ede8 0%, #c7e8e1 100%);
  color: #0b5f52;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

tbody tr {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:hover {
  background: #f7fcfb;
}

tbody tr:last-child td {
  border-bottom: none;
}

.subtle {
  color: var(--muted);
  font-size: 0.85rem;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  margin-right: 0.35rem;
}

.pill-passed { background: #e6f4ec; color: #1a5c30; border: 1px solid #a8d8bc; }
.pill-failed { background: #fde8ee; color: #8b1a2e; border: 1px solid #e8a0b0; }
.pill-open { background: #e8f1f8; color: #003064; border: 1px solid #b8d0e8; }

.interactive-pill {
  cursor: pointer;
}

.interactive-pill:hover {
  filter: brightness(0.98);
}

.defect-list {
  margin: 0;
  padding-left: 1rem;
  max-height: 8rem;
  overflow: auto;
}

.defect-list li {
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.defect-inline-actions {
  display: inline-flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.defect-inline-actions button {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.summary-box {
  margin-top: 0.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #9ecdc4;
  border-radius: 6px;
  background: #d5ede8;
  color: #1a3a30;
  font-size: 0.92rem;
}

.user-analytics-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.9rem;
  overflow: hidden;
}

.user-analytics-header {
  background: #d5ede8;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.user-analytics-header .username {
  font-weight: 700;
  font-size: 1rem;
  margin-right: 0.5rem;
}

.failed-tests-panel {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e8a0b0;
  border-radius: 8px;
  background: #fff8fa;
}

.failed-tests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.failed-tests-list {
  margin: 0;
  padding-left: 1.25rem;
}

.failed-tests-list li {
  margin-bottom: 0.3rem;
}

.user-analytics-header .role-badge {
  font-size: 0.75rem;
  background: #9ecdc4;
  color: #004d42;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.user-analytics-header .reset-btn {
  margin-left: auto;
  background: none;
  color: #8b1a2e;
  border: 1px solid #e8a0b0;
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.user-analytics-header .btn-feedback-delete {
  margin-left: auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  background: none;
  color: #8b1a2e;
  border: 1px solid #e8a0b0;
}

.user-analytics-header .btn-feedback-delete:hover {
  background: #fde8ee;
}

.user-analytics-body { padding: 0.5rem 1rem 0.75rem; }

.handbook-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.handbook-table th {
  background: #d5ede8;
  color: #006858;
  font-weight: 600;
  border-bottom: 1px solid #9ecdc4;
  padding: 0.4rem 0.5rem;
}

.handbook-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #c0ddd8;
}

.handbook-table tr:last-child td { border-bottom: none; }

.no-handbooks {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.4rem 0;
}

.defects-section {
  margin-top: 0.3rem;
  font-size: 0.88rem;
}

.defects-section strong { color: #006858; }

.chapter-feedback-section {
  margin-top: 0.65rem;
  font-size: 0.88rem;
}

.chapter-feedback-section strong {
  color: #006858;
}

.chapter-feedback-list {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.chapter-feedback-item {
  border: 1px solid #c0ddd8;
  border-radius: 6px;
  background: #f7fcfb;
  padding: 0.55rem 0.7rem;
}

.chapter-feedback-rating {
  display: inline-block;
  margin-top: 0.2rem;
  color: #1a5c30;
  font-weight: 600;
}

.chapter-feedback-remark {
  margin-top: 0.35rem;
  color: var(--text);
  white-space: pre-wrap;
}

.chapter-impact-aggregate {
  border: 1px solid #c0ddd8;
  border-radius: 8px;
  background: #eef8f6;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.chapter-impact-aggregate strong {
  color: #0b5f52;
}

.chapter-impact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.chapter-impact-content {
  flex: 1;
}

.chapter-impact-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-width: 140px;
  text-align: center;
}

.overall-label {
  font-size: 0.75rem;
  color: #0b5f52;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  max-width: 120px;
}

.overall-value {
  font-size: 2rem;
  font-weight: 700;
  color: #0d6631;
}

.chapter-impact-aggregate-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.role-chapter-group {
  margin-bottom: 1rem;
}

.role-chapter-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0b5f52;
  margin-bottom: 0.4rem;
  padding-left: 0.5rem;
  border-left: 3px solid #0d6631;
}

.chapter-impact-aggregate-list li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.chapter-impact-avg-label {
  color: #18443c;
  font-weight: 600;
}

.chapter-impact-avg-value {
  color: #0d6631;
  font-weight: 700;
}

.chapter-impact-avg-meta {
  color: #4e6f68;
  font-size: 0.82rem;
}

.role-impact-aggregate {
  margin-top: 0;
}

.role-impact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.7rem;
}

.role-impact-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #d6f0ea;
  border: 1px solid #a8d8ce;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  min-width: 130px;
  text-align: center;
}

.role-impact-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0b5f52;
  margin-bottom: 0.25rem;
}

.role-impact-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0d6631;
}

.role-impact-meta {
  font-size: 0.78rem;
  color: #4e6f68;
  margin-top: 0.2rem;
}

.analytics-container { margin-top: 0.8rem; }

.kpi-analytics-container {
  margin-top: 0.85rem;
}

.kpi-summary-box {
  margin-bottom: 0.9rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #9ecdc4;
  border-radius: 8px;
  background: #ecf8f5;
  color: #1a3a30;
}

.kpi-user-grid {
  display: grid;
  gap: 0.9rem;
}

.kpi-user-card {
  border: 1px solid #b8ddd6;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.kpi-user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: #dff1ec;
  border-bottom: 1px solid #c4dfd9;
}

.kpi-user-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #083f35;
}

.kpi-user-meta {
  margin-top: 0.15rem;
  color: #42635b;
  font-size: 0.82rem;
}

.kpi-user-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e0ece8;
}

.kpi-user-summary span {
  display: inline-flex;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #c7ded8;
  background: #f7fcfb;
  color: #1a4a40;
  font-size: 0.8rem;
  font-weight: 600;
}

.kpi-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.55rem;
  padding: 0.8rem 1rem 1rem;
}

.kpi-metric-tile {
  border: 1px solid #d8e8e4;
  border-radius: 8px;
  background: #fbfefd;
  padding: 0.55rem 0.65rem;
}

.kpi-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.kpi-metric-label {
  color: #23564c;
  font-size: 0.8rem;
  font-weight: 600;
}

.kpi-metric-value {
  margin-top: 0.3rem;
  color: #0f3c34;
  font-size: 1.02rem;
  font-weight: 700;
}

.kpi-ampel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.kpi-overall {
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
}

.ampel-green {
  background: #e6f4ec;
  color: #1a5c30;
  border-color: #a8d8bc;
}

.ampel-yellow {
  background: #fff5df;
  color: #7a5600;
  border-color: #e8cf8e;
}

.ampel-red {
  background: #fde8ee;
  color: #8b1a2e;
  border-color: #e8a0b0;
}

.history-block {
  border-color: #e8c8d0;
}

.history-list {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.history-entry {
  border: 1px solid #c7ddd8;
  border-radius: 6px;
  background: #f9fcfb;
}

.history-entry > summary {
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  font-weight: 600;
  color: #1f3c35;
  list-style-position: inside;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-entry-body {
  border-top: 1px solid #d7e8e3;
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.3rem;
}

.session {
  margin-top: 0.4rem;
  color: var(--muted);
}

.session-banner {
  margin-top: 0.9rem;
  color: #1a3a30;
  background: #d5ede8;
  border: 1px solid #9ecdc4;
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.92rem;
}

/* Enhanced table styling */
tbody tr:hover {
  background: #f7fcfb;
}

/* Enhanced checkbox styling in table cells */
td label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #1a2e28;
  font-weight: 400;
  margin: 0.2rem 0;
  padding: 0;
}

td label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 0;
  padding: 0;
  border: 2px solid #a8ccc5;
  border-radius: 4px;
  cursor: pointer;
  accent-color: #0d6631;
  background: white;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

td label input[type="checkbox"]:hover {
  border-color: #0d6631;
  box-shadow: 0 0 0 3px rgba(13, 102, 49, 0.1);
  transform: scale(1.05);
}

td label input[type="checkbox"]:checked {
  background: #0d6631;
  border-color: #0d6631;
}

/* Button styling */
button.secondary,
button.btn-reset-password,
button.secondary.btn-admin-defect-edit,
button.secondary.btn-admin-defect-send {
  background: #2aa18a;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-block;
  margin-right: 0.4rem;
}

button.secondary:hover,
button.btn-reset-password:hover,
button.secondary.btn-admin-defect-edit:hover,
button.secondary.btn-admin-defect-send:hover {
  background: #1a7a6d;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 104, 88, 0.25);
}

button.secondary.secondary-danger {
  background: #d64545;
}

button.secondary.secondary-danger:hover {
  background: #b83535;
}

@media (max-width: 768px) {
  .info.header-session-info {
    position: static;
    display: block;
    margin: 0.55rem 0 0;
    text-align: center;
  }

  header nav .nav-back,
  header nav #logoutLink {
    position: static;
  }

  .brand-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-logo-accenture,
  .brand-logo-app,
  .brand-header h1 {
    justify-self: center;
  }

  .brand-logo-accenture,
  .brand-logo-app {
    position: static;
  }

  .brand-logo-accenture { max-width: 56vw; }
  .brand-logo-app { max-width: 62vw; }

  button.secondary.secondary-danger {
    margin-left: 0;
  }
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0.25rem 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  padding: 0.3rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.checkbox-label:hover {
  background: rgba(45, 155, 135, 0.08);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0d6631;
  border-radius: 3px;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}

.checkbox-label input[type="checkbox"]:hover {
  transform: scale(1.1);
}

.checkbox-label input[type="checkbox"]:checked {
  background: #0d6631;
}

.checkbox-label span {
  font-weight: 500;
  color: #0b5f52;
}

/* Interactive metadata (for clickable feedback count) */
.interactive-meta {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #4e6f68;
}

.interactive-meta:hover {
  text-decoration-style: solid;
  color: #0b5f52;
  font-weight: 600;
}

/* Modal panel styling */
.modal-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f5f5f5;
  border-radius: 8px 8px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0b5f52;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

.modal-body {
  padding: 1rem;
}
