/* ==========================================================================
   C3 Card — Main Stylesheet
   Dusk Blue Theme & 2026 Visual Design Guideline
   ========================================================================== */

@import url('variables.css');

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary-accent);
  text-decoration: none;
}

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

/* Typography Helpers */
.text-sans {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.text-mono {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

/* ==========================================================================
   App Shell & Header Bar
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 64px;
  background-color: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-logo {
  width: 36px;
  height: 36px;
  background-color: var(--color-primary-accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 2px 4px rgba(61, 90, 128, 0.2);
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.header-logo:hover {
  opacity: 0.9;
}

.header-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.header-back-btn:hover {
  background-color: var(--color-neutral-shaded);
  border-color: var(--color-border-hover);
  color: var(--color-primary-accent);
}

.header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Card Type Selector (Loyalty or Ticket) in Header */
.header-type-selector {
  display: inline-flex;
  align-items: stretch;
  height: var(--interactive-height);
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: 3px;
  gap: 3px;
  box-sizing: border-box;
}

.type-segment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: calc(var(--border-radius-sm) - 1px);
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
  white-space: nowrap;
}

.type-segment-btn:hover {
  color: var(--color-text-primary);
}

.type-segment-btn.active {
  background-color: var(--color-bg-surface);
  color: var(--color-primary-accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.type-btn-icon {
  display: none;
}

.type-btn-text {
  display: inline;
}

/* Icon-Only Add Card Button */
.header-add-btn {
  width: var(--interactive-height);
  height: var(--interactive-height);
  padding: 0;
  background-color: var(--color-primary-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, background-color 0.15s;
  box-sizing: border-box;
}

.header-add-btn:hover {
  opacity: 0.92;
}

/* Icon-Only Share Button */
.header-icon-btn {
  position: relative;
  width: var(--interactive-height);
  height: var(--interactive-height);
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.header-icon-btn:hover {
  background-color: var(--color-neutral-shaded);
  border-color: var(--color-border-hover);
  color: var(--color-primary-accent);
}

.header-icon-btn .badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.68rem;
  padding: 2px 5px;
  min-width: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Pending Shares Indicator */
.pending-share-btn {
  position: relative;
  height: var(--interactive-height);
  padding: 0 14px;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pending-share-btn:hover {
  background-color: var(--color-neutral-shaded);
  border-color: var(--color-border-hover);
}

.badge-counter {
  background-color: var(--color-destructive);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  min-width: 18px;
  text-align: center;
}

/* Primary Button */
.btn-primary {
  height: var(--interactive-height);
  padding: 0 18px;
  background-color: var(--color-primary-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  height: var(--interactive-height);
  padding: 0 16px;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--color-neutral-shaded);
  border-color: var(--color-border-hover);
}

.btn-destructive {
  height: var(--interactive-height);
  padding: 0 16px;
  background-color: rgba(238, 108, 77, 0.1);
  color: var(--color-destructive);
  border: 1px solid rgba(238, 108, 77, 0.3);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-destructive:hover {
  background-color: rgba(238, 108, 77, 0.2);
  border-color: var(--color-destructive);
}

/* User Profile Avatar & Dropdown */
.profile-menu-container {
  position: relative;
}

.profile-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background-color: var(--color-secondary-accent);
  color: var(--color-primary-accent);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.15s;
}

.profile-avatar-btn:hover {
  border-color: var(--color-primary-accent);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  z-index: 150;
  overflow: hidden;
}

.profile-dropdown-menu.show {
  display: flex;
}

.profile-user-info {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
}

.profile-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background-color 0.1s;
}

.dropdown-item:hover {
  background-color: var(--color-neutral-shaded);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 4px 0;
}

.dropdown-item.logout {
  color: var(--color-destructive);
}

/* ==========================================================================
   Main Content Container
   ========================================================================== */

.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

/* ==========================================================================
   Search & Filter Bar
   ========================================================================== */

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 2rem;
}

.search-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.search-bar-row .search-bar-wrapper {
  flex: 1;
  position: relative;
}

.search-bar-wrapper {
  position: relative;
  width: 100%;
}

.tag-filter-menu-wrapper {
  position: relative;
  flex-shrink: 0;
}

.search-tag-btn {
  width: var(--interactive-height);
  height: var(--interactive-height);
  padding: 0;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  box-sizing: border-box;
}

.search-tag-btn:hover {
  border-color: var(--color-border-hover);
  color: var(--color-primary-accent);
  background-color: var(--color-bg-base);
}

.search-tag-btn.active {
  background-color: rgba(61, 90, 128, 0.1);
  border-color: var(--color-primary-accent);
  color: var(--color-primary-accent);
}

.search-tag-btn .tag-btn-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary-accent);
  box-shadow: 0 0 0 2px var(--color-bg-surface);
}

/* Tag Dropdown Menu */
.tag-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 250px;
  max-height: 320px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tag-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-base);
}

.tag-dropdown-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-dropdown-clear-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-destructive);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.tag-dropdown-clear-btn:hover {
  text-decoration: underline;
}

.tag-dropdown-list {
  padding: 6px;
  overflow-y: auto;
  max-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tag-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: calc(var(--border-radius-sm) - 1px);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--color-text-primary);
  font-size: 0.88rem;
  transition: background-color 0.12s ease;
}

.tag-dropdown-item:hover {
  background-color: var(--color-neutral-shaded);
}

.tag-dropdown-item.active {
  background-color: rgba(61, 90, 128, 0.1);
  color: var(--color-primary-accent);
  font-weight: 700;
}

.tag-dropdown-item .item-tag-name {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-dropdown-item .item-tag-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background-color: var(--color-neutral-shaded);
  padding: 1px 6px;
  border-radius: 10px;
}

.tag-dropdown-empty {
  padding: 16px 14px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Reset Button (X) right to the tag selector */
.search-reset-btn {
  width: var(--interactive-height);
  height: var(--interactive-height);
  padding: 0;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.search-reset-btn:hover {
  border-color: var(--color-destructive);
  color: var(--color-destructive);
  background-color: rgba(238, 108, 77, 0.08);
}

.search-input {
  width: 100%;
  height: var(--interactive-height);
  padding: 0 16px 0 44px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:hover {
  border-color: var(--color-border-hover);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary-accent);
  box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.12);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: none;
}

/* Quick Filter Pills */
.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  height: 34px;
  padding: 0 14px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 17px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-pill:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.filter-pill.active {
  background-color: var(--color-primary-accent);
  border-color: var(--color-primary-accent);
  color: #ffffff;
}

.pill-count {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
}

.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Tag filter sub-row */
.tag-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.tag-pill {
  font-size: 0.78rem;
  padding: 3px 10px;
  background-color: rgba(152, 193, 217, 0.2);
  border: 1px solid rgba(152, 193, 217, 0.4);
  border-radius: 12px;
  color: var(--color-primary-accent);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tag-pill:hover {
  background-color: rgba(152, 193, 217, 0.35);
}

.tag-pill.active {
  background-color: var(--color-primary-accent);
  border-color: var(--color-primary-accent);
  color: #ffffff;
}

/* ==========================================================================
   Card Grid & Card Items
   ========================================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* Separator between favourite and non-favourite cards.
   Spans all grid columns, so on desktop the non-favourites start on a new row. */
.favourites-divider {
  grid-column: 1 / -1;
  height: 1px;
  margin: 6px 0;
  background-color: var(--color-border);
}

.card-item {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
}

.card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  border-color: var(--color-border-hover);
}

.card-item.archived {
  opacity: 0.6;
}

.card-item.dark-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.card-main-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.card-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Fallback logo: first letter of the card name in the card color, on the same white tile as logo images */
.card-logo-letter {
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border-radius: var(--border-radius-sm);
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  color: var(--color-primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.card-generic-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-sm);
  background-color: rgba(61, 90, 128, 0.1);
  color: var(--color-primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1;
}

.card-color-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.card-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #d1d5db;
  background-color: #e5e7eb;
  color: #374151;
  display: inline-flex;
  align-items: center;
  line-height: 1.3;
}

.card-type-badge.loyalty {
  background-color: #e5e7eb;
  border-color: #d1d5db;
  color: #374151;
}

.card-type-badge.ticket {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
}

.card-code-type-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Card Number Preview */
.card-number-preview {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  letter-spacing: 0.04em;
  margin: 8px 0 12px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Bottom Metadata */
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 10px;
}

.card-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.card-tag {
  font-size: 0.72rem;
  background-color: var(--color-bg-base);
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--color-border);
}

.card-code-type-badge {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  background-color: var(--color-bg-base);
  color: var(--color-text-muted);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.card-code-type-badge:hover {
  border-color: var(--color-primary-accent);
  color: var(--color-primary-accent);
  background-color: var(--color-bg-surface);
}

.card-exp-warning {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
}

.card-exp-warning.expired {
  background-color: rgba(238, 108, 77, 0.15);
  color: var(--color-destructive);
}

.card-exp-warning.soon {
  background-color: rgba(237, 231, 177, 0.5);
  color: #856404;
}

.card-exp-warning.ok {
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  color: var(--color-secondary-accent);
}

.empty-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text-primary);
  margin-bottom: 0;
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: var(--color-overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.modal-backdrop.show {
  display: flex;
}

#card-detail-modal {
  z-index: 1000;
}

#card-form-modal,
#share-card-modal,
#pending-shares-modal {
  z-index: 1100;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background-color: var(--color-bg-surface);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.96) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text-primary);
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: color 0.1s, background-color 0.1s;
}

.modal-close-btn:hover {
  color: var(--color-text-primary);
  background-color: var(--color-neutral-shaded);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background-color: #fafafa;
}

/* High Brightness Detail & Scan View */
.scan-view-card {
  background-color: #ffffff !important;
}

.scan-code-container {
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  min-height: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.scan-code-container:hover {
  border-color: var(--color-primary-accent);
  box-shadow: 0 4px 16px rgba(61, 90, 128, 0.12);
}

.scan-code-container.high-brightness {
  background-color: #ffffff !important;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.8), 0 0 10px rgba(0, 0, 0, 0.15) !important;
  border-color: #000000 !important;
}

#detail-code-target {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

#barcode-display-target svg,
#barcode-display-target canvas,
#detail-code-target svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 160px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

#detail-code-target canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

#qrcode-display-target img,
#qrcode-display-target canvas,
#detail-code-target img {
  max-width: 100%;
  max-height: 250px;
  width: auto;
  height: auto;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}

.code-format-indicator {
  margin-top: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--color-text-muted);
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
}

.scan-code-container:hover .code-format-indicator {
  color: var(--color-primary-accent);
  border-color: var(--color-primary-accent);
  background-color: var(--color-bg-surface);
}

/* Card Number Copy Block */
.copy-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  margin-bottom: 14px;
}

.copy-number {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: 0.05em;
  user-select: all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary-accent);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background-color: var(--color-primary-accent);
  color: #ffffff;
  border-color: var(--color-primary-accent);
}

.btn-icon-copy {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Notes Panel */
.notes-block {
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.notes-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notes-content {
  font-size: 0.9rem;
  color: var(--color-text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Badges Row below notes */
.detail-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.detail-badges-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-date-badge {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Modal Detail Footer & Trash Dropdown */
.detail-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.detail-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-action {
  width: var(--interactive-height);
  height: var(--interactive-height);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.btn-icon-action:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
  background-color: var(--color-neutral-shaded);
}

.btn-icon-action.btn-trash-toggle:hover,
.btn-icon-action.btn-trash-toggle.active {
  border-color: var(--color-destructive);
  color: var(--color-destructive);
  background-color: rgba(238, 108, 77, 0.08);
}

.detail-trash-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.detail-trash-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 150px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  animation: trashPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes trashPop {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.trash-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: calc(var(--border-radius-sm) - 1px);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.trash-menu-item:hover {
  background-color: var(--color-neutral-shaded);
}

.trash-menu-item.item-delete {
  color: var(--color-destructive);
}

.trash-menu-item.item-delete:hover {
  background-color: rgba(238, 108, 77, 0.1);
  color: var(--color-destructive);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  height: var(--interactive-height);
  padding: 0 12px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

.form-textarea {
  height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary-accent);
}

/* Color Picker Input & Clear Button */
.card-color-picker-input {
  width: var(--interactive-height);
  height: var(--interactive-height);
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  background-color: var(--color-bg-surface);
  box-sizing: border-box;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.card-color-picker-input:hover {
  border-color: var(--color-border-hover);
}

.card-color-picker-input:focus {
  outline: none;
  border-color: var(--color-primary-accent);
}

.card-color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.card-color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.card-color-clear-btn {
  width: var(--interactive-height);
  height: var(--interactive-height);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.card-color-clear-btn:hover {
  color: var(--color-destructive);
  border-color: var(--color-destructive);
}

/* Template Logo Preview */
.template-logo-preview {
  width: var(--interactive-height);
  height: var(--interactive-height);
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border);
  padding: 4px;
  background-color: #ffffff;
  box-sizing: border-box;
  flex-shrink: 0;
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25000;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 18px;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

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

@keyframes toastSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.success {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.toast.error {
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.toast.info {
  background-color: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .app-header {
    padding: 0 0.75rem;
  }
  .header-actions {
    gap: 6px;
  }
  .type-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .type-btn-text {
    display: none;
  }
  .type-segment-btn {
    padding: 0 9px;
  }
  .main-content {
    padding: 1rem 0.75rem 3rem 0.75rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .favourites-divider {
    margin: 0;
  }
}

/* ==========================================================================
   Custom Select Dropdown Styles (Typeahead Combobox, matching tasktracker)
   ========================================================================== */

.custom-select-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.custom-select-control {
  width: 100%;
  height: var(--interactive-height);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-surface);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  position: relative;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
  box-sizing: border-box;
}

.custom-select-control:hover {
  border-color: var(--color-border-hover);
}

.custom-select-control.focused,
.custom-select-container.is-open .custom-select-control {
  border-color: var(--color-primary-accent);
  box-shadow: 0 0 0 3px rgba(61, 90, 128, 0.12);
}

.custom-select-control.disabled {
  opacity: 0.6;
  background-color: var(--color-bg-base);
  cursor: not-allowed;
}

.custom-select-input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 34px 0 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-primary);
  box-sizing: border-box;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
}

.custom-select-input:focus {
  cursor: text;
}

.custom-select-control.disabled .custom-select-input {
  cursor: not-allowed;
}

.custom-select-caret-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-muted);
  outline: none;
}

.custom-select-control.disabled .custom-select-caret-btn {
  cursor: not-allowed;
  pointer-events: none;
}

.custom-select-caret-icon {
  width: 16px;
  height: 16px;
  transition: transform 150ms ease;
}

.custom-select-container.is-open .custom-select-caret-icon {
  transform: rotate(180deg);
}

.custom-select-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
  display: none;
  flex-direction: column;
  padding: 4px 0;
  z-index: 1050;
  max-height: 220px;
  overflow-y: auto;
}

.custom-select-panel.show {
  display: flex;
}

.custom-select-panel::-webkit-scrollbar {
  width: 6px;
}

.custom-select-panel::-webkit-scrollbar-track {
  background: var(--color-bg-base);
}

.custom-select-panel::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}

.custom-select-panel::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-accent);
}

.custom-select-no-results {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  background-color: var(--color-bg-base);
}

.custom-select-item {
  height: 34px;
  padding: 0 12px;
  font-size: 0.88rem;
  color: var(--color-text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
  outline: none;
  border-left: 3px solid transparent;
  background-color: var(--color-bg-surface);
  box-sizing: border-box;
  flex-shrink: 0; /* prevent rows being squashed inside the max-height flex panel */
}

/* Template (brand preset) select: roomier rows with larger logos */
#custom-select-container-card-input-preset .custom-select-panel {
  max-height: 320px;
}

#custom-select-container-card-input-preset .custom-select-item {
  height: 44px;
}

#custom-select-container-card-input-preset .custom-select-item-content {
  gap: 10px;
}

#custom-select-container-card-input-preset .custom-select-item-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.custom-select-item:hover,
.custom-select-item:focus,
.custom-select-item.highlighted {
  background-color: var(--color-neutral-shaded);
  color: var(--color-primary-accent);
}

.custom-select-item.active {
  background-color: rgba(61, 90, 128, 0.1);
  color: var(--color-primary-accent);
  font-weight: 700;
  border-left-color: var(--color-primary-accent);
}

.custom-select-item-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.custom-select-item-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  padding: 1px;
  flex-shrink: 0;
  display: block;
}

.custom-select-item-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  display: inline-block;
}

.custom-select-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  display: flex;
  align-items: center;
}

.custom-select-item-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   Shared Sub-Pages & Settings Layouts (Account, Export/Import, Tags, Archived)
   ========================================================================== */

.settings-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem 1rem;
}

.settings-card {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
}

.settings-title {
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  margin-bottom: 8px;
  background-color: var(--color-bg-base);
}

.danger-box {
  border: 1px solid rgba(238, 108, 77, 0.4);
  background-color: rgba(238, 108, 77, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 20px 24px;
}

.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
  font-weight: 600;
}

.alert-error {
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
  font-weight: 600;
}

/* Custom Toggle Switch (On/Off Indicator) styling */
.toggle-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  margin-bottom: 10px;
}
.toggle-switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toggle-switch-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text-primary);
}
.toggle-switch-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.toggle-switch-control {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 34px;
}
.toggle-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch-control input:checked + .toggle-switch-slider {
  background-color: var(--color-primary-accent);
}
.toggle-switch-control input:checked + .toggle-switch-slider:before {
  transform: translateX(22px);
}

/* Data Tables */
.data-table-container {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  width: 100%;
  max-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background-color: var(--color-neutral-shaded);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  vertical-align: middle;
}

.data-table tbody tr {
  background-color: var(--color-bg-surface);
  transition: background-color 0.12s ease;
}

.data-table tbody tr:hover {
  background-color: var(--color-neutral-shaded);
}

@media (max-width: 600px) {
  .responsive-full-width-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Custom Single-Line File Input */
.custom-file-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.custom-file-input {
  width: 100%;
  height: var(--interactive-height);
  line-height: calc(var(--interactive-height) - 2px);
  padding: 0 10px;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.custom-file-input:hover {
  border-color: var(--color-border-hover);
}

.custom-file-input:focus {
  outline: none;
  border-color: var(--color-primary-accent);
}

/* Chrome/Safari/Edge custom file button */
.custom-file-input::-webkit-file-upload-button {
  height: 28px;
  line-height: 26px;
  background-color: var(--color-neutral-shaded);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  padding: 0 12px;
  margin-right: 12px;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  vertical-align: middle;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.custom-file-input::-webkit-file-upload-button:hover {
  background-color: var(--color-border);
  color: var(--color-text-primary);
}

/* Firefox custom file button */
.custom-file-input::file-selector-button {
  height: 28px;
  line-height: 26px;
  background-color: var(--color-neutral-shaded);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  padding: 0 12px;
  margin-right: 12px;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  vertical-align: middle;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.custom-file-input::file-selector-button:hover {
  background-color: var(--color-border);
  color: var(--color-text-primary);
}

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

/* ==========================================================================
   Favourite Star Toggle Styles
   ========================================================================== */

.favourite-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  width: 44px;
  height: 42px;
  min-width: 44px;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.favourite-toggle-btn:hover {
  color: #f59e0b;
  border-color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.08);
}

.favourite-toggle-btn.is-active {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
  background-color: rgba(245, 158, 11, 0.1);
}

.detail-favourite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 4px;
  margin-left: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.detail-favourite-btn:hover {
  color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.1);
}

.detail-favourite-btn.is-active {
  color: #f59e0b;
}

.star-icon {
  display: block;
  transition: transform 0.15s ease;
}

.favourite-toggle-btn:active .star-icon,
.detail-favourite-btn:active .star-icon {
  transform: scale(1.25);
}
