:root {
  --fire: #b96514;
  --fire-dark: #5f2e0c;
  --sand: #fbf8f3;
  --paper: #fffdf9;
  --ink: #786759;
  --ok: #dff1e6;
  --ok-b: #a9d5bd;
  --warn: #fff5ea;
  --warn-b: #f0d4b5;
  --err: #f8d7da;
  --err-b: #dc9096;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(185, 101, 20, 0.16), transparent 30%), linear-gradient(180deg, #f8f3ed, #f2ede6);
  color: #212529;
}

.app-shell {
  max-width: 1220px;
  margin: 12px auto;
  padding: 0 12px;
}

.app-shell.app-wide {
  max-width: 1440px;
}

.app-card {
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid #e2dfda;
  border-radius: 1rem;
  box-shadow: 0 18px 36px rgba(62, 36, 12, 0.08);
  overflow: hidden;
}

.app-shell.app-wide .app-card {
  overflow: visible;
}

.app-header {
  position: relative;
  z-index: 2500;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px 22px;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  background: linear-gradient(135deg, #8c4915, #b96514);
  color: #fff;
}

.app-brand,
.app-user {
  display: flex;
  gap: .55rem;
  align-items: center;
}

.app-brand {
  color: #fff;
  text-decoration: none;
}

.app-brand:hover,
.app-brand:focus {
  color: #fff;
  text-decoration: none;
}

.app-brand-badge,
.app-user-badge {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.app-brand-title {
  font-size: 1.15rem;
  font-weight: bold;
  line-height: 1.15;
}

.app-brand-sub,
.app-user-sub {
  font-size: .84rem;
  color: rgba(255, 255, 255, 0.82);
}

.app-user-name {
  color: #fff;
  font-weight: 400;
  line-height: 1.2;
}

.app-user-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.app-user-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.app-user-link {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  padding: .42rem .78rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}

.app-user-link:hover,
.app-user-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.profile-menu-wrap {
  position: relative;
}

.profile-menu-button {
  color: #fff;
  cursor: pointer;
}

.profile-menu-button:hover,
.profile-menu-button:focus {
  background: rgba(255, 255, 255, 0.2);
}

.profile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .7rem);
  z-index: 3000;
  width: min(340px, calc(100vw - 32px));
  color: #212529;
  background: var(--paper);
  border: 1px solid #eadfce;
  border-radius: .95rem;
  box-shadow: 0 18px 38px rgba(62, 36, 12, 0.18);
  overflow: hidden;
}

.profile-menu-panel.show {
  display: block;
}

.profile-menu-head {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .95rem 1rem;
  background: linear-gradient(180deg, #fffaf4, #fffdf9);
  border-bottom: 1px solid #eadfce;
}

.profile-menu-avatar {
  width: 2.45rem;
  height: 2.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .8rem;
  background: #fff7ec;
  border: 1px solid var(--warn-b);
  color: var(--fire-dark);
}

.profile-menu-head strong,
.profile-menu-head small {
  display: block;
}

.profile-menu-identity {
  min-width: 0;
}

.profile-menu-head strong {
  color: var(--fire-dark);
  font-size: .95rem;
  font-weight: 400;
  line-height: 1.2;
}

.profile-menu-head small {
  margin-top: .1rem;
  color: var(--ink);
  font-size: .78rem;
  line-height: 1.25;
}

.profile-menu-meta {
  display: grid;
  gap: .35rem;
  margin-top: .7rem;
  padding-top: .65rem;
  border-top: 1px solid #eadfce;
}

.profile-menu-meta span {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .55rem;
  color: #3b322b;
  font-size: .78rem;
  line-height: 1.25;
}

.profile-menu-meta b {
  color: var(--ink);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.profile-menu-section {
  padding: .85rem 1rem 1rem;
  border-bottom: 1px solid #eadfce;
}

.profile-menu-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .45rem;
  color: var(--fire-dark);
  font-size: .82rem;
  font-weight: 400;
}

.profile-menu-label small {
  color: var(--ink);
  font-weight: 400;
}

.profile-language-filter {
  position: relative;
  margin-top: .65rem;
}

.profile-language-filter i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8f7d6d;
}

.profile-language-filter input {
  width: 100%;
  border: 1px solid #d9c5b0;
  border-radius: .8rem;
  background: linear-gradient(180deg, #fff, #fff8ef);
  padding: .55rem .75rem .55rem 2.25rem;
  font-size: .84rem;
  font-weight: 400;
  line-height: 1.35;
}

.profile-language-list {
  display: grid;
  gap: .35rem;
  max-height: 132px;
  margin-top: .65rem;
  overflow-y: auto;
  padding-right: .2rem;
}

.profile-language-item,
.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid transparent;
  border-radius: .8rem;
  background: transparent;
  color: #3b322b;
  text-align: left;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 400;
}

.profile-language-item {
  justify-content: space-between;
  padding: .48rem .65rem;
}

.profile-language-item small {
  color: var(--ink);
  font-weight: 400;
}

.profile-language-item:hover,
.profile-language-item:focus,
.profile-language-item.is-active,
.profile-menu-item:hover,
.profile-menu-item:focus {
  background: #fff7ec;
  border-color: var(--warn-b);
  color: var(--fire-dark);
}

.profile-menu-actions {
  display: grid;
  gap: .35rem;
  padding: .65rem;
}

.profile-menu-item {
  padding: .62rem .7rem;
}

.profile-menu-item.logout {
  border-top: 1px solid #eadfce;
  border-radius: 0 0 .75rem .75rem;
  margin-top: .2rem;
}

.app-body {
  padding: 24px;
}

.filter-label {
  margin-bottom: .38rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 500;
  color: #4f463f;
  line-height: 1.2;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.25rem;
  padding: .32rem .72rem;
  border-radius: 999px;
  font-size: .74rem;
  line-height: 1;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .02em;
  border: 1px solid transparent;
}

.status-draft {
  background: #fff6ec;
  color: #d94b00;
  border-color: #f4d8b9;
}

.status-submitted {
  background: #eaf7e8;
  color: #16612e;
  border-color: #c9e4c8;
}

.status-to-be-corrected {
  background: #fff6ec;
  color: #d94b00;
  border-color: #f4d8b9;
}

.status-confirmed {
  background: #e8f4ff;
  color: #0b6fb3;
  border-color: #b6daf5;
}

.validation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: .9rem;
  border: 1px solid transparent;
}

.v-ok {
  color: #1f7f3c;
  background: #edf8ef;
  border-color: #c9e4c8;
}

.v-warning {
  color: #f26a00;
  background: #fff6ec;
  border-color: #f4d8b9;
}

.v-error {
  color: #d92323;
  background: #fff0f0;
  border-color: #f3b9b9;
}

.scope-indicator {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .55rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  background: #f7efe5;
  color: #7a3b10;
  font-size: .78rem;
  font-weight: 700;
}

.picker-input-wrap {
  position: relative;
}

.picker-panel {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  z-index: 1085;
  display: none;
  padding: .75rem;
  border: 1px solid #eadfce;
  border-radius: 1rem;
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(95, 46, 12, 0.14);
}

.picker-panel.show {
  display: block;
}

.datepicker-picker {
  box-shadow: none;
}

.picker-panel .datepicker-cell.selected,
.picker-panel .datepicker-cell.selected:hover {
  background: linear-gradient(180deg, var(--fire), #8c4915);
  color: #fff;
}

.picker-panel .datepicker-cell.today:not(.selected) {
  background: #fff7ec;
  color: var(--fire-dark);
}

.picker-panel .datepicker-cell.focused:not(.selected),
.picker-panel .datepicker-cell:hover:not(.selected) {
  background: #ffefd8;
  color: var(--fire-dark);
}

.picker-panel .datepicker-controls .button {
  color: var(--fire-dark);
}

.picker-panel .datepicker-controls .button:hover,
.picker-panel .datepicker-controls .button:focus {
  background: #fff7ec;
}

.report-action-menu {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .36rem .72rem;
  border-radius: .45rem;
  color: #9a4b11;
  border-color: #efb06f;
  background: #fff7ef;
  font-weight: 400;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  white-space: nowrap;
}

.report-action-menu:hover,
.report-action-menu:focus,
.report-action-menu.show {
  color: #9a4b11;
  border-color: #df8a2f;
  background: #fff3e5;
}

.report-actions-dropdown .dropdown-menu {
  min-width: 16rem;
  padding: .45rem .55rem;
  border-color: #ead8c4;
  border-radius: .7rem;
  box-shadow: 0 16px 34px rgba(42, 31, 20, .14);
}

.report-actions-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .55rem;
  border-radius: .45rem;
  color: #172432;
  background: transparent;
  border: 0;
  font-weight: 400;
  white-space: normal;
}

.report-actions-dropdown .dropdown-item + .dropdown-item {
  border-top: 1px solid #eee1d4;
}

.report-actions-dropdown .dropdown-item:hover,
.report-actions-dropdown .dropdown-item:focus {
  color: #172432;
  background: #fff8ef;
  border-color: #eee1d4;
}

.report-action-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: .5rem;
  background: #fff3e5;
  color: #e18010;
  font-size: 1.12rem;
}

.report-action-copy {
  display: grid;
  gap: .15rem;
  min-width: 0;
}

.report-action-title {
  color: #172432;
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.15;
}

.report-action-subtitle {
  color: #6f7780;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.25;
}

.report-action-submit .report-action-icon {
  background: #eef7ff;
  color: #146fae;
}

.report-action-draft .report-action-icon {
  background: #f4f1ff;
  color: #7157b5;
}

.report-action-correct .report-action-icon {
  background: #fff3e5;
  color: #e18010;
}

.report-action-confirm .report-action-icon {
  background: #e9f8f0;
  color: #0f8f4e;
}

.report-action-discard .report-action-icon {
  background: #fff0f2;
  color: #d9253a;
}

.filters {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr auto;
  gap: .85rem;
  align-items: end;
  margin: .85rem 1.2rem .85rem;
  padding: .85rem 1rem;
  border: 1px solid #eee4d8;
  border-radius: .65rem;
  background: #fffdfb;
  box-shadow: 0 6px 16px rgba(52, 38, 27, .035);
}

.search-wrap {
  position: relative;
}

.search-wrap i {
  position: absolute;
  left: .78rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6f6b68;
  font-size: .9rem;
}

.search-wrap input {
  padding-left: 2.35rem;
}

.filters .form-control,
.filters .form-select,
.filters .btn {
  min-height: 2.45rem;
  border-color: #e6ded6;
  border-radius: .38rem;
  background-color: #fff;
  color: #2f2a26;
  font-size: .84rem;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: none;
}

.filters .form-control::placeholder {
  color: #7f7a75;
}

.filters .form-control:focus,
.filters .form-select:focus {
  border-color: #e96b1a;
  box-shadow: 0 0 0 .18rem rgba(217, 75, 0, .12);
}

.filters .btn-outline-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-color: #e6ded6;
  color: #5f5852;
  padding-right: .8rem;
  padding-left: .8rem;
  font-weight: 400;
}

.filters .btn-outline-secondary:hover,
.filters .btn-outline-secondary:focus {
  background: #fff6ec;
  border-color: #f4d8b9;
  color: #b64000;
}

.table-wrap {
  padding: 0 1.2rem 1.1rem;
}

.shared-grid-inline {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee4d8;
}

.shared-grid-inline .shared-grid-title {
  padding: 0 1.2rem .45rem;
}

.incidents-table,
.uploads-table {
  border-collapse: separate;
  border-spacing: 0 .52rem;
  min-width: 1120px;
  margin-bottom: 0;
  font-size: .84rem;
}

.incidents-table th,
.uploads-table th {
  padding: .25rem 1rem .35rem;
  border: 0;
  background: transparent;
  color: #4f463f;
  font-size: .68rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}

.incidents-table td,
.uploads-table td {
  padding: .82rem 1rem;
  border-top: 1px solid #ece5dd;
  border-bottom: 1px solid #ece5dd;
  background: #fff;
  vertical-align: middle;
  white-space: nowrap;
}

.incidents-table tbody tr,
.uploads-table tbody tr {
  filter: drop-shadow(0 5px 12px rgba(40, 30, 22, .055));
}

.incidents-table tbody tr:hover td,
.uploads-table tbody tr:hover td {
  background: #fffaf4;
}

.incidents-table tbody td:first-child,
.uploads-table tbody td:first-child {
  border-left: 1px solid #ece5dd;
  border-radius: .55rem 0 0 .55rem;
}

.incidents-table tbody td:last-child,
.uploads-table tbody td:last-child {
  border-right: 1px solid #ece5dd;
  border-radius: 0 .55rem .55rem 0;
}

.incident-id-link {
  font-weight: 400;
  color: #d83c00;
  text-decoration: none;
  white-space: nowrap;
}

.incident-id-link:hover {
  text-decoration: underline;
}

.incident-meta {
  display: block;
  margin-top: .2rem;
  color: #6d6761;
  font-size: .74rem;
  white-space: nowrap;
}

.grid-cell-with-icon {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.grid-cell-icon {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #eee4d8;
  border-radius: 999px;
  background: #fffaf6;
  color: #5f5852;
  font-size: .82rem;
}

.grid-cell-main {
  min-width: 0;
  color: #231f20;
  font-weight: 400;
  white-space: nowrap;
}

.validation-column,
.validation-cell {
  text-align: center;
}

.empty {
  display: none;
  margin: 0 1.2rem 1.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid #ece5dd;
  border-radius: .55rem;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 12px rgba(40, 30, 22, .055);
  text-align: center;
}

.empty-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 auto .55rem;
  border: 1px solid #f4d8b9;
  border-radius: 999px;
  background: #fff6ec;
  color: #d94b00;
  font-size: 1rem;
}

.empty strong,
.empty span {
  display: block;
}

.empty strong {
  color: #231f20;
  font-size: .92rem;
  font-weight: 900;
}

.empty span {
  margin-top: .2rem;
  color: #6d6761;
  font-size: .82rem;
}

.empty.show {
  display: block;
}

@media (max-width: 991px) {
  .app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .app-brand > div,
  .app-user-copy,
  .app-user-actions {
    display: none;
  }
  .app-user {
    width: auto;
    flex-wrap: nowrap;
  }
  .filters {
    grid-template-columns: 1fr 1fr 1fr auto;
  }
}

@media (max-width: 767px) {
  .filters {
    flex-direction: column;
    align-items: flex-start;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .profile-menu-wrap {
    position: static;
  }
  .profile-menu-panel {
    left: 1rem;
    right: 1rem;
    top: calc(100% + .5rem);
    width: auto;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
  .profile-menu-meta span {
    grid-template-columns: 1fr;
    gap: .1rem;
  }
  .app-body {
    padding: 16px;
  }
}
