@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #eef4ee;
  --bg-strong: #dbe8df;
  --card: rgba(255, 255, 255, 0.92);
  --card-solid: #ffffff;
  --line: rgba(25, 34, 28, 0.1);
  --ink: #172033;
  --muted: #62706d;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: rgba(15, 118, 110, 0.1);
  --success: #15803d;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow-sm: 0 10px 30px rgba(23, 32, 51, 0.06);
  --shadow-md: 0 22px 70px rgba(23, 32, 51, 0.12);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 22%),
    linear-gradient(180deg, #f7f8f3 0%, var(--bg) 30%, #edf4f1 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img,
video,
canvas {
  max-width: 100%;
}

#root {
  min-height: 100vh;
}

.container {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0 1rem;
}

.page-stack {
  display: grid;
  gap: 1.25rem;
}

.page-stack > * {
  min-width: 0;
}

.app-shell {
  min-height: 100vh;
}

.app-main {
  min-height: calc(100vh - 72px);
  padding: 1.1rem 0 6rem;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(247, 248, 243, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.nav-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-mark small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: white;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.nav-desktop {
  display: none;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  transition: 0.18s ease;
}

.nav-pill.active,
.nav-pill:hover {
  background: rgba(255, 255, 255, 0.76);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.nav-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 0;
}

.user-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #10b981, #34d399);
}

.user-chip span:last-child {
  display: block;
  max-width: 9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-sheet {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 0.45rem;
}

.sheet-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 700;
}

.sheet-link.active {
  color: var(--primary-dark);
}

.sheet-link.danger {
  color: var(--danger);
}

.mobile-dock {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.55rem;
  border-radius: 24px;
  background: rgba(23, 32, 51, 0.9);
  box-shadow: 0 20px 50px rgba(23, 32, 51, 0.24);
}

.dock-link {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  min-height: 56px;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
}

.dock-link.active {
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: #fff;
}

.desktop-only {
  display: none;
}

.mobile-only {
  display: inline-flex;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.75rem 1.15rem;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: #fff;
  box-shadow: 0 16px 40px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #22c55e);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #166534, var(--success));
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #f87171);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-outline {
  background: transparent;
  color: var(--primary-dark);
  border: 1.5px solid rgba(15, 118, 110, 0.28);
}

.btn-lg {
  min-height: 54px;
  padding: 0.95rem 1.3rem;
  font-size: 0.98rem;
}

.btn-sm {
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.form-input {
  width: 100%;
  border: 1px solid rgba(23, 32, 51, 0.11);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.form-input.error {
  border-color: rgba(220, 38, 38, 0.38);
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.form-row {
  display: grid;
  gap: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: capitalize;
}

.badge-present,
.badge-active {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.badge-late {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

.badge-absent,
.badge-inactive {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-radius: 18px;
}

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

th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.72);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
  vertical-align: middle;
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.66);
}

.stats-grid {
  display: grid;
  gap: 0.85rem;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon-blue {
  background: rgba(59, 130, 246, 0.14);
}

.stat-icon-green {
  background: rgba(34, 197, 94, 0.14);
}

.stat-icon-red {
  background: rgba(239, 68, 68, 0.14);
}

.stat-icon-yellow {
  background: rgba(245, 158, 11, 0.18);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-dark {
  border-color: rgba(23, 32, 51, 0.15);
  border-top-color: var(--primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-header {
  display: grid;
  gap: 0.35rem;
}

.page-header h1 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.page-header p {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 42rem;
}

.alert {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(239, 68, 68, 0.11);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.2);
}

.alert-info {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-dark);
  border-color: rgba(15, 118, 110, 0.18);
}

.empty-state {
  text-align: center;
  padding: 2.4rem 1rem;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(23, 32, 51, 0.56);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(100%, 620px);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  padding: 1.35rem;
}

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

.modal-title {
  font-size: 1.08rem;
  font-weight: 800;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.3rem;
}

.page-btn {
  min-width: 42px;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
}

.page-btn.active {
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: white;
  border-color: transparent;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.camera-container {
  position: relative;
  overflow: hidden;
  background: #07111d;
  border-radius: 22px;
  aspect-ratio: 4 / 5;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(7, 17, 29, 0.52);
}

.camera-overlay-card {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  max-width: 84%;
}

.photo-preview {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 0 auto;
  border-radius: 22px;
  border: 4px solid rgba(34, 197, 94, 0.24);
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.16), transparent 26%),
    linear-gradient(145deg, #f7f7ee, #e0f0ec);
}

.auth-card {
  width: min(100%, 460px);
  padding: 1.4rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-md);
}

.auth-card-wide {
  width: min(100%, 640px);
}

.auth-header {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
}

.auth-header h1 {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.auth-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.11);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.auth-footer {
  margin-top: 1.2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-footer a {
  color: var(--primary-dark);
  font-weight: 800;
}

.auth-note-card {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.78);
}

@media (max-width: 719px) {
  nav[style*="position: sticky"][style*="z-index: 100"] {
    background: rgba(247, 248, 243, 0.92) !important;
    backdrop-filter: blur(16px);
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] {
    padding: 0.75rem 0.8rem !important;
    height: auto !important;
    min-height: 64px !important;
    gap: 0.65rem !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] > a {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] > a span:last-child {
    display: block;
    max-width: 8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] > div[style*="gap: 0.25rem"][style*="flex: 1"] {
    display: none !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] > div[style*="gap: 0.75rem"] {
    margin-left: auto !important;
    gap: 0.45rem !important;
    min-width: 0 !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] > div[style*="gap: 0.75rem"] > span {
    display: inline-block !important;
    max-width: 24vw !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.78rem !important;
    color: var(--muted) !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] > div[style*="gap: 0.75rem"] > button {
    display: none !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="height: 60px"] > button[style*="font-size: 1.25rem"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    margin-left: 0 !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.78) !important;
    color: var(--ink) !important;
    flex-shrink: 0 !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="border-top: 1px solid"] {
    padding: 0 0.8rem 0.85rem !important;
    gap: 0.45rem !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="border-top: 1px solid"] > a,
  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="border-top: 1px solid"] > button {
    border: 1px solid rgba(255, 255, 255, 0.86) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.82) !important;
    color: var(--ink) !important;
    padding: 0.85rem 0.9rem !important;
  }

  nav[style*="position: sticky"][style*="z-index: 100"] > div[style*="border-top: 1px solid"] > button {
    color: var(--danger) !important;
  }

  .container {
    padding: 0 0.8rem;
  }

  .app-main {
    padding: 0.9rem 0 6.75rem;
  }

  .nav-row {
    min-height: 64px;
    gap: 0.65rem;
  }

  .brand-mark {
    flex: 1 1 auto;
  }

  .brand-mark small {
    display: none;
  }

  .brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .nav-meta {
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .user-chip {
    padding: 0.38rem 0.65rem;
    max-width: 40vw;
  }

  .nav-sheet {
    padding: 0 0.8rem 0.85rem;
  }

  .sheet-link {
    padding: 0.85rem 0.9rem;
  }

  .mobile-dock {
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.6rem;
    gap: 0.4rem;
    padding: 0.45rem;
    border-radius: 20px;
  }

  .dock-link {
    min-height: 52px;
    font-size: 0.68rem;
  }

  .dock-link span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card {
    padding: 0.95rem;
    border-radius: 18px;
  }

  .page-header {
    gap: 0.25rem;
  }

  .page-header h1 {
    font-size: clamp(1.3rem, 7vw, 1.7rem);
  }

  .page-header p {
    font-size: 0.88rem;
  }

  .page-header[style*="display: flex"] {
    display: grid !important;
    gap: 0.85rem !important;
  }

  .page-header[style*="display: flex"] > * {
    min-width: 0;
  }

  .btn,
  .btn-lg {
    width: 100%;
  }

  .camera-container {
    max-width: 100%;
    aspect-ratio: 3 / 4;
  }

  .photo-preview {
    max-width: 100%;
  }

  .modal-overlay {
    padding: 0.6rem;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    padding: 1rem;
  }

  .pagination {
    gap: 0.4rem;
  }

  .page-btn {
    flex: 1 1 42px;
    min-width: 0;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap table {
    border-collapse: separate;
  }

  .table-wrap tbody {
    display: grid;
    gap: 0.8rem;
  }

  .table-wrap tr {
    padding: 0.9rem;
    border: 1px solid rgba(23, 32, 51, 0.08);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.94);
    box-shadow: var(--shadow-sm);
  }

  .table-wrap td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid rgba(23, 32, 51, 0.06);
    min-width: 0;
  }

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

  .table-wrap td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .table-wrap td > * {
    min-width: 0;
  }

  .table-wrap td img {
    width: 84px !important;
    height: 84px !important;
    max-width: none;
  }

  .table-wrap td [style*="display: flex"] {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .table-wrap td .btn {
    width: auto;
    min-height: 36px;
    padding: 0.55rem 0.75rem;
  }

  .table-wrap td .badge {
    margin-left: auto;
  }

  [style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"],
  [style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"],
  .modal [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .modal [style*="grid-column: 1/-1"] {
    grid-column: auto !important;
  }

  .card[style*="display: flex"][style*="flex-wrap: wrap"] {
    flex-direction: column;
    align-items: stretch;
  }

  .card[style*="display: flex"][style*="flex-wrap: wrap"] > * {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  [style*="display: flex"][style*="justify-content: space-between"][style*="font-size: 0.875rem"] {
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: flex-start !important;
  }

  [style*="display: flex"][style*="gap: 1rem"][style*="flex-wrap: wrap"] > * {
    flex: 1 1 100%;
    min-width: 0 !important;
  }

  [style*="display: flex"][style*="gap: 0.75rem"][style*="justify-content: center"],
  [style*="display: flex"][style*="gap: 0.75rem"][style*="justify-content: flex-end"] {
    flex-direction: column;
  }

  [style*="max-width: 200"][style*="white-space: nowrap"] {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: break-word;
  }
}

@media (min-width: 720px) {
  table {
    min-width: 680px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .container {
    padding: 0 1.25rem;
  }

  .app-main {
    padding: 1.6rem 0 2rem;
  }

  .nav-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 1.25rem;
  }

  .desktop-only {
    display: inline-flex;
  }

  .mobile-only,
  .mobile-dock {
    display: none;
  }

  .card {
    padding: 1.35rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
