:root {
  color-scheme: light;
  --bg-top: #e8f3ff;
  --bg-bottom: #f7fbff;
  --panel-color: #ffffff;
  --line-color: #d3e3f5;
  --line-strong: #b7d1ef;
  --text-color: #153452;
  --text-soft: #4e6984;
  --brand-700: #0f58a8;
  --brand-600: #1a73cf;
  --brand-500: #2383e2;
  --brand-100: #e5f1ff;
  --danger: #b63434;
  --radius: 14px;
  --soft-shadow: 0 10px 30px rgba(22, 71, 122, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Aptos", "Montserrat", "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text-color);
  background:
    radial-gradient(circle at 12% 0%, rgba(42, 132, 232, 0.16) 0%, transparent 35%),
    radial-gradient(circle at 85% 6%, rgba(26, 115, 207, 0.12) 0%, transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

a {
  color: var(--brand-700);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem 1.1rem;
  border-bottom: 1px solid rgba(168, 198, 229, 0.6);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  color: var(--text-color);
  text-decoration: none;
  text-align: center;
}

.brand-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  object-position: center;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  width: 100%;
}

.primary-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover {
  border-color: var(--line-strong);
  background: #f2f8ff;
  color: var(--brand-700);
}

.notification-menu {
  position: relative;
}

.notification-menu summary {
  list-style: none;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}

.notification-menu summary:hover {
  border-color: var(--line-strong);
  background: #f2f8ff;
  color: var(--brand-700);
}

.notification-menu summary::-webkit-details-marker {
  display: none;
}

.notification-badge {
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #d43d3d;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
}

.notification-menu-panel {
  position: absolute;
  right: 0;
  margin-top: 0.4rem;
  min-width: 300px;
  max-width: 360px;
  background: #ffffff;
  border: 1px solid var(--line-color);
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
  padding: 0.65rem;
  z-index: 20;
}

.notification-menu-panel ul {
  margin: 0;
  padding-left: 1rem;
  max-height: 280px;
  overflow: auto;
}

.notification-menu-panel li {
  margin-bottom: 0.45rem;
}

.notification-item-unread a,
.notification-item-unread span {
  font-weight: 700;
}

.notification-view-all-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
}

.content-shell {
  max-width: 1080px;
  margin: 1.8rem auto;
  padding: 0 1rem 2.5rem;
}

.content-shell > .panel {
  animation: panel-in 0.35s ease both;
}

.content-shell > .panel:nth-of-type(2) {
  animation-delay: 0.06s;
}

.content-shell > .panel:nth-of-type(3) {
  animation-delay: 0.12s;
}

.panel {
  background: var(--panel-color);
  border: 1px solid var(--line-color);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  padding: 1.2rem;
  margin-bottom: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(22, 71, 122, 0.1);
}

.panel h1,
.panel h2,
.panel h3 {
  margin-top: 0;
  color: #0f487f;
}

.panel h1 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  margin-bottom: 0.55rem;
}

.panel h2 {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  margin-bottom: 0.45rem;
}

.panel p {
  margin-top: 0.3rem;
  margin-bottom: 0.6rem;
}

.panel-hero {
  background: linear-gradient(120deg, #f9fcff 0%, #eef6ff 100%);
  border: 1px solid #cddff4;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.subtle {
  color: var(--text-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.user-role-dependent-fields,
.user-role-inline-section {
  display: contents;
}

.user-role-dependent-fields[hidden],
.user-role-inline-section[hidden] {
  display: none;
}

label {
  font-weight: 600;
  color: #23527d;
  font-size: 0.92rem;
}

input,
select,
textarea,
button {
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  color: var(--text-color);
  background: #ffffff;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.18);
}

button {
  width: fit-content;
  border: none;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 88, 168, 0.28);
}

.button-link {
  display: inline-block;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  border: none;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 88, 168, 0.28);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line-color);
  border-radius: 12px;
}

th,
td {
  padding: 0.62rem;
  text-align: left;
}

th {
  background: #edf5ff;
  color: #1d4f7f;
  border-bottom: 1px solid var(--line-color);
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

tbody tr + tr td {
  border-top: 1px solid #edf3fa;
}

.announcement-list {
  margin: 0;
  padding-left: 1.1rem;
}

.announcement-list li {
  margin-bottom: 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed #d8e7f8;
}

.announcement-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.announcement-meta {
  color: var(--text-soft);
}

.status-note {
  border-left: 4px solid var(--brand-500);
  background: var(--brand-100);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
}

.status-note-success {
  border-left-color: #1d8f55;
  background: #e9f8ef;
  color: #115f38;
}

.status-note-error {
  border-left-color: #b63434;
  background: #fdecec;
  color: #8a2323;
}

.field-validation-error {
  color: var(--danger);
  font-size: 0.88rem;
}

.field-hint {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.technician-decision-shell {
  margin: 1rem 0 1.15rem;
  padding: 1rem;
  border: 1px solid #cddff4;
  background: linear-gradient(135deg, #f9fcff 0%, #eef6ff 100%);
}

.technician-decision-copy {
  margin-bottom: 0.9rem;
}

.technician-decision-form {
  gap: 0.85rem;
}

.decision-section {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  border: 1px solid #d7e6f7;
  border-radius: 12px;
  background: #ffffff;
}

.decision-section[hidden] {
  display: none;
}

.technician-decision-actions {
  justify-content: flex-end;
}

.secondary-action {
  margin-bottom: 0.75rem;
  background: #f4f7fb;
  color: #1d4f7f;
  border: 1px solid #c9d9ec;
  box-shadow: none;
}

.secondary-action:hover {
  box-shadow: none;
}

.user-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.user-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.typeahead-shell {
  position: relative;
}

.typeahead-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid #c9d9ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
}

.typeahead-option {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-color);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  box-shadow: none;
}

.typeahead-option:hover,
.typeahead-option:focus-visible {
  background: #eef6ff;
  box-shadow: none;
}

.radio-group-inline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.radio-option-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--text-color);
}

.radio-option-inline input[type="radio"] {
  margin: 0;
}

.user-filter-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.user-form-surface {
  margin-top: 0.5rem;
}

.user-form-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.inline-form {
  margin: 0;
}

.notifications-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.notification-row-unread td {
  background: #eef6ff;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  color: var(--text-color);
}

.checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  padding: 0;
}

.locations-fieldset {
  border: 1px solid #d7e6f7;
  border-radius: 10px;
  padding: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.locations-fieldset[hidden] {
  display: none;
}

.locations-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 700;
  color: #1d4f7f;
}

.stock-main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.stock-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.line-items-shell {
  margin-top: 0.65rem;
}

.line-items-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.line-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.line-item-actions button {
  padding: 0.45rem 0.65rem;
}

.request-drilldown {
  margin-bottom: 0.55rem;
  border: 1px solid #d7e6f7;
  border-radius: 10px;
  background: #f8fbff;
}

.request-drilldown summary {
  cursor: pointer;
  font-weight: 700;
  color: #1d4f7f;
  padding: 0.5rem 0.65rem;
}

.request-drilldown[open] {
  box-shadow: inset 0 0 0 1px #e5f0fb;
}

.request-drilldown p {
  margin: 0.25rem 0.65rem;
}

.request-drilldown-table {
  margin: 0.4rem 0.65rem 0.65rem;
  width: calc(100% - 1.3rem);
}

.request-drilldown-table th,
.request-drilldown-table td {
  padding: 0.45rem 0.55rem;
}

.maintenance-breakdown-group,
.maintenance-breakdown-status {
  margin-bottom: 0.6rem;
  border: 1px solid #d7e6f7;
  border-radius: 10px;
  background: #f8fbff;
}

.maintenance-breakdown-group summary,
.maintenance-breakdown-status summary {
  cursor: pointer;
  font-weight: 700;
  color: #1d4f7f;
  padding: 0.55rem 0.7rem;
}

.maintenance-breakdown-group[open],
.maintenance-breakdown-status[open] {
  box-shadow: inset 0 0 0 1px #e5f0fb;
}

.maintenance-breakdown-group summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.maintenance-breakdown-meta {
  font-weight: 500;
  font-size: 0.92rem;
}

.maintenance-breakdown-table {
  margin: 0.45rem 0.7rem 0.75rem;
  width: calc(100% - 1.4rem);
}

.maintenance-breakdown-table th,
.maintenance-breakdown-table td {
  padding: 0.48rem 0.56rem;
}

.request-item-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.2rem;
}

.request-item-list li {
  color: #1a446d;
  font-size: 0.93rem;
}

.completed-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.9rem;
}

.completed-filter-actions {
  display: flex;
  align-items: end;
}

.completed-filter-actions button {
  width: 100%;
}

.stock-manage-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(240px, 1fr);
  gap: 1rem;
  align-items: start;
}

.stock-manage-main,
.stock-manage-actions {
  border: 1px solid #d8e8f9;
  border-radius: 12px;
  padding: 0.9rem;
  background: #fafdff;
}

.stock-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.8rem;
}

.stock-manage-grid p {
  margin: 0;
}

/* Manage action bar --------------------------------------------------------- */

.manage-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.manage-action-btn {
  min-width: 140px;
}

.manage-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}

/* Shipping worksheet -------------------------------------------------------- */

.stock-status-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-600);
  margin: 0 0 1rem;
}

.ship-mode-action {
  margin-bottom: 0.5rem;
}

.ship-mode-btn {
  background: linear-gradient(135deg, #1a7a4f 0%, #155e3c 100%);
}

.ship-mode-btn:hover {
  box-shadow: 0 8px 18px rgba(15, 100, 60, 0.28);
}

.ship-mode-cancel {
  background: #f4f7fb;
  color: #1d4f7f;
  border: 1px solid #c9d9ec;
  box-shadow: none;
}

.ship-mode-cancel:hover {
  background: #e8f0fb;
  box-shadow: none;
  transform: none;
}

.ship-worksheet-section {
  margin-top: 1.4rem;
}

.ship-worksheet-hint {
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.8rem;
  border-left: 4px solid var(--brand-500);
  background: var(--brand-100);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.93rem;
}

.ship-worksheet-table .col-ship-select {
  width: 44px;
  text-align: center;
}

.ship-worksheet-table .col-right {
  text-align: right;
}

.ship-worksheet-table .ship-select {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-600);
  padding: 0;
  border: none;
  background: transparent;
}

.ship-qty-input {
  width: 76px;
  padding: 0.3rem 0.45rem;
  text-align: right;
  font-size: 0.93rem;
}

.ship-qty-input:disabled {
  background: #f4f7fb;
  color: #9db5cc;
  border-color: #dce8f5;
  cursor: not-allowed;
}

.backorder-badge {
  display: inline-block;
  min-width: 2.2rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  background: #fff7ed;
  color: #a05a1a;
  border: 1px solid #f5d7a8;
}

.backorder-badge.backorder-zero {
  background: #f0fdf4;
  color: #2a7a4a;
  border-color: #a8d5b5;
}

.ship-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #d8e8f9;
  border-radius: 10px;
  background: #f6faff;
}

.ship-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.summary-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
}

.summary-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
}

.ship-submit-area {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed #b0c8e8;
  border-radius: 10px;
  background: #f9fbff;
}

.ship-submit-area .subtle {
  margin: 0;
  font-size: 0.9rem;
}

.ship-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.ship-avail-ok {
  color: #2a7a4a;
  font-weight: 600;
}

.ship-avail-low {
  color: #a05a1a;
  font-weight: 600;
}

.ship-avail-warn {
  margin-left: 0.2em;
  font-style: normal;
  cursor: help;
}

.ship-avail-unknown {
  color: #9db5cc;
}

/* End shipping worksheet ---------------------------------------------------- */
  width: min(520px, 94vw);
}

.stock-item-dialog h3 {
  margin-bottom: 0.2rem;
}

.user-dialog {
  width: min(780px, 94vw);
  border: 1px solid #d4e4f7;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 20px 46px rgba(12, 45, 86, 0.28);
}

.user-dialog::backdrop {
  background: rgba(17, 54, 95, 0.34);
  backdrop-filter: blur(2px);
}

.collapsible-panel {
  margin-bottom: 1rem;
  border: 1px solid #dce8f6;
  border-radius: 10px;
  padding: 0.9rem;
  background: #f9fcff;
}

.announcement-image {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0.5rem 0;
  border-radius: 10px;
  border: 1px solid #dce8f6;
}

.danger-panel {
  border-color: #f2c8c8;
  background: linear-gradient(135deg, #fffefe 0%, #fff7f7 100%);
}

.request-chip {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.22rem 0.45rem;
  border-radius: 7px;
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 0.88rem;
  color: #754040;
  background: #fff1f1;
  border: 1px solid #f3cece;
}

.login-panel {
  max-width: 440px;
  margin: 2.3rem auto;
  padding: 1.35rem;
  border: 1px solid var(--line-color);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  background: rgba(255, 255, 255, 0.95);
}

.login-heading {
  margin-bottom: 1rem;
  text-align: center;
}

.login-heading h1 {
  margin-bottom: 0.25rem;
}

.login-heading p {
  margin-bottom: 0;
  color: var(--text-soft);
}

.company-logo {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line-color);
}

.error-text {
  color: var(--danger);
}

.stock-field.field-error input,
.stock-field.field-error select,
.line-items-shell.field-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent);
}

input.input-validation-error,
select.input-validation-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent);
}

@media (max-width: 900px) {
  .top-nav {
    align-items: center;
  }

  .primary-nav {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .content-shell {
    margin-top: 1rem;
  }

  .panel,
  .login-panel {
    padding: 1rem;
  }

  .stock-manage-layout {
    grid-template-columns: 1fr;
  }

  .ship-qty-input {
    width: 64px;
  }

  .ship-summary {
    grid-template-columns: 1fr 1fr;
  }

  .brand-name {
    font-size: 0.98rem;
  }

  .line-items-heading {
    flex-direction: column;
    align-items: stretch;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}