/* ==========================================================================
   WHERE - Mobiloptimerad Klädinventering
   Google Material Design 3 (Material You) Designsystem
   ========================================================================== */

:root {
  color-scheme: light;

  /* MD3 Färgpalett (Google Material You - Varm Sand / Desert Tonal) */
  --md-sys-color-primary: #755b3b;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ebdcc4; /* Ljus varm sand för knappar & FAB */
  --md-sys-color-on-primary-container: #291800;

  --md-sys-color-secondary: #655d51;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #ede1d1; /* Ljus sand för aktiva val och nav */
  --md-sys-color-on-secondary-container: #201a11;

  --md-sys-color-tertiary: #54634f;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #d7e8cf;
  --md-sys-color-on-tertiary-container: #121f10;

  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;

  /* M3 Tonal Surface System (Varma sandtonade ytor) */
  --md-sys-color-surface: #fbf8f5;
  --md-sys-color-on-surface: #1e1b16;
  --md-sys-color-surface-dim: #dfd9d2;
  --md-sys-color-surface-bright: #fbf8f5;

  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f6f2ec;
  --md-sys-color-surface-container: #f0ebe4;
  --md-sys-color-surface-container-high: #eae5de;
  --md-sys-color-surface-container-highest: #e4dfd8;

  --md-sys-color-on-surface-variant: #4b453d;
  --md-sys-color-outline: #7c756b;
  --md-sys-color-outline-variant: #cdc4b8;

  /* Semantiska statusfärger (Varma M3 Tonal containers) */
  --status-active-bg: #d4ebd6;
  --status-active-fg: #135324;
  --status-grow-bg: #e0f2fe;   /* Fräsch himmelsblå för plagg att växa i */
  --status-grow-fg: #0369a1;
  --status-save-bg: #faedd9;  /* Varm sand-bärnsten istället för kallt ljusblå */
  --status-save-fg: #614000;
  --status-sell-bg: #fde8bc;
  --status-sell-fg: #5d3d00;
  --status-donate-bg: #ece0f5;
  --status-donate-fg: #542b7d;
  --status-lost-bg: #fee2e2;   /* Varning/rödton för borttappad */
  --status-lost-fg: #991b1b;

  /* M3 Elevation Shadows (Dubbla fjädrande skuggor) */
  --elevation-0: none;
  --elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.20);
  --elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.20);
  --elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.12), 0 1px 3px 0 rgba(0, 0, 0, 0.20);
  --elevation-4: 0 6px 10px 4px rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.20);

  /* Form & Hörnradier (M3 spec) */
  --radius-xs: 4px;
  --radius-sm: 8px;      /* M3 Chips, Badges & Text Fields */
  --radius-md: 12px;     /* M3 Medium containers */
  --radius-lg: 16px;     /* M3 Cards & FAB */
  --radius-xl: 28px;     /* M3 Dialogs, Bottom Sheets & Pills */
  --radius-full: 9999px; /* M3 Buttons & Search Bar */

  /* Typografi & Dimensioner */
  --font-family: "Roboto", "Google Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bottom-nav-height: 80px; /* Standard Google M3 Navigation Bar */
}

/* Basinställningar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
  line-height: 1.5;
  font-size: 15px;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}


/* Layout container */
.app-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

@media (min-width: 768px) {
  .app-container {
    padding: 24px 32px;
  }
}

/* ==========================================================================
   Google M3 Navigation Bar (Mobil & Desktop)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: var(--md-sys-color-surface-container);
  border-top: none;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding: 0 12px;
}

@media (min-width: 768px) {
  .bottom-nav {
    max-width: 480px;
    margin: 0 auto;
    bottom: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--elevation-2);
    border: none;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s ease;
  padding: 8px 0 6px;
  text-decoration: none;
  gap: 4px;
}

.bottom-nav-item .icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 32px;
  border-radius: 16px; /* M3 aktiv indikator-piller */
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1), color 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.bottom-nav-item.active {
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
}

.bottom-nav-item.active .icon-wrapper {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* Google M3 Floating Action Button (FAB: Flytande nere till höger) */
.m3-fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg); /* 16px M3 Squircle */
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--elevation-3);
  z-index: 95;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

/* M3 Extended FAB (Ikon + Text) */
.m3-fab-extended {
  width: auto;
  min-width: 56px;
  padding: 0 20px 0 16px;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}

.m3-fab-extended .m3-fab-label {
  line-height: 1;
  white-space: nowrap;
}

.m3-fab:hover {
  box-shadow: var(--elevation-4);
  transform: scale(1.04);
}

.m3-fab:active {
  transform: scale(0.96);
  box-shadow: var(--elevation-1);
}

@media (min-width: 1024px) {
  .m3-fab {
    right: calc(50vw - 560px + 24px);
  }
}

/* ==========================================================================
   Knappar (Material Design 3 Button Styles)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  white-space: nowrap;
  user-select: none;
  min-height: 40px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  font-weight: 600;
  box-shadow: var(--elevation-1);
}

.btn-primary:hover {
  background-color: #e0d0b5;
  box-shadow: var(--elevation-2);
}

.btn-tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 600;
}

.btn-tonal:hover {
  background-color: #e5d9c7;
}

.btn-outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}

.btn-outlined:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.btn-text {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  padding: 8px 12px;
}

.btn-text:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.btn-danger {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.btn-danger:hover {
  background-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Katalog / Plagg Rutnät
   ========================================================================== */
.catalog-header {
  margin-bottom: 16px;
}

/* M3 Search Bar (56px standardhöjd, pillerform med M3 skugga) */
.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: var(--md-sys-color-outline);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 56px;
  padding: 0 48px 0 52px;
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  box-shadow: var(--elevation-1);
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
              border-color 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.search-input:focus {
  background-color: var(--md-sys-color-surface-container-lowest);
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--elevation-2);
}

.search-input::placeholder {
  color: var(--md-sys-color-outline);
}

.search-clear {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--md-sys-color-outline);
  cursor: pointer;
  display: none;
  padding: 8px;
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

/* Horisontell filterlist med mjuk mobil-scroll */
.filter-scroll-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 6px;
  margin-bottom: 6px;
  flex-wrap: nowrap;
}

.filter-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

@media (min-width: 601px) {
  .filter-scroll-wrapper {
    overflow: visible;
    flex-wrap: wrap;
  }
}

/* Multi-select filter dropdown container */
.filter-dropdown {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

/* M3 Filter Chips (8px radie, inte piller) */
.filter-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm); /* 8px M3 */
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.2, 0, 0, 1);
  min-height: 36px;
}

.filter-chip-btn * {
  pointer-events: none;
}

.filter-chip-btn:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.filter-chip-btn.active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: var(--md-sys-color-secondary-container);
  font-weight: 600;
}

/* Räknare för valda filter (M3 badge) */
.filter-badge {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 6px;
  border-radius: var(--radius-xs); /* 4px M3 badge */
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Dropdown popover meny */
.filter-menu {
  display: none;
  background-color: var(--md-sys-color-surface-container-low);
  z-index: 100;
  padding: 8px 0 6px;
}

/* Desktop: Popover under chip-knappen */
@media (min-width: 601px) {
  .filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    min-width: 250px;
    max-width: 360px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-md);
    box-shadow: var(--elevation-3);
  }

  /* Placera sista rullgardinerna mot höger på desktop så de inte rinner utanför skärmen */
  .filter-dropdown:last-child .filter-menu,
  .filter-dropdown:nth-last-child(2) .filter-menu {
    left: auto;
    right: 0;
  }
}

/* Mobil-anpassning för filtermeny: M3 Bottom Sheet med drag-handtag */
@media (max-width: 600px) {
  .filter-menu,
  .filter-dropdown .filter-menu {
    position: fixed;
    top: auto;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    min-width: 0;
    max-width: none;
    width: 100%;
    max-height: calc(85vh - var(--bottom-nav-height));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--elevation-4);
    background-color: var(--md-sys-color-surface-container-low);
    border: none;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    z-index: 150;
    animation: m3FilterSheetUp 0.2s cubic-bezier(0.2, 0, 0, 1);
    padding: 8px 16px 16px;
  }

  /* M3 Drag Handle längst upp på Bottom Sheet */
  .filter-menu::before {
    content: "";
    display: block;
    width: 32px;
    height: 4px;
    background-color: var(--md-sys-color-outline-variant);
    border-radius: var(--radius-full);
    margin: 4px auto 12px;
  }

  @keyframes m3FilterSheetUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.filter-menu.open {
  display: flex;
  flex-direction: column;
}

.filter-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 14px 8px;
  border-bottom: 1px solid var(--md-sys-color-surface-container-high);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.filter-menu-list {
  max-height: min(480px, 60vh);
  overflow-y: auto;
  padding: 6px 0;
  overscroll-behavior: contain;
}

@media (max-width: 600px) {
  .filter-menu-list {
    max-height: min(520px, 65vh);
  }
}

/* Storleksfilter: 2 kolumner så alla storlekar ryms utan onödig scrollning */
.filter-dropdown[data-filter="size"] .filter-menu {
  min-width: 290px;
  max-width: 380px;
}

.filter-dropdown[data-filter="size"] .filter-menu-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 6px;
}

@media (max-width: 600px) {
  .filter-dropdown[data-filter="size"] .filter-menu {
    min-width: 0;
    max-width: none;
  }
}

.filter-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s ease;
  border-radius: var(--radius-xs);
}

.filter-menu-item:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.filter-menu-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--md-sys-color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-menu-footer {
  padding: 8px 12px 2px;
  border-top: 1px solid var(--md-sys-color-surface-container-high);
}

/* Aktiva filter-brickor (M3 Input Chips: 8px radie) */
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 12px;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm); /* 8px M3 */
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.active-filter-pill:hover {
  background-color: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-error);
}

.active-filter-pill .pill-remove {
  font-size: 0.75rem;
  font-weight: bold;
  opacity: 0.7;
}

.active-filter-pill:hover .pill-remove {
  opacity: 1;
  color: var(--md-sys-color-error);
}


.catalog-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  font-size: 0.9rem;
  color: var(--md-sys-color-outline);
  font-weight: 500;
}

/* Plaggrutnät */
.garment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 680px) {
  .garment-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .garment-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* Garment Card (Material Design 3 Elevated Card) */
.garment-card {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-lg); /* 16px M3 */
  overflow: hidden;
  box-shadow: var(--elevation-1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  text-decoration: none;
  color: inherit;
  border: none;
}

.garment-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
}

.garment-card:active {
  transform: scale(0.99);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--md-sys-color-surface-container);
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-high);
}

/* Storleksbadge i hörnet (Solid M3 badge, ingen iOS blur) */
.card-size-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: #1a1c1e;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: var(--radius-xs); /* 4px M3 badge */
  box-shadow: var(--elevation-1);
  letter-spacing: 0.02em;
}

/* Statusbadge i kortets bild (M3 Tonal containers) */
.card-status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs); /* 4px M3 badge */
  box-shadow: var(--elevation-1);
}

.status-i-bruk {
  background-color: var(--status-active-bg);
  color: var(--status-active-fg);
}

.status-vaxa-i,
.status-att-växa-i,
.status-att-vaxa-i {
  background-color: var(--status-grow-bg);
  color: var(--status-grow-fg);
}

.status-sparas {
  background-color: var(--status-save-bg);
  color: var(--status-save-fg);
}

.status-säljas {
  background-color: var(--status-sell-bg);
  color: var(--status-sell-fg);
}

.status-skänkas {
  background-color: var(--status-donate-bg);
  color: var(--status-donate-fg);
}

.status-borttappad {
  background-color: var(--status-lost-bg);
  color: var(--status-lost-fg);
}

/* Skick-badge nere till vänster i bild (Solid M3 surface badge) */
.card-condition-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  font-weight: 600;
  font-size: 0.70rem;
  padding: 2px 8px;
  border-radius: var(--radius-xs); /* 4px M3 badge */
  box-shadow: var(--elevation-1);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  max-width: calc(50% - 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Till salu-badge nere till höger i bild (M3 Tonal badge) */
.card-for-sale-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: #15803d;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.70rem;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  box-shadow: var(--elevation-1);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(50% - 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.card-content {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-brand {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--md-sys-color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--md-sys-color-on-surface);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-condition-row {
  margin-top: auto;
  padding-top: 6px;
}

.card-condition-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--md-sys-color-secondary);
}

.card-meta-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 6px;
  font-size: 0.78rem;
  color: var(--md-sys-color-outline);
}

.card-location-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-secondary);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Formulär & Enhetlig sidlayout
   ========================================================================== */
.page-container,
.form-container,
.form-card,
.settings-container {
  max-width: 720px;
  margin: 0 auto;
}

.form-card {
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.page-header,
.settings-header,
.form-header {
  margin-bottom: 20px;
  border-bottom: none;
  padding-bottom: 0;
}

.page-header h1,
.settings-header h1,
.form-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin: 0;
}

.page-header p,
.form-header p {
  font-size: 0.9rem;
  color: var(--md-sys-color-outline);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--md-sys-color-on-surface);
}

/* M3 Outlined Text Field */
.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-xs); /* 4px M3 text field */
  border: 1px solid var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.form-control:focus {
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding: 11px 15px;
}

/* Chip Väljare (M3 Choice Chips: 8px radie, inte piller) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-option {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.chip-option input[type="radio"],
.chip-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.chip-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm); /* 8px M3 Choice Chip */
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s cubic-bezier(0.2, 0, 0, 1);
  min-height: 40px;
}

.chip-option:hover .chip-box {
  background-color: var(--md-sys-color-surface-container-high);
}

.chip-option input:checked+.chip-box {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: var(--md-sys-color-primary);
  font-weight: 600;
  box-shadow: var(--elevation-1);
}

/* Speciella storlekschips (8px M3 radie) */
.size-chips .chip-box {
  min-width: 56px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* Grön statusprick för 'I bruk' */
.status-dot-green {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #16a34a;
  display: inline-block;
  flex-shrink: 0;
}

/* Plats-ikon-väljare */
.icon-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-chips-grid .chip-box {
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bildinmatning & Förhandsgranskning */
.photo-upload-zone {
  border: 2px dashed var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background-color: var(--md-sys-color-surface-container-lowest);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.photo-upload-zone:hover {
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container-low);
}

.photo-upload-zone .upload-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.preview-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--elevation-1);
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.preview-thumb.is-primary {
  border: 2.5px solid #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Stjärna för huvudbild uppe till vänster (Solid M3 overlay-knapp, utan blur) */
.preview-thumb .thumb-star-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: rgba(26, 28, 30, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 3;
}

.preview-thumb .thumb-star-btn:hover {
  background-color: rgba(0, 0, 0, 0.95);
  transform: scale(1.1);
  color: #fbbf24;
}

.preview-thumb .thumb-star-btn.is-active {
  background-color: #ffffff;
  color: #d97706;
  border-color: #f59e0b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.preview-thumb .thumb-star-btn.is-active:hover {
  transform: scale(1.1);
  background-color: #ffffff;
}

/* Soptunna för att ta bort bild uppe till höger (Solid M3 overlay-knapp, utan blur) */
.preview-thumb .thumb-trash-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: rgba(26, 28, 30, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 3;
}

.preview-thumb .thumb-trash-btn:hover {
  background-color: var(--md-sys-color-error);
  border-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  transform: scale(1.1);
}


/* Formulär Knappar Footer */
.form-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--md-sys-color-surface-container-high);
}

@media (min-width: 600px) {
  .form-actions-bar {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Detalj-vy (Garment Detail)
   ========================================================================== */
.detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.detail-gallery {
  position: relative;
  width: 100%;
  max-height: 460px;
  aspect-ratio: 4 / 3;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--elevation-2);
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumbs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 4px;
}

.gallery-thumb-btn {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
  flex-shrink: 0;
}

.gallery-thumb-btn.active {
  border-color: var(--md-sys-color-primary);
}

.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-card {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: none;
  box-shadow: var(--elevation-1);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-badges {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  box-shadow: var(--elevation-1);
  white-space: nowrap;
  text-decoration: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.detail-badge:hover {
  opacity: 0.92;
}

.detail-badge svg {
  display: block;
  flex-shrink: 0;
}

.detail-badge-sale {
  background-color: #15803d;
  color: #ffffff;
}

.detail-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 20px 0;
  padding: 16px 0 8px 0;
  border-top: 1px solid var(--md-sys-color-surface-container-high);
}

.spec-item .spec-label {
  font-size: 0.8rem;
  color: var(--md-sys-color-outline);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.spec-item .spec-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-top: 2px;
}

.spec-link {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--md-sys-color-outline-variant);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.spec-link:hover {
  color: var(--md-sys-color-on-primary-container);
  text-decoration-color: var(--md-sys-color-primary);
}

.detail-notes-card {
  margin: 16px 0;
  padding: 14px 16px;
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.detail-notes-label {
  font-size: 0.8rem;
  color: var(--md-sys-color-outline);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-notes-content {
  font-size: 0.95rem;
  color: var(--md-sys-color-on-surface);
  line-height: 1.55;
  white-space: pre-line;
  word-break: break-word;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ==========================================================================
   Förvaringsplatser (Lådor)
   ========================================================================== */
.locations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.location-item-card {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  border: none;
  box-shadow: var(--elevation-1);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}

.location-item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
}

.location-item-card .drag-handle {
  flex-shrink: 0;
  padding: 6px 4px;
}

.location-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.location-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.location-item-card:hover .location-icon-box {
  transform: scale(1.05);
}

.location-card-main {
  flex: 1;
  min-width: 0;
}

.location-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.location-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  line-height: 1.3;
}

.location-card-desc {
  font-size: 0.84rem;
  color: var(--md-sys-color-outline);
  margin-top: 2px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .location-card-desc {
    white-space: normal;
  }
}

.location-card-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.location-count-badge {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm); /* 8px M3 badge */
  text-decoration: none;
  white-space: nowrap;
}

.location-badge-standard {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  padding: 2px 7px;
  border-radius: var(--radius-xs); /* 4px M3 badge */
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.danger-zone-card {
  margin-top: 32px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-error-container);
}

/* ==========================================================================
   Toasts & Meddelanden (Material Design 3 Snackbar)
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 440px;
}

.toast-message {
  background-color: #313033; /* M3 Inverse Surface */
  color: #f4eff4; /* M3 Inverse On Surface */
  padding: 14px 20px;
  border-radius: var(--radius-xs); /* 4px M3 Snackbar */
  box-shadow: var(--elevation-3);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: toastFadeIn 0.25s ease forwards;
  pointer-events: auto;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--md-sys-color-outline);
}

.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--md-sys-color-outline-variant);
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 6px;
}

/* ==========================================================================
   Inställningar (Settings)
   ========================================================================== */
.settings-container {
  max-width: 720px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 20px;
}

.settings-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* M3 Secondary Tabs (Underline Active Indicator) */
.settings-tabs {
  display: flex;
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab-btn {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 0;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  position: relative;
  margin-bottom: -1px;
}

.settings-tab-btn:hover {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.settings-tab-btn.active {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  font-weight: 600;
  border-bottom: 3px solid var(--md-sys-color-primary);
  box-shadow: none;
}

.settings-card {
  background-color: var(--md-sys-color-surface-container-low);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--elevation-1);
  padding: 24px;
}

@media (max-width: 600px) {
  .settings-tabs {
    border-radius: 0;
    padding: 0;
  }

  .settings-tab-btn {
    padding: 10px 8px;
    font-size: 0.82rem;
    gap: 4px;
    border-radius: 0;
  }

  .settings-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
}

/* Lösenordshantering i Inställningar */
.password-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.password-status-card.status-active {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.password-status-card.status-inactive {
  background-color: #fffbeb;
  border-color: #fef08a;
  color: #854d0e;
}

.password-form-box {
  max-width: 480px;
}

/* Inloggningsvy (Login Page - M3 Surface Container) */
.login-container {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--md-sys-color-surface-container-low);
  border: none;
  border-radius: var(--radius-xl); /* 28px M3 Dialog */
  padding: 36px 28px;
  box-shadow: var(--elevation-2);
}

.login-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.settings-card-header {
  margin-bottom: 16px;
}

.settings-add-form {
  margin-bottom: 20px;
}

.input-with-button {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-button .form-control {
  flex: 1;
}

.settings-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-item-card {
  background-color: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: background-color 0.15s;
}

.settings-item-card:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.settings-item-view {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--md-sys-color-outline);
  padding: 4px;
  border-radius: var(--radius-xs);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.15s, background-color 0.15s;
}

.drag-handle:hover {
  color: var(--md-sys-color-on-surface);
  background-color: var(--md-sys-color-surface-container-high);
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-item {
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.sortable-item.is-dragging {
  opacity: 0.9;
  box-shadow: var(--elevation-4);
  transform: scale(1.02);
  background-color: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
  z-index: 100;
  position: relative;
}

.sortable-item.drop-target-above {
  border-top: 2px solid var(--md-sys-color-primary);
}

.sortable-item.drop-target-below {
  border-bottom: 2px solid var(--md-sys-color-primary);
}

.btn-icon-subtle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  color: var(--md-sys-color-outline);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon-subtle:hover:not(:disabled) {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.btn-icon-subtle.text-danger:hover {
  color: var(--md-sys-color-error);
  background-color: var(--md-sys-color-error-container);
}

.btn-icon-subtle.disabled-action {
  opacity: 0.25;
  cursor: not-allowed;
}

.settings-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--md-sys-color-on-surface);
}

.settings-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs); /* 4px M3 badge */
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-outline);
}

.settings-badge.badge-active {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.settings-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.settings-item-edit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border: 1px solid rgba(186, 26, 26, 0.2);
}

.alert-success {
  background-color: var(--status-active-bg);
  color: var(--status-active-fg);
  border: 1px solid rgba(21, 128, 61, 0.2);
}

.empty-state-text {
  text-align: center;
  padding: 24px 0;
  color: var(--md-sys-color-outline);
  font-size: 0.9rem;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   In-app dialoger (Material Design 3 Dialogs: 28px radie, utan blur)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.38); /* M3 Scrim */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--radius-xl); /* 28px M3 Dialog */
  box-shadow: var(--elevation-3);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: m3DialogFadeIn 0.2s cubic-bezier(0.2, 0, 0, 1);
  border: none;
}

@keyframes m3DialogFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: none;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--md-sys-color-outline);
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--md-sys-color-on-surface);
  background-color: var(--md-sys-color-surface-container-highest);
}

.modal-body {
  padding: 0 24px 24px;
}

.modal-footer {
  padding: 16px 24px 24px;
  border-top: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background-color: transparent;
}

/* Valalternativ i Pensionera-modal */
.retire-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.retire-option-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background-color: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.retire-option-card:hover {
  background-color: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
  transform: translateY(-1px);
}

.retire-option-card .option-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.retire-option-card .option-content {
  flex: 1;
}

.retire-option-card .option-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 2px;
}

.retire-option-card .option-desc {
  font-size: 0.78rem;
  color: var(--md-sys-color-outline);
  line-height: 1.35;
}

.retire-option-card.option-danger:hover {
  border-color: var(--md-sys-color-error);
  background-color: var(--md-sys-color-error-container);
}

.retire-option-card.option-danger:hover .option-title {
  color: var(--md-sys-color-on-error-container);
}