/* ==========================================================================
   Content Portal
   --------------------------------------------------------------------------
    1. Tokens
    2. Base
    3. Buttons
    4. Dividers
    5. Scroll containers and helpers
    6. Custom radio and toggle switch
    7. Login
    8. Form controls
    9. Multiselect dropdown
   10. App shell (navbar, side menu, content grid)
   11. Panels (left sidebar, main content)
   12. Data grid
   13. Content line: yes/no switch and placeholder select
   14. Toasts
   15. Split card, status fields, info rows
   16. Modal
   17. Forms (channel wizard, entity forms)
   18. Right sidebar
   19. Breadcrumb
   20. Skeleton loader
   21. Column layouts
   22. Progress bar
   23. Responsive

   Order matters in a few places where rules have equal specificity;
   those spots are marked with "ORDER:".
   ========================================================================== */


/* ==========================================================================
   1. Tokens
   Colour names match the Figma variables exactly, so the
   `var(--Action-blue, #1895E4)` snippets that Dev Mode emits resolve to them.
   Custom properties are case-sensitive: `--white` and `--White` are two
   different variables.
   ========================================================================== */

:root {
  --White: #FFF;
  --Black: #000;
  --Action-blue: #1895E4;
  --Caution-yellow: #DA8E00;
  --Light-gray: #9E9E9E;
  --Highlight-gray: #767676;
  --Input-gray: #303030;
  --Dark-gray: #202020;
  --Abyss-gray: #101010;

  --Primary-gradient: linear-gradient(90deg, #123C56 0%, #14689C 100%);
  --Secondary-gradient: linear-gradient(90deg, #2A3033 0%, #465357 100%);
  --Success-gradient: linear-gradient(90deg, #004505 0%, #017007 100%);
  --Warning-gradient: linear-gradient(90deg, #713D01 0%, #D18F01 100%);
  --Error-gradient: linear-gradient(90deg, #510001 0%, #A50103 100%);

  --Modal-blue: rgba(14, 51, 74, .85);
  --Warning-Modal-Yellow: rgba(151, 98, 0, .85);

  --track-bg: var(--Abyss-gray, #101010);
  --ok-green: var(--Success-gradient, linear-gradient(90deg, #004505 0%, #017007 100%));

  --text-gray: #ccc;
  --label-width: 200px;
  --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-heading: 'Montserrat', var(--font-body);
}


/* ==========================================================================
   2. Base
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Form controls don't inherit the page font by default */
button,
input,
select,
textarea {
  font-family: inherit;
}

body {
  max-width: 1920px;
  margin: 0 auto;
  background: var(--Abyss-gray);
  color: var(--White);
  font-family: var(--font-body);
}

h2,
.secondary {
  color: var(--White);
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
  overflow-wrap: break-word;
}

h3 {
  color: var(--White);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: break-word;
  padding: 20px;
}

h4 {
  color: var(--White);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: break-word;
}

/* ORDER: after h2/.secondary so .bold wins on the same element */
.bold             { font-weight: bold; }
.full-width       { width: 100%; }
.no-padding-left  { padding-left: 0 !important; }
.no-padding-right { padding-right: 0 !important; }
.flex-row         { flex-direction: row !important; }
.flex-column      { flex-direction: column !important; }

/* ==========================================================================
   3. Buttons
   ========================================================================== */

button,
.btn {
  /*display: flex;*/
  align-items: center;
  /*gap: 10px; */
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}

button {
  background: var(--Secondary-gradient);
  color: var(--White);
  font-weight: 600;
}

button.primary,
button.blue {
  background: var(--Primary-gradient);
}

button:disabled {
  opacity: .15;
  cursor: not-allowed;
}

.btn {
  font-weight: 700;

  &.btn--warning {
    background: var(--Warning-gradient);
    color: var(--Black);
  }

  &.btn--secondary {
    background: var(--Secondary-gradient);
    color: var(--White);
  }
}


/* ==========================================================================
   4. Dividers
   ========================================================================== */

.separator-line-horizontal,
.horizontal-divider,
.modal-separator,
.content-sidebar .separator,
.split-card-separator {
  flex-shrink: 0;   /* a 1px line must never collapse in a flex column */
  align-self: stretch;
  height: 1px;
  border: 0;
  background: var(--Abyss-gray);
}

.separator-line-vertical,
.vertical-divider,
.split-card-divider {
  flex-shrink: 0;
  align-self: stretch;
  width: 1px;
  border: 0;
  background: var(--Abyss-gray);
}

/* Dividers inside split cards are lighter */
.split-card-separator,
.split-card-divider {
  background: var(--Input-gray);
}


/* ==========================================================================
   5. Scroll containers and helpers
   ========================================================================== */

.content-scrollable {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 20px;
  overflow-x: hidden;
  overflow-y: auto;
}

.content-scrollable::-webkit-scrollbar,
.checkboxes::-webkit-scrollbar {
  width: 8px;
}

.content-scrollable::-webkit-scrollbar-track,
.checkboxes::-webkit-scrollbar-track {
  border-radius: 4px;
  background: var(--Abyss-gray);
}

.content-scrollable::-webkit-scrollbar-thumb,
.checkboxes::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #14689C;
}

.content-scrollable::-webkit-scrollbar-thumb:hover,
.checkboxes::-webkit-scrollbar-thumb:hover {
  background: #448AFF;
}

/* Firefox has no ::-webkit-scrollbar. The guard keeps Chromium on the rules
   above (scrollbar-color would override them there). */
@supports not selector(::-webkit-scrollbar) {
  .content-scrollable,
  .checkboxes {
    scrollbar-color: #14689C var(--Abyss-gray);
    scrollbar-width: thin;
  }
}

.input-like {
  margin-bottom: 10px;
  padding: 10px 12px;
  color: var(--White);
  font-size: 16px;
}

.input-explain-text {
  display: flex;
  align-items: center;
  align-self: stretch;
  max-width: 450px;
  padding: 0 30px;
  font-style: italic;

  &.wide {
    max-width: fit-content;
  }
}


/* ==========================================================================
   6. Custom radio and toggle switch
   ORDER: before section 8, so `input[type="checkbox"]` sizing still wins
   over `.toggle input` (same specificity).
   ========================================================================== */

.custom-radio {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--Input-gray);
  border-radius: 50%;
  background-color: var(--Abyss-gray);
  cursor: pointer;
}

input:checked + .custom-radio {
  border-color: #2563eb;

  &::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2563eb;
    transform: translate(-50%, -50%);
  }
}

/* Toggle: .toggle-wrapper > .toggle-control > option · .toggle · option */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-gray);
  font-size: 16px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-option {
  color: #aaa;
}

/* Emphasise the first option when off, the last when on */
.toggle-option:first-child,
.toggle-control:has(input:checked) .toggle-option:last-child {
  color: var(--White);
  font-weight: 600;
}

.toggle-control:has(input:checked) .toggle-option:first-child {
  font-weight: normal;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;

  input {
    width: 0;
    height: 0;
    opacity: 0;
  }

  /* Scoped to .toggle – it used to be a global .slider that also leaked
     into the switch in section 13. */
  .slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background-color: #555;
    cursor: pointer;
    transition: background-color .2s;

    &::before {
      content: "";
      position: absolute;
      top: 3px;
      left: 3px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background-color: var(--White);
      transition: transform .2s;
    }
  }

  input:checked + .slider {
    background-color: var(--Action-blue);

    &::before {
      background-color: var(--Modal-blue);
      transform: translateX(20px);
    }
  }
}

/* Keyboard focus ring for both switch styles */
.toggle input:focus-visible + .slider,
li.content-line .toggle-container .switch-wrapper .toggle-input:focus-visible + .slider {
  outline: 2px solid #2196F3;
  outline-offset: 2px;
}


/* ==========================================================================
   7. Login
   ========================================================================== */

.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;

  .login-container {
    max-width: 360px;
    padding: 24px;

    label {
      padding-bottom: 5px;
    }
  }

  .login-header {
    display: flex;
    justify-content: center;
    align-items: center;

    .header-text {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 10px;
      font-size: 1.1em;

      h1 {
        font-size: 1.8em;
      }
    }

    .logo {
      display: flex;
      justify-content: center;
      width: 250px;
      height: 250px;
    }
  }

  .error {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffe6e6;
    color: #8a0000;
    font-size: 14px;
  }
}

.login-container button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: var(--Primary-gradient);
}


/* ==========================================================================
   8. Form controls
   ========================================================================== */

.field {
  height: 84px;
  margin-bottom: 14px;
  text-align: center;
}

label {
  display: block;
  color: var(--Light-gray);
}

input,
select {
  width: 320px;
  padding: 14px 12px;
  border: 1px solid var(--Abyss-gray);
  border-radius: 5px;
  background-color: var(--Input-gray);
  color: var(--White);
  font-size: 16px;
}

input[type="radio"],
input[type="checkbox"] {
  appearance: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--Input-gray);
  background-color: var(--Abyss-gray);

  &:checked {
    background-color: var(--Action-blue);
    box-shadow: inset 0 0 0 2px var(--Abyss-gray);
  }
}

input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-bottom: 6px;
  padding: 2px;
  border-radius: 13px;
  background-clip: padding-box;
  box-shadow: none;
  transition: 120ms ease-in-out;
  transition-property: background-color, box-shadow;
}

input[type="checkbox"] {
  width: 26px;
  height: 26px;
  padding: 1px;
  background-clip: content-box;

  /* Checkmark image – kept at scale(0); the checked state is the blue fill */
  &::before {
    content: url("/assets/img/checkmark.svg");
    width: 14.999px;
    height: 11.238px;
    margin-bottom: 2px;
    transform: scale(0);
    transition: transform 120ms ease-in-out;
  }
}

input:disabled,
select:disabled,
input:disabled + label,
select:disabled + label {
  opacity: .15;
}

select {
  display: flex;
  align-items: center;
  height: 48px;
  appearance: base-select;
}

/* Must stay a separate rule. Browsers without ::picker() (Firefox, Safari < 27)
   drop an entire rule when one selector in its list is unknown – the old
   `input, select, ::picker(select) { … }` lost all input styling there. */
::picker(select) {
  appearance: base-select;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 320px;
  padding: 0;
  border: 1px solid var(--Light-gray);
  border-radius: 5px;
  background: var(--Input-gray);
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, .5);
  color: var(--White);
  font-size: 16px;
}

option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-self: stretch;
  gap: 10px;
  height: 48px;
  padding: 10px;
  border-radius: 5px;
}

/* ORDER: hover beats checked, focus beats hover */
option:checked    { background: var(--Highlight-gray); }
option:hover      { background: var(--Action-blue); }
option:focus      { background: var(--Highlight-gray); }
option::checkmark { display: none; }

textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--Abyss-gray);
  border-radius: 5px;
  background: var(--Input-gray);
  color: var(--White);
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: keep-all;
  resize: vertical;
}

/* ORDER: after the radio/checkbox borders; focus after hover */
input:hover,
select:hover,
textarea:hover {
  border: 1px solid var(--Action-blue);
}

input:focus {
  outline: none;
  border-color: var(--White);
}

.input-style {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--Abyss-gray);
  border-radius: 5px;
  background-color: var(--Input-gray);
  color: var(--White);
  font-size: 16px;
}

/* `.selectBox :hover` means "any hovered element inside .selectBox" – in
   practice the .overSelect overlay, which is what draws the blue box.
   ORDER: before the focus rule so focus still wins. */
.input-style:hover,
.selectBox :hover {
  border: 1px solid var(--Action-blue);
}

.input-style:is(:focus, :open) {
  outline: none;
  border-color: var(--White);
}

select.input-style {
  appearance: none;
  padding-right: 30px;   /* keep text clear of the arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}


/* ==========================================================================
   9. Multiselect dropdown
   ========================================================================== */

.multiselect {
  position: relative;   /* anchor for .checkboxes */
  width: 100%;
}

.selectBox {
  position: relative;

  select {
    width: 100%;
  }
}

.overSelect {
  position: absolute;
  inset: 0;
}

.checkboxes {
  position: absolute;
  z-index: 1;
  display: none;   /* opened from JS */
  min-width: 300px;
  max-height: 500px;
  overflow-y: auto;
  padding-top: 10px;
  border: 1px solid var(--Abyss-gray);
  border-radius: 5px;
  background-color: var(--Input-gray);
  color: var(--White);
  font-size: 16px;

  label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    cursor: pointer;
  }

  label input[type="checkbox"] {
    appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1px solid var(--Input-gray);
    border-radius: 4px;
    background: var(--Abyss-gray);
    cursor: pointer;

    &:checked {
      border-color: #888;
      background-color: #505050;
    }

    &:checked::after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 7px;
      height: 13px;
      border: 2px solid var(--White);
      border-top: none;
      border-left: none;
      transform: translate(-50%, -60%) rotate(45deg);
    }
  }
}


/* ==========================================================================
   10. App shell
   ========================================================================== */

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

#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--Dark-gray);

  .navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;

    button:hover {
      background: rgba(255, 255, 255, .15);
      transform: scale(1.05);
      cursor: pointer;
    }

    button:active {
      transform: scale(.95);
    }

    .menu-icon svg {
      transition: transform .3s ease;
    }

    .nav-header-text {
      display: flex;
      align-items: center;
      gap: 10px;
      height: 60px;
      padding: 10px 20px;
    }
  }

  .navbar-right .nav-brand {
    display: flex;
    align-items: center;
  }
}

#navbar .navbar-left .menu-icon,
#navBackBtn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  width: 80px;
  height: 80px;
  aspect-ratio: 1 / 1;
  border: 0;
  background: var(--Dark-gray);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;

  &.active {
    opacity: 1;
    visibility: visible;
  }
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  width: 434px;
  overflow-y: auto;
  background: var(--Black);
  box-shadow: 2px 0 10px rgba(0, 0, 0, .1);
  transform: translateX(-100%);
  transition: transform .3s ease-in-out;

  &.active {
    transform: translateX(0);
  }
}

.sidebar-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  height: 80px;

  .sidebar-close {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;

    &:hover {
      background: rgba(255, 255, 255, .1);
      color: #e74c3c;
      transform: rotate(90deg);
      cursor: pointer;
    }

    svg {
      transition: stroke .3s ease;
    }
  }
}

.nav-menu {
  flex: 1;
  padding: 0 40px 40px;
  list-style: none;

  a {
    display: block;
    padding: 15px 20px;
    color: var(--Action-blue);
    font-size: 32px;
    text-decoration: none;
    transition: background .3s, padding-left .3s;
  }

  a.active {
    padding-left: 26px;
    border-left: 4px solid var(--Action-blue);
    color: var(--White);
  }

  /* ORDER: after .active, so the active link also gets the hover padding */
  a:hover {
    padding-left: 30px;
    color: var(--White);
  }
}

.sidebar-footer {
  flex-shrink: 0;
}

.app-body {
  display: flex;
  flex: 1;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 20px;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;   /* main + right sidebar */
  gap: 20px;
  width: 100%;
  min-height: 100%;

  &:has(.content-sidebar--left) {
    grid-template-columns: 280px 1fr 280px;
  }

  /* Create pages use the full width */
  &:has(.new-customer, .new-ship, .new-operator) {
    display: contents;
  }

  &:has(.receivers) .content-main {
    gap: 20px;
  }
}


/* ==========================================================================
   11. Panels
   ========================================================================== */

/* Shared panel box */
.content-sidebar--left,
.content-sidebar .tools-section,
.content-sidebar .widget-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px 0;
  border-radius: 8px;
  background: var(--Dark-gray);
}

/* Panel titles – the same list is resized in section 22 */
.data-grid-title,
.content-sidebar--left h2,
.content-sidebar :is(.tools-section, .help-section) h2 {
  color: var(--White);
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
}

.content-sidebar--left {
  height: 100%;

  h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 20px;
  }

  .entity-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    gap: 10px;
    padding: 0 20px;

    p,
    span {
      display: flex;
      align-items: center;
      font-size: 16px;
    }

    p {
      color: var(--Light-gray);
      font-weight: 400;
    }

    span {
      align-self: stretch;
      color: var(--White);
      font-weight: 700;
    }
  }

  .content-left-sidebar-channel-alarms {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
    padding: 10px 20px;
    color: var(--White);
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 400;
  }
}

.content-main {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  min-width: 0;   /* prevents overflow */
  min-height: 100%;
  border-radius: 10px;
  background: var(--Dark-gray);
}

.data-grid-title {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 30px 20px 20px;
  border-bottom: 1px solid var(--Abyss-gray);
  border-radius: 8px 8px 0 0;
  background: var(--Dark-gray);
}


/* ==========================================================================
   12. Data grid
   ========================================================================== */

.data-grid {
  width: 100%;
  border-radius: 8px;
  background: var(--Dark-gray);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  color: var(--Light-gray);
}

.data-grid-search {
  display: flex;
  align-items: center;
  height: 81px;
  padding: 20px;

  .data-grid-search__label {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 10px 10px 10px 0;
    color: var(--Light-gray);
    font-size: 16px;
    font-weight: 400;
  }

  input {
    width: 300px;
    margin-bottom: 0;

    &::placeholder {
      color: var(--Light-gray);
      font-style: italic;
    }
  }
}

/* Header and rows share the column template. Each grid sets
   --data-grid-columns below; the mobile rule can then override the
   template itself without fighting #content specificity. */
.data-grid-header,
.data-grid-row {
  display: grid;
  grid-template-columns: var(--data-grid-columns, 1fr 2fr 2fr 2fr 2fr);
  gap: 15px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--Abyss-gray);
}

#content .channel-grid :is(.data-grid-header, .data-grid-row) {
  --data-grid-columns: .8fr .4fr 2fr 2fr 2fr 2fr;
}

#content .license-grid :is(.data-grid-header, .data-grid-row) {
  --data-grid-columns: .5fr 2fr 4fr .5fr 2fr;
}

#content :is(.content-main.channels, .content-main.operators) :is(.data-grid-header, .data-grid-row) {
  --data-grid-columns: .2fr 1fr 1fr 1fr 1fr 1fr;
}

#content .content-main.customers :is(.data-grid-header, .data-grid-row) {
  --data-grid-columns: .2fr 1fr 1fr;
}

.data-grid-header {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .5px;

  > div {
    display: flex;
    align-items: center;
    min-width: 0;   /* lets grid children shrink */
    overflow: visible;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

.data-grid-body {
  display: flex;
  flex-direction: column;
}

.data-grid-row {
  align-items: center;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    box-shadow: -3px 0 0 0 #667eea inset;
    transform: translateX(5px);
  }
}

.data-grid-cell {
  display: flex;
  align-items: center;
  min-width: 0;   /* lets flex children shrink */
  overflow: hidden;
  color: var(--White);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;

  span,
  p {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* `display: flex` is intentional: it outranks the mobile `display: grid` */
  &.actions {
    display: flex;
    gap: 8px;
  }

  button.secondary       { background: #95a5a6; }
  button.secondary:hover { background: #7f8c8d; }
  button.danger          { background: #e74c3c; }
  button.danger:hover    { background: #c0392b; }

  .ship-receiver-statuses {
    padding: 5px 5px 5px 10px;
  }

  svg {
    flex-shrink: 0;
  }
}

.create-channel-gateway {
  .data-grid-row:hover {
    box-shadow: initial;
    transform: none;
  }

  .data-grid-cell.role {
    color: var(--Light-gray);
  }

  .data-grid-cell .select-gateway {
    display: grid;
    gap: 10px;
  }
}

.data-grid-empty {
  padding: 60px 20px;
  color: #95a5a6;
  text-align: center;

  svg {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    opacity: .3;
  }

  h3 {
    margin-bottom: 10px;
    color: #7f8c8d;
  }

  p {
    font-size: 14px;
  }
}


/* ==========================================================================
   13. Content line: "No [switch] Yes" and placeholder select
   ========================================================================== */

li.content-line {
  .toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;

    .side-label {
      font-size: 14px;
      cursor: pointer;
      user-select: none;
      transition: opacity .2s, font-weight .2s;
    }

    .left-label  { font-weight: bold;   opacity: 1; }
    .right-label { font-weight: normal; opacity: .5; }

    /* Checked: emphasise "Yes". The old `.toggle-input:checked ~ .right-label`
       never matched because the input sits inside .switch-wrapper and the
       labels don't. :has() works wherever the labels are. */
    &:has(.toggle-input:checked) {
      .left-label  { font-weight: normal; opacity: .5; }
      .right-label { font-weight: bold;   opacity: 1; }
    }

    .switch-wrapper {
      position: relative;
      display: inline-block;
      width: 50px;
      height: 26px;

      .toggle-input {
        position: absolute;
        width: 0;
        height: 0;
        opacity: 0;
      }

      .slider {
        position: absolute;
        inset: 0;
        border-radius: 34px;
        background-color: var(--Abyss-gray);
        cursor: pointer;
        transition: background-color .3s;

        &::before {
          content: "";
          position: absolute;
          top: 3px;   /* what actually rendered; the old `bottom: 4px` never applied */
          left: 4px;
          width: 15px;
          height: 15px;
          border-radius: 50%;
          background-color: var(--Action-blue);
          box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
          transition: transform .3s;
        }
      }

      .toggle-input:checked + .slider {
        background-color: var(--Action-blue);

        &::before {
          background-color: var(--Modal-blue);
          transform: translateX(27px);
        }
      }
    }
  }

  /* Italic grey placeholder until a real value is chosen */
  select {
    align-self: stretch;
    justify-content: space-between;
    /*padding: 15px 36px 15px 10px; */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='10' viewBox='0 0 17 10' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.4062 0.473553C14.9731 -0.130521 15.9222 -0.160689 16.5263 0.40617C17.1301 0.973071 17.1604 1.92228 16.5937 2.52629L10.3232 9.2089C9.33572 10.2612 7.66427 10.261 6.67669 9.2089L0.406178 2.52629C-0.160686 1.92218 -0.130529 0.973043 0.47356 0.40617C1.07767 -0.16066 2.02682 -0.130525 2.59368 0.473553L8.49993 6.7675L14.4062 0.473553Z' fill='white'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    color: var(--Light-gray);
    font-size: 16px;
    font-style: italic;
    min-width: 165px;

    option {
      color: var(--Light-gray);
      font-style: italic;

      &:not([value=""]) {
        color: var(--White);
        font-style: normal;
      }
    }

    &.has-value {
      color: var(--White);
      font-style: normal;
    }
  }
}

.field-error {
  display: none;
  margin-top: 4px;
  padding: 0 2px;
  color: #ff0000;
  font-size: 15px;

  &.visible {
    display: block;
  }
}

.input-error {
  border: 1px solid #F00034 !important;
}


/* ==========================================================================
   14. Toasts
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transform: translate(-50%, 0);
}

.toast-notification-wrapper {
  height: 0;
  transition: height .5s cubic-bezier(.25, .46, .45, .94);

  &.active {
    height: 70px;
  }
}

.toast-notification {
  position: absolute;
  display: flex;
  align-items: center;
  border-radius: 10px;
  background: var(--Black);
  transform: translate(-50%, -50vh);
  transition: transform .5s cubic-bezier(.25, .46, .45, .94);

  &.active {
    transform: translate(-50%, 0);
  }
}

.toast-icon-background {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  align-self: stretch;
  gap: 10px;
  width: 68px;
  padding: 10px;
  border-radius: 10px;

  &.error   { background: var(--Error-gradient); }
  &.warning { background: var(--Warning-gradient); }
  &.success { background: var(--Success-gradient); }
  &.info    { background: var(--Primary-gradient); }
}

.toast-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px 0 0 10px;
}

.toast-text-container {
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
  width: 600px;
  padding: 0 10px;
}

.toast-description {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  align-self: stretch;
}

.toast-clear-notification {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.toast-cancel-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 48px;
  height: 48px;
  padding: 10px;
  border-radius: 5px;
  background: var(--Input-gray);
}

.toast-cross {
  position: relative;
  width: 17px;
  height: 17px;
}


/* ==========================================================================
   15. Split card, status fields, info rows
   ========================================================================== */

.split-card {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  padding: 0 20px;
  overflow: hidden;
  border-radius: 5px;

  .split-card-aside {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    padding: 20px;
    border-radius: 5px 0 0 5px;

    &.active  { background: var(--Success-gradient); }
    &.error   { background: var(--Error-gradient); }
    &.warning { background: var(--Warning-gradient); }

    .split-card-aside__image {
      width: 100px;
      height: 150px;
      padding: 20px 0;
      border-radius: 10px 0 0 10px;
      object-fit: contain;
    }
  }

  .split-card-content {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 20px 0;
    border-radius: 0 5px 5px 0;
    background: var(--Abyss-gray);

    .split-card-content__header {
      display: flex;
      align-items: center;
      padding: 10px 20px;
    }

    .split-card-content__title {
      color: var(--White);
      font-family: var(--font-heading);
      font-size: 32px;
      font-weight: 700;
    }

    .split-card-content__body {
      display: flex;
      align-items: flex-start;
      align-self: stretch;
      gap: 10px;
    }

    .split-card-content__status-col {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      width: 272px;
      min-width: 0;
      overflow: hidden;

      .status-field__actions {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 20px;

        button {
          background: var(--Primary-gradient);
          color: var(--White);
          font-size: 16px;
          font-weight: 700;
        }
      }
    }

    .split-card-content__info-col {
      display: flex;
      flex: 1 1 0;
      flex-direction: column;
      align-items: flex-start;
      min-width: 0;
      overflow: hidden;
    }
  }
}

.status-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  min-width: 0;
  padding: 0 20px;
  overflow: hidden;

  .status-field__label,
  .status-field__value {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .status-field__label {
    min-height: 36px;
    color: var(--Light-gray);
    font-size: 16px;
    font-weight: 400;
  }

  .status-field__value {
    min-height: 48px;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    white-space: normal;

    &.active             { color: #007007; }
    &.error              { color: #F00034; }
    &.warning            { color: #f59e0b; }
    &.unavailable-status { color: var(--Light-gray); }
  }
}

.info-row {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 10px;

  .info-row__label {
    display: flex;
    align-items: center;
    width: 40%;
    min-width: 80px;
    max-width: 200px;
    height: 48px;
    padding: 10px;
    color: var(--Light-gray);
    font-size: 16px;
    font-weight: 400;
  }

  .info-row__value {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;   /* lets long values wrap */
    color: var(--White);
    font-size: 16px;
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: break-word;
  }
}


/* ==========================================================================
   16. Modal
   ========================================================================== */


.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--Modal-blue);
  backdrop-filter: blur(15px);

  .modal-card {
    position: fixed;        /* already the UA default for dialog */
    inset: 0;               /* keep — this is what triggers margin:auto centering */
    margin: auto;           /* the actual centering */
    width: fit-content;
    height: fit-content;
    max-width: min(90vw, 900px);
    max-height: 90vh;
    overflow: auto;

    border: none;
    padding: 0;
    background: var(--panel-bg);
    color: inherit;
    border-radius: 8px;
  }

  .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  &.warning {
    background: var(--Warning-Modal-Yellow);
  }

  /* Gateway select dialog */
  &#gateway-select-dialog .modal-card {
    max-width: 1000px;

    .gateway-dialog {
      width: 100%;
      display: flex;
      gap: 20px;
      flex-direction: column;

      .data-grid {
        .radio-input-container {
          display: flex;
          flex-direction: column;
          gap: 25px;
          align-items: flex-start;

          label {
            display: flex;
            flex-direction: row-reverse; /* puts the radio after the text visually, adjust to taste */
            align-items: center;
            gap: 10px;
            cursor: pointer;
          }

          input[type="radio"] {
            width: 16px;
            height: 16px;
            accent-color: #2563eb;
            flex-shrink: 0;
            cursor: pointer;
          }

          input {
            display: none;
          }
        }
      }
    }

    .data-grid-header, .data-grid-row {
      grid-template-columns: 2fr 1fr 3fr 3fr 2fr 2fr;
      padding: 15px 10px;
    }

    .data-grid-row:hover {
      transform: none;
    }
  }

  .modal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 600px;
    padding: 20px 0;
    border-radius: 10px;
    background: var(--Dark-gray);

    .modal-header {
      display: flex;
      align-items: center;
      width: 100%;
      height: 60px;
      padding: 10px 20px;

      .modal-title {
        color: var(--White);
        font-family: var(--font-heading);
        font-size: 32px;
        font-weight: 700;
      }
    }

    .modal-body {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      width: 100%;
      max-width: 1040px;
      padding: 0 20px;

      .modal-message {
        max-width: 500px;
        color: var(--Light-gray);
        font-size: 16px;
        font-weight: 400;
      }
    }

    .modal-footer {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      align-self: stretch;
      gap: 10px;
      padding: 0 20px;
    }
  }
}


/* ==========================================================================
   17. Forms
   ========================================================================== */

.form-main,
.form-main-alternate,
.channel-form-main {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 20px;
  padding: 20px 0;
  border-radius: 10px;
  background: var(--Dark-gray);
}

.form-main {
  gap: 10px;
}

.form-main hr,
.channel-form-main hr {
  align-self: stretch;
  width: 100%;
  height: 2px;
  border: 0;
  background: var(--Abyss-gray);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

/* Wizard tabs */
.channel-form-tabs-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.channel-form-tab-wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;

  span {
    color: var(--Action-blue);
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 400;
    text-decoration: underline;
    overflow-wrap: break-word;
  }

  &[disabled] {
    opacity: .15 !important;
    cursor: default;
  }

  &.active {
    opacity: 1 !important;

    span {
      color: var(--White);
      text-decoration: none;
    }
  }
}

.channel-form-arrow-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 10px 0;
  opacity: .15;

  div {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 10px;

    img {
      position: relative;
      width: 10px;
      height: 17px;
    }
  }
}

/* Wizard layout */
.channel-form {
  display: flex;
  flex: 1 0 0;
  align-items: flex-start;
  align-self: stretch;
  gap: 20px;
  padding: 0 20px;
}

.channel-form-left,
.channel-form-right {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.channel-form-right {
  align-self: stretch;
}

.channel-form-panel,
.form-panel {
  display: flex;
  flex: 1 0 0;
  flex-wrap: wrap;
  align-items: flex-start;
  align-self: stretch;

  &.flex-column {
    gap: 20px;
  }
}

.create-channel-input-configuration .content-line .content-line-input {
  flex: 1;
  width: 100%;
  max-width: 400px;
}

/* ORDER: .form-stack must come before the fieldset and .content-line rules */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  height: 100%;

  .form-section {
    --label-width: 11rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    p {
      color: var(--text-gray);
    }
  }

  .dual-column {
    display: flex;
    align-items: stretch;
    gap: 1.5rem;
    height: 100%;

    h2 {
      padding: 0;
    }

    .inputs-container {
      gap: 10px;
    }
  }

  .dual-column-column {
    flex: 1;   /* equal widths regardless of content */
    min-width: 0;
  }

  .inputs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    list-style: none;

    .input-with-description p {
      padding: 14px 9px 0;
      color: var(--Light-gray);
    }
  }

  .content-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
  }

  /* NOTE: inside a .content-line, `.content-line .content-line-input`
     further down wins (same specificity, later), so those inputs stay
     capped at 300px. Kept as-is. */
  .content-line-input,
  .content-line-control {
    flex: 1;
    min-width: 0;
  }
}

#channel-form-io {
  display: flex;
  align-items: flex-start;
  align-self: stretch;
  padding: 0;

  .channel-form-fieldset {
    display: flex;
    flex: 1 0 0;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;

    legend {
      padding: 10px 0 30px;
    }

    p {
      padding: 0 10px;
      color: var(--Light-gray);
    }

    .inputs-container {
      padding: 15px 0 0;

      input {
        max-width: 200px;
      }

      textarea {
        width: 100%;
        max-width: 200px;
      }

      select {
        width: initial;
        min-width: 200px;
        max-width: 300px;
      }
    }
  }
}

.create-channel-summary {
  flex-direction: column;
  gap: 20px;

  legend {
    padding: 10px !important;
  }

  h3 {
    padding: 10px;
    font-weight: 400;
    line-height: normal;
  }

  .inputs-container {
    padding: 10px 10px 0 !important;
  }

  .channel-form-panel.flex-row {
    gap: 20px;
  }

}

/* Shared by wizard fieldsets and entity form panels */
.channel-form-fieldset,
.form-panel {
  gap: 20px;
  border-width: 0 !important;

  legend {
    padding: 10px 20px;
  }

  .sub-title {
    padding: 20px 0;
    font-size: 20px;
  }

  .inputs-container {
    padding: 15px 20px 0;

    .toggle-wrapper {
      padding-bottom: 15px;
    }

    .radio-input-container {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 25px;

      label {
        display: flex;
        flex-direction: row-reverse;   /* text first, then the radio */
        align-items: center;
        gap: 10px;
        cursor: pointer;
      }

      /* Native radio hidden; .custom-radio draws it */
      input {
        display: none;
      }
    }
  }
}

.channel-form-fieldset {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  flex: 1 0 0;

  p {
    padding: 10px 0;
    color: var(--text-gray);
  }
}

.form-panel {
  flex-direction: column;
  padding: 0 20px;

  .inputs-container {
    width: 100%;
  }
}

.channel-form-footer,
.form-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 20px;
}

.channel-form-footer .channel-form-footer-buttons,
.form-footer .form-footer-buttons {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  align-self: stretch;
  gap: 10px;
}

.content-line {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 10px;
  margin-bottom: 5px;

  &.lengthened {
    align-items: flex-start;
  }

  .line-label {
    width: 50%;
    max-width: 300px;
  }

  .content-line-input {
    /*display: flex; */
    flex: 0 1 300px;
    /*flex-direction: column;*/
    align-items: flex-start;
    min-width: 0;
    max-width: 300px;
  }

  .auto-note {
    color: var(--Light-gray, #9E9E9E);
    font-style: italic;
    font-family: Roboto;
  }

  select {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  input,
  select {
    /*width: 50%; */
    max-width: 300px;
  }

  /* Custom elements are inline by default */
  multiselect-checkbox {
    /*
    display: block;
    flex: 1;
    min-width: 0;
    */
    display: flex;
    flex: 0 1 300px;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    max-width: 300px;
  }
}

.input-label,
.content-line .line-label {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 10px;
  color: var(--Light-gray);
}

/* --label-width is 200px, or 11rem inside .form-stack .form-section */
.input-label {
  flex: 0 0 var(--label-width);
}

.customer-operator-details-hint {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 10px;
  padding: 10px;

  span {
    display: flex;
    align-items: center;
    align-self: stretch;
    color: var(--Light-gray);
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
  }
}


/* ==========================================================================
   18. Right sidebar
   (panel box and title typography are shared in section 11)
   ========================================================================== */

.content-sidebar {
  position: sticky;
  top: 90px;   /* below the navbar */
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);

  :is(.tools-section, .widget-section) h2 {
    display: flex;
    align-items: flex-start;
    align-self: stretch;
    gap: 10px;
    padding: 10px 20px 20px;
    border-bottom: 1px solid var(--Abyss-gray);
  }

  .tools-section button {
    height: 40px;
  }

  .tools-section .tools-container,
  .widget-section .widget-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    gap: 10px;
    padding: 10px 20px;
  }

  .widget-section h2 {
    font-weight: 700;
    font-size: 26px;
  }

  .widget-section .widget-container {
    padding-bottom: 0;
  }

  .tools-section .tools-container {
    .tools-container-delete-note {
      color: var(--Light-gray);
      font-size: 16px;
      font-style: italic;
      font-weight: 400;
    }

    .deleted-in-x-days {
      color: var(--Caution-yellow);
      font-size: 16px;
      font-style: normal;
      font-weight: 700;
    }
  }

  .help-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 0;
    border-radius: 10px;
    background: var(--Primary-gradient);

    h2 {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 0 20px;
    }

    .help-text {
      display: flex;
      align-items: center;
      align-self: stretch;
      padding: 0 20px;

      span {
        color: var(--White);
        font-size: 16px;
        font-style: italic;
        font-weight: 400;
      }
    }
  }
}

.tools-container .help-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 10px;
  padding: 0 20px;
  color: var(--White);
  font-size: 16px;
  font-style: italic;
  font-weight: 400;

  span {
    color: var(--Light-gray);
  }
}


/* ==========================================================================
   19. Breadcrumb
   ========================================================================== */

.breadcrumb-wrap {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--Dark-gray);

  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;

    .breadcrumb__item {
      display: flex;
      align-items: center;
      gap: 10px;
      height: 48px;
      padding: 10px 20px;
      color: var(--Action-blue);
      font-family: var(--font-heading);
      font-size: 24px;
      font-weight: 400;

      &.breadcrumb__item--active {
        height: 60px;
        color: var(--White);
        font-size: 32px;
        font-weight: 700;
      }
    }

    .breadcrumb__sep {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px;

      svg {
        width: 9.998px;
        height: 17px;
        fill: var(--White);
      }
    }
  }
}


/* ==========================================================================
   20. Skeleton loader
   ========================================================================== */

.skeleton {
  border-radius: 4px;
  background: linear-gradient(90deg, #202020 25%, #2a2a2a 50%, #202020 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-row {
  height: 60px;
  margin-bottom: 10px;
}

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


/* ==========================================================================
   21. Column layouts
   ========================================================================== */

.dual-column {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  align-self: stretch;
  width: 100%;

  &.fill {
    height: -webkit-fill-available;
  }
}

.dual-column-column {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 20px;
}

.inner-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 20px;

  .content-line {
    padding: 0 20px;
  }
}

.dual-column-column h2,
.inner-container h2,
.status-container h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 10px 20px;
}

.compact-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-self: stretch;
  gap: 10px;
}

.status-container {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 0 20px;
}

/* ==========================================================================
   22. Progress bar
   ========================================================================== */

.completion {
  width: 100%;

  .completion-note {
    padding: 20px 20px 0;
    color: var(--Light-gray);
    font-style: italic;
  }

  .completion-track {
    position: relative;
    display: flex;
    align-items: center;
    height: 3rem;
    background: var(--track-bg);

    .completion-fill {
      height: 100%;
      width: 0;
      background: var(--ok-green);
      transition: width .25s ease;

      &.phase-1 {
        border-left: 2px solid #008000;
      }
    }

    .completion-percent {
      position: absolute;
      left: 50%;
      transform: translateX(-50%); font-weight: 600;
    }
  }
}

/* ==========================================================================
   23. Responsive (largest breakpoint first)
   ========================================================================== */

@media (max-width: 1400px) {
  .content-wrapper {
    gap: 15px;
  }

  .data-grid-title,
  .content-sidebar--left h2,
  .content-sidebar :is(.tools-section, .help-section) h2 {
    font-size: 28px;
  }

  /* Matching the base selectors' specificity removes the need for !important */
  .status-field .status-field__label,
  .info-row .info-row__label,
  .info-row .info-row__value {
    font-size: 13px;
  }

  .status-field .status-field__value {
    font-size: 17px;
  }
}

@media (max-width: 1200px) {
  .content-wrapper {
    grid-template-columns: 1fr 280px;
    gap: 20px;
  }

  .content-sidebar {
    max-width: 280px;
  }

  .data-grid-title,
  .content-sidebar--left h2,
  .content-sidebar :is(.tools-section, .help-section) h2 {
    font-size: 25px;
  }

  .dual-column {
    flex-direction: column;
  }
}

@media (max-width: 992px) {
  .content-wrapper,
  .content-wrapper:has(.content-sidebar--left) {
    grid-template-columns: 1fr;   /* stack everything */
  }

  .content-sidebar--left  { order: 1; position: static; }
  .content-main           { order: 2; }
  .content-sidebar--right { order: 2; position: static; }

  .split-card {
    flex-direction: column;

    .split-card-aside {
      flex-direction: row;
      width: 100px;
      padding: 16px 20px;
      border-radius: 5px 5px 0 0;

      .split-card-aside__image {
        width: 60px;
        height: 60px;
        padding: 0;
        border-radius: 8px;
      }
    }

    .split-card-content {
      border-radius: 0 0 5px 5px;

      .split-card-content__body {
        flex-direction: column;
      }

      .split-card-content__status-col {
        width: 100%;
      }
    }
  }

  .split-card-divider {
    width: 100%;
    height: 1px;
  }

  .info-row .info-row__label {
    width: 160px;
  }
}

@media (max-width: 768px) {
  .data-grid-header {
    display: none;
  }

  .data-grid-body {
    padding: 0 10px;
    background: var(--Abyss-gray);
  }

  /* Rows become cards. Works for every grid now that the per-grid
     templates are set through --data-grid-columns. */
  .data-grid-row {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 8px;
    background: var(--Abyss-gray);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  }

  .data-grid-cell {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    overflow: visible;
    white-space: normal;
    text-overflow: unset;

    &::before {
      content: attr(data-label);
      color: var(--White);
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
    }
  }

  .data-grid-cell.actions::before {
    display: none;
  }
}

@media (max-width: 720px) {
  .separator-line-vertical {
    display: none;
  }

  /* Stack label above control. .form-stack is listed so its own
     align-items/gap don't override this. */
  .content-line,
  .form-stack .content-line {
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
  }

  /* In a column, a flex-basis sets height: reset them, otherwise every
     .content-line-input becomes 300px tall. */
  .input-label,
  .content-line .content-line-input {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;

    .info-row__label {
      width: auto;
      height: auto;
      padding: 0;
    }

    .info-row__value {
      font-size: 15px;
    }
  }

  .split-card .split-card-content {
    .split-card-content__title {
      font-size: 24px;
    }

    .split-card-content__info-col {
      overflow: visible;
    }
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
