:root {
  --bg: #fffbf7;
  --bg-strong: #fffdfb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #080b12;
  --muted: #62707a;
  --line: rgba(212, 105, 61, 0.12);
  --line-strong: rgba(212, 105, 61, 0.2);
  --accent: #d4693d;
  --accent-deep: #8f3e28;
  --green: #1b7b5c;
  --green-soft: rgba(27, 123, 92, 0.12);
  --amber: #a96316;
  --amber-soft: rgba(169, 99, 22, 0.14);
  --shadow: 0 12px 34px rgba(212, 105, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 125, 35, 0.2), transparent 20%),
    radial-gradient(circle at 100% 100%, rgba(80, 127, 255, 0.14), transparent 22%),
    linear-gradient(135deg, #fff8f1 0%, #fffdf9 46%, #f5f8ff 100%);
}

button,
input,
select,
textarea,
dialog,
table {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.login-screen {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 52px;
  align-items: center;
  position: relative;
  padding: 34px 46px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(30, 41, 51, 0.1);
  background:
    radial-gradient(circle at 0 54%, rgba(255, 166, 89, 0.22), transparent 20%),
    radial-gradient(circle at 100% 100%, rgba(121, 158, 255, 0.16), transparent 18%),
    radial-gradient(circle at 14% 22%, rgba(255, 135, 51, 0.09), transparent 14%),
    linear-gradient(135deg, rgba(255, 249, 241, 0.96), rgba(255, 255, 255, 0.96) 58%, rgba(245, 248, 255, 0.96));
  box-shadow: 0 24px 60px rgba(83, 66, 54, 0.12);
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
  width: 120px;
  height: 120px;
  opacity: 0.32;
}

.login-screen::before {
  left: -16px;
  top: 86px;
  background-image: radial-gradient(circle, rgba(255, 118, 36, 0.45) 1.2px, transparent 1.2px);
  background-size: 12px 12px;
}

.login-screen::after {
  right: 18px;
  bottom: 34px;
  background-image: radial-gradient(circle, rgba(80, 127, 255, 0.32) 1.2px, transparent 1.2px);
  background-size: 12px 12px;
}

.login-copy,
.login-card {
  position: relative;
  z-index: 1;
}

.login-copy {
  display: grid;
  gap: 18px;
  align-content: start;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
}

.brand-mark img {
  width: 230px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(18, 63, 160, 0.12));
  mix-blend-mode: multiply;
}

.login-copy h1,
.topbar h1,
.section-header h2,
.mini-card h3,
.modal-head h3 {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.login-copy h1 {
  margin: 0;
  max-width: 8.5ch;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.93;
  letter-spacing: 0;
  color: #080b12;
  text-wrap: balance;
}

.login-text,
.subtle {
  color: var(--muted);
  line-height: 1.7;
  max-width: 58ch;
}

.accent-dot {
  color: #ff6516;
}

.hero-line {
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6516, rgba(255, 101, 22, 0.2));
  margin-top: 2px;
}

.login-card,
.panel,
.stat-card,
.mini-card,
.modal-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 26px;
  border-radius: 20px;
  display: grid;
  gap: 16px;
  max-width: 420px;
  justify-self: end;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 41, 51, 0.08);
  box-shadow: 0 20px 45px rgba(55, 56, 88, 0.12);
}

.login-card h2,
.section-header h2,
.topbar h1 {
  margin: 0;
}

.login-card h2 {
  font-size: 2rem;
  color: #141a24;
}

.login-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ff6a1a;
  background: linear-gradient(145deg, rgba(255, 128, 42, 0.14), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(255, 128, 42, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.login-icon span {
  font-size: 1.55rem;
  line-height: 1;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.storage-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--muted);
}

.main-layout,
.asset-columns,
.stats-grid,
.asset-lists,
.picker-grid {
  display: grid;
  gap: 18px;
}

.main-layout {
  gap: 24px;
}

.app-message {
  margin: 0 0 20px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-strong);
}

.stat-card span {
  color: var(--muted);
  display: block;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1;
}

.stat-card.warm {
  background: linear-gradient(145deg, rgba(212, 105, 61, 0.18), rgba(255, 255, 255, 0.95));
}

.stat-card.cool {
  background: linear-gradient(145deg, rgba(27, 123, 92, 0.16), rgba(255, 255, 255, 0.95));
}

.panel {
  padding: 20px;
  border-radius: 22px;
}

.section-header,
.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.asset-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-lists {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.search-panel {
  display: grid;
  gap: 14px;
  margin: 16px 0 18px;
}

.search-label {
  max-width: 360px;
}

.search-result {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(30, 41, 51, 0.08);
  text-align: left;
}

.search-result-card {
  display: grid;
  gap: 12px;
}

.search-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.search-result-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.search-result-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.search-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mini-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
}

.mini-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.asset-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.asset-list li {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(30, 41, 51, 0.08);
}

.asset-meta,
.muted-line,
.empty-text,
.error-text,
.info-text {
  color: var(--muted);
}

.asset-main {
  font-weight: 700;
}

.asset-meta,
.muted-line {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
}

.stack-item+.stack-item {
  margin-top: 10px;
}

label,
fieldset legend,
th {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(30, 41, 51, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(30, 41, 51, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

input:focus {
  outline: 2px solid rgba(212, 105, 61, 0.25);
  border-color: var(--accent);
}

select:focus,
textarea:focus {
  outline: 2px solid rgba(212, 105, 61, 0.25);
  border-color: var(--accent);
}

button {
  border: 0;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:not(.ghost-button):not(.icon-button):not(.table-button):not(.nav-button):not(.category-button):not(.category-summary-card):not(.page-button):not(.page-nav-button) {
  background: linear-gradient(135deg, var(--accent), #e68e61);
  color: #fff;
  box-shadow: 0 12px 24px rgba(212, 105, 61, 0.2);
}

.secondary-button,
.ghost-button,
.table-button,
.icon-button {
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-deep);
  border: 1px solid rgba(143, 62, 40, 0.14);
  box-shadow: none;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.demo-button {
  width: 100%;
  margin-top: 12px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green);
  box-shadow: none;
}

.demo-button:hover {
  background: var(--green);
  color: #fff;
}

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

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-badge.available {
  color: var(--green);
  background: var(--green-soft);
}

.status-badge.assigned {
  color: var(--amber);
  background: var(--amber-soft);
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-layout {
  gap: 20px;
}

.dashboard-header {
  margin-bottom: 12px;
}

.tabs-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.tabs-container button:hover {
  transform: none;
}

.workspace-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dashboard-nav {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 16px;
  background: #fff9f2;
  border: 1px solid rgba(212, 105, 61, 0.1);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  background: #fff9f2;
  border: 1px solid rgba(212, 105, 61, 0.1);
}

/* Shared button styles */
.nav-button,
.category-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  border: 1px solid transparent;
}

.nav-button {
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 12px;
  gap: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.category-button {
  flex-direction: column;
  height: 120px;
  padding: 16px;
  border-radius: 14px;
  gap: 12px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
  text-align: center;
}

.category-button svg {
  color: var(--accent);
  transition: transform 200ms ease;
}

.category-button:hover svg {
  transform: scale(1.1);
}

#dashboard-nav .nav-button.workspace-tab {
  flex: 0 0 auto;
  width: fit-content;
}

#dashboard-nav .nav-button:not(.active):hover,
#category-strip .category-button:not(.active):hover {
  background: #fff;
  border-color: rgba(212, 105, 61, 0.35);
  color: var(--accent-deep);
  transform: none;
}

#dashboard-nav .nav-button.active,
#category-strip .category-button.active {
  background: linear-gradient(135deg, #f09865 0%, var(--accent) 100%);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(212, 105, 61, 0.25);
}

#dashboard-nav .nav-button.active svg,
#category-strip .category-button.active svg {
  color: #fff;
}

#category-strip .category-button {
  flex: 0 1 auto;
  min-width: 92px;
}

.nav-button.workspace-tab:focus-visible,
.category-button:focus-visible {
  outline: 3px solid rgba(212, 105, 61, 0.28);
  outline-offset: 2px;
}

.view-container,
.dashboard-band {
  display: grid;
  gap: 18px;
}

.summary-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}

.category-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.category-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(212, 105, 61, 0.08);
  box-shadow: 0 4px 14px rgba(212, 105, 61, 0.05);
  transition: all 240ms ease;
  cursor: pointer;
  text-align: center;
}

.category-summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(212, 105, 61, 0.12);
  border-color: rgba(212, 105, 61, 0.2);
}

.summary-icon-wrapper {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff9f2;
  color: var(--accent);
  margin-bottom: 18px;
}

.summary-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.summary-total {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 18px;
  line-height: 1;
}

.summary-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff9f2;
  color: #a96316;
  font-size: 0.88rem;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-field {
  min-width: 220px;
  max-width: 320px;
}

.toolbar-field.small {
  min-width: 170px;
  max-width: 200px;
}

.assignment-summary {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(30, 41, 51, 0.08);
  color: var(--text);
  font-weight: 600;
}

.toast-region {
  position: fixed;
  top: 20px;
  right: 20px;
  display: grid;
  gap: 10px;
  z-index: 50;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 18px 34px rgba(30, 41, 51, 0.18);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-success {
  background: linear-gradient(135deg, #1b7b5c, #38a47e);
}

.toast-error {
  background: linear-gradient(135deg, #b84b2e, #dd6d4f);
}

.toast-out {
  opacity: 0;
  transform: translateY(-4px);
}

.loading-state {
  padding: 28px;
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(30, 41, 51, 0.16);
}

.empty-text {
  text-align: center;
  padding: 12px;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(16, 23, 29, 0.38);
}

.modal-card {
  width: min(760px, calc(100vw - 24px));
  padding: 22px;
  border-radius: 22px;
  background: var(--bg-strong);
  display: grid;
  gap: 14px;
}

.modal-card.compact {
  width: min(520px, calc(100vw - 24px));
}

.picker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.picker-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  min-width: 0;
}

.check-list {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.check-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.check-item.disabled {
  opacity: 0.5;
}

.error-text {
  margin: 0;
  font-size: 0.9rem;
}

.info-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(27, 123, 92, 0.1);
  border: 1px solid rgba(27, 123, 92, 0.16);
}

.subtle-login {
  background: rgba(212, 105, 61, 0.08);
  border-color: rgba(212, 105, 61, 0.15);
}

.credit-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .category-summary-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  #dashboard-nav .nav-button.workspace-tab {
    flex: 1 1 auto;
    min-width: 140px;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

@media (max-width: 860px) {

  .login-screen,
  .picker-grid,
  .asset-lists,
  .search-result-grid,
  .topbar,
  .stats-grid,
  .category-summary-grid {
    grid-template-columns: 1fr;
  }

  .login-screen {
    padding: 28px 22px;
    gap: 30px;
  }

  .login-card {
    max-width: 100%;
    justify-self: stretch;
  }

  .toolbar-row {
    flex-direction: column;
  }

  .dashboard-nav,
  .category-grid {
    gap: 10px;
    padding: 10px;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .category-button {
    height: 100px;
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 20px;
  }

  .panel,
  .login-card,
  .modal-card {
    border-radius: 18px;
  }

  .login-copy h1 {
    max-width: 100%;
  }

  .brand-mark {
    margin-bottom: 6px;
  }

  .brand-mark img {
    width: 180px;
  }

  .login-screen {
    padding: 22px 16px;
    border-radius: 22px;
  }
}

.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.page-numbers {
  display: flex;
  gap: 8px;
}

.page-button,
.page-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
}

.page-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.page-button:hover:not(.active),
.page-nav-button:hover:not(:disabled) {
  background: #fff9f2;
  border-color: var(--accent);
  color: var(--accent);
}

.page-nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.page-nav-button svg {
  margin: 0 4px;
}