/* ================================================
 ROOT VARIABLES â€” SCIâ€‘FI / CDS THEME
  (lighter content, dark space background)
================================================= */
:root {
  --color-bg: #0a0f1a;           /* Deep space background (unchanged) */

  /* Lightened content surfaces */
  --color-surface: #141b2f;      /* Lighter panel surface */
  --color-surface-alt: #1f2937;  /* Alternate panel, still lighter than before */

  --color-border: #2d3a58;       /* Slightly brighter border */
  --color-border-glow: rgba(0, 233, 255, 0.35);

  /* Brighter text */
  --color-text: #f3f4f6;         /* Almost white text */
  --color-text-muted: #a5b4fc;   /* Light, cool muted text */

  --color-accent: #00e7ff;       /* Holographic cyan glow */
  --color-accent-dim: #0096aa;
  --color-accent-glow: rgba(0, 231, 255, 0.45);

  /* Softer, modern rounded look */
  --radius: 12px;
  --radius-sm: 6px;

  --shadow-glow: 0 0 18px rgba(0, 231, 255, 0.25);
  --shadow-panel: 0 0 25px rgba(0, 231, 255, 0.18);

  --space-xs: 0.35rem;
  --space-sm: 0.6rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
}

/* ================================================
 GLOBAL STYLES
================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);

  /* Modern system font stack */
 font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color: var(--color-text);
  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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


/* ================================================
 LINKS â€” MATCH HINT TEXT (TEAL)
================================================= */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: #38e1ff;
  text-shadow: 0 0 6px var(--color-accent-glow);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Subtle starfield effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(0,255,255,0.05) 0, transparent 40%),
    radial-gradient(circle at 80% 40%, rgba(0,255,255,0.04) 0, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(0,255,255,0.05) 0, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* ================================================
 APP LAYOUT
================================================= */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  z-index: 1;
}

/* ================================================
 HEADER / NAV
================================================= */
.app-header {
  background: rgba(10, 15, 26, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-panel);
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
}

/* Branding */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-logo {
  padding: 0;
  background: none;
  box-shadow: none;

  height: 72px;
  width: auto;
  display: flex;
  align-items: center;
  overflow: visible;
}

.brand-logo img {
  height: 100%;
  width: auto;
  display: block;
}

.brand-text-main {
  font-size: 1rem;
  font-weight: 600;
}

.brand-text-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Navigation */
.header-nav {
  display: flex;
  gap: var(--space-md);
  flex-wrap: nowrap;
}

.header-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: 0.2s;
}

.header-nav a:hover {
  background: rgba(0, 233, 255, 0.12);
  color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

.header-nav a.active {
  background: rgba(0, 233, 255, 0.18);
  color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}

/* ================================================
   Header navigation: desktop defaults
   ================================================ */

.nav-toggle {
  display: none;
}

/* ================================================
 MAIN
================================================= */
.app-main {
  padding: var(--space-lg) var(--space-md);
  box-sizing: border-box;
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-title {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(0, 233, 255, 0.3);
}

.page-subtitle {
  color: var(--color-text-muted);
}

.page-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  box-sizing: border-box;
}

/* ================================================
 PANELS / CARDS
================================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);

  /* spacing between stacked cards */
  margin-bottom: var(--space-lg);
}

.card-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-accent);
}

.card-subtitle {
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.section-card {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  border: 1px solid var(--color-border);



  /* spacing */
  margin-bottom: var(--space-lg);
}

.section-card .card-header {
  background-color: var(--color-surface-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-card .toggle-edit {
    margin-left: auto;
}

/* ================================================
 DASHBOARD TILES — OUTLINE PRIMARY STYLE
================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
}

.dashboard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    padding: var(--space-md);
    text-decoration: none;

    border: 1px solid var(--color-accent);
    border-radius: var(--radius);

    background: rgba(0, 231, 255, 0.06);
    color: var(--color-text);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.08s ease;
}

.dashboard-tile:hover {
    background: rgba(0, 231, 255, 0.12);
    border-color: #38e1ff;
    transform: translateY(-1px);
}

.dashboard-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;
    margin-bottom: var(--space-sm);

    border: 1px solid var(--color-accent);
    border-radius: var(--radius);

    background: rgba(10, 15, 26, 0.6);
    color: var(--color-accent);
}

.dashboard-tile-icon svg {
    width: 46px;
    height: 46px;
    stroke: currentColor;
    fill: none;
}

.dashboard-tile-label {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--color-text-muted);
}

.dashboard-tile:hover .dashboard-tile-label {
    color: var(--color-accent);
}

/* ================================================
   FORM VALIDATION STATES (THEME-CONSISTENT)
================================================ */

.form-control.is-valid {
  border-color: #22c55e; /* green */
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.45);
}

.form-control.is-invalid {
  border-color: #ef4444; /* matches destructive/edit red feel */
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.45);
}

.form-hint.hint-valid {
  border-left-color: #22c55e;
  color: #22c55e;
}

.form-hint.hint-invalid {
  border-left-color: #ef4444;
  color: #ef4444;
}

.form-hint.hint-warning {
  border-left-color: #ff9f00;
  color: #ff9f00;
}

.form-hint a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-body .form-hint {
    display: block;
}

/* ================================================
 FORMS
================================================= */
.form-wrapper {
    width: 100%;
    margin: 0 auto;
    background: rgba(20, 31, 59, 0.9);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-panel);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.form-grid {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-md);
}

.form-label {
  font-weight: 600;
}

.form-control {
  width: 85%;
  box-sizing: border-box;
  background: #1f2937;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent-glow);
  outline: none;
}

.form-actions {
  padding: 0 var(--space-md) var(--space-md);
}

.form-hint {
  width: 85%;
  background: rgba(0, 233, 255, 0.07);
  border-left: 3px solid var(--color-accent);
  color: var(--color-accent);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* ================================================
 BUTTONS â€” CDS GRADIENT
================================================= */
.btn {
  border: none;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: 0.2s ease;
  color: white;
}

/* PRIMARY ACTION – neon-outline with strong text contrast */
.btn-primary,
.cds-button {
  /* Brand colours */
  --neon-start: #0ea5e9;  /* cyan */
  --neon-end:   #22d3ee;  /* neon teal */

  /* ? Higher-energy neon fill */
background:
  linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.22),
    rgba(34, 211, 238, 0.22)
  );

color: #04131f;

  /* ? Dark text with real contrast */
  color: #38e1ff;

  /* Clear outline defines affordance */
  border: 1px solid #0ea5e9;

  font-weight: 600;
  box-shadow: none;

  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.05s ease;
}

/* Hover: more neon, not more depth */
.btn-primary:hover,
.cds-button:hover {
  background:
    linear-gradient(
      135deg,
      rgba(14, 165, 233, 0.55),
      rgba(56, 225, 255, 0.55)
    );
  border-color: #38e1ff;
  color: #020c14;
}

/* Active: tactile press, no glow explosion */
.btn-primary:active,
.cds-button:active {
  transform: translateY(1px);
  box-shadow: inset 0 4px 10px rgba(8, 47, 73, 0.45);
}

/* ? Proper keyboard focus (WCAG 2.2 compliant) */
.btn-primary:focus-visible,
.cds-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 6px #22d3ee;
}

/* Disabled stays readable */
.btn-primary:disabled,
.cds-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:disabled,
.btn:disabled {
    cursor: not-allowed;
}

.btn-spaced {
  margin-top: var(--space-md);
}

.btn-outline-primary {
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    background: transparent;
    transition: 0.2s ease;
}

.btn-outline-primary:hover {
    color: #0a0f1a; /* your background colour */
    background: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.btn-outline-primary:active {
    background: var(--color-accent-dim);
    box-shadow: 0 0 12px var(--color-accent-glow);
}

.btn-outline-secondary {
    color: #6c757d;
    border: 1px solid #6c757d;
    background-color: transparent;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: #ffffff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* -----------------------------
   Secondary button
----------------------------- */
.btn-secondary {
    background: linear-gradient(135deg, #e6f2f0, #d1ebe7);
    color: #0b3f3a;
    border: 1px solid #0b3f3a;
    box-shadow: 0 6px 14px rgba(11, 63, 58, 0.15);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #d1ebe7, #bfe3de);
    box-shadow: 0 10px 22px rgba(11, 63, 58, 0.25);
}

.btn-secondary:active {
    box-shadow: 0 4px 10px rgba(11, 63, 58, 0.45);
}

.btn-secondary:focus-visible {
    outline: 2px solid #0b3f3a;
}

/* Inline action forms */
form.form-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
}

/* ================================================
 FOOTER
================================================= */
.app-footer {
  background: #111827;
  border-top: 1px solid var(--color-border);
  padding: var(--space-md);
  color: var(--color-text-muted);
}

.app-footer-inner {
  display: flex;
  justify-content: space-between;
}

/* ================================================
 UTILITIES
================================================= */
.text-muted {
  color: var(--color-text-muted);
}

.stack-md {
  margin-top: var(--space-md);
}

/* ================================================
 LINKS â€” MATCH HINT TEXT (TEAL, SUBTLE)
================================================= */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: #38e1ff; /* slightly brighter teal */
  text-shadow: 0 0 6px var(--color-accent-glow);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ================================================
 RESPONSIVE PAGE CONTAINER
================================================= */
.page-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

@media (max-width: 992px) {
  .page-content {
    max-width: 90%;
  }
}

@media (max-width: 600px) {
  .page-content {
    max-width: 100%;
    padding: var(--space-md);
  }
}

/* ================================================
   TABLES — MODERNISED, ROUNDED & LIGHTER
================================================= */

/* Base table styling (shared by all tables) */
table,
.table,
.table-borderless {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;

  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  color: var(--color-text);

  margin-bottom: var(--space-lg);
}


/* Table headers */
table thead th,
.table thead th {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Cell spacing & borders */
table th,
table td,
.table th,
.table td,
.table-borderless th,
.table-borderless td {
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

/* Remove bottom border on last row */
table tbody tr:last-child td,
.table tbody tr:last-child td,
.table-borderless tbody tr:last-child td,
table tbody tr:last-child th,
.table tbody tr:last-child th,
.table-borderless tbody tr:last-child th {
  border-bottom: none;
}

/* Row hover */
table tbody tr:hover,
.table tbody tr:hover {
  background-color: rgba(30, 64, 175, 0.45);
}

/* =================================================
   PROFILE TABLES — CONSISTENT LABEL / VALUE ALIGNMENT
   (Desktop only; mobile untouched)
================================================= */
@media (min-width: 769px) {

    /* Force consistent column widths across all profile cards */
    .section-card table {
        table-layout: fixed;
        width: 100%;
    }

    /* Label column */
    .section-card table th {
        width: 38%;
        text-align: left;
        vertical-align: middle;
        white-space: normal;
        padding-right: 1.25rem;
    }

    /* Value column */
    .section-card table td {
        width: 62%;
        text-align: left;
        vertical-align: middle;
    }
}
/* =================================================
   DEFAULT TABLE BEHAVIOUR
   (Data / admin / list tables)
================================================= */

/* Tables are FLEXIBLE by default */
table {
  table-layout: auto;
}

/* Allow content to wrap naturally */
table th,
table td {
  white-space: normal;
  overflow-wrap: break-word;
  vertical-align: top;
}

/* =================================================
   FIXED-LAYOUT TABLES (OPT-IN)
   Use for form / label-value tables only
================================================= */

.table-fixed {
  table-layout: fixed;
}

.table-fixed th {
  width: 16rem; /* consistent label column */
}
/* =================================================
   MOBILE ROW SEPARATION (OVERRIDE BASE TABLE SPACING)
================================================= */
@media (max-width: 768px) {
  table,
  .table,
  .table-borderless {
    border-spacing: 0 0.75rem; /* vertical space between rows */
  }
}

/* ================================================
 MODALS
================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.modal-overlay.is-visible {
  display: flex;
}

.modal-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-panel);
  margin-bottom: var(--space-lg);
}

/* ================================================
 PROFILE HERO LAYOUT (social-style)
================================================= */

.profile-hero-card {
  /* Slightly larger feel for the hero card if desired */
}

.profile-hero-card .card-header {
  border-bottom: 1px solid var(--color-border);
}

.profile-hero-card .card-body {
  padding: var(--space-md);
}

/* Container: image left, info right */
.profile-hero-layout {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap; /* stack on small screens */
}

/* Left column: large image */
.profile-hero-photo {
  flex: 0 0 auto;
}

/* Large profile image (actual photo) */
.profile-photo-lg {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow-panel);
  border: 1px solid var(--color-border);
}

/* Large placeholder when there is no photo */
.profile-photo-placeholder-lg {
  width: 220px;
  height: 220px;
  border-radius: var(--radius);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-panel);
  border: 1px solid var(--color-border);
}

.profile-photo-thumb {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 6px; /* rounded square */
    cursor: pointer;
}

.profile-photo-initial {
  font-size: 3rem;
  font-weight: 700;
}

/* Right column: name + meta */
.profile-hero-main {
  flex: 1 1 260px;
  min-width: 0;
}

/* Header row: name + status badge right aligned */
.profile-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.profile-name {
  font-size: 1.5rem;
  margin: 0;
}

/* Handle â€“ subtle, like @username */
.profile-handle {
  font-size: 0.9rem;
}

/* Status badge sits nicely in the top-right of the header block */
.profile-status-badge {
  white-space: nowrap;
}

/* Meta: membership type, number, joined */
.profile-hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
}

.profile-meta-item {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.profile-meta-item .meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}

.profile-meta-item .meta-value {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .profile-hero-layout {
    align-items: flex-start;
  }

  .profile-photo-lg,
  .profile-photo-placeholder-lg {
    width: 160px;
    height: 160px;
  }

  .profile-hero-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-status-badge {
    margin-top: 0.25rem;
  }
}

/* ================================================
 PROFILE PHOTOS
================================================= */
.profile-photo {
  max-width: 140px;
  height: 140px;
  object-fit: cover;
}

.profile-photo-placeholder {
  width: 140px;
  height: 140px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Badge fallback */
.badge.bg-secondary,
.profile-status-badge {
    background: rgba(255, 255, 255, 0.06);       /* very soft tint */
    color: var(--color-text-muted);              /* subtle text colour */
    border: 1px solid rgba(255, 255, 255, 0.12); /* faint border */
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: none;                       /* cleaner look */
}

.card,
.section-card,
.form-wrapper,
.modal-card {
  border-radius: var(--radius);
  overflow: hidden;      /* ðŸ”‘ ensures inner content respects rounding */
  position: relative;    /* good practice when using overflow */
}

/* Default: hide editable fields */
.field-edit {
    display: none;
}

/* Default: show display-only fields */
.field-display {
    display: inline;
}

/* Edit mode */
.section-card.editing .field-display {
    display: none;
}

.section-card.editing .field-edit {
    display: block;
}

/* Utility class to hide elements (needed for Edit/Done toggle) */
.d-none {
    display: none !important;
}


/* ================================================
 FLOATING SAVE BAR (GLOBAL COMPONENT)
================================================ */

#submit-bar {
    position: fixed;              /* stick to viewport */
    left: 50%;                    /* horizontally center */
    bottom: 15%;                  /* float into middle-ish area */
    transform: translateX(-50%);
    width: auto;
    max-width: 90%;
    padding: var(--space-md) var(--space-lg);

    /* Theme visuals */
    background: rgba(10, 15, 26, 0.92);   /* semi-glass panel */
    border: 1px solid var(--color-border);
    border-radius: var(--radius);

    /* Elevation + glow */
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.55),
        0 0 25px var(--color-accent-glow),
        0 0 12px rgba(0, 231, 255, 0.25);

    backdrop-filter: blur(10px);
    z-index: 999;                 /* above main content */
}

/* We don't need the hr divider anymore */
#submit-bar hr {
    display: none;
}

/* Layout inside the bar */
#submit-bar .d-flex {
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
}

/* Entry animation when bar first appears */
#submit-bar:not(.d-none):not(.is-hiding) {
    animation: save-bar-float-in 0.35s ease-out;
}

@keyframes save-bar-float-in {
    from {
        opacity: 0;
        transform: translate(-50%, 20%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0%);
    }
}

/* Cancel changes link (secondary action in save bar) */
.cancel-link {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Disabled state - greyed out when nothing changed */
.cancel-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.cancel-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* Fade-out animation when cancelling */
#submit-bar.is-hiding {
    animation: save-bar-fade-out 0.25s ease-in forwards;
}

/* Improve alignment of page headers globally */
.page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
}

@keyframes save-bar-fade-out {
    from {
        opacity: 1;
        transform: translate(-50%, 0%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, 10%);
    }
}

/* Global card body padding for all cards */
.card-body {
    padding: var(--space-md);
}

.card-content {
    padding: var(--space-md);
}


/* ================================================
   CHECKING STATE (AJAX IN FLIGHT)
================================================ */

.form-control.is-checking,
.form-control.is-checking:focus {
  border-color: var(--color-text-muted);
  animation: input-pulse 1.2s ease-in-out infinite;
  outline: none;
}

.form-hint.hint-checking {
  border-left-color: var(--color-text-muted);
  color: var(--color-text-muted);
}

/* Validation focus overrides */
.form-control.is-valid:focus {
  outline: none;
}

.form-control.is-invalid,
.form-control.is-invalid:focus {
  border-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.45);
  outline: none;
}

@keyframes input-pulse {
  0% {
    box-shadow: inset 0 0 0 0 rgba(165, 180, 252, 0.35);
  }
  70% {
    box-shadow: inset 0 0 0 3px rgba(165, 180, 252, 0.15);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(165, 180, 252, 0);
  }
}

/* Password field with show/hide button */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 85%;          /* match your .form-control width */
}

.password-field .form-control {
  width: 100%;         /* fill the wrapper */
  padding-right: 3rem; /* space for the eye button */
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  color: inherit;
}

.password-toggle:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.password-toggle-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

/* Offset anchor scrolling for sticky header */
.anchor-target {
    scroll-margin-top: 120px;
}

/* Space buttons that use btn-spaced */
.btn-spaced {
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
}

/* ================================================
   DATETIME PICKER — CDS THEME ALIGNMENT
   Makes the calendar affordance obvious and on-theme
================================================ */

/* Base date & time inputs */
input[type="date"],
input[type="time"] {
  cursor: pointer;
  padding-right: 3.25rem;
}

/* Shared calendar/clock icon styling (WebKit) */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  transform: scale(1.8);
  margin-right: 0.75rem;
  cursor: pointer;
}

/* Hover state — mirrors link / button glow behaviour */
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
  text-shadow: 0 0 8px var(--color-accent-glow);
}

/* Focus state — matches form-control focus feel */
input[type="date"]:focus::-webkit-calendar-picker-indicator,
input[type="time"]:focus::-webkit-calendar-picker-indicator {
  text-shadow:
    0 0 10px var(--color-accent-glow),
    0 0 4px rgba(0, 231, 255, 0.4);
}

/* ================================================
 LAYOUT UTILITIES
================================================= */

/* Inline row of action forms (multiple POST buttons side-by-side) */
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.action-row > form {
    margin: 0;
}

/* =================================================
   HEADER & NAVIGATION — MOBILE
================================================ */
@media (max-width: 768px) {

  .app-header-inner {
    position: relative;
  }

  /* Burger button */
  .nav-toggle {
    display: block;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
  }

  .nav-toggle-bar {
    display: block;
    width: 24px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--color-accent);
    border-radius: 2px;
  }

  /* Mobile menu panel */
  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;

    background: rgba(10, 15, 26, 0.96);
    backdrop-filter: blur(10px);

    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-panel);

    padding: var(--space-sm) 0;
    flex-direction: column;
    gap: 0;

    z-index: 1000;
  }

  /* Open state */
  .header-nav[data-open="true"] {
    display: flex;
  }

  /* Menu links */
.header-nav a {
  position: relative;           /* anchor for ::after */
  display: block;

  padding: 0.9rem 1.25rem 1.2rem; /* extra bottom space for divider */
  line-height: 1.4;
  text-align: left;

  font-size: 1rem;
  color: var(--color-text-muted);
  text-decoration: none;

  border-left: 3px solid transparent;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
  .header-nav a:hover,
  .header-nav a:focus-visible {
    background-color: rgba(0, 231, 255, 0.12);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
  }

  .header-nav a.active {
    background-color: rgba(0, 231, 255, 0.18);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
  }

/* Subtle separators between mobile nav items */
.header-nav a:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0.35rem;              /* sits below text, not through it */

  height: 1px;

  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 231, 255, 0.25),
    transparent
  );
}
  /* ---------------------------------
     FORMS
  --------------------------------- */

  .form-control,
  .form-hint {
    width: 100%;
    max-width: 100%;
  }

  .form-wrapper .form-grid .form-control,
  .form-wrapper .form-grid .form-hint {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ---------------------------------
     TABLES
  --------------------------------- */
  .card table,
  .card tbody,
  .card tr {
    display: block;
    width: 100%;
  }

  .card th {
    display: none;
  }

  .card td {
    display: block;
    width: 100%;
    padding-left: var(--space-sm);
    box-sizing: border-box;
  }

  .card table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
  }

/* ---------------------------------
   Mobile table rows as cards
--------------------------------- */
.card tbody tr {
  background: var(--color-surface);
  border: 2px solid var(--color-border); /* stronger border */
  border-radius: var(--radius);
  padding: var(--space-sm);
  margin-bottom: var(--space-md);

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Alternate stacked "columns" inside mobile cards */
.card tbody tr td:nth-child(even) {
  background: linear-gradient(
    to right,
    rgba(30, 64, 175, 0.17),
    rgba(30, 64, 175, 0.11)
  );
  border-radius: calc(var(--radius) / 2);
  padding: var(--space-xs) var(--space-sm);
}

/* Remove inner cell borders on mobile cards */
.card tbody tr td {
  border-bottom: none;
}

/* Last card spacing tidy-up */
.card tbody tr:last-child {
  margin-bottom: 0;
}

.card table {
  border: none;
  box-shadow: none;
}
