:root {
  /* Ireland Summer Games 2026 Color Palette */
  --ems-primary: #004A8F; /* Primary blue from logo */
  --ems-primary-hover: #003366; /* Darker blue */
  --ems-secondary: #8BC34A; /* Primary green from logo */
  --ems-secondary-dark: #1B5E20; /* Dark forest green */
  --ems-accent-green: #D4E157; /* Light accent green */
  --ems-surface: #ffffff;
  --ems-surface-subtle: #f5f7fb;
  --ems-surface-strong: #0b1d3a;
  --ems-border: rgba(0, 74, 143, 0.12);
  --ems-shadow-soft: 0 12px 32px rgba(11, 26, 51, 0.08);
  --ems-shadow-strong: 0 20px 45px rgba(6, 16, 33, 0.12);

  --ems-text-dark: #1f2a44;
  --ems-text-muted: #6b7a90;
  --ems-text-light: rgba(255, 255, 255, 0.85);

  --ems-radius-sm: 0.5rem;
  --ems-radius-md: 0.9rem;
  --ems-radius-lg: 1.25rem;

  --ems-space-0: 0.25rem;
  --ems-space-1: 0.5rem;
  --ems-space-2: 0.75rem;
  --ems-space-3: 1rem;
  --ems-space-4: 1.5rem;
  --ems-space-5: 2rem;
  --ems-space-6: 3rem;

  --ems-font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --ems-font-size-base: 1rem;
  --ems-line-height-base: 1.6;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--ems-font-family);
  font-size: var(--ems-font-size-base);
  line-height: var(--ems-line-height-base);
  color: var(--ems-text-dark);
  background: linear-gradient(
      180deg,
      rgba(0, 43, 100, 0.05) 0%,
      rgba(0, 43, 100, 0) 320px
    ),
    var(--ems-surface-subtle);
  min-height: 100vh;
  overflow-x: hidden;
}

.auth-layout {
  display: flex;
  min-height: 100vh;
}

.auth-layout__panel {
  width: min(520px, 100%);
  margin: auto;
  padding: clamp(48px, 10vw, 96px);
}

.auth-card {
  background: var(--ems-surface);
  border-radius: 22px;
  padding: clamp(32px, 5vw, 48px);
  box-shadow: 0 24px 70px rgba(12, 31, 74, 0.14);
  border: 1px solid rgba(10, 32, 81, 0.08);
}

.auth-card .page-title {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  margin-bottom: 0.25rem;
}

.auth-card .page-subtitle {
  font-size: 0.95rem;
  color: var(--ems-text-muted);
  margin-bottom: var(--ems-space-3);
}

.auth-card .form-label {
  font-weight: 600;
  color: #162648;
}

.auth-card .form-control {
  border-radius: 12px;
  padding-block: 12px;
  border: 1px solid rgba(21, 51, 112, 0.18);
}

.auth-card .btn {
  width: 100%;
  justify-content: center;
  padding-block: 12px;
  font-weight: 600;
  border-radius: 14px;
}

.auth-card__footer {
  margin-top: var(--ems-space-3);
  text-align: center;
  font-size: 0.9rem;
  color: var(--ems-text-muted);
}

.auth-card__footer a {
  color: var(--ems-primary);
  font-weight: 600;
}

@media (max-width: 960px) {
  .auth-layout {
    padding: 32px 24px;
  }

  .auth-card {
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(10, 28, 74, 0.12);
  }
}

p {
  margin-bottom: var(--ems-space-2);
}

a {
  color: var(--ems-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--ems-primary-hover);
  text-decoration: underline;
}

.container-xxl {
  max-width: 1180px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--ems-page-bg);
}

.sidebar {
  width: 220px;
  min-width: 220px;
  background: linear-gradient(145deg, #004A8F, #1B5E20);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: var(--ems-space-4) var(--ems-space-3);
  box-shadow: 18px 0 40px rgba(6, 18, 41, 0.15);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  margin-bottom: var(--ems-space-4);
}

.sidebar-toggle {
  position: absolute;
  top: var(--ems-space-3);
  right: calc(-1 * var(--ems-space-3));
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 950;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  transform: translateX(4px);
  box-shadow: 0 10px 20px rgba(0, 43, 100, 0.25);
}

.sidebar-toggle .icon {
  width: 0.85rem;
  height: 0.85rem;
}

.sidebar--collapsed .sidebar-toggle {
  right: calc(-1 * var(--ems-space-2));
  transform: translateX(0);
}

.sidebar--collapsed {
  width: 88px !important;
  min-width: 88px !important;
  padding: var(--ems-space-3) var(--ems-space-2);
  align-items: center;
}

.sidebar--collapsed.sidebar--compact {
  padding: var(--ems-space-2);
}

.sidebar--collapsed .sidebar-link__text,
.sidebar--collapsed .sidebar-user__meta,
.sidebar--collapsed .sidebar-signout__label {
  display: none;
}

.sidebar--collapsed .sidebar-link {
  justify-content: center;
  padding: var(--ems-space-2);
  width: 100%;
}

.sidebar--collapsed .sidebar-link__icon {
  width: 2.4rem;
  height: 2.4rem;
}

.sidebar--collapsed .sidebar-footer {
  align-items: center;
}

.sidebar--collapsed .sidebar-user {
  flex-direction: column;
  gap: var(--ems-space-1);
  justify-content: center;
  padding: var(--ems-space-2);
  width: 100%;
}

.sidebar--collapsed .sidebar-user__icon {
  width: 2.4rem;
  height: 2.4rem;
}

.sidebar--collapsed .sidebar-signout {
  justify-content: center;
}

.sidebar-brand__link {
  display: flex;
  align-items: center;
  gap: var(--ems-space-2);
  text-decoration: none;
  color: inherit;
}

.sidebar-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 0.95rem;
}

.sidebar-brand__logo {
  max-width: 100%;
  height: auto;
  max-height: 9rem;
  object-fit: contain;
  display: block;
  padding: var(--ems-space-2);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-brand__logo-icon {
  width: 2.8rem;
  height: 2.8rem;
  object-fit: contain;
  display: none;
  padding: var(--ems-space-1);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar--collapsed .sidebar-brand__logo {
  display: none;
}

.sidebar--collapsed .sidebar-brand__logo-icon {
  display: block;
}

.sidebar-brand__link {
  justify-content: center;
}

.sidebar--collapsed .sidebar-brand__link {
  justify-content: center;
}

.icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
}

.icon-inline {
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.35rem;
}

.btn .icon-inline {
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.45rem;
}

.btn-link .icon-inline {
  margin-right: 0;
}

.sidebar-brand__text {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-0);
}

.sidebar-brand__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-brand__subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: var(--ems-space-4);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--ems-space-2);
  padding: var(--ems-space-1) var(--ems-space-2);
  border-radius: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-link:hover::before,
.sidebar-link:focus-visible::before {
  opacity: 1;
}

.sidebar-link.active {
  color: #1B5E20;
}

.sidebar-link.active::before {
  opacity: 1;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(27, 94, 32, 0.35);
}

.sidebar-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  background-color: rgba(255, 255, 255, 0.14);
  font-size: 1rem;
  z-index: 1;
}

.sidebar-link.active .sidebar-link__icon {
  background-color: rgba(27, 94, 32, 0.12);
  color: #1B5E20;
}

.sidebar-link__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 1;
}

.sidebar-link__label {
  font-weight: 600;
  letter-spacing: 0.015em;
}

.sidebar-link__caption {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-2);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--ems-space-2);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: var(--ems-space-2);
  border-radius: var(--ems-radius);
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-user__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  background-color: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.sidebar-user__icon .icon {
  width: 1rem;
  height: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.sidebar-user__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.sidebar-user__name {
  font-weight: 600;
}

.sidebar-user__email {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ems-space-1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.sidebar-signout:hover,
.sidebar-signout:focus {
  border-color: rgba(255, 255, 255, 0.55);
  color: #0c2348;
  background-color: #ffffff;
}

.sidebar-signout__label {
  font-weight: 600;
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.ems-toolbar {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 43, 100, 0.08);
  box-shadow: 0 12px 30px rgba(6, 25, 51, 0.08);
  position: sticky;
  top: 0;
  z-index: 900;
}

.ems-toolbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--ems-space-3) var(--ems-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-2);
}

@media (min-width: 992px) {
  .ems-toolbar__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.ems-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-2);
  justify-content: flex-start;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--ems-space-5) var(--ems-space-4) var(--ems-space-6);
  min-width: 0;
}

.app-main > *:first-child {
  margin-top: 0;
}

.btn {
  font-weight: 600;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn.btn-sm {
  padding: 0.35rem 0.85rem;
  font-weight: 600;
}

.btn-primary {
  background-color: var(--ems-primary);
  border-color: var(--ems-primary);
  box-shadow: 0 12px 20px rgba(0, 43, 100, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--ems-primary-hover);
  border-color: var(--ems-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0, 43, 100, 0.3);
}

.btn-outline-primary {
  color: var(--ems-primary);
  border-color: rgba(0, 43, 100, 0.4);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #ffffff;
  background-color: var(--ems-primary);
  border-color: var(--ems-primary);
}

.btn-light {
  color: var(--ems-primary);
  border-color: rgba(0, 43, 100, 0.12);
  background-color: rgba(0, 43, 100, 0.06);
}

.btn-light:hover,
.btn-light:focus {
  background-color: rgba(0, 43, 100, 0.16);
  border-color: rgba(0, 43, 100, 0.16);
}

.badge {
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.badge--info {
  background-color: rgba(0, 120, 255, 0.12);
  color: #0b4a8d;
}

.badge--success {
  background-color: rgba(39, 174, 96, 0.16);
  color: #16613f;
}

.badge--warning {
  background-color: rgba(255, 193, 7, 0.2);
  color: #8a6200;
}

.badge--danger {
  background-color: rgba(220, 53, 69, 0.16);
  color: #93253c;
}

.badge--neutral {
  background-color: rgba(31, 42, 68, 0.12);
  color: var(--ems-text-dark);
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.badge-soft--info {
  background-color: rgba(0, 120, 255, 0.12);
  color: #0b4a8d;
}

.badge-soft--success {
  background-color: rgba(39, 174, 96, 0.16);
  color: #16613f;
}

.badge-soft--warning {
  background-color: rgba(255, 193, 7, 0.2);
  color: #8a6200;
}

.badge-soft--danger {
  background-color: rgba(220, 53, 69, 0.16);
  color: #93253c;
}

.badge-soft--neutral {
  background-color: rgba(31, 42, 68, 0.12);
  color: var(--ems-text-dark);
}

.alert {
  border-radius: var(--ems-radius-md);
  border: none;
  box-shadow: var(--ems-shadow-soft);
  padding: var(--ems-space-3);
}

.ems-toolbar {
  background-color: var(--ems-surface);
  border-bottom: 1px solid var(--ems-border);
  box-shadow: 0 16px 30px rgba(6, 25, 51, 0.08);
  position: sticky;
  top: 0;
  z-index: 1010;
}

.ems-toolbar-copy .ems-toolbar-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--ems-text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: var(--ems-space-1);
}

.ems-toolbar-copy .ems-toolbar-caption {
  font-size: 0.95rem;
  color: var(--ems-text-dark);
  margin-bottom: 0;
  font-weight: 500;
}

.ems-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-1);
  justify-content: center;
}

.ems-toolbar-link {
  display: inline-flex;
  align-items: center;
  gap: var(--ems-space-1);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background-color: rgba(0, 43, 100, 0.08);
  color: var(--ems-primary);
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.ems-toolbar-link .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.ems-toolbar-link:hover,
.ems-toolbar-link:focus {
  background-color: var(--ems-primary);
  color: #ffffff;
  border-color: var(--ems-primary);
  box-shadow: 0 16px 28px rgba(0, 43, 100, 0.25);
}

main {
  padding-top: var(--ems-space-5);
  padding-bottom: var(--ems-space-6);
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-2);
  margin-bottom: var(--ems-space-4);
}

.page-header__text {
  max-width: 700px;
}

.page-title,
.section-title,
.summary-card__value {
  line-height: 1.15;
}

.page-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ems-text-muted);
  display: block;
  margin-bottom: var(--ems-space-1);
}

.page-title {
  font-size: clamp(2rem, 2.4vw, 2.75rem);
  font-weight: 700;
  margin-bottom: var(--ems-space-1);
  color: var(--ems-primary);
}

.page-subtitle {
  font-size: 1rem;
  color: var(--ems-text-muted);
  margin-bottom: 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-2);
}

.summary-grid {
  display: grid;
  gap: var(--ems-space-3);
}

.summary-grid--metrics {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.summary-card {
  background: var(--ems-surface);
  border-radius: var(--ems-radius-lg);
  padding: clamp(var(--ems-space-3), 3vw, var(--ems-space-4));
  border: 1px solid rgba(0, 43, 100, 0.08);
  box-shadow: var(--ems-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-1);
  min-height: 100%;
}

.summary-card--accent {
  background: linear-gradient(140deg, #00418f, #2367c8);
  color: #ffffff;
  border: none;
  box-shadow: var(--ems-shadow-strong);
}

.summary-card__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  color: inherit;
  opacity: 0.85;
}

.summary-card__value {
  font-size: clamp(2.2rem, 3.2vw, 2.9rem);
  font-weight: 700;
  color: inherit;
}

.summary-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.summary-card__actions--uniform {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.summary-card__action-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
}

.summary-card__action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-card__action-icon svg,
.summary-card__action-icon .icon {
  width: 1rem;
  height: 1rem;
}

.summary-card__action-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  font-size: 0.875rem;
  line-height: 1.2;
  word-break: break-word;
}

.summary-card__action-text > span:first-child {
  display: block;
}

.summary-card__action-badge {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 0.125rem;
}

.summary-card__meta {
  font-size: 0.9rem;
  color: inherit;
  opacity: 0.8;
}

.card-elevated {
  border-radius: var(--ems-radius-lg);
  border: 1px solid rgba(0, 43, 100, 0.05);
  box-shadow: var(--ems-shadow-soft);
}

.card-elevated > .card-body {
  padding: clamp(var(--ems-space-3), 3.5vw, var(--ems-space-4));
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ems-primary);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--ems-text-muted);
  margin-bottom: var(--ems-space-3);
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-2);
}

.link-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--ems-space-2) var(--ems-space-3);
  border-radius: var(--ems-radius-md);
  border: 1px solid rgba(0, 43, 100, 0.08);
  transition: all 0.15s ease;
  color: var(--ems-text-dark);
}

.link-list__item:hover,
.link-list__item:focus {
  border-color: rgba(0, 43, 100, 0.18);
  background-color: rgba(0, 43, 100, 0.05);
  text-decoration: none;
}

.link-list__item .link-list__meta {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-0);
}

.link-list__item-title {
  font-weight: 600;
  color: var(--ems-primary);
  transition: color 0.2s ease;
}

.link-list__item:hover .link-list__item-title,
.link-list__item:focus .link-list__item-title {
  color: var(--ems-secondary);
}

.link-list__item-copy {
  font-size: 0.85rem;
  color: var(--ems-text-muted);
}

.link-list__icon {
  font-size: 1.5rem;
  color: var(--ems-primary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-1);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--ems-space-1);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background-color: rgba(0, 43, 100, 0.08);
  color: var(--ems-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.chip-muted {
  background-color: rgba(0, 43, 100, 0.06);
  color: var(--ems-text-muted);
}

.form-control,
.form-select {
  border-radius: var(--ems-radius-sm);
  border: 1px solid rgba(0, 43, 100, 0.12);
  padding: 0.55rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select.is-loading {
  background-image: linear-gradient(90deg, rgba(0, 43, 100, 0.15), rgba(0, 43, 100, 0.05));
  background-size: 200% 100%;
  animation: ems-loading 1.2s ease infinite;
}

/* Tom Select overrides ---------------------------------------------------- */
.ts-wrapper {
  color: var(--ems-text-dark);
}

.ts-wrapper .ts-control,
.ts-wrapper .ts-control input {
  color: inherit !important;
  background-color: var(--ems-surface);
}

.ts-wrapper.single .ts-control,
.ts-wrapper.form-select .ts-control {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.ts-wrapper .ts-control input::placeholder {
  color: var(--ems-text-muted);
}

.ts-dropdown,
.ts-dropdown .dropdown-input {
  background-color: #ffffff;
  color: var(--ems-text-dark);
}

.ts-dropdown .option,
.ts-dropdown .create,
.ts-dropdown .no-results,
.ts-dropdown .optgroup-header {
  color: var(--ems-text-dark);
}

.ts-dropdown .active,
.ts-dropdown .active.create {
  color: var(--ems-text-dark);
}

@keyframes ems-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.form-label {
  font-weight: 600;
  color: var(--ems-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.form-section {
  padding: var(--ems-space-4);
  border-radius: var(--ems-radius-lg);
  background-color: var(--ems-surface);
  border: 1px solid rgba(0, 43, 100, 0.08);
  box-shadow: var(--ems-shadow-soft);
}

.form-shell {
  background-color: var(--ems-surface);
  border-radius: var(--ems-radius-lg);
  border: 1px solid rgba(0, 43, 100, 0.08);
  box-shadow: var(--ems-shadow-soft);
  padding: var(--ems-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-4);
}

.form-shell__body {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-4);
}

.form-section__header {
  margin-bottom: var(--ems-space-3);
}

.form-section__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ems-text-muted);
  display: inline-block;
  margin-bottom: var(--ems-space-1);
}

.form-section__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ems-primary);
  margin-bottom: var(--ems-space-1);
}

.form-section__description {
  font-size: 0.95rem;
  color: var(--ems-text-muted);
  margin-bottom: 0;
  max-width: 620px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--ems-space-3);
}

.definition-grid {
  display: grid;
  gap: var(--ems-space-2);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.definition-grid__item {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-0);
}

.definition-grid__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--ems-text-muted);
  font-weight: 600;
}

.definition-grid__value {
  font-weight: 600;
  color: var(--ems-text-dark);
}

.definition-grid__value.muted {
  color: var(--ems-text-muted);
  font-weight: 500;
}

.definition-grid dt {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--ems-text-muted);
  margin-bottom: var(--ems-space-0);
  font-weight: 600;
}

.definition-grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--ems-text-dark);
}

.definition-grid dd.muted {
  color: var(--ems-text-muted);
  font-weight: 500;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-1);
}

.form-field .form-label {
  margin-bottom: 0;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field--third {
  min-width: 200px;
}

.form-field__error {
  color: #c62828;
  font-size: 0.8rem;
}

.form-field__error ul {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
}

.form-field__help {
  font-size: 0.8rem;
  color: var(--ems-text-muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-2);
  justify-content: flex-end;
  border-top: 1px solid rgba(0, 43, 100, 0.08);
  padding-top: var(--ems-space-3);
}

.form-actions .btn-link {
  font-weight: 600;
  color: var(--ems-text-muted);
}

.form-check.form-switch {
  padding-left: 3.2rem;
}

.formset-group {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-3);
}

.formset-item {
  border: 1px solid rgba(0, 43, 100, 0.12);
  border-radius: var(--ems-radius-lg);
  padding: var(--ems-space-3);
  background-color: rgba(0, 43, 100, 0.02);
  box-shadow: 0 10px 22px rgba(11, 26, 51, 0.08);
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-3);
}

.formset-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ems-space-2);
}

.formset-item__title {
  font-weight: 600;
  color: var(--ems-primary);
}

.formset-item__remove {
  display: flex;
  align-items: center;
  gap: var(--ems-space-1);
  font-size: 0.85rem;
  color: var(--ems-text-muted);
}

.request-items-shell {
  margin-top: var(--ems-space-3);
  border-radius: var(--ems-radius-lg);
  border: 1px solid rgba(0, 43, 100, 0.08);
  overflow-x: auto;
  background-color: #fbfdff;
}

.request-items-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}

.request-items-table thead th {
  background: linear-gradient(180deg, rgba(0, 43, 100, 0.08) 0%, rgba(0, 43, 100, 0) 100%);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--ems-text-muted);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 43, 100, 0.12);
}

.request-items-row {
  background-color: var(--ems-surface);
  transition: background-color 0.2s ease;
}

.request-items-row + .request-items-row {
  border-top: 1px solid rgba(0, 43, 100, 0.05);
}

.request-items-row:hover {
  background-color: rgba(226, 234, 246, 0.32);
}

.request-items-cell {
  padding: 14px 16px;
  vertical-align: middle;
}

.request-items-cell select.form-select,
.request-items-cell input.form-control,
.request-items-cell textarea.form-control {
  min-width: 12rem;
}

.request-items-cell textarea.form-control {
  min-height: 42px;
  resize: vertical;
}

.request-items-cell--index {
  width: 56px;
  text-align: center;
  font-weight: 600;
  color: var(--ems-text-muted);
}

.request-items-row__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(0, 43, 100, 0.1);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ems-primary);
}

.request-items-col--availability,
.request-items-cell--availability {
  width: 110px;
  text-align: center;
}

.request-items-col--quantity,
.request-items-cell--quantity {
  width: 110px;
}

.request-items-col--actions,
.request-items-cell--actions {
  width: 72px;
  text-align: right;
}

.request-items-cell--asset .form-select,
.request-items-cell--location .form-select {
  min-width: 16rem;
}

.request-items-cell--quantity .form-control {
  min-width: 6rem;
  max-width: 7rem;
  text-align: right;
}

.request-items-footer {
  margin-top: var(--ems-space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ems-space-3);
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 4px 12px;
  border-radius: 999px;
  background-color: rgba(39, 174, 96, 0.12);
  color: #1f8f46;
  font-weight: 600;
  font-size: 0.82rem;
  min-width: 42px;
}

.availability-pill--warning {
  background-color: rgba(217, 83, 79, 0.16);
  color: #a94442;
}

@media (max-width: 768px) {
  .request-items-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-2);
}

.table {
  margin-bottom: 0;
}

.table-modern {
  --bs-table-bg: transparent;
  --bs-table-border-color: rgba(0, 43, 100, 0.08);
  border-radius: var(--ems-radius-lg);
  overflow: hidden;
}

table.asset-table {
  border-collapse: separate;
  border-spacing: 0;
}

table.asset-table thead th {
  background-color: rgba(0, 43, 100, 0.92);
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  padding: 0.95rem;
}

table.asset-table tbody td {
  vertical-align: middle;
  padding: 0.95rem;
  border-color: rgba(0, 43, 100, 0.08);
}

.asset-name a {
  font-weight: 600;
  color: var(--ems-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.asset-name a:hover,
.asset-name a:focus {
  color: var(--ems-secondary);
  text-decoration: underline;
}

.tanstack-card {
  background: var(--ems-surface);
  border-radius: var(--ems-radius-lg);
  border: 1px solid rgba(0, 43, 100, 0.08);
  box-shadow: var(--ems-shadow-soft);
  padding: clamp(var(--ems-space-3), 3vw, var(--ems-space-4));
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-3);
}

.table-card {
  background: var(--ems-surface);
  border-radius: var(--ems-radius-lg);
  border: 1px solid rgba(0, 43, 100, 0.08);
  box-shadow: var(--ems-shadow-soft);
  padding: clamp(var(--ems-space-3), 3vw, var(--ems-space-4));
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-3);
}

.table-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ems-space-2);
}

.table-card__header .section-title {
  margin-bottom: var(--ems-space-0);
}

.table-card__header .section-subtitle {
  margin-bottom: 0;
}

.table-card__table {
  overflow-x: auto;
}

.table-pagination {
  margin-top: var(--ems-space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ems-space-2);
}

.table-pagination__summary {
  font-size: 0.9rem;
  color: var(--ems-text-muted);
}

.table-pagination .pagination {
  margin-bottom: 0;
}

.pagination .page-item.active .page-link {
  background-color: var(--ems-secondary);
  border-color: var(--ems-secondary);
  color: #ffffff;
}

.pagination .page-link {
  color: var(--ems-secondary);
}

.pagination .page-link:hover {
  color: var(--ems-secondary-dark);
  background-color: rgba(0, 0, 0, 0.05);
  border-color: var(--ems-secondary);
}

@media (max-width: 640px) {
  .table-pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}

.table-row-overdue {
  background-color: #fff5f0;
}

.table-row-overdue td {
  border-top-color: rgba(255, 141, 66, 0.28);
}

.table-card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  min-width: 640px;
}

.table-card thead th {
  background: rgba(0, 43, 100, 0.08);
  color: var(--ems-primary);
  padding: var(--ems-space-3) var(--ems-space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 600;
  border-bottom: 2px solid rgba(0, 43, 100, 0.15);
  white-space: nowrap;
}

.table-card tbody td {
  padding: var(--ems-space-3) var(--ems-space-2);
  border-bottom: 1px solid rgba(0, 43, 100, 0.08);
  vertical-align: top;
  background-color: var(--ems-surface);
}

.table-card tbody tr:nth-child(even) td {
  background-color: rgba(0, 43, 100, 0.02);
}

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

.table-card tbody tr:hover td {
  background-color: rgba(0, 43, 100, 0.05) !important;
}

.table-card tbody td .d-flex {
  gap: var(--ems-space-1);
}

.table-card tbody td .badge-soft {
  margin-top: 0.125rem;
}

.table-card .table-empty {
  text-align: center;
  padding: var(--ems-space-4);
  color: var(--ems-text-muted);
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-2);
  align-items: center;
}

.table-toolbar .table-actions {
  display: flex;
  gap: var(--ems-space-2);
  margin-left: auto;
}

.table-toolbar .table-actions .btn {
  border-radius: 999px;
  border: 1px solid rgba(0, 43, 100, 0.12);
  background-color: rgba(0, 43, 100, 0.06);
  color: var(--ems-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--ems-space-1);
}

.table-toolbar .table-actions .btn:hover,
.table-toolbar .table-actions .btn:focus {
  background-color: rgba(0, 43, 100, 0.16);
  border-color: rgba(0, 43, 100, 0.16);
  color: var(--ems-primary);
}

.table-toolbar .table-actions .btn.active {
  background-color: var(--ems-primary);
  color: #ffffff;
  border-color: var(--ems-primary);
  box-shadow: 0 12px 22px rgba(0, 43, 100, 0.25);
}

.filter-pill__label {
  font-size: 0.82rem;
}

.filter-pill__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background-color: rgba(0, 43, 100, 0.18);
  color: var(--ems-primary);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0 0.45rem;
}

.table-toolbar .table-actions .btn.active .filter-pill__count {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.filters-hub {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-3);
}

.filters-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ems-space-2);
  align-items: center;
  border: 1px solid rgba(0, 43, 100, 0.08);
  border-radius: var(--ems-radius-lg);
  padding: var(--ems-space-3);
  background: #fff;
  box-shadow: var(--ems-shadow-soft);
}

.filters-meta {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-2);
}

.filters-count {
  font-weight: 600;
  color: var(--ems-primary);
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: var(--ems-space-2);
  margin-left: auto;
}

.filters-panel {
  border: 1px solid rgba(0, 43, 100, 0.08);
  border-radius: var(--ems-radius-lg);
  padding: clamp(var(--ems-space-3), 3vw, var(--ems-space-4));
  background: #fff;
  box-shadow: var(--ems-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-3);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ems-space-3);
}

.filters-panel__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--ems-space-2);
}

.filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--ems-space-1);
}

[x-cloak] {
  display: none !important;
}

.table-search {
  position: relative;
  flex: 1 1 260px;
}

.table-search input {
  padding-left: 2.35rem;
  border-radius: 999px;
}

.table-search .icon {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  transform: translateY(-50%);
  color: var(--ems-muted);
}

.tanstack-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.tanstack-table thead th {
  background: rgba(0, 43, 100, 0.05);
  color: var(--ems-primary);
  padding: var(--ems-space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 43, 100, 0.08);
  cursor: pointer;
  user-select: none;
}

.tanstack-table thead th.is-sortable:hover {
  background: rgba(0, 43, 100, 0.08);
}

.tanstack-table tbody td {
  padding: var(--ems-space-2);
  border-bottom: 1px solid rgba(0, 43, 100, 0.05);
  vertical-align: middle;
}

.tanstack-table tbody tr:hover td {
  background: rgba(0, 43, 100, 0.03);
}

.sort-indicator {
  margin-left: 0.3rem;
  font-size: 0.7rem;
  color: var(--ems-muted);
}

.tanstack-table thead th.is-sorted .sort-indicator {
  color: var(--ems-primary);
}

.table-link {
  color: var(--ems-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.table-link:hover,
.table-link:focus {
  color: var(--ems-secondary);
  text-decoration: underline;
}

.badge-transferable {
  background-color: rgba(27, 180, 92, 0.14);
  color: #0f6a3a;
}

.badge-non-transferable {
  background-color: rgba(220, 53, 69, 0.15);
  color: #a5283f;
}

.dataTables_wrapper .dt-buttons {
  display: flex;
  gap: var(--ems-space-2);
  flex-wrap: wrap;
  margin-bottom: var(--ems-space-2);
}

.dataTables_wrapper .dt-buttons .btn {
  border-radius: 999px !important;
}

.dataTables_wrapper .dataTables_filter {
  text-align: right !important;
  margin-bottom: var(--ems-space-2);
}

.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.35rem;
  border-radius: 999px !important;
  padding-left: 2.5rem;
  border: 1px solid rgba(0, 43, 100, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23828ba2' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-4.35-4.35M11 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  background-size: 1.05rem;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_info {
  font-size: 0.85rem;
  color: var(--ems-text-muted);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 999px !important;
  padding: 0.35rem 0.9rem !important;
  margin: 0 0.1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--ems-primary) !important;
  border-color: var(--ems-primary) !important;
  color: #ffffff !important;
}

.list-group-flush .list-group-item {
  padding-left: 0;
  padding-right: 0;
  border: none;
}

.list-group-item + .list-group-item {
  border-top: 1px solid rgba(0, 43, 100, 0.08);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-2);
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: var(--ems-space-2);
  padding: var(--ems-space-2);
  border-radius: var(--ems-radius-md);
  border: 1px solid rgba(0, 43, 100, 0.06);
}

.timeline-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background-color: rgba(0, 43, 100, 0.08);
  color: var(--ems-primary);
  font-size: 1rem;
}

.timeline-item__icon .icon {
  width: 1rem;
  height: 1rem;
}

.timeline-item__content {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-0);
}

.timeline-item__title {
  font-weight: 600;
  color: var(--ems-primary);
}

.timeline-item__meta {
  font-size: 0.85rem;
  color: var(--ems-text-muted);
}

.timeline.timeline--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--ems-space-3);
}

.timeline.timeline--grid .timeline-item {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ems-space-2);
  height: 100%;
}

.timeline.timeline--grid .timeline-item__icon {
  margin-bottom: var(--ems-space-1);
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ems-space-3);
}

.definition-grid__item {
  display: flex;
  flex-direction: column;
  gap: var(--ems-space-0);
}

.definition-grid__term {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--ems-text-muted);
}

.definition-grid__description {
  font-size: 1rem;
  color: var(--ems-text-dark);
}

.grid-responsive {
  display: grid;
  gap: var(--ems-space-3);
}

.grid-responsive--three {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-responsive--two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card-divider {
  height: 1px;
  background: rgba(0, 43, 100, 0.08);
  margin: var(--ems-space-3) 0;
}

.muted {
  color: var(--ems-text-muted) !important;
}

.nav-tabs {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-tabs .nav-link {
  color: var(--ems-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--ems-secondary-dark);
  border-bottom-color: transparent;
  background-color: rgba(0, 0, 0, 0.02);
}

.nav-tabs .nav-link.active {
  color: var(--ems-primary);
  background-color: transparent;
  border-bottom-color: transparent;
  font-weight: 600;
}

.stat-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--ems-text-muted);
}

.stat-stack strong {
  color: var(--ems-primary);
}

.empty-state {
  text-align: center;
  padding: var(--ems-space-4);
  color: var(--ems-text-muted);
}

.empty-state .icon {
  font-size: 2rem;
  margin-bottom: var(--ems-space-2);
  color: rgba(0, 43, 100, 0.45);
  width: 2rem;
  height: 2rem;
}

@media (max-width: 1080px) {
  .summary-grid {
    gap: var(--ems-space-2);
  }

  .summary-card {
    border-radius: var(--ems-radius-md);
  }

  .card-elevated > .card-body {
    padding: var(--ems-space-3);
  }

  .filters-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ems-space-3);
  }

  .filters-actions {
    margin-left: 0;
  }

  .ems-toolbar {
    position: static;
    box-shadow: none;
  }

  .ems-toolbar__inner {
    padding: var(--ems-space-3) var(--ems-space-3);
  }

  .app-main {
    padding: var(--ems-space-4) var(--ems-space-3) var(--ems-space-5);
  }

  .form-shell {
    padding: var(--ems-space-3);
  }

  .form-section {
    padding: var(--ems-space-3);
  }

  .form-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .summary-grid {
    gap: var(--ems-space-2);
  }

  .summary-card {
    padding: var(--ems-space-3);
  }

  .card-elevated > .card-body {
    padding: var(--ems-space-3);
  }

  .filters-toolbar,
  .filters-panel {
    padding: var(--ems-space-2);
  }

  .page-title {
    font-size: 1.8rem;
  }

  .ems-toolbar-actions {
    flex-direction: column;
  }

  .ems-toolbar-link {
    width: 100%;
    justify-content: center;
  }

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

  .btn,
  .btn-light,
  .btn-outline-primary {
    width: 100%;
    justify-content: center;
  }

  .dataTables_wrapper .dataTables_filter {
    text-align: left !important;
  }

  .app-main {
    padding: var(--ems-space-3) var(--ems-space-2) var(--ems-space-4);
  }
}

/* Card View for Tables */
.table-view-toggle {
  display: flex;
  align-items: center;
  gap: var(--ems-space-1);
  border: 1px solid rgba(0, 43, 100, 0.15);
  border-radius: var(--ems-radius);
  padding: 0.25rem;
  background: var(--ems-surface);
}

.table-view-toggle button {
  border: none;
  background: transparent;
  padding: 0.4rem 0.6rem;
  border-radius: calc(var(--ems-radius) - 2px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ems-text-muted);
  transition: all 0.2s ease;
}

.table-view-toggle button:hover {
  background: rgba(0, 43, 100, 0.05);
  color: var(--ems-primary);
}

.table-view-toggle button.active {
  background: var(--ems-secondary);
  color: white;
}

.table-view-toggle .icon {
  width: 1rem;
  height: 1rem;
}

.table-card-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--ems-space-3);
  padding: var(--ems-space-2) 0;
}

.table-card-view__card {
  background: var(--ems-surface);
  border: 1px solid rgba(0, 43, 100, 0.08);
  border-radius: var(--ems-radius-lg);
  padding: var(--ems-space-3);
  box-shadow: var(--ems-shadow-soft);
  position: relative;
  transition: all 0.2s ease;
}

.table-card-view__card:hover {
  box-shadow: var(--ems-shadow-md);
  border-color: rgba(0, 43, 100, 0.15);
}

.table-card-view__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: var(--ems-space-2);
}

.table-card-view__field:last-child {
  margin-bottom: 0;
}

.table-card-view__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ems-text-muted);
}

.table-card-view__value {
  font-size: 0.95rem;
  color: var(--ems-text);
  word-break: break-word;
}

.table-card-view__value a {
  color: var(--ems-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.table-card-view__value a:hover,
.table-card-view__value a:focus {
  color: var(--ems-secondary);
  text-decoration: underline;
}

.table-card-view__actions {
  display: flex;
  gap: var(--ems-space-1);
  margin-top: var(--ems-space-2);
  padding-top: var(--ems-space-2);
  border-top: 1px solid rgba(0, 43, 100, 0.08);
  justify-content: flex-end;
}

.table-card-view__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--ems-space-4);
  color: var(--ems-text-muted);
}

.events-card-view,
.venues-card-view {
  padding: var(--ems-space-2) 0;
}

.events-card-view .row,
.venues-card-view .row {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-left: calc(var(--bs-gutter-x) * -0.5);
  margin-right: calc(var(--bs-gutter-x) * -0.5);
}

.events-card-view .col-md-6,
.venues-card-view .col-md-6 {
  flex: 0 0 50% !important;
  max-width: 50% !important;
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
}

@media (max-width: 767.98px) {
  .events-card-view .col-md-6,
  .venues-card-view .col-md-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 640px) {
  .table-card-view {
    grid-template-columns: 1fr;
  }
}

/* Bundle Selection Styles */
.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.bundle-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.bundle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bundle-card .card-body {
  padding: 1.25rem;
}

.bundle-card .card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.bundle-card .list-unstyled {
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

/* Notification Bell Styles */
.notifications-bell {
  position: relative;
  display: inline-block;
}

.notifications-bell__button {
  position: relative;
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--ems-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notifications-bell__icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.notifications-bell__badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  transform: translate(25%, -25%);
}

.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 360px;
  max-width: 90vw;
  background: white;
  border: 1px solid var(--ems-border);
  border-radius: var(--ems-radius-md);
  box-shadow: var(--ems-shadow-strong);
  z-index: 1000;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.notifications-dropdown__header {
  padding: 1rem;
  border-bottom: 1px solid var(--ems-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notifications-dropdown__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ems-text-dark);
}

.notifications-dropdown__mark-all {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

.notifications-dropdown__list {
  overflow-y: auto;
  flex: 1;
  max-height: 400px;
}

.notifications-dropdown__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ems-text-muted);
}

.notifications-dropdown__item {
  display: block;
  padding: 1rem;
  border-bottom: 1px solid var(--ems-border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.notifications-dropdown__item:hover {
  background-color: var(--ems-surface-subtle);
}

.notifications-dropdown__item--unread {
  background-color: #e7f3ff;
  font-weight: 500;
}

.notifications-dropdown__item-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notifications-dropdown__item-title {
  font-weight: 600;
  color: var(--ems-text-dark);
  font-size: 0.9375rem;
}

.notifications-dropdown__item-body {
  color: var(--ems-text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.notifications-dropdown__item-time {
  color: var(--ems-text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.notifications-dropdown__footer {
  padding: 0.75rem;
  border-top: 1px solid var(--ems-border);
}

