/* Mobile-first marine admin portal */
:root {
  --bg: #243044;
  --card: #2f3d52;
  --text: #f8fafc;
  --muted: #a8b4c4;
  --accent: #38bdf8;
  --danger: #f87171;
  --ok: #4ade80;
  --border: #4a5a70;
  --input-bg: #3d4d63;
  --surface-elevated: #36465c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
}

.owner-user-form.stack {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.owner-users-table-wrap {
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

#owner-users-section h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.owner-user-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

.owner-user-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.owner-user-select {
  margin: 0;
  align-self: flex-start;
}

.owner-users-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
}

.owner-users-bulk-bar .checkbox-row {
  margin: 0;
}

.owner-users-bulk-bar button {
  width: auto;
}

.owner-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.owner-user-name {
  font-size: 0.95rem;
  line-height: 1.3;
}

.owner-user-status {
  align-self: flex-start;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
}

.owner-user-email {
  margin: 0;
  word-break: break-word;
}

.owner-user-role {
  margin: 0;
}

.owner-user-access.access-expired {
  color: #c2410c;
}

.owner-user-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  width: 100%;
}

.owner-user-actions button {
  font-size: 0.82rem;
  padding: 0.55rem 0.7rem;
  width: 100%;
  margin: 0;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

#owner-users-dev-link {
  margin-top: 0.75rem;
  padding: 0.75rem;
  word-break: break-all;
}

#owner-users-dev-link a {
  color: var(--accent);
}

#owner-users-dev-link button {
  margin-top: 0.5rem;
  width: 100%;
}

.wrap-wide {
  max-width: 1100px;
}

.header-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  min-height: 4.5rem;
}

.summary-value {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0.15rem;
}

.summary-card--ok {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.1);
}

.summary-card--bad {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.1);
}

.summary-card--unknown {
  border-color: var(--border);
}

.summary-value--ok {
  color: var(--ok);
}

.summary-value--bad {
  color: var(--danger);
}

.summary-value--unknown {
  color: var(--muted);
}

.date-range-block {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.date-range-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.date-range-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.date-range-row label > span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.date-range-row input[type="date"] {
  background: #f1f5f9;
  border: 2px solid #64748b;
  color: #0f172a;
  color-scheme: light;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  font-weight: 600;
  min-height: 2.85rem;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.date-range-row input[type="date"]:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.45);
  background: #ffffff;
}

.date-range-row input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  filter: none;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0.15rem;
}

.date-range-row input[type="date"]::-webkit-datetime-edit,
.date-range-row input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  color: #0f172a;
}

.date-range-row input[type="date"]::-webkit-datetime-edit-text,
.date-range-row input[type="date"]::-webkit-datetime-edit-month-field,
.date-range-row input[type="date"]::-webkit-datetime-edit-day-field,
.date-range-row input[type="date"]::-webkit-datetime-edit-year-field {
  color: #0f172a;
  padding: 0 0.12rem;
}

.date-range-summary {
  margin: 0.5rem 0 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

.date-range-summary.range-invalid {
  color: var(--danger);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.preset-btn {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.filter-hint {
  display: block;
  min-height: 1.25rem;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.25;
}

.filter-inactive input {
  opacity: 0.45;
}

.filter-grid label {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.filter-grid label > span:first-child {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.3;
  min-height: 1.1rem;
}

.filter-grid select,
.filter-grid input[type="text"] {
  min-height: 2.75rem;
}

.filter-grid .btn-row {
  margin-top: 0;
  align-self: start;
  padding-top: calc(0.3rem + 1.1rem);
}

.filter-grid .btn-row button {
  min-height: 2.75rem;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.tab-nav .tab {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.tab-nav .tab.active {
  border-color: var(--accent);
  color: var(--accent);
}

.card.panel-table {
  overflow: hidden;
  padding: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: lowercase;
}

.data-table .col-ts {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
}

.data-table .col-subject {
  white-space: normal;
  min-width: 10rem;
  max-width: 16rem;
}

.data-table .col-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .col-action {
  text-align: right;
}

.data-table .col-seq {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
  min-width: 2.5rem;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.code-block {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-session-badge {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.admin-session-sep {
  opacity: 0.6;
  padding: 0 0.15rem;
}

h1, h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

a {
  color: var(--accent);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

a.card:hover {
  border-color: var(--accent);
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

a.card h3 {
  color: var(--accent);
}

#company-list,
#vessel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#company-list .card,
#vessel-list .card {
  margin-bottom: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

label:not(.audit-check-label) {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  max-width: 1rem;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.vessel-autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% - 0.15rem);
  max-height: 220px;
  overflow-y: auto;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.autocomplete-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
  background: var(--card);
  outline: none;
}

.autocomplete-item .meta {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

textarea {
  min-height: 160px;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

button, .btn {
  display: inline-block;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0f172a;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

button.danger {
  background: var(--danger);
  color: #fff;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nav a {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.9rem;
}

.message {
  padding: 0.65rem;
  border-radius: 8px;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.message.error {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.message.ok {
  background: rgba(74, 222, 128, 0.14);
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.message.info {
  background: rgba(56, 189, 248, 0.12);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.message.neutral {
  background: var(--surface-elevated);
  color: var(--muted);
  border: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.inbound-mail-section {
  margin-top: 1rem;
}

.inbound-mail-section h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.card-badges {
  margin-top: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge--ok {
  background: rgba(74, 222, 128, 0.15);
  color: var(--ok);
}

.badge--bad {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.sender-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.sender-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sender-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  word-break: break-word;
}

.sender-label {
  font-size: 0.85rem;
}

.sender-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.sender-status--ok {
  color: var(--ok);
}

.sender-status--paused {
  color: #fbbf24;
}

.sender-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sender-add-form {
  margin-top: 0.5rem;
}

.summary-card--warn .summary-value--warn {
  color: #fbbf24;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
  align-items: center;
}

.subnav a {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.subnav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.kv-list {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.kv-list dt {
  font-weight: 600;
  color: var(--muted);
}

.kv-list dd {
  margin: 0;
}

.filter-grid .filter-actions {
  display: flex;
  align-items: flex-end;
  margin: 0;
  padding-top: calc(0.3rem + 1.1rem);
}

.filter-grid .filter-actions button {
  min-height: 2.75rem;
  width: 100%;
}

.date-input,
.filter-grid input[type="date"] {
  background: #f1f5f9;
  border: 2px solid #94a3b8;
  color: #0f172a;
  color-scheme: light;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 2.75rem;
}

.date-input:focus,
.filter-grid input[type="date"]:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
  background: #ffffff;
}

.date-input::-webkit-calendar-picker-indicator,
.filter-grid input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.page-header-main {
  min-width: 0;
}

.breadcrumb {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.card-lead {
  margin: 0 0 0.85rem;
}

.card-table {
  padding: 0.75rem;
}

.page-audit .audit-demo-card {
  background: var(--surface-elevated);
}

.page-audit input[type="checkbox"] {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  max-width: 1rem !important;
  padding: 0 !important;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.audit-demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.audit-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0;
  min-width: 0;
  padding: 0.7rem 0.85rem;
}

.audit-tool-card--event {
  border-color: rgba(56, 189, 248, 0.4);
}

.audit-tool-card--email {
  border-color: rgba(251, 191, 36, 0.4);
}

.audit-tool-card .card-title {
  margin: 0;
  font-size: 0.95rem;
}

.audit-tool-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}

.audit-tool-hint code {
  font-size: 0.78rem;
  color: var(--accent);
}

.audit-tool-btn {
  align-self: flex-start;
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
}

.audit-check-label {
  display: block;
  margin: 0;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}

.audit-check-label input[type="checkbox"] {
  margin-right: 0.45rem;
  vertical-align: middle;
}

.audit-email-actions {
  margin: 0.5rem 0 0;
}

.audit-email-card #aa-send-email {
  font-size: 0.88rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  opacity: 0.7;
}

.audit-email-card #aa-send-email.aa-send-ready {
  background: var(--accent);
  color: #0f172a;
  border: none;
  font-weight: 600;
  opacity: 1;
}

.app-modal[hidden] {
  display: none !important;
}

.app-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 40, 0.55);
}

.app-modal-dialog {
  position: relative;
  max-width: 920px;
  margin: 4vh auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 92vh;
  overflow: auto;
}

.app-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.app-modal-close {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.app-modal-body {
  padding: 1rem;
}

.audit-filters-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.audit-date-panel {
  padding: 0.85rem;
  border-radius: 10px;
  border: 2px solid #94a3b8;
  background: #f8fafc;
  color-scheme: light;
}

.audit-date-panel-title {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.page-audit .audit-date-panel label {
  margin: 0;
}

.page-audit .audit-date-panel label > span {
  color: #0f172a;
  font-weight: 700;
}

.page-audit .audit-date-panel input[type="date"] {
  background: #ffffff !important;
  border: 2px solid #475569 !important;
  color: #0f172a !important;
  color-scheme: light;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  font-weight: 600;
  min-height: 2.85rem;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.page-audit .audit-date-panel input[type="date"]:focus {
  outline: none;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.45);
  background: #ffffff !important;
}

.page-audit .audit-date-panel input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.1rem;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f172a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.2rem 1.2rem;
}

.page-audit .audit-date-panel input[type="date"]::-webkit-datetime-edit,
.page-audit .audit-date-panel input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  color: #0f172a;
}

.page-audit .audit-date-panel input[type="date"]::-webkit-datetime-edit-text,
.page-audit .audit-date-panel input[type="date"]::-webkit-datetime-edit-month-field,
.page-audit .audit-date-panel input[type="date"]::-webkit-datetime-edit-day-field,
.page-audit .audit-date-panel input[type="date"]::-webkit-datetime-edit-year-field {
  color: #0f172a;
  padding: 0 0.12rem;
}

.audit-date-row {
  margin: 0;
}

.audit-filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: end;
}

.audit-filter-row label {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.audit-filter-row label > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.audit-apply-btn {
  min-height: 2.75rem;
  width: 100%;
}

.pager-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .audit-demo-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .audit-filter-row {
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
  }

  .audit-apply-btn {
    min-width: 9.5rem;
    width: auto;
  }
}

/* Academy cohort provisioning */
.wrap--wide {
  max-width: 920px;
}

.cohort-lead {
  margin: 0 0 1rem;
}

.cohort-panel label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.cohort-textarea {
  width: 100%;
  min-height: 18rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  resize: vertical;
}

.cohort-toolbar {
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.cohort-stats {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.cohort-company {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.cohort-company h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.cohort-company ul {
  margin: 0;
  padding-left: 1.1rem;
}

.cohort-company li {
  margin-bottom: 0.65rem;
}

.cohort-raw {
  margin-top: 1rem;
}

.cohort-raw pre {
  overflow: auto;
  font-size: 0.72rem;
  max-height: 16rem;
  background: rgba(15, 23, 42, 0.45);
  padding: 0.75rem;
  border-radius: 8px;
}
