:root {
  --navy: #102d46;
  --blue: #1677b8;
  --bg: #f3f6f9;
  --line: #dbe4eb;
  --muted: #687d8d;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: #183247;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #102d46, #1c729f);
}
.box {
  width: min(390px, 92vw);
  background: white;
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 25px 60px #0018;
}
.logo {
  width: 55px;
  height: 55px;
  border-radius: 14px;
  background: #168bd1;
  color: white;
  display: grid;
  place-items: center;
  font-weight: bold;
}
.box h1 {
  margin-bottom: 5px;
}
.box p,
.muted {
  color: var(--muted);
}
.box p {
  margin-top: 0;
}
.box label,
.form label,
.toolbar label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  margin: 12px 0;
}
.box input,
.form input,
.form select,
.form textarea,
.toolbar input {
  width: 100%;
  padding: 11px;
  border: 1px solid #cbd8e2;
  border-radius: 8px;
  margin-top: 7px;
  background: #fff;
}
.box button,
.primary {
  width: 100%;
  border: 0;
  background: var(--blue);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}
.error {
  color: #b42d2d;
  margin-top: 12px;
}
#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
aside {
  position: fixed;
  width: 240px;
  height: 100vh;
  background: var(--navy);
  padding: 22px 12px;
  color: white;
}
aside h2 {
  margin-left: 8px;
}
aside h2 span {
  font-weight: normal;
  color: #a9c0d1;
}
nav {
  display: grid;
  gap: 4px;
  margin-top: 25px;
}
nav button,
#logout {
  border: 0;
  background: transparent;
  color: #bfd0dc;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
nav button.active,
nav button:hover {
  background: #215575;
  color: white;
}
#profile {
  position: absolute;
  bottom: 60px;
  border-top: 1px solid #31536b;
  padding: 14px 8px;
  width: 210px;
}
#profile small {
  display: block;
  color: #a9c0d1;
  margin-top: 4px;
}
#logout {
  position: absolute;
  bottom: 14px;
}
main {
  grid-column: 2;
  padding: 0 32px 40px;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#content {
  flex: 1;
}
.loginCredit,
.appFooter {
  color: var(--muted);
  text-align: center;
}
.incidentPagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.incidentSearch {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 16px;
}
.incidentSearch label { margin: 0; }
.incidentSearch label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}
.incidentSearch input { width: 100%; }
.incidentSearch button { min-height: 42px; }
.incidentSearchResult {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .9rem;
}
.emptyTableMessage {
  padding: 28px 12px !important;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 760px) {
  .incidentSearch { grid-template-columns: 1fr 1fr; }
  .incidentSearch label { grid-column: 1 / -1; }
}
.incidentPagination > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.incidentPagination button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--navy);
  min-width: 36px;
  padding: 7px 9px;
  cursor: pointer;
}
.incidentPagination button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}
.incidentPagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.pageGap {
  padding: 0 4px;
}
@media (max-width: 760px) {
  .incidentPagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

.kpiCategoryItem {
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
}

.kpiCategoryItem:last-child {
  margin-bottom: 0;
}
.loginCredit {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
  font-size: 12px;
}
.loginCredit span,
.loginCredit small,
.appFooter span,
.appFooter small {
  display: block;
}
.loginCredit small,
.appFooter small {
  margin-top: 5px;
}
.appFooter {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding: 18px 10px 0;
  font-size: 12px;
}
header {
  height: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header small {
  color: #708493;
  font-weight: bold;
  letter-spacing: 0.12em;
}
header h1 {
  margin: 5px 0;
}
.online {
  color: #177047;
  background: #e3f6eb;
  padding: 9px 12px;
  border-radius: 18px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}
.card,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px;
  box-shadow: 0 2px 5px #2341;
}
.card strong {
  display: block;
  font-size: 27px;
  margin-top: 10px;
}
.card small {
  color: var(--muted);
}
.panel {
  margin-top: 20px;
}
.panel h3 {
  margin-top: 0;
}
.panel h4 {
  margin: 20px 0 5px;
}
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.wide {
  grid-column: 1/-1;
}
.form textarea {
  min-height: 82px;
  resize: vertical;
}
.form .primary {
  grid-column: 1/-1;
  margin-top: 12px;
}
.check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 36px !important;
}
.check input {
  width: auto;
  margin: 0;
}
.tableWrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 760px;
}
th,
td {
  text-align: left;
  padding: 11px 9px;
  border-bottom: 1px solid #e5ecf1;
  vertical-align: top;
}
th {
  color: #6b7f8f;
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge {
  padding: 5px 8px;
  border-radius: 12px;
  background: #e8eff4;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}
.APPROVED,
.Completed {
  background: #dff3e7;
  color: #176d43;
}
.SUBMITTED,
.Pending {
  background: #fff0c8;
  color: #906107;
}
.RETURNED,
.Critical,
.Escalated {
  background: #f9dddd;
  color: #a32f2f;
}
.actions button,
.toolbar button {
  border: 1px solid #cbd7df;
  background: white;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
}
.review {
  border-top: 3px solid var(--blue);
  margin-top: 25px;
}
.details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 10px;
}
.toolbar label {
  margin: 0;
}
.barRow {
  display: grid;
  grid-template-columns: 220px 1fr 50px;
  gap: 12px;
  align-items: center;
  margin: 13px 0;
}
.barRow div {
  height: 12px;
  background: #e9eff4;
  border-radius: 8px;
  overflow: hidden;
}
.barRow i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 8px;
}
.userPasswordDialog {
  width: min(760px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--bg);
  color: inherit;
}
.userPasswordDialog::backdrop {
  background: #0009;
}
.incidentEditDialog {
  width: min(980px, 96vw);
}
.dialogActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.dialogActions button {
  width: auto;
  min-width: 150px;
}
.dayEndActions,
.dayEndHeading,
.dayEndSubmit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.dayEndActions .actions,
.dayEndHeading .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dayEndSubmit {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.dayEndSubmit .primary {
  width: auto;
}
.successMessage {
  color: #176d43;
  font-weight: bold;
  margin-top: 12px;
}
.taskOverdue {
  background: #fff5f5;
}
.overdueText {
  color: #a32f2f;
  font-weight: bold;
}
.taskHistory {
  list-style: none;
  margin: 18px 0;
  padding: 0;
}
.taskHistory li {
  border-left: 3px solid var(--blue);
  background: white;
  margin: 0 0 12px;
  padding: 12px 16px;
}
.taskHistory p {
  margin: 7px 0;
}
.reportFilterForm #reportPeriodFields {
  display: contents;
}
.reportHeading,
.reportExportActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.reportHeading h2 {
  margin: 0 0 8px;
}
.reportBrand {
  color: var(--navy);
  font-weight: bold;
  text-align: right;
}
.reportExportActions .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.buttonLink {
  display: inline-block;
  border: 1px solid #cbd7df;
  border-radius: 6px;
  background: white;
  color: var(--navy);
  padding: 9px 12px;
  text-decoration: none;
}
.compactReportTable {
  min-width: 480px;
}
.printCredit {
  display: none;
}
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  aside,
  header,
  .appFooter,
  .noPrint {
    display: none !important;
  }
  body,
  #app,
  main,
  #content {
    display: block;
    background: white;
    color: black;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  .panel,
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  .tableWrap {
    overflow: visible;
  }
  table {
    min-width: 0;
    font-size: 8px;
  }
  th,
  td {
    padding: 5px 4px;
  }
  thead {
    display: table-header-group;
  }
  tr {
    break-inside: avoid;
  }
  .printCredit {
    display: block;
    margin-top: 15px;
    text-align: center;
    font-size: 8px;
  }
}
@media (max-width: 760px) {
  .dayEndActions,
  .dayEndHeading {
    align-items: stretch;
    flex-direction: column;
  }
}
@media (max-width: 900px) {
  #app {
    display: block;
  }
  aside {
    position: static;
    width: auto;
    height: auto;
  }
  aside nav {
    display: flex;
    overflow: auto;
    margin-top: 15px;
  }
  nav button {
    white-space: nowrap;
  }
  #profile,
  #logout {
    position: static;
  }
  main {
    padding: 0 14px;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .form {
    grid-template-columns: 1fr;
  }
  .wide,
  .form .primary {
    grid-column: 1;
  }
  .details {
    grid-template-columns: 1fr 1fr;
  }
  .barRow {
    grid-template-columns: 120px 1fr 35px;
  }
  .online {
    display: none;
  }
}
