/* My Reports Archive — production-specific overrides (shared list UI in archive_list.css) */

:root {
  --font-rounded: var(--font);
  --blue-border: rgba(255, 90, 0, 0.2);
}

.mi-wrap {
  animation: miFadeUp 0.35s ease both;
}

.mi-toolbar {
  margin-bottom: 18px;
  animation: miFadeUp 0.4s ease both 0.04s;
}

.mi-toolbar-row {
  gap: 10px;
}

.mi-search-input {
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mi-search-input::placeholder {
  color: var(--muted);
}

.mi-search-input:focus {
  border-color: rgba(255, 90, 0, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.07);
}

.mi-tool-btn {
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.mi-tool-btn:hover {
  background: var(--surface2);
}

.mi-tool-btn:active {
  transform: scale(0.97);
}

.mi-tool-btn.is-active {
  background: rgba(255, 90, 0, 0.07);
  border-color: rgba(255, 90, 0, 0.18);
  color: var(--accent);
}

.mi-cal-badge {
  pointer-events: none;
}

.mi-view-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.mi-view-btn {
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-rounded);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.mi-view-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.mi-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-family: var(--font-rounded);
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.mi-btn-primary {
  background: var(--accent);
  color: #fff;
}

.mi-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.04);
}

.mi-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.mi-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f9fb;
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.mi-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.07);
  vertical-align: middle;
}

.mi-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.mi-table tbody tr:hover {
  background: var(--surface2);
}

.mi-table-main {
  max-width: 230px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mi-table-muted {
  color: var(--muted);
}

.mi-table-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.mi-table-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.mi-status-header {
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-align: left;
}

.mi-status-name {
  font-size: 14px;
}

.mi-status-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  opacity: 1;
}

.mi-card {
  border: 1px solid var(--border);
  padding: 16px;
}

.mi-card::before {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 65%);
  border-radius: 0;
}

/* Shared visual mapping for the resubmitted status across card and table
   views. The tint stays intentionally light while remaining distinct from
   regular In Progress. */
.mi-card.mi-status--resubmitted {
  background: linear-gradient(145deg, #fbf8ff 0%, #f3edff 100%);
  border-color: rgba(126, 87, 194, 0.3);
}

.mi-card.mi-status--resubmitted::before {
  background: linear-gradient(90deg, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
}

.mi-table tbody tr.mi-status--resubmitted {
  background: #faf7ff;
}

.mi-table tbody tr.mi-status--resubmitted:hover {
  background: #f3edff;
}

.mi-card-title {
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.mi-pill-row {
  gap: 7px;
  margin: 12px 0;
}

.mi-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.mi-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.mi-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 0;
}

.mi-label {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.mi-value {
  font-size: 13px;
  word-break: break-word;
  line-height: 1.35;
  margin-top: 0;
}

/* Crew Total's value is plain crew-entered text (often long/multi-line),
   shown as compact body copy -- NOT the large headline styling used for the
   report's own (calculated) Total value right below it. */
.mi-crew-total-value {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.mi-open {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.mi-open:hover {
  background: rgba(255, 90, 0, 0.12);
  border-color: rgba(255, 90, 0, 0.12);
}

.mi-cal-dropdown {
  background: #fff;
}

.mi-cal-input {
  margin-bottom: 12px;
}

.mi-cal-apply {
  margin-top: 0;
  width: auto;
  height: auto;
  padding: 10px 16px;
}

.mi-details-wrap {
  background: rgba(17, 17, 17, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 12px;
  z-index: 9999;
}

.mi-details-panel {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(255, 90, 0, 0.22);
  box-shadow: 0 20px 44px rgba(17, 17, 17, 0.18);
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 0 18px 88px;
  display: block;
}

.mi-details-head {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 3;
  padding: 18px 0 12px;
  margin-bottom: 14px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 90, 0, 0.18);
}

.mi-details-close {
  width: auto;
  height: auto;
  padding: 8px 16px;
  flex-shrink: 0;
  background: rgba(255, 90, 0, 0.1);
  border: 1px solid rgba(255, 90, 0, 0.24);
  border-radius: 999px;
  color: #ff5a00;
  font-size: inherit;
}

.mi-details-wrap .mi-open {
  color: #ff5a00;
}

.mi-details-wrap .mi-open:hover {
  background: rgba(255, 90, 0, 0.14);
  border-color: rgba(255, 90, 0, 0.34);
  color: #ff5a00;
}

.mi-details-wrap .mi-card-title {
  color: #111111;
}

.mi-details-wrap #miDetailsBody .mi-label {
  color: rgba(17, 17, 17, 0.52);
}

.mi-details-wrap #miDetailsBody .mi-value {
  color: #111111;
}

#miDetailsBody {
  padding: 0;
  overflow: visible;
}

.mi-updates-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 90, 0, 0.18);
}

.mi-updates-head,
.mi-update-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mi-updates-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mi-update-item {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}

.mi-update-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-primary);
  font-size: 12px;
}

.mi-update-meta time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.mi-update-body {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mi-update-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

.mi-update-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mi-update-textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.mi-update-textarea:focus {
  border-color: rgba(255, 90, 0, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.08);
}

.mi-post-update-btn,
.mi-resubmit-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 13px;
  font-family: var(--font-rounded);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mi-post-update-btn {
  background: var(--accent);
  color: #fff;
}

.mi-resubmit-btn {
  background: #f3edff;
  border-color: rgba(126, 87, 194, 0.28);
  color: #6941a5;
}

.mi-post-update-btn:disabled,
.mi-resubmit-btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.mi-update-state {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.mi-update-state.is-error { color: #b42318; }
.mi-update-state.is-success { color: #1a7a40; }

@media (max-width: 640px) {
  .mi-toolbar-row {
    flex-wrap: wrap;
  }

  .mi-search-wrap {
    flex: 1 1 100%;
  }

  .mi-view-switch {
    flex: 1 1 auto;
  }

  .mi-view-btn {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .mi-meta {
    grid-template-columns: 1fr;
  }

  .mi-tool-btn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .mi-search-input {
    height: 40px;
  }

  .mi-updates-head,
  .mi-update-actions,
  .mi-update-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .mi-update-meta time { white-space: normal; }

  .mi-post-update-btn,
  .mi-resubmit-btn { width: 100%; }

  .mi-update-state { text-align: left; }
}

@keyframes miFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
