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

:root {
  --bg: #f5f3ff;
  --bg-alt: #ede9fe;
  --text: #171023;
  --muted: #5a5272;
  --accent: #7c3aed;
  --accent-dark: #6d28d9;
  --border: #ddd6fe;
  --card: #ffffff;
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 14px 36px rgba(76, 29, 149, 0.12);

  /* Responsive spacing tokens */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;

  /* Touch target minimum (44px recommended) */
  --touch-min: 44px;

  /* Container padding - mobile default */
  --container-padding: 0.75rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #faf5ff 0%, var(--bg) 45%, var(--bg-alt) 100%);
  color: var(--text);
  font-size: 0.9rem;
}

@media (min-width: 480px) {
  body {
    font-size: 1rem;
  }
  :root {
    --container-padding: 1rem;
  }
}

@media (min-width: 768px) {
  :root {
    --container-padding: 1.5rem;
  }
}

.container {
  max-width: 960px;
  margin: var(--space-md) auto;
  padding: 0 var(--container-padding) var(--space-xl);
}

@media (min-width: 768px) {
  .container {
    margin: 2rem auto;
    padding: 0 var(--container-padding) 3rem;
  }
}

/* Header - Mobile First */
.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--container-padding);
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: relative;
}

.brand {
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

@media (min-width: 540px) {
  .brand-emoji {
    display: none;
  }
}

.header-mascot {
  width: 48px;
  height: 60px;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.header-mascot svg {
  width: 100%;
  height: 100%;
  display: block;
}

.header-mascot svg [fill="#333333"] {
  fill: #f5f3ee;
}

.header-mascot svg [fill="#4D4D4D"] {
  fill: #d9d3c8;
}

.header-mascot svg [fill="#232323"] {
  fill: #a59b8c;
}

.header-mascot svg [fill="#1E1E1E"] {
  fill: #3a332c;
}

.header-mascot svg {
  filter: drop-shadow(0 2px 6px rgba(76, 29, 149, 0.18));
}

.header-mascot #cauda path {
  fill: #8f8576;
}


.header-mascot #cauda {
  animation: cat-tail 4.5s linear infinite;
  transform-origin: right bottom;
  transform-box: fill-box;
}

@keyframes cat-tail {
  0% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(30deg);
  }
  100% {
    transform: rotate(-10deg);
  }
}

@media (min-width: 540px) {
  .header-mascot {
    display: inline-flex;
  }
}

/* Header alerts - toujours visible */
.header-alerts {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  justify-content: flex-end;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #5b21b6;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.2);
  white-space: nowrap;
  text-decoration: none;
}

.header-pill:hover {
  filter: brightness(0.97);
}

.header-pill.danger {
  color: #b91c1c;
  background: #fee2e2;
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
}

.header-pill.muted {
  color: #6b7280;
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
}

.header-pill.danger.subtle {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
  box-shadow: none;
}

/* Hamburger toggle - mobile only */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 10px 18px rgba(124, 58, 237, 0.2);
  font-size: 1.2rem;
  color: var(--text);
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.nav-toggle:hover {
  background: rgba(124, 58, 237, 0.08);
  transform: translateY(-1px);
}

.nav-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 22px rgba(124, 58, 237, 0.35);
}

/* Nav container - mobile: hidden by default */
.app-header nav {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  order: 10;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  margin-top: var(--space-sm);
}

.app-header nav.is-open {
  display: flex;
}

.app-header nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--touch-min);
  padding: var(--space-md) var(--space-lg);
  color: #4c1d95;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.06);
  transition: background 0.15s ease, color 0.15s ease;
}

.app-header nav a:hover,
.app-header nav a:active {
  background: rgba(124, 58, 237, 0.15);
  color: #5b21b6;
}

/* Admin pill & logout - dans nav sur mobile */
.app-header > .admin-pill,
.app-header > form:not(.header-form) {
  display: none;
}

.app-header nav .admin-pill,
.app-header nav form {
  width: 100%;
}

.app-header nav .link-button {
  width: 100%;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767px) {
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.18);
    backdrop-filter: blur(2px);
    z-index: 5;
  }

  .app-header {
    z-index: 10;
  }

  .app-header nav {
    position: absolute;
    right: var(--container-padding);
    top: calc(100% + 0.6rem);
    padding: 0.6rem;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f3efff 100%);
    box-shadow: 0 20px 40px rgba(30, 27, 75, 0.18);
    backdrop-filter: blur(10px);
    margin-top: 0;
    border-top: none;
    gap: 0.55rem;
    width: min(340px, calc(100vw - (var(--container-padding) * 2)));
  }

  .app-header nav.is-open {
    display: grid;
    animation: nav-pop 0.18s ease-out both;
  }

  @keyframes nav-pop {
    from {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .app-header nav a,
  .app-header nav .admin-pill,
  .app-header nav .link-button {
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.04), rgba(99, 102, 241, 0.02));
    border: 1px solid rgba(124, 58, 237, 0.18);
    box-shadow: 0 8px 18px rgba(30, 27, 75, 0.12);
    color: #3b0764;
    font-weight: 600;
    text-decoration: none;
    justify-content: space-between;
  }

  .app-header nav a:hover,
  .app-header nav .admin-pill:hover,
  .app-header nav .link-button:hover {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.08), rgba(99, 102, 241, 0.05));
  }

  .app-header nav .admin-pill,
  .app-header nav .link-button {
    background-image: none;
    box-shadow: 0 6px 14px rgba(30, 27, 75, 0.12);
  }
}

/* Desktop: 768px+ */
@media (min-width: 768px) {
  .app-header {
    flex-wrap: nowrap;
    padding: var(--space-lg) var(--space-xl);
    gap: var(--space-lg);
  }

  .brand {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: none;
  }

  .app-header nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    width: auto;
    order: 0;
    padding-top: 0;
    border-top: none;
    margin-top: 0;
  }

  .app-header nav a {
    flex: 0 0 auto;
    min-height: auto;
    padding: 0.35rem 0.6rem;
    background: transparent;
    margin-right: 0.5rem;
  }

  .header-alerts {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .header-pill {
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
  }

  .app-header > .admin-pill,
  .app-header > form:not(.header-form) {
    display: block;
  }

  .app-header nav .admin-pill,
  .app-header nav form {
    display: none;
  }
}

/* Page header - Mobile first */
.page-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.page-header .button {
  width: 100%;
}

.page-header .add-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.page-header .add-button .btn-icon {
  display: none;
  font-size: 1.4rem;
  line-height: 1;
}

@media (max-width: 479px) {
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .page-header h1 {
    font-size: 1.4rem;
    line-height: 1.2;
    margin-right: 0.5rem;
  }

  .page-header-title h1 {
    font-size: 1.4rem;
    line-height: 1.2;
  }

  .page-header .add-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    align-self: center;
    justify-content: center;
  }

  .page-header .add-button .btn-label {
    display: none;
  }

  .page-header .add-button .btn-icon {
    display: inline-block;
  }
}

.page-header-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@media (min-width: 480px) {
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
  }

  .page-header .button {
    width: auto;
  }
}

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

/* Cards grid - Mobile first */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 540px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
  }
}

/* Animal card - Mobile first */
.animal-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7f5ff 100%);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 10px 25px rgba(76, 29, 149, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (min-width: 480px) {
  .animal-card {
    padding: 1.4rem 1.6rem;
  }
}

.animal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(76, 29, 149, 0.12);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.animal-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  flex: 1;
}

.animal-title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.animal-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.animal-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #5b21b6;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.18);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.animal-edit:hover {
  background: rgba(124, 58, 237, 0.14);
  transform: translateY(-1px);
}

.animal-edit svg {
  width: 16px;
  height: 16px;
  display: block;
}

.animal-avatar {
  width: 104px;
  height: 104px;
  border-radius: 18px;
  object-fit: cover;
  display: block;
  margin-bottom: 0;
  border: 1px solid rgba(109, 40, 217, 0.25);
  box-shadow: 0 8px 18px rgba(109, 40, 217, 0.18);
}

@media (min-width: 480px) {
  .animal-avatar {
    width: 124px;
    height: 124px;
    border-radius: 22px;
  }
}

.animal-card-body {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-lg);
  align-items: center;
  width: 100%;
}

.animal-meta {
  min-width: 0;
  line-height: 1.45;
}

@media (min-width: 720px) {
  .animal-card-header {
    gap: var(--space-md);
  }

  .animal-card-body {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

.photo-block img {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(109, 40, 217, 0.2);
  box-shadow: var(--shadow);
}

.photo-block.is-small img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
}

.photo-cropper {
  margin-top: 0.75rem;
  max-width: 360px;
}

#photo-preview {
  width: 100%;
  max-height: 320px;
  display: none;
  border-radius: 12px;
  border: 1px solid rgba(109, 40, 217, 0.2);
}

.photo-cropper .cropper-container {
  max-width: 360px;
}

.file-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px dashed rgba(109, 40, 217, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.file-input input[type="file"] {
  position: absolute;
  left: -9999px;
}

.file-button {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}

.file-name {
  color: var(--muted);
  font-size: 0.9rem;
}

.animal-card h3 {
  margin: 0 0 0.25rem;
}

.animal-card h3 a {
  color: var(--accent-dark);
  text-decoration: none;
}

.animal-card .button {
  color: #ffffff;
}

/* Card actions - Mobile first */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: 0;
}

@media (max-width: 479px) {
  .card-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .card-actions .button {
    width: auto;
    flex: 1 1 48%;
  }
}

.card-actions .button {
  width: 100%;
  min-height: var(--touch-min);
}

@media (min-width: 480px) {
  .card-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .card-actions .button {
    width: auto;
    min-height: auto;
  }
}

@media (min-width: 720px) {
  .card-actions {
    margin-top: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

.admin-pill {
  border: 1px solid rgba(109, 40, 217, 0.2);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.modal-wide {
  max-width: 860px;
}

.admin-panel-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 2fr);
  gap: 1.5rem;
}

.admin-user-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.admin-users-list {
  width: 100%;
}

.full-width {
  width: 100%;
}

@media (max-width: 720px) {
  .admin-panel-grid {
    grid-template-columns: 1fr;
  }
}

/* Form grid - Mobile first */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (min-width: 480px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-lg);
  }
}

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

.table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.9rem 0.8rem;
  border-bottom: 1px solid rgba(124, 58, 237, 0.18);
}

.data-table tbody td {
  padding: 1rem 0.8rem;
  border-bottom: 1px solid rgba(124, 58, 237, 0.12);
}

.data-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.05);
}

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

.data-table .table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #5b21b6;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease;
}

.data-table .table-action:hover {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  border-color: transparent;
}

.data-table .table-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #5b21b6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease;
}

/* Foods actions menu - shared (desktop + mobile) */
.foods-table {
  overflow: visible;
}

.foods-table .action-menu {
  position: relative;
}

.foods-table .action-menu summary {
  list-style: none;
  cursor: pointer;
}

.foods-table .action-menu summary::-webkit-details-marker {
  display: none;
}

.foods-table .menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 0;
  background: #ffffff;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(30, 27, 75, 0.16);
  padding: 0.35rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.foods-table .menu-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: #3b0764;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  background-image: none;
  border: none;
  box-shadow: none;
  min-height: auto;
  text-align: left;
  cursor: pointer;
  line-height: 1.1;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.foods-table .menu-item:hover {
  background: rgba(124, 58, 237, 0.08);
}

.foods-table .menu-item + .menu-item {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.foods-table .menu-item.icon-only {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  line-height: 0;
  font-size: 0.95rem;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.16);
  color: #4c1d95;
  box-sizing: border-box;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.foods-table .menu-item.icon-only:hover {
  background: rgba(124, 58, 237, 0.14);
}

.foods-table .menu-item.icon-only.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.foods-table .menu-item.icon-only.danger:hover {
  background: rgba(239, 68, 68, 0.14);
}

.foods-table .menu-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.foods-table .menu-icon.edit-icon {
  transform: scale(1.08);
  transform-origin: center;
}

.reminders-table .table-icon {
  background: #ffffff;
  border-color: rgba(124, 58, 237, 0.35);
  color: #5b21b6;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.12);
}

.reminders-table .table-icon:hover {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(124, 58, 237, 0.22);
}

.foods-table .action-cell {
  width: 1%;
  white-space: nowrap;
}

.reminders-table {
  table-layout: fixed;
  width: 100%;
}

.reminders-table th,
.reminders-table td {
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

@media (min-width: 701px) {
  .reminders-table th:nth-child(1),
  .reminders-table td:nth-child(1) {
    width: 35%;
  }

  .reminders-table th:nth-child(2),
  .reminders-table td:nth-child(2) {
    width: 20%;
  }

  .reminders-table th:nth-child(3),
  .reminders-table td:nth-child(3) {
    width: 25%;
  }

  .reminders-table th:nth-child(4),
  .reminders-table td:nth-child(4) {
    width: 20%;
  }
}

.data-table .table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.data-table .table-icon.ghost {
  background: transparent;
  border: 1px dashed rgba(124, 58, 237, 0.25);
  color: #6d28d9;
}

.data-table .table-icon.ghost:hover {
  background: rgba(124, 58, 237, 0.1);
  color: #5b21b6;
  border-color: rgba(124, 58, 237, 0.4);
}

.recurrence-edit {
  color: #5b21b6;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  position: relative;
}

.recurrence-edit::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: rgba(124, 58, 237, 0.25);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.15s ease;
}

.recurrence-edit:hover::after {
  transform: scaleX(1);
}

.data-table .table-icon:hover {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  border-color: transparent;
}

.data-table .table-icon.done {
  opacity: 0.5;
  cursor: default;
  background: rgba(124, 58, 237, 0.08);
}

.data-table .table-icon.done:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #5b21b6;
  border-color: rgba(124, 58, 237, 0.25);
}

.data-table .table-divider td {
  padding-top: 1.1rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(91, 33, 182, 0.7);
  border-top: 1px dashed rgba(124, 58, 237, 0.2);
}

.data-table tr.is-completed {
  background: rgba(124, 58, 237, 0.03);
}

.data-table tr.is-completed td {
  color: #9ca3af;
}

.completed-text {
  text-decoration: line-through;
  color: #9ca3af;
}

.badge {
  background: #7c3aed;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  margin-left: 0.4rem;
  line-height: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.4rem;
  width: fit-content;
}

.status-badge.overdue {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.count-pill {
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: #5b21b6;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
}

/* Reminder bar - Mobile first */
.reminder-bar {
  background: #ffffff;
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  padding: var(--space-md);
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.08);
}

@media (min-width: 480px) {
  .reminder-bar {
    border-radius: 16px;
    padding: var(--space-lg) 1.4rem;
  }
}

.reminder-bar-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 480px) {
  .reminder-bar-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
  }
}

.reminder-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.reminder-chip {
  background: rgba(124, 58, 237, 0.12);
  color: #5b21b6;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-weight: 600;
  font-size: 0.8rem;
}

@media (min-width: 480px) {
  .reminder-chip-list {
    gap: var(--space-sm);
  }

  .reminder-chip {
    padding: 0.35rem 0.85rem;
    font-size: 0.9rem;
  }
}

.nested-table {
  margin-top: 0.75rem;
  background: rgba(124, 58, 237, 0.05);
  border-radius: 12px;
  padding: 0.4rem 1rem;
  box-shadow: none;
}

.recap-accordion {
  display: grid;
  gap: 1rem;
}

.recap-item {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.12);
  padding: 0;
}

.recap-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.2rem 1.4rem;
}

.recap-item summary::-webkit-details-marker {
  display: none;
}

.recap-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1.5rem;
  align-items: center;
  font-weight: 600;
}

.recap-day {
  font-size: 1rem;
}

.recap-kcal {
  font-size: 1rem;
}

.recap-target {
  color: var(--muted);
  font-size: 0.9rem;
}

.recap-item summary::after {
  content: "▾";
  color: #6d28d9;
  font-size: 0.9rem;
  margin-left: auto;
}

.recap-item[open] summary {
  background: #f1ebff;
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.recap-item[open] summary::after {
  content: "▴";
}

.recap-panel {
  padding: 1rem 1.4rem 1.4rem;
}

.recap-detail-title {
  font-weight: 700;
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .recap-summary {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

.nested-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.nested-table tbody tr {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.nested-table td,
.nested-table th {
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
  padding: 1.1rem 0;
}

.log-table th,
.log-table td {
  padding: 1rem 0.8rem;
}

.log-table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.log-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.05);
}

/* Log cards - Mobile first */
.log-cards {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.log-card {
  background: #ffffff;
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 12px;
  padding: var(--space-md);
  display: grid;
  gap: var(--space-xs);
}

@media (min-width: 480px) {
  .log-card {
    padding: var(--space-lg) 1.1rem;
    gap: var(--space-sm);
    border-radius: 14px;
  }
}

.log-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
}

.log-time {
  color: #4c1d95;
  font-size: 0.9rem;
}

.log-food {
  flex: 1;
  text-align: right;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-metrics {
  display: flex;
  gap: var(--space-sm);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 480px) {
  .log-metrics {
    gap: var(--space-lg);
    font-size: 0.95rem;
  }
}

.chip-delete {
  background: #fee2e2;
  color: #991b1b;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.chip-delete:hover {
  background: #fecaca;
}

.button-danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.25);
}

.button-danger:hover {
  background: #dc2626;
}

/* Modals - Mobile first */
.modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-height: 100vh;
  max-height: 100dvh;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: var(--space-lg);
  min-width: auto;
  width: calc(100vw - 2rem);
  max-width: 90vw;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

@media (min-width: 480px) {
  .modal-card {
    width: auto;
    min-width: 320px;
    padding: 1.4rem 1.6rem;
  }
}

.modal-card h3 {
  margin: 0 0 var(--space-sm);
  font-size: 1.1rem;
}

.modal-actions {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 480px) {
  .modal-actions {
    flex-direction: row;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
}

/* Table/Card switching - Mobile */
@media (max-width: 700px) {
  .log-table {
    display: none;
  }

  .log-cards {
    display: flex;
  }

  .reminders-table thead {
    display: none;
  }

  .reminders-table,
  .reminders-table tbody {
    display: block;
    width: 100%;
  }

  .reminders-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title   title"
      "date    actions"
      "recur   actions";
    gap: 0.3rem 0.5rem;
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 16px;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.7rem;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.08);
  }

  .reminders-table tr.is-completed {
    background: rgba(124, 58, 237, 0.03);
    border-color: rgba(124, 58, 237, 0.08);
  }

  .reminders-table td {
    display: block;
    padding: 0;
    border: none;
    font-size: 0.9rem;
    width: auto;
  }

  /* Hide data-label pseudo-elements */
  .reminders-table td::before {
    display: none;
  }

  /* Title cell - full width */
  .reminders-table td[data-label="Titre"] {
    grid-area: title;
    margin: 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    margin-bottom: 0.1rem;
  }

  .reminders-table td[data-label="Titre"] strong {
    font-size: 1.05rem;
    display: block;
    line-height: 1.3;
  }

  /* Date - left half, row 2 */
  .reminders-table td[data-label="Prochain rappel"] {
    grid-area: date;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    background: rgba(124, 58, 237, 0.08);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #5b21b6;
    white-space: nowrap;
  }

  /* Recurrence - left half, row 3 */
  .reminders-table td[data-label="Récurrence"] {
    grid-area: recur;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    background: rgba(124, 58, 237, 0.08);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #5b21b6;
    white-space: nowrap;
  }

  .reminders-table td[data-label="Récurrence"] .recurrence-edit {
    font-size: 0.78rem;
  }

  /* Actions - right half, spanning rows 2-3, centered */
  .reminders-table .action-cell {
    grid-area: actions;
    padding: 0;
    border-top: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .reminders-table .table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
  }

  /* Touch targets for table icons on mobile */
  .reminders-table .table-icon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .reminders-table .status-badge {
    margin-top: 0.3rem;
  }

  /* Divider row */
  .reminders-table tr.table-divider {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.6rem 0 0.35rem;
    margin-top: 0.4rem;
  }

  .reminders-table tr.table-divider td {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: rgba(91, 33, 182, 0.7);
    font-weight: 600;
  }

  /* Foods table - mobile card layout */
  .foods-table thead {
    display: none;
  }

  .foods-table,
  .foods-table tbody {
    display: block;
    width: 100%;
  }

  .foods-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 16px;
    padding: 0.9rem 3.4rem 0.85rem 0.95rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.08);
    overflow: visible;
    position: relative;
  }

  .foods-table td {
    display: block;
    padding: 0;
    border: none;
    font-size: 0.9rem;
    width: auto;
  }

  .foods-table td::before {
    display: none;
  }

  /* Name - full width, forces its own line */
  .foods-table td[data-label="Nom"] {
    flex-basis: 100%;
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
    margin-bottom: 0.05rem;
  }

  /* Brand, type, kcal as inline pills */
  .foods-table td[data-label="Marque"],
  .foods-table td[data-label="Type"],
  .foods-table td[data-label="kcal/g"] {
    display: inline-flex;
    align-items: center;
    background: rgba(124, 58, 237, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #5b21b6;
    white-space: nowrap;
  }

  /* Action button - pushed to the right */
  .foods-table .action-cell {
    margin-left: 0;
    padding: 0;
    border-top: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 1rem;
    right: 1rem;
  }

  .foods-table .table-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    font-size: 0.9rem;
  }

  .foods-table .table-icon.menu {
    width: 30px;
    height: 30px;
    font-size: 1.15rem;
    line-height: 1;
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.18);
  }

  .foods-table .action-menu {
    position: relative;
  }

  .foods-table .action-menu summary {
    list-style: none;
    cursor: pointer;
  }

  .foods-table .action-menu summary::-webkit-details-marker {
    display: none;
  }

  .foods-table .menu-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 0;
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(30, 27, 75, 0.16);
    padding: 0.35rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    z-index: 2;
    backdrop-filter: blur(4px);
  }

  .foods-table .menu-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    color: #3b0764;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    background: transparent;
    background-image: none;
    border: none;
    box-shadow: none;
    min-height: auto;
    text-align: left;
    cursor: pointer;
    line-height: 1.1;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
  }

  .foods-table .menu-item:hover {
    background: rgba(124, 58, 237, 0.08);
  }

  .foods-table .menu-item + .menu-item {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
  }

  .foods-table .menu-item.icon-only {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    line-height: 0;
    font-size: 0.95rem;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.16);
    color: #4c1d95;
    box-sizing: border-box;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
  }

  .foods-table .menu-item.icon-only:hover {
    background: rgba(124, 58, 237, 0.14);
  }

  .foods-table .menu-item.icon-only.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
  }

  .foods-table .menu-item.icon-only.danger:hover {
    background: rgba(239, 68, 68, 0.14);
  }

  .foods-table .menu-icon {
    width: 18px;
    height: 18px;
    display: block;
  }

  .foods-table .menu-icon.edit-icon {
    transform: scale(1.08);
    transform-origin: center;
  }

  .foods-table .menu-item.danger {
    color: #b91c1c;
  }

  .foods-table .menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
  }
}

@media (min-width: 701px) {
  .log-table {
    display: table;
  }

  .log-cards {
    display: none;
  }
}

/* Nested table in recap - mobile optimization */
@media (max-width: 700px) {
  .nested-table {
    display: block;
    padding: 0;
    background: transparent;
  }

  .nested-table thead {
    display: none;
  }

  .nested-table tbody,
  .nested-table tr {
    display: block;
  }

  .nested-table tr {
    background: rgba(124, 58, 237, 0.04);
    border-radius: 10px;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-md);
  }

  .nested-table td {
    display: inline;
    padding: 0;
    border: none;
    font-size: 0.85rem;
  }

  .nested-table td:first-child {
    font-weight: 600;
    color: #4c1d95;
  }

  .nested-table td:nth-child(2) {
    flex: 1;
    min-width: 80px;
  }

  .nested-table td:nth-child(3),
  .nested-table td:nth-child(4) {
    background: rgba(124, 58, 237, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #5b21b6;
    font-weight: 600;
  }

  .recap-item summary {
    padding: var(--space-md);
  }

  .recap-panel {
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }

  .recap-detail-title {
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
  }
}

/* Eligibility table - mobile card view */
.eligibility-cards {
  display: none;
}

@media (max-width: 600px) {
  .eligibility-table {
    display: none;
  }

  .eligibility-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .eligibility-card {
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 12px;
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }

  .eligibility-card.is-disabled {
    opacity: 0.5;
    background: rgba(124, 58, 237, 0.02);
  }

  .eligibility-card-info {
    flex: 1;
    min-width: 0;
  }

  .eligibility-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
  }

  .eligibility-card-meta {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
  }

  .eligibility-chip {
    background: rgba(124, 58, 237, 0.08);
    color: #5b21b6;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
  }

  .eligibility-toggle {
    flex-shrink: 0;
  }

  .eligibility-toggle input[type="checkbox"] {
    width: 44px;
    height: 44px;
    margin: 0;
  }
}

@media (min-width: 601px) {
  .eligibility-table {
    display: table;
  }
}

/* Nested table - proper table display on desktop */
@media (min-width: 701px) {
  .nested-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
  }

  .nested-table thead {
    display: table-header-group;
  }

  .nested-table tbody {
    display: table-row-group;
  }

  .nested-table tr {
    display: table-row;
  }

  .nested-table th,
  .nested-table td {
    display: table-cell;
  }
}

.actions a {
  margin-right: 0.75rem;
}

.actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Buttons - Mobile first with touch targets */
button,
.button {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 18px rgba(124, 58, 237, 0.25);
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:active,
.button:active {
  transform: scale(0.98);
}

@media (min-width: 768px) {
  button,
  .button {
    padding: 0.6rem 1.1rem;
    min-height: auto;
  }
}

.button.secondary {
  background: #f3e8ff;
  color: #5b21b6;
  border: 1px solid #d8b4fe;
}

button:hover,
.button:hover {
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
}

.button.secondary:hover {
  color: #ffffff;
}

.button:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

/* Link button - Mobile first */
.link-button {
  background: transparent;
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #5b21b6;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.15s ease;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.link-button.danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0;
}

@media (min-width: 768px) {
  .link-button {
    padding: 0.35rem 0.9rem;
    min-height: auto;
  }

  .link-button.danger {
    width: 32px;
    height: 32px;
    min-width: auto;
    min-height: auto;
  }
}

.link-button.danger:hover {
  background: #fee2e2;
  color: #991b1b;
  border-color: transparent;
}

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

.overdue-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.4rem;
}

.overdue-list li {
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

.link-button:hover {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  border-color: transparent;
}

.modal-form {
  width: min(720px, 92vw);
}

/* Form labels */
label {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: 0.875rem;
}

/* Form inputs - Mobile first with touch targets */
input,
select,
textarea {
  padding: 0.75rem 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem; /* 16px prevents iOS zoom */
  width: 100%;
  min-height: var(--touch-min);
}

textarea {
  min-height: 100px;
}

@media (min-width: 768px) {
  input,
  select,
  textarea {
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
    min-height: auto;
  }

  textarea {
    min-height: 120px;
  }
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.estimate {
  margin: 1rem 0;
}

.estimate-status {
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.estimate-status.ok {
  border-color: var(--success);
}

.estimate-status.warning {
  border-color: var(--warning);
}

.estimate-status.exceeds {
  border-color: var(--danger);
}

.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-page {
  background: radial-gradient(circle at top, #ffffff 0%, #f4edff 45%, #efe7ff 100%);
}

.login-card {
  background: var(--card);
  padding: 2.4rem;
  border-radius: 18px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  width: min(420px, 92vw);
  box-shadow: 0 18px 40px rgba(76, 29, 149, 0.15);
}

.login-brand {
  font-weight: 700;
  color: #5b21b6;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.login-card h1 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
}

.login-subtitle {
  margin: 0 0 1.6rem;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form .button {
  width: 100%;
  margin-top: 0.3rem;
}

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

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

/* Mobile: hide reminder bar by default (header shows count) */
@media (max-width: 600px) {
  .reminder-bar {
    display: none;
  }
}
