/* ==========================================================================
   Inventory Uploader — Cool slate + teal theme (smooth edges, sleek, easy to read)
   ========================================================================== */

:root {
  /* Slate + teal palette */
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-card-muted: #334155;
  --bg-input: #0f172a;
  --bg-topbar: #0f172a;
  --border: #334155;
  --border-focus: #14b8a6;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-subtle: rgba(20, 184, 166, 0.18);
  --accent-ghost-border: rgba(20, 184, 166, 0.45);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.top-bar__left,
.top-bar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-name {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  font-size: 1.05rem;
}

.store-pill {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.top-bar__notifications-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-bar__notifications-btn:hover {
  background: var(--bg-card-muted);
  color: var(--accent);
}

.top-bar__notifications-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.top-bar__notifications-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   App layout — sidebar + main (all pages when logged in, tab-like navigation)
   -------------------------------------------------------------------------- */
.app-layout {
  display: block;
  min-height: calc(100vh - 3.5rem);
}

.app-sidebar {
  position: fixed;
  left: 0;
  top: 3.5rem;
  width: 260px;
  height: calc(100vh - 3.5rem);
  padding: 1rem 0 1rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--bg-page);
  overflow-y: auto;
  z-index: 5;
}

@media (max-width: 768px) {
  .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-y: visible;
  }
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.app-main {
  min-width: 0;
  margin-left: 260px;
}

@media (max-width: 768px) {
  .app-main {
    margin-left: 0;
  }
}

/* --------------------------------------------------------------------------
   Home page — optional two-column layout (welcome only; nav is in sidebar)
   -------------------------------------------------------------------------- */
.home-layout {
  display: block;
  margin-top: 0.5rem;
}

.home-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.home-nav__section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.home-nav__heading {
  margin: 0;
  padding: 0 0 0.35rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.home-nav__item {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-nav__item:hover {
  background: var(--bg-card-muted);
  color: var(--accent);
}

.home-nav__item--active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.home-nav__item--active:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.home-nav__item--sub {
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.home-nav__desc {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.35;
}

.home-nav__badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--text-inverse);
}

.home-main {
  min-width: 0;
}

.home-welcome {
  margin-bottom: 1.5rem;
}

/* Quick action strip (e.g. tickets on inventory index for store users) */
.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.action-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
}

.action-strip__item:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.action-strip__item::after {
  content: "→";
  font-size: 0.85rem;
  opacity: 0.8;
}

.logout-form {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Page layout
   -------------------------------------------------------------------------- */
.page {
  flex: 1;
  padding: 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto 2rem auto;
}

.page-section {
  margin-top: 1rem;
}

.page-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0 0 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.page-footer-link {
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   Cards — smooth edges, warm shadow
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card--center {
  max-width: 420px;
  margin: 3rem auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.card--action {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card--form {
  margin-top: 0.75rem;
}

.card__title {
  margin: 0 0 0.25rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.card__subtitle {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.card-link {
  text-decoration: none;
  color: inherit;
}

.card-link--disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Buttons — pill shape, warm accent
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  padding: 0.5rem 1.1rem;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-ghost-border);
}

.btn-ghost:hover {
  background: var(--accent-subtle);
}

/* --------------------------------------------------------------------------
   Forms — smooth inputs, clear focus
   -------------------------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.form__label {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.form__input,
.form__select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form__input::placeholder {
  color: var(--text-muted);
}

.form__input:focus,
.form__select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.form__submit {
  margin-top: 0.75rem;
}

.form__actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */
.flash-container {
  margin-bottom: 0.75rem;
}

.flash {
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
  border: 1px solid transparent;
}

.flash-error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.flash-success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.hint {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Checkbox lists
   -------------------------------------------------------------------------- */
.list--checkboxes {
  margin-top: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  max-height: 260px;
  overflow: auto;
  padding: 0.4rem 0.5rem;
  background: var(--bg-card-muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
}

.checkbox-row--stacked {
  flex-direction: column;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--accent);
}

.make-store-files {
  margin-top: 0.5rem;
}

.make-store-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(71, 85, 105, 0.4);
}

.make-store-row:last-child {
  border-bottom: none;
}

.make-store-checkbox {
  min-width: 8rem;
}

.make-store-file-label {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.make-store-row .form__input.make-store-file {
  flex: 1;
  min-width: 12rem;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */
.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Pills / badges
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.pill--soon {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Layout split
   -------------------------------------------------------------------------- */
.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.2fr);
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.layout-split--full {
  grid-template-columns: minmax(0, 1fr);
  max-width: 52rem;
}

.layout-split__main,
.layout-split__side {
  min-width: 0;
}

.inventory-do-list {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.inventory-do-list li {
  margin: 0.4rem 0;
}

.card--muted {
  background: var(--bg-card-muted);
  border: 1px solid var(--border);
  margin-top: 1rem;
}

.card__title--small {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Tables — clean, readable
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.table th {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card-muted);
  font-size: 0.85rem;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:nth-child(odd) td {
  background: rgba(15, 23, 42, 0.35);
}

.table tbody tr:nth-child(even) td {
  background: rgba(30, 41, 59, 0.55);
}

.table tbody tr:hover td {
  background: rgba(51, 65, 85, 0.65);
}

.form__input--cell {
  width: 100%;
  min-width: 4rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Budget table */
.table--budget {
  table-layout: auto;
}

.table--budget thead th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  padding: 0.6rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table--budget thead th:first-child {
  text-align: left;
}

.table--budget thead th:not(:first-child) {
  text-align: right;
}

.table--budget tbody td {
  padding: 0.4rem 0.6rem;
  vertical-align: middle;
  min-height: 2.25rem;
}

.table--budget tbody td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}

.table--budget tbody td:not(:first-child) {
  text-align: right;
}

.table--budget .form__input--cell {
  display: block;
  width: 100%;
  min-width: 3.5rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
  text-align: right;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s, background-color 0.15s;
}

.table--budget .form__input--cell:hover {
  border-color: var(--border-focus);
}

.table--budget .form__input--cell:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.25);
}

.table--budget tbody tr:nth-child(even) .form__input--cell {
  background: var(--bg-card-muted);
}

.table--budget tbody tr:nth-child(even) .form__input--cell:focus {
  background: var(--bg-input);
}

.table--budget td.budget-readonly {
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  background: var(--bg-card-muted);
  border-radius: var(--radius-sm);
}

.table--budget tbody tr:nth-child(even) td.budget-readonly {
  background: rgba(30, 41, 59, 0.6);
}

.budget-percent-cell {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.budget-percent-cell .form__input--cell {
  flex: 1;
  min-width: 0;
}

.budget-percent-suffix {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  margin-left: 0.1rem;
}

.table__cell--computed {
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

.table tbody tr:nth-child(odd) td.table__cell--computed {
  background: rgba(15, 23, 42, 0.35);
}

.table tbody tr:nth-child(even) td.table__cell--computed {
  background: rgba(30, 41, 59, 0.55);
}

.table tbody tr:hover td.table__cell--computed {
  background: rgba(51, 65, 85, 0.65);
}

.checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.checkbox-cell input[type="checkbox"] {
  accent-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Card header row / sort
   -------------------------------------------------------------------------- */
.card__header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.card__header-row .card__title {
  margin: 0;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.sort-control__label {
  color: var(--text-muted);
}

.sort-control__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.sort-control__link:hover {
  text-decoration: underline;
}

.sort-control__link--active {
  font-weight: 600;
  color: var(--text);
}

.sort-control__sep {
  color: var(--text-muted);
}

.card__subtitle strong {
  color: var(--text);
}

.card__subtitle code,
.card code {
  font-size: 0.9em;
  padding: 0.15rem 0.4rem;
  background: var(--bg-card-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Notifications
   -------------------------------------------------------------------------- */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.notification-block {
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-left-color: var(--accent);
}

.notification-block--unread {
  border-left-color: var(--accent-hover);
  background: var(--bg-card-muted);
}

.notification-block--archived {
  border-left-color: var(--text-muted);
  opacity: 0.92;
}

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ticket-title {
  margin: 0.35rem 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.ticket-description {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.notification-block__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.notification-block__time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notification-block__store {
  font-weight: 600;
  color: var(--text);
}

.notification-block__tab {
  font-weight: 500;
}

.notification-block__actor {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.notification-block__subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.notification-block__meta {
  margin: 0.15rem 0 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.notification-block__stats {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.notification-block__stats li {
  margin: 0.15rem 0;
}

.notification-details {
  display: block;
}

.notification-details[open] .notification-block__hint {
  display: none;
}

.notification-block__summary {
  cursor: pointer;
  list-style: none;
  outline: none;
}

.notification-block__summary::-webkit-details-marker {
  display: none;
}

.notification-block__summary::marker {
  display: none;
}

.notification-block__summary::before {
  content: "▸ ";
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

.notification-details[open] .notification-block__summary::before {
  content: "▾ ";
}

.notification-block__hint {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.notification-block__changes .activity-per-item__intro {
  margin-bottom: 0.5rem;
}

.update-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
}

.update-row__field {
  min-width: 0;
}

.update-row__field--wide {
  grid-column: span 1;
}

.section-heading {
  margin: 0.75rem 0 0.35rem 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge--info {
  background: var(--accent-subtle);
  color: var(--accent);
}

.badge--success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

/* --------------------------------------------------------------------------
   Activity log / details
   -------------------------------------------------------------------------- */
.activity-details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.activity-details__body {
  margin-top: 0.5rem;
  padding: 0.85rem;
  background: var(--bg-card-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-height: 20rem;
  overflow-y: auto;
  min-width: 32rem;
}

.activity-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.activity-mini-table th,
.activity-mini-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.activity-mini-table th {
  color: var(--text-muted);
  font-weight: 500;
}

.activity-mini-table tbody tr:last-child td {
  border-bottom: none;
}

.activity-diff-cell {
  white-space: nowrap;
}

.activity-diff-old {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  margin-right: 0.25rem;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  text-decoration: line-through;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.activity-diff-arrow {
  color: var(--text-muted);
  margin: 0 0.25rem;
  font-size: 0.75rem;
}

.activity-diff-new {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.activity-field-name {
  color: var(--text);
}

.activity-two-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.25rem;
}

.activity-two-tables__panel {
  min-width: 0;
  padding: 0.6rem;
  background: var(--bg-card-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.activity-two-tables__title {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.activity-two-tables__panel:first-child .activity-two-tables__title {
  color: #fca5a5;
}

.activity-two-tables__panel:last-child .activity-two-tables__title {
  color: #86efac;
}

.activity-per-item__intro {
  margin: 0 0 0.75rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.activity-item-block {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-card-muted);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--text-muted);
}

.activity-item-block:last-child {
  margin-bottom: 0;
}

.activity-item-block__name {
  margin: 0 0 0.4rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.activity-item-changes {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.activity-item-change {
  margin: 0.25rem 0;
  font-size: 0.85rem;
}

.activity-item-change__label {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.activity-details-row td {
  vertical-align: top;
  padding-top: 0;
  border-top: none;
  background: var(--bg-card-muted);
}

.activity-details-cell {
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 0.75rem;
}

.activity-details-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  color: var(--accent);
}

.activity-details-toggle:hover {
  color: var(--accent-hover);
}

.activity-details__json {
  margin: 0;
  padding: 0.5rem;
  font-size: 0.75rem;
  overflow-x: auto;
  max-height: 12rem;
  overflow-y: auto;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.form-inline .form__label {
  margin: 0;
}

.form-inline .form__select {
  min-width: 8rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .activity-two-tables {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 1rem;
  }

  .layout-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Prevent iOS/Android from zooming when focusing inputs */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}
