:root,[data-bs-theme="light"]{--paper:#f6f5f0;--surface:#fff;--ink:#232c29;--muted:#69736d;--line:#dddfd5;--accent:#275543;--accent-light:#edf3ec;--warm:#efe8d8;--bs-body-bg:var(--paper);--bs-body-color:var(--ink);--bs-primary:#275543;--bs-primary-rgb:39,85,67;--bs-link-color:#275543;--bs-border-color:var(--line);--bs-secondary-color:var(--muted);--bs-tertiary-bg:var(--paper)}
[data-bs-theme="dark"]{--paper:#171e1b;--surface:#202a25;--ink:#e8ede5;--muted:#aab7ad;--line:#39453d;--accent:#94c7a7;--accent-light:#2a3c31;--warm:#3a372b;--bs-body-bg:var(--paper);--bs-body-color:var(--ink);--bs-primary-rgb:148,199,167;--bs-link-color:var(--accent);--bs-border-color:var(--line);--bs-secondary-color:var(--muted)}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--paper)!important;color:var(--ink);font-size:14px;line-height:1.6;background-image:none!important}body:before,body:after{display:none!important}h1,h2,h3,h4,h5,h6{color:var(--ink);letter-spacing:-.035em}h1{font-size:clamp(28px,3vw,42px);font-weight:600;line-height:1.15}h2{font-size:22px;font-weight:600}p{max-width:75ch}a{color:var(--accent)}.text-muted{color:var(--muted)!important}.text-primary{color:var(--accent)!important}.text-body{color:var(--ink)!important}.bg-primary-subtle{background:var(--accent-light)!important}.workspace-main{margin-left:240px;width:calc(100% - 240px);max-width:none;padding:40px 48px!important}.workspace-sidebar{position:fixed;inset:0 auto 0 0;width:240px;z-index:1030;background:var(--surface)!important;border-right:1px solid var(--line);padding:32px 22px;display:flex;flex-direction:column;color:var(--ink)}.sidebar-brand-row{display:flex;justify-content:space-between;align-items:center}.workspace-brand{font-size:22px;font-weight:700;letter-spacing:-1px;display:flex;gap:9px;align-items:center;color:var(--ink);text-decoration:none}.workspace-brand i{font-size:21px;color:var(--accent)}.brand-dot{color:var(--accent);margin-left:-9px}.workspace-caption,.sidebar-section-label,.eyebrow{font-size:10px;font-weight:650;letter-spacing:1.8px;color:var(--muted)}.workspace-caption{margin:8px 0 28px 31px;font-size:9px}.sidebar-add{display:flex;gap:10px;justify-content:center;margin-bottom:25px;padding:12px!important}.workspace-nav{display:flex;flex-direction:column;gap:5px}.workspace-nav a{display:flex;align-items:center;gap:13px;padding:11px 13px;border-radius:6px;color:var(--muted);text-decoration:none;font-weight:500}.workspace-nav a i{font-size:18px}.workspace-nav a:hover,.workspace-nav a.is-active{background:var(--accent-light);color:var(--accent)}.sidebar-section-label{margin:31px 13px 12px}.collection-shortcuts a{font-size:13px;padding-top:9px;padding-bottom:9px}.sidebar-bottom{margin-top:auto;padding-top:28px}.sidebar-utility{display:flex;gap:10px;border:0;background:none;color:var(--muted);text-decoration:none;padding:10px 4px;font-size:12px}.sidebar-account{border-top:1px solid var(--line);padding-top:20px;margin-top:16px;display:flex;gap:10px;align-items:center;font-size:11px}.sidebar-account small{display:block;font-size:9px;color:var(--muted)}.sidebar-account>a{margin-left:auto}.account-avatar{background:var(--warm);color:var(--ink);padding:8px;border-radius:50%;font-weight:600}.workspace-footer{margin-left:240px;border-top:1px solid var(--line);font-size:11px}.mobile-topbar{display:none}.skip-link{position:fixed;top:-100px;left:250px;background:var(--surface);padding:12px;z-index:2000}.skip-link:focus{top:0}.btn{border-radius:6px;font-size:13px;font-weight:550;box-shadow:none!important;transition:background .15s,color .15s;min-height:36px}.btn-primary{--bs-btn-bg:#275543;--bs-btn-border-color:#275543;--bs-btn-hover-bg:#193c2e;--bs-btn-hover-border-color:#193c2e;--bs-btn-active-bg:#193c2e;--bs-btn-disabled-bg:#6b8376;color:#fff;background-image:none!important}.btn-outline-primary{--bs-btn-color:var(--accent);--bs-btn-border-color:var(--line);--bs-btn-hover-bg:var(--accent-light);--bs-btn-hover-color:var(--accent);--bs-btn-hover-border-color:var(--accent);--bs-btn-active-bg:var(--accent-light);--bs-btn-active-color:var(--accent)}.btn-outline-secondary,.btn-outline-light,.btn-soft-light{color:var(--ink);border:1px solid var(--line);background:var(--surface)}.form-control,.form-select{border:1px solid var(--line);border-radius:6px;background-color:var(--surface);color:var(--ink);font-size:14px;min-height:43px;box-shadow:none}.form-control:focus,.form-select:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-light)}.form-label{font-size:12px;font-weight:600;color:var(--ink);margin-bottom:7px}.form-text{font-size:11px;color:var(--muted)}.form-check-input:checked{background-color:#275543;border-color:#275543}.card,.glass-card,.inventory-mobile-card,.inventory-metric-card,.filter-panel,.modal-content{background:var(--surface)!important;background-image:none!important;border:1px solid var(--line)!important;border-radius:9px!important;box-shadow:none!important;backdrop-filter:none!important;color:var(--ink)}.shadow-sm,.shadow-lg,.shadow{box-shadow:none!important}.badge{font-weight:500;border-radius:4px!important}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:30px}.page-heading h1{margin:9px 0 10px}.page-heading p{color:var(--muted);margin:0;font-size:14px}.heading-actions{display:flex;gap:10px;align-items:center;flex-shrink:0}.heading-actions .btn{padding:11px 17px}.overview-metrics{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);border-radius:8px;background:var(--surface);margin-bottom:32px}.overview-metric{padding:22px 25px;border-right:1px solid var(--line)}.overview-metric:last-child{border:0}.overview-metric span{display:block;color:var(--muted);font-size:11px}.overview-metric strong{display:block;font-size:29px;font-weight:550;margin:4px 0;letter-spacing:-1px}.section-heading{display:flex;justify-content:space-between;align-items:center;margin:32px 0 17px;gap:12px}.section-heading h2{margin:0}.section-heading a{font-size:12px}.collection-types{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.type-tile{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:24px;text-decoration:none;color:var(--ink);position:relative}.type-tile:hover{border-color:var(--accent);color:var(--ink)}.type-tile>i{font-size:28px;display:block;margin-bottom:18px;color:var(--accent)}.type-tile h3{font-size:18px;margin-bottom:5px}.type-tile p{font-size:12px;color:var(--muted);margin:0}.type-tile .tile-count{position:absolute;right:22px;top:27px;color:var(--muted);font-size:11px}.dashboard-lower{display:grid;grid-template-columns:2fr 1fr;gap:24px}.collection-empty{padding:42px;border:1px dashed var(--line);border-radius:8px;background:var(--surface);text-align:center}.collection-empty i{font-size:32px;color:var(--accent);display:block;margin-bottom:17px}.collection-empty h3{font-size:20px}.collection-empty p{color:var(--muted);font-size:13px;margin:12px auto 23px;max-width:43ch}.recent-entry{display:flex;gap:15px;align-items:center;padding:16px 0;border-bottom:1px solid var(--line);text-decoration:none;color:var(--ink)}.recent-entry img{width:48px;height:58px;object-fit:contain;background:var(--surface);border-radius:4px}.recent-entry strong{font-size:13px;display:block}.recent-entry small{color:var(--muted);font-size:11px}.recent-entry>i{margin-left:auto}.activity-entry{padding:14px 0;border-bottom:1px solid var(--line)}.activity-entry p{font-size:12px;margin:0}.activity-entry small{color:var(--muted);font-size:10px}.collection-tip{background:var(--warm);padding:24px;border-radius:8px;margin-top:22px}.collection-tip h3{font-size:16px}.collection-tip p{font-size:12px;color:var(--muted);margin-bottom:0}.collection-form-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:25px;align-items:start}.form-section{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:26px;margin-bottom:20px}.form-section-header{display:flex;gap:12px;align-items:center;margin-bottom:23px}.step-number{width:28px;height:28px;border-radius:50%;background:var(--accent-light);color:var(--accent);display:grid;place-items:center;font-size:11px;font-weight:650;flex-shrink:0}.form-section h2{font-size:18px;margin:0}.form-section-header p{font-size:12px;color:var(--muted);margin:3px 0 0}.type-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.type-choice{position:relative;cursor:pointer;border:1px solid var(--line);border-radius:7px;padding:17px 9px;display:flex;flex-direction:column;gap:9px;align-items:center;font-size:12px;color:var(--muted);text-align:center}.type-choice:has(input:checked){border-color:var(--accent);background:var(--accent-light);color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.type-choice input{position:absolute;opacity:0}.type-choice:has(input:focus-visible){outline:3px solid var(--accent);outline-offset:3px}.type-choice i{font-size:23px}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.field-full{grid-column:1/-1}.photo-panel{position:sticky;top:25px}.photo-drop{display:block;text-align:center;border:1px dashed #a2b1a2;border-radius:7px;background:var(--paper);padding:28px 15px;cursor:pointer}.photo-drop i{font-size:28px;color:var(--accent);display:block;margin-bottom:10px}.photo-drop strong{font-size:13px}.photo-drop small{display:block;font-size:11px;color:var(--muted);margin-top:5px}.photo-previews{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:15px}.photo-preview{position:relative;border:1px solid var(--line);border-radius:6px;padding:6px;background:var(--paper)}.photo-preview img{width:100%;height:115px;object-fit:contain}.photo-preview .form-select{min-height:30px;font-size:10px;margin-top:6px;padding:3px 20px 3px 5px}.photo-preview button{position:absolute;top:5px;right:5px;border:1px solid var(--line);background:var(--surface);border-radius:4px;width:26px;height:26px}.form-help{font-size:12px;color:var(--muted)}.form-actions{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:20px 0}.form-actions .btn-primary{padding:12px 24px}.draft-status{font-size:11px;color:var(--muted)}details>summary{font-size:13px;font-weight:600;cursor:pointer;padding:2px 0}details[open]>summary{margin-bottom:20px}.type-specific[hidden]{display:none!important}.candidate-list{display:grid;gap:8px}.candidate-option{display:block;border:1px solid var(--line);border-radius:6px;padding:12px;font-size:12px;background:var(--surface)}.candidate-option:has(input:checked){border-color:var(--accent);background:var(--accent-light)}.detail-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:28px}.detail-gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:15px}.detail-gallery img{width:100%;height:280px;object-fit:contain;background:var(--surface);border:1px solid var(--line);border-radius:7px}.detail-pair{display:flex;justify-content:space-between;gap:20px;padding:11px 0;border-bottom:1px solid var(--line);font-size:13px}.detail-pair dt{color:var(--muted);font-weight:400}.detail-pair dd{text-align:right;margin:0;overflow-wrap:anywhere}.auth-layout .workspace-main{margin-left:0;width:100%;display:grid;place-items:center;min-height:100vh}.auth-layout .glass-card{padding:38px!important}.auth-screen{min-height:90vh}.table{--bs-table-bg:var(--surface);--bs-table-color:var(--ink);--bs-table-border-color:var(--line);font-size:13px}.table thead th{font-size:10px;letter-spacing:.7px;text-transform:uppercase;color:var(--muted);background:var(--paper)!important}.pagination .page-link{color:var(--accent);background:var(--surface);border-color:var(--line)}.pagination .active>.page-link{background:#275543;color:#fff}.inventory-hero,.catalog-hero{background:var(--surface)!important;background-image:none!important;border:1px solid var(--line)!important;box-shadow:none!important;color:var(--ink)!important;border-radius:8px!important}.inventory-hero:before,.inventory-hero:after,.catalog-hero:before,.catalog-hero:after{display:none!important}.inventory-metric-card{padding:16px!important}.inventory-metric-value{font-size:23px!important}.inventory-metric-grid{gap:10px!important}.inventory-filter-bar,.catalog-filter-bar{box-shadow:none!important;background:var(--surface)!important;border-color:var(--line)!important}.modal-header{border-color:var(--line)}.modal-footer{border-color:var(--line)}.alert{border-radius:6px;font-size:13px}*:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(min-width:992px){.workspace-sidebar.offcanvas-lg{display:flex!important;position:fixed!important;visibility:visible!important;height:100vh!important;width:240px!important;transform:none!important}.workspace-sidebar .offcanvas-body{display:flex;flex-direction:column}}@media(max-width:1199px){.workspace-main{padding:30px!important}.collection-form-layout{grid-template-columns:minmax(0,1fr) 270px}.detail-layout{grid-template-columns:minmax(0,1fr) 300px}}
@media(max-width:991px){.mobile-topbar{display:flex;justify-content:space-between;align-items:center;padding:17px 22px;background:var(--surface);border-bottom:1px solid var(--line)}.workspace-sidebar{width:260px!important}.workspace-main{margin-left:0;width:100%;padding:28px 22px!important}.workspace-footer{margin-left:0}.collection-form-layout{grid-template-columns:minmax(0,1fr) 280px}.skip-link{left:20px}.detail-layout{grid-template-columns:1fr}.dashboard-lower{grid-template-columns:1.4fr 1fr}}
@media(max-width:700px){.page-heading{align-items:flex-start;flex-direction:column;margin-bottom:24px}.page-heading h1{font-size:31px}.heading-actions{width:100%}.overview-metrics{grid-template-columns:repeat(2,1fr)}.overview-metric:nth-child(2){border-right:0}.overview-metric:nth-child(-n+2){border-bottom:1px solid var(--line)}.overview-metric{padding:17px}.overview-metric strong{font-size:26px}.collection-types{gap:9px}.type-tile{padding:15px 12px}.type-tile h3{font-size:14px}.type-tile p{font-size:10px}.type-tile .tile-count{position:static;display:block;margin-bottom:10px}.type-tile>i{font-size:22px;margin-bottom:12px}.dashboard-lower{grid-template-columns:1fr}.collection-form-layout{grid-template-columns:1fr}.photo-panel{position:static;grid-row:1}.form-section{padding:20px}.photo-drop{padding:18px}.field-grid{gap:15px}.field-grid>.field-full{grid-column:1/-1}.form-actions{flex-wrap:wrap}.form-actions .btn{flex:1}.photo-previews{grid-template-columns:repeat(3,minmax(0,1fr))}.collection-empty{padding:30px 20px}.detail-gallery img{height:220px}.workspace-main{padding:25px 17px!important}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Access screens share the workspace rhythm without a desktop-only hero. */
.auth-layout .workspace-main {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: clamp(24px, 5vw, 56px) !important;
  box-sizing: border-box;
  overflow: auto;
  background: var(--paper);
}

.auth-layout .workspace-main::before { display: none; }
body.auth-layout .auth-screen {
  width: 100%;
  min-height: auto;
  margin: 0;
  padding: 0 !important;
}
.auth-screen > [class*="col-"] { width: min(100%, 460px); }
.auth-login-screen > [class*="col-"] { width: min(100%, 430px); }
.auth-layout .glass-card.auth-card {
  width: 100%;
  max-width: none;
  padding: clamp(26px, 4vw, 40px) !important;
  border-radius: 16px !important;
  background: var(--surface) !important;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.auth-brand img { width: 32px; height: 32px; object-fit: contain; }
.auth-brand--mark { margin-bottom: 20px; }
.auth-brand--mark img { width: 64px; height: 64px; }
.auth-card--login { padding: 36px 40px !important; }
.auth-intro { margin-bottom: 28px; }
.auth-intro .icon-circle { margin-bottom: 14px !important; }
.auth-screen h1 { font-size: 24px; line-height: 1.22; }
.auth-screen .text-center > p { font-size: 14px; line-height: 1.5; }
.auth-card .form-control { min-height: 46px; }
.auth-options { gap: 12px; }
.auth-options > a { white-space: nowrap; }
.auth-register { display: flex; justify-content: center; gap: 5px; }

@media (max-width: 575.98px) {
  .auth-layout .workspace-main { padding: 20px 16px !important; }
  .auth-screen > [class*="col-"] { width: 100%; }
  .auth-layout .glass-card.auth-card { padding: 26px 24px !important; }
  .auth-layout .glass-card.auth-card--login { padding: 30px 24px 26px !important; }
  .auth-brand { margin-bottom: 24px; font-size: 21px; }
  .auth-brand--mark { margin-bottom: 18px; }
  .auth-brand--mark img { width: 58px; height: 58px; }
  .auth-intro { margin-bottom: 24px; }
  .auth-screen h1 { font-size: 22px; }
  .auth-options { align-items: flex-start !important; gap: 10px; }
  .auth-options .form-check { min-width: 0; }
  .auth-options > a { font-size: 12px; }
}
@media(max-width:700px){.photo-panel{grid-row:auto}.photo-panel .collection-tip{display:none}.collection-form-layout{display:flex;flex-direction:column}.collection-form-layout>div,.collection-form-layout>aside{width:100%}.photo-panel{order:-1}.photo-panel .form-section{padding:16px}.photo-panel .form-section-header{margin-bottom:12px}.photo-panel .form-section-header p{display:none}.photo-drop{padding:12px}.photo-drop i{display:inline;font-size:18px;margin-right:8px}.photo-drop small{margin-top:2px}.photo-panel .form-section>input[type=file]{font-size:11px}.photo-panel .draft-status{font-size:10px}}
@media(max-width:480px){.field-grid{grid-template-columns:1fr}.overview-metric span{font-size:10px}.heading-actions{flex-wrap:wrap}.type-tile .tile-count{font-size:10px}.type-tile p{display:none}.collection-form-layout .photo-panel .photo-previews:empty{display:none}.collection-form-layout .photo-panel .form-section-header h2{font-size:15px}}
/* Keep the mobile navigation above Bootstrap's modal backdrop. */
@media (max-width: 991px) {
  .workspace-sidebar { z-index: 1045; }
}

/* The order is part of a physical copy: make it visible before the upload ends. */
.photo-preview.is-pending { opacity: .72; }
.photo-preview.is-preview-loading::after {
  content: 'Preparando…';
  position: absolute;
  inset: 32px 6px 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  background: var(--paper);
}
.photo-preview__order {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: 7px;
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.photo-preview__actions {
  position: absolute;
  z-index: 1;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 3px;
}
.photo-preview__actions button { position: static; line-height: 1; }
.photo-preview__actions button:disabled { opacity: .45; }
.photo-order-help { margin: 0; }
/* Collection controls use the same neutral surfaces as the rest of the workspace. */
.workspace-main .inventory-surface,
.workspace-main .catalog-surface {
  background: var(--surface) !important;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none !important;
}
.workspace-main .inventory-controls-form .form-control,
.workspace-main .inventory-controls-form .form-select,
.workspace-main .inventory-controls-form .input-group-text,
.workspace-main .catalog-controls-form .form-control,
.workspace-main .catalog-controls-form .form-select,
.workspace-main .catalog-controls-form .input-group-text {
  color: var(--ink);
  background-color: var(--surface);
  border-color: var(--line);
  border-radius: 6px;
}
.workspace-main .inventory-controls-form .form-control::placeholder,
.workspace-main .catalog-controls-form .form-control::placeholder {
  color: var(--muted);
}
.workspace-main .inventory-pill,
.workspace-main .catalog-pill {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--line);
}
.workspace-main .inventory-mobile-name {
  white-space: normal;
  overflow: visible;
  display: block;
  line-height: 1.5;
}
.detail-gallery > :only-child { grid-column: 1 / -1; }
:root[data-bs-theme="dark"] .btn-outline-secondary,
:root[data-bs-theme="dark"] .btn-outline-light {
  color: var(--ink);
  background-color: var(--surface);
  border-color: var(--line);
}
:root[data-bs-theme="dark"] .workspace-main .inventory-controls-form .form-control,
:root[data-bs-theme="dark"] .workspace-main .inventory-controls-form .form-select,
:root[data-bs-theme="dark"] .workspace-main .catalog-controls-form .form-control,
:root[data-bs-theme="dark"] .workspace-main .catalog-controls-form .form-select {
  color: var(--ink);
  background-color: var(--surface);
  border-color: var(--line);
}

.sidebar-add {
  align-items: center;
}

.sidebar-add i {
  line-height: 1;
}

/* The fixed desktop rail and the mobile offcanvas share this element. */
.workspace-sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Keep every Bootstrap dialog interactive above app navigation on narrow screens. */
.modal-backdrop { z-index: 1060; }
.modal { z-index: 1070; }

.catalog-add-camera-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--paper);
}

.catalog-add-camera-preview {
  display: block;
  width: 100%;
  max-height: 20rem;
  object-fit: cover;
  background: #101513;
}

/* The catalog inherits older indigo dark styles; keep its mobile surfaces in the workspace palette. */
:root[data-bs-theme="dark"] .workspace-main .inventory-surface,
:root[data-bs-theme="dark"] .workspace-main .catalog-surface,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-card,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-card {
  background: var(--surface) !important;
  background-image: none !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-card:hover,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-card:focus-within,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-card:hover,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-card:focus-within {
  border-color: var(--accent) !important;
  box-shadow: none !important;
  transform: none;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-thumb,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-thumb {
  background: var(--paper) !important;
  border-color: var(--line) !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge {
  background: var(--accent-light) !important;
  color: var(--ink) !important;
}

/* Keep the catalog metadata vocabulary visible in the workspace dark palette. */
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--number,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--number,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--category,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--category,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--condition,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--condition {
  background: rgba(148, 163, 184, 0.24) !important;
  color: #e2e8f0 !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--variant,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--variant {
  background: rgba(167, 139, 250, 0.28) !important;
  color: #ddd6fe !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--series,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--series,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--language,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--language {
  background: rgba(56, 189, 248, 0.23) !important;
  color: #bae6fd !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--rarity,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--rarity,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--holo,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--holo,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--rating,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--rating {
  background: rgba(251, 191, 36, 0.24) !important;
  color: #fde68a !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--edition,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--edition,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--photo,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--photo {
  background: rgba(45, 212, 191, 0.22) !important;
  color: #99f6e4 !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--owned,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--owned {
  background: rgba(74, 222, 128, 0.22) !important;
  color: #bbf7d0 !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--quantity,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--quantity,
:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-badge.catalog-badge--detail,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-badge.catalog-badge--detail {
  background: rgba(244, 114, 182, 0.22) !important;
  color: #fbcfe8 !important;
}

:root[data-bs-theme="dark"] .workspace-main .inventory-mobile-price,
:root[data-bs-theme="dark"] .workspace-main .catalog-mobile-price {
  color: var(--accent) !important;
}

#catalogAddModal .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--surface);
}

#catalogAddModal .modal-footer .btn-success {
  order: -1;
}

@media (max-width: 575.98px) {
  #catalogAddModal .modal-dialog {
    height: calc(100% - 1rem);
    margin: 0.5rem;
  }

  #catalogAddModal .modal-content {
    max-height: calc(100vh - 1rem);
  }

  #catalogAddModal .modal-footer .btn {
    flex: 1 1 100%;
  }

  .catalog-add-camera-preview {
    max-height: 42vh;
  }
}

/* Detail pages distinguish shared catalog facts from the owner's physical copy. */
.detail-section-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.detail-section-intro h2 {
  margin: 2px 0 4px;
}

.detail-section-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.detail-section-kicker {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.detail-section-intro--compact {
  display: block;
}

.detail-definition-list {
  margin: 0 0 20px;
}

.detail-definition-list .detail-pair:last-child {
  border-bottom: 0;
}

.detail-notes {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-notes h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: normal;
}

.detail-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.detail-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.detail-danger strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.detail-danger p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .detail-section-intro {
    flex-direction: column;
    gap: 14px;
  }

  .detail-section-intro > .btn {
    width: 100%;
  }

  .detail-danger {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-danger .btn {
    width: 100%;
  }
}

/* Academy-inspired product hierarchy: one calm media focus, one product sheet,
   and one clearly separate physical-copy panel. */
.collection-detail-heading {
  align-items: flex-end;
  max-width: 1500px;
  margin-bottom: 28px;
}

.detail-breadcrumb {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.collection-detail-heading h1 {
  max-width: 820px;
  margin: 0 0 7px;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 500;
  line-height: 1.08;
}

.collection-detail-page {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(430px, 1fr) minmax(270px, 310px);
  gap: clamp(22px, 2vw, 30px);
  align-items: start;
  max-width: 1500px;
}

.collection-detail-media,
.detail-copy-column { position: sticky; top: 24px; min-width: 0; }
.collection-detail-product { min-width: 0; }

.detail-product-sheet,
.detail-copy-sheet {
  padding: clamp(22px, 2.2vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.detail-product-sheet .detail-section-intro,
.detail-copy-sheet .detail-section-intro { margin-bottom: 8px; }

.detail-product-sheet .detail-section-intro h2,
.detail-copy-sheet .detail-section-intro h2 {
  margin: 0 0 5px;
  font-size: 22px;
  font-weight: 600;
}

.detail-definition-list--primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.detail-definition-list--primary .detail-pair:first-child { grid-column: 1 / -1; }

.detail-pair {
  min-width: 0;
  padding: 13px 0;
  font-size: 13px;
}

.detail-pair dt { flex: 0 1 44%; }
.detail-pair dd { flex: 1 1 56%; font-weight: 550; }

.detail-technical,
.item-detail-technical {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-technical > summary,
.item-detail-technical > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 14px 2px;
  list-style: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.detail-technical > summary::-webkit-details-marker,
.item-detail-technical > summary::-webkit-details-marker { display: none; }

.detail-technical > summary::after,
.item-detail-technical > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 21px;
  font-weight: 400;
}

.detail-technical[open] > summary::after,
.item-detail-technical[open] > summary::after { content: "−"; }

.detail-technical__hint,
.item-detail-technical-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.detail-technical__body,
.item-detail-technical-body { padding: 0 2px 22px; }
.detail-technical__body .detail-definition-list { margin-bottom: 14px; }

.detail-product-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.detail-product-actions span { color: var(--muted); font-size: 11px; line-height: 1.4; }

.detail-copy-sheet .detail-pair { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr); }
.detail-copy-sheet .detail-pair dt,
.detail-copy-sheet .detail-pair dd { text-align: left; }
.detail-copy-sheet .detail-pair dd { justify-self: end; text-align: right; }

.media-gallery { min-width: 0; }
.media-gallery__label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.media-gallery__stage {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  place-items: center;
  overflow: hidden;
  background: #f6f7f8;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.media-gallery__stage img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 14px;
  object-fit: contain;
}

.media-gallery__open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.media-gallery__caption { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.media-gallery__thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }

.media-gallery__thumb {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  padding: 4px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.media-gallery__thumb:hover,
.media-gallery__thumb.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.media-gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.media-gallery__thumb span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 2px 4px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  font-size: 8px;
  line-height: 1.2;
}

.collection-detail-empty { min-height: 430px; display: grid; place-content: center; }

/* Catalog and collection browse surfaces share the same portrait media grammar. */
.inventory-thumb {
  width: 64px;
  height: 80px;
  padding: 4px;
  object-fit: contain;
  background: #f6f7f8;
  border-radius: 8px;
}

.inventory-gallery-grid .inventory-mobile-thumb,
.inventory-gallery-grid .catalog-mobile-thumb { aspect-ratio: 3 / 4; background: #f6f7f8; }
.inventory-gallery-grid .inventory-mobile-thumb img,
.inventory-gallery-grid .catalog-mobile-thumb img { padding: 10px; object-fit: contain; }
.inventory-gallery-grid .inventory-mobile-card,
.inventory-gallery-grid .catalog-mobile-card { padding: 12px; }
.inventory-table tbody td { padding-top: 12px; padding-bottom: 12px; }

/* Game modal keeps one visual identity and moves audit-only facts behind disclosure. */
#catalogItemModal .item-detail-overview--game {
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 34px;
  margin-bottom: 24px;
}

#catalogItemModal .item-detail-overview--game .item-detail-overview-media { position: static; }
#catalogItemModal .item-detail-overview--game .media-gallery__stage { max-height: 390px; }
#catalogItemModal .item-detail-overview--game .item-detail-section { margin: 26px 0 0; }
#catalogItemModal .item-detail-overview--game .item-detail-section-title { margin-bottom: 12px; }
#catalogItemModal .item-detail-overview--game .item-detail-facts { border-radius: 10px; }
#catalogItemModal .item-detail-overview--game .item-detail-fact { padding: 12px 13px; }
#catalogItemModal .item-detail-technical .item-detail-facts { margin-top: 4px; }

[data-bs-theme="dark"] .media-gallery__stage,
[data-bs-theme="dark"] .inventory-thumb,
[data-bs-theme="dark"] .inventory-gallery-grid .inventory-mobile-thumb,
[data-bs-theme="dark"] .inventory-gallery-grid .catalog-mobile-thumb { background: #111725; }

[data-bs-theme="dark"] .media-gallery__open,
[data-bs-theme="dark"] .media-gallery__thumb span { background: rgba(25, 34, 54, 0.94); color: var(--ink); }

@media (max-width: 1199.98px) {
  .collection-detail-page { grid-template-columns: minmax(250px, 320px) minmax(380px, 1fr); }
  .detail-copy-column { position: static; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .45fr); gap: 24px; }
  .detail-danger { align-self: end; }
}

@media (max-width: 767.98px) {
  .collection-detail-heading { align-items: flex-start; }
  .collection-detail-heading .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .collection-detail-heading .heading-actions .btn:last-child { grid-column: 1 / -1; }
  .collection-detail-page { grid-template-columns: 1fr; gap: 24px; }
  .collection-detail-media,
  .detail-copy-column { position: static; }
  .collection-detail-media { width: min(100%, 390px); margin: 0 auto; }
  .detail-definition-list--primary { grid-template-columns: 1fr; }
  .detail-copy-column { grid-column: auto; display: block; }
  .detail-copy-column .detail-danger { margin-top: 22px; }
  .detail-product-actions { align-items: stretch; flex-direction: column; }
  .detail-product-actions .btn { width: 100%; }
  .detail-technical__hint,
  .item-detail-technical-hint { display: none; }

  #catalogItemModal .item-detail-overview--game { grid-template-columns: 1fr; gap: 22px; }
  #catalogItemModal .item-detail-overview--game .item-detail-overview-media { width: min(100%, 280px); max-width: none; }
  #catalogItemModal .item-detail-overview--game .media-gallery__stage { height: auto; min-height: 0; aspect-ratio: 3 / 4; }
  #catalogItemModal .item-detail-overview--game .item-detail-facts { grid-template-columns: 1fr; }
  #catalogItemModal .item-detail-overview--game .item-detail-fact { border-right: 0; }
  #catalogItemModal .item-detail-overview--game .item-detail-fact:last-child { border-bottom: 0; }
}

/* Editorial workspace refresh: keeps the existing information architecture while
   replacing the old green utility theme with the light, gallery-like direction. */
:root,
[data-bs-theme="light"] {
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #1e1d29;
  --muted: #656b76;
  --line: #e5e7eb;
  --accent: #00b1e2;
  --accent-strong: #008ab8;
  --accent-light: rgba(0, 177, 226, 0.1);
  --warm: rgba(24, 26, 31, 0.07);
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-primary: var(--accent);
  --bs-primary-rgb: 0, 177, 226;
  --bs-link-color: var(--accent-strong);
  --bs-link-hover-color: #055e83;
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--paper);
}

[data-bs-theme="dark"] {
  --paper: #111725;
  --surface: #192236;
  --ink: #edf4fb;
  --muted: #aab7c9;
  --line: #334057;
  --accent: #58ceee;
  --accent-strong: #8ae4fa;
  --accent-light: #203c4b;
  --warm: #252f44;
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-primary: var(--accent);
  --bs-primary-rgb: 88, 206, 238;
  --bs-link-color: var(--accent);
  --bs-link-hover-color: #b4effc;
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--paper);
}

body {
  background: var(--paper) !important;
  color: var(--ink);
  font-family: Inter, -apple-system, "system-ui", "Helvetica Neue", "Segoe UI", "Noto Sans", ui-sans-serif, system-ui, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: normal;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.workspace-brand {
  font-family: inherit;
  letter-spacing: normal;
}

h1 { font-size: 28px; font-weight: 500; line-height: 1.3; }
h2 { font-size: 28px; font-weight: 500; line-height: 1.6; }
h3 { font-size: 21px; font-weight: 500; line-height: 1.3; }
h4,
h5,
h6,
.h4,
.h5,
.h6 { font-weight: 600; }

.dashboard-hero .display-6,
#scanResults h2 { letter-spacing: normal !important; }

.workspace-sidebar {
  width: 224px;
  padding: 26px 20px;
  background: rgba(255, 254, 250, 0.94) !important;
  border-right-color: var(--line);
}

[data-bs-theme="dark"] .workspace-sidebar { background: rgba(25, 34, 54, 0.94) !important; }

.workspace-brand {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
}

.workspace-brand i,
.brand-dot { color: var(--accent); }

.workspace-brand .brand-mark {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 auto;
}

.workspace-caption { margin: 9px 0 25px 39px; }

.workspace-nav { gap: 2px; }

.workspace-nav a {
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.workspace-nav a:hover,
.workspace-nav a.is-active {
  background: var(--accent-light);
  color: var(--accent-strong);
}

.workspace-nav a.is-active { font-weight: 650; }

.workspace-main {
  margin-left: 224px;
  width: calc(100% - 224px);
  padding: 30px 44px 54px !important;
}

.workspace-footer { margin-left: 224px; }

.btn {
  min-height: 40px;
  padding: 10px 15px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: normal;
  box-shadow: none !important;
}

.heading-actions .btn,
.form-actions .btn-primary {
  padding: 10px 15px;
}

.sidebar-add { padding: 10px 15px !important; }

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-strong);
  --bs-btn-hover-border-color: var(--accent-strong);
  --bs-btn-active-bg: #056484;
  --bs-btn-active-border-color: #056484;
  --bs-btn-disabled-bg: #8bcfe2;
  --bs-btn-disabled-border-color: #8bcfe2;
  color: #fff;
}

.btn-success {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-strong);
  --bs-btn-hover-border-color: var(--accent-strong);
  --bs-btn-active-bg: var(--accent-strong);
  --bs-btn-active-border-color: var(--accent-strong);
  --bs-btn-disabled-bg: #8bdff1;
  --bs-btn-disabled-border-color: #8bdff1;
  color: #fff;
}

.btn-outline-primary {
  --bs-btn-color: var(--accent-strong);
  --bs-btn-border-color: #b7dce7;
  --bs-btn-hover-color: #075e7b;
  --bs-btn-hover-bg: var(--accent-light);
  --bs-btn-hover-border-color: var(--accent);
}

.btn-outline-secondary,
.btn-outline-light,
.btn-soft-light {
  background: transparent;
  border-color: #3f424a;
  color: var(--ink);
}

.btn-outline-secondary:hover,
.btn-outline-light:hover,
.btn-soft-light:hover {
  background: var(--warm);
  border-color: #3f424a;
  color: var(--ink);
}

.btn-group { gap: 8px; }
.btn-group > .btn {
  margin-left: 0 !important;
  border-radius: 8px !important;
}
.btn-group > .btn-outline-secondary,
.btn-group > .btn-outline-primary,
.taxonomy-tabs .nav-link:not(.active) {
  background: var(--warm);
  border-color: transparent;
  color: var(--ink);
}
.btn-group > .btn-outline-secondary:hover,
.btn-group > .btn-outline-primary:hover,
.taxonomy-tabs .nav-link:not(.active):hover {
  background: rgba(24, 26, 31, 0.12);
  border-color: transparent;
  color: var(--ink);
}
.taxonomy-tabs .nav-link {
  min-height: 40px;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}
.taxonomy-tabs .nav-link.active {
  background: var(--accent);
  color: #fff;
}

.inventory-controls .btn,
.catalog-controls .btn {
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: normal;
}

.form-control,
.form-select,
.input-group-text {
  min-height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: normal;
  box-shadow: none;
}

.workspace-main .workspace-filter-form .form-select {
  border-radius: var(--control-radius);
}

.form-control-sm,
.form-select-sm {
  min-height: 38px;
  font-size: 12px;
  line-height: 1.6;
}

.form-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 177, 226, 0.14);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.input-group > .input-group-text:first-child { border-radius: var(--control-radius) 0 0 var(--control-radius); }
.input-group > .form-control:not(:first-child) { border-radius: 0; }
.input-group > .btn:last-child { border-radius: 0 6px 6px 0; }

.dashboard-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  min-height: 236px;
  padding: 34px 38px;
  margin: -30px -44px 36px;
  overflow: hidden;
  color: #fff;
  background: #102f46;
}

.dashboard-banner::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(15, 42, 76, 0.22);
}

.dashboard-banner__copy { max-width: 650px; }

.dashboard-banner .eyebrow,
.dashboard-banner h1,
.dashboard-banner p { color: #fff; }

.dashboard-banner .eyebrow { margin-bottom: 10px; }

.dashboard-banner h1 {
  margin: 0 0 10px;
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 1px 12px rgba(4, 31, 60, 0.3);
}

.dashboard-banner p {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.6;
  max-width: 56ch;
}

.dashboard-banner__actions {
  justify-content: flex-end;
  margin-left: auto;
}

.dashboard-banner__actions .btn-outline-secondary {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
  color: #183047;
}

.dashboard-banner__actions .btn-outline-secondary:hover {
  background: #fff;
  color: var(--accent-strong);
}

.overview-metrics,
.collection-types,
.dashboard-lower { max-width: 1440px; }

.overview-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: clamp(20px, 2.4vw, 40px);
  margin-bottom: 42px;
}

.overview-metric {
  min-width: 0;
  padding: 8px 0;
  border: 0 !important;
}

.overview-metric strong {
  margin: 3px 0;
  color: var(--ink);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: normal;
}

.section-heading { margin: 34px 0 15px; }
.section-heading h2 { font-size: 28px; font-weight: 500; line-height: 1.6; }

.type-tile,
.form-section,
.collection-tip,
.collection-empty,
.inventory-surface,
.catalog-surface,
.inventory-controls-form,
.catalog-controls-form,
.card,
.glass-card,
.inventory-mobile-card,
.catalog-mobile-card,
.modal-content {
  border-radius: 8px !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

.type-tile { padding: 23px; }
.type-tile:hover { border-color: var(--accent); background: #fbfeff; }
.type-tile > i { color: var(--accent); }

.recent-entry {
  padding: 15px 0;
  border-color: var(--line);
}

.recent-entry:hover { color: var(--accent-strong); }

.collection-tip { background: var(--warm); }

.inventory-hero,
.catalog-hero {
  min-height: 156px;
  padding: 27px 31px !important;
  margin-bottom: 22px !important;
  overflow: hidden;
  background: #143348 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.inventory-hero__main,
.catalog-hero__main { max-width: 620px; }

.inventory-hero h1,
.catalog-hero h1 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: normal;
}

.inventory-hero p,
.catalog-hero p {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: normal;
}

.workspace-caption,
.sidebar-section-label,
.eyebrow,
.inventory-hero__eyebrow,
.catalog-hero__eyebrow { letter-spacing: normal; }

.inventory-advanced-filters {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.inventory-advanced-filters__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--warm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  list-style: none;
}

.inventory-advanced-filters__summary::-webkit-details-marker { display: none; }
.inventory-advanced-filters__summary:hover { background: rgba(24, 26, 31, 0.12); }

.inventory-advanced-filters__state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.inventory-advanced-filters__body { padding: 16px 4px 4px; }

@media (min-width: 640px) and (max-width: 991.98px) {
  .inventory-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
  .inventory-gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .inventory-gallery-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Abstract archive headers: each surface has its own purpose and visual rhythm. */
.workspace-hero {
  --hero-start: #102f46;
  --hero-mid: #087c9b;
  --hero-end: #8fdce9;
  --hero-tilt: -7deg;
  position: relative;
  isolation: isolate;
  display: flex !important;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  color: #fff !important;
  background:
    linear-gradient(90deg, rgba(8, 28, 43, 0.82) 0%, rgba(8, 28, 43, 0.38) 47%, rgba(8, 28, 43, 0.04) 78%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.52) 0 5%, transparent 5.4%),
    linear-gradient(135deg, var(--hero-start) 0%, var(--hero-mid) 58%, var(--hero-end) 100%) !important;
}

.workspace-hero::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block !important;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: linear-gradient(90deg, transparent 28%, #000 72%);
  mask-image: linear-gradient(90deg, transparent 28%, #000 72%);
}

.workspace-hero::after {
  position: absolute;
  top: 50%;
  right: 7%;
  z-index: 1;
  display: block !important;
  width: clamp(220px, 31vw, 450px);
  height: clamp(92px, 10vw, 136px);
  content: "";
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04));
  box-shadow:
    -28px 24px 0 rgba(255, 255, 255, 0.12),
    -56px 48px 0 rgba(255, 255, 255, 0.07);
  transform: translateY(-50%) rotate(var(--hero-tilt));
  animation: workspace-hero-drift 10s ease-in-out infinite;
}

.workspace-hero > * {
  position: relative;
  z-index: 2;
  animation: workspace-hero-reveal 420ms ease-out both;
}

.workspace-hero--inventory {
  --hero-start: #143348;
  --hero-mid: #176f89;
  --hero-end: #76cede;
  --hero-tilt: 6deg;
}

.workspace-hero--catalog {
  --hero-start: #182f50;
  --hero-mid: #3b658d;
  --hero-end: #9bd4df;
  --hero-tilt: -3deg;
}

.workspace-hero--catalog::after {
  width: clamp(190px, 27vw, 390px);
  height: clamp(112px, 12vw, 156px);
  border-radius: 8px;
  box-shadow:
    22px -18px 0 rgba(255, 255, 255, 0.1),
    44px -36px 0 rgba(255, 255, 255, 0.06);
}

.workspace-hero .eyebrow,
.workspace-hero .inventory-eyebrow,
.workspace-hero .catalog-eyebrow {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.workspace-hero .btn { transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.workspace-hero .btn:hover { transform: translateY(-2px); }
.inventory-hero__meta--actions { justify-content: flex-end; }

@keyframes workspace-hero-drift {
  0%, 100% { transform: translateY(-50%) rotate(var(--hero-tilt)); }
  50% { transform: translateY(calc(-50% - 7px)) rotate(var(--hero-tilt)); }
}

@keyframes workspace-hero-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .workspace-hero {
    align-items: flex-start;
    flex-direction: column;
    min-height: 240px;
  }

  .workspace-hero::before { opacity: 0.2; }
  .workspace-hero::after { right: -110px; opacity: 0.52; }
  .inventory-hero__meta--actions { width: 100%; }
}

.inventory-hero h1,
.catalog-hero h1,
.inventory-hero p,
.catalog-hero p { color: #fff !important; text-shadow: 0 1px 10px rgba(11, 45, 74, 0.38); }

/* Hero actions use the same three levels as the workspace without inheriting hero copy colour. */
.workspace-hero .inventory-hero-actions .btn {
  text-shadow: none !important;
}

.workspace-hero .inventory-title.fw-semibold,
.workspace-hero .catalog-title.fw-semibold {
  font-weight: 500 !important;
}

.workspace-hero .inventory-hero-actions .btn-primary {
  color: #fff !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

.workspace-hero .inventory-hero-actions .btn-outline-secondary {
  color: #16334a !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.94) !important;
}

.workspace-hero .inventory-hero-actions .btn-outline-primary {
  color: #fff !important;
  background: rgba(10, 42, 61, 0.52) !important;
  border-color: rgba(255, 255, 255, 0.48) !important;
}

.workspace-hero .inventory-hero-actions .btn-outline-secondary:hover,
.workspace-hero .inventory-hero-actions .btn-outline-secondary:focus {
  color: #102f46 !important;
  background: #fff !important;
  border-color: #fff !important;
}

.workspace-hero .inventory-hero-actions .btn-outline-primary:hover,
.workspace-hero .inventory-hero-actions .btn-outline-primary:focus {
  color: #fff !important;
  background: rgba(10, 42, 61, 0.76) !important;
  border-color: rgba(255, 255, 255, 0.78) !important;
}

.inventory-hero .inventory-pill,
.catalog-hero .catalog-pill {
  background: rgba(255, 255, 255, 0.88) !important;
  color: #16334a !important;
  border-color: transparent !important;
}

.inventory-hero .inventory-hero__note,
.catalog-hero .catalog-hero__note { color: #effbff !important; }

.inventory-controls,
.catalog-controls,
.inventory-controls-form,
.catalog-controls-form { background: transparent !important; }

.inventory-table-wrapper,
.catalog-table-wrapper { border-radius: 0; }

.inventory-table thead th,
.catalog-table thead th,
.table thead th { background: transparent !important; }

.inventory-table tbody tr:hover,
.catalog-table tbody tr:hover { background: var(--accent-light); }

.inventory-chip,
.inventory-qty-pill,
.inventory-pill,
.catalog-pill {
  border-radius: 999px !important;
  background: var(--accent-light);
  color: var(--accent-strong);
}

.auth-layout .workspace-main {
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

.auth-layout .workspace-main::before {
  position: absolute;
  inset: 0 0 auto;
  height: 30vh;
  content: "";
  background:
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, 0.44) 0 4%, transparent 4.4%),
    linear-gradient(115deg, #102f46 0%, #087c9b 58%, #8fdce9 100%);
  opacity: 0.93;
}

.auth-layout .auth-screen { position: relative; z-index: 1; }

.auth-screen h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
}

.auth-screen .text-center > p {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.auth-layout .glass-card {
  max-width: 450px;
  padding: 40px !important;
  background: rgba(255, 254, 250, 0.96) !important;
}

[data-bs-theme="dark"] .auth-layout .glass-card { background: rgba(25, 34, 54, 0.96) !important; }

@media (max-width: 991px) {
  .workspace-main {
    margin-left: 0;
    width: 100%;
    padding: 28px 22px 44px !important;
  }

  .workspace-footer { margin-left: 0; }

  .dashboard-banner {
    min-height: 230px;
    margin: -28px -22px 31px;
    padding: 30px 23px;
  }
}

/* Catalog detail modal: a focused, editorial layout for cover-led records. */
#catalogItemModal .modal-dialog {
  width: min(960px, calc(100% - 2rem));
  max-width: 960px;
}

#catalogItemModal .catalog-detail-modal {
  overflow: hidden;
  border-radius: 18px !important;
  background: var(--surface) !important;
  border-color: var(--line) !important;
  box-shadow: 0 24px 70px rgba(24, 35, 30, 0.18) !important;
}

#catalogItemModal .catalog-detail-modal-header {
  padding: 18px 24px !important;
  background: var(--surface) !important;
  border-bottom-color: var(--line) !important;
}

#catalogItemModal .catalog-detail-modal-header .modal-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

#catalogItemModal .catalog-detail-modal-body {
  padding: 0 !important;
  background: var(--surface) !important;
}

#catalogItemModal #catalogItemModalBody {
  padding: 28px 30px 32px;
  color: var(--ink);
  background: var(--surface) !important;
}

#catalogItemModal .item-detail-overview {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  padding-bottom: 28px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

#catalogItemModal .item-detail-overview-media,
#catalogItemModal .item-detail-overview-copy {
  min-width: 0;
}

#catalogItemModal .item-detail-overview .item-detail-photos {
  margin: 0;
}

#catalogItemModal .item-detail-overview .item-detail-photos h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

#catalogItemModal .item-detail-overview .item-detail-photos .row {
  display: block;
}

#catalogItemModal .item-detail-overview .item-detail-photos figure {
  width: 100%;
  margin: 0;
}

#catalogItemModal .item-detail-overview .item-detail-photos figure img {
  display: block;
  width: 100%;
  height: 330px;
  padding: 12px;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px !important;
}

#catalogItemModal .item-detail-overview .item-detail-photos figcaption {
  margin-top: 8px !important;
  color: var(--muted) !important;
  font-size: 11px;
}

#catalogItemModal .item-detail-cover-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 12px;
}

#catalogItemModal .item-detail-overview-title {
  margin: 2px 0 6px;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

#catalogItemModal .item-detail-overview-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

#catalogItemModal .item-detail-overview--game .item-detail-overview-media {
  position: sticky;
  top: 12px;
}

#catalogItemModal .item-detail-overview--game .item-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

#catalogItemModal .item-detail-game-facts .item-detail-facts,
#catalogItemModal .item-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

#catalogItemModal .item-detail-fact {
  min-width: 0;
  padding: 14px 15px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#catalogItemModal .item-detail-fact:nth-child(2n) { border-right: 0; }
#catalogItemModal .item-detail-fact:nth-last-child(-n + 2) { border-bottom: 0; }

#catalogItemModal .item-detail-fact-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
}

#catalogItemModal .item-detail-fact-value {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

#catalogItemModal .item-detail-section { margin-bottom: 26px; }

#catalogItemModal .item-detail-section-title {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

#catalogItemModal .item-detail-subsection-title {
  margin: 18px 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}

#catalogItemModal .item-detail-market {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

#catalogItemModal .item-detail-market > p { margin-bottom: 0; font-size: 12px; }

#catalogItemModal .item-detail-market-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

#catalogItemModal .item-detail-market-metric {
  display: flex;
  min-height: 88px;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

#catalogItemModal .item-detail-market-metric-currency {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
}

#catalogItemModal .item-detail-market-metric-value {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

#catalogItemModal .item-detail-market-metric-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

#catalogItemModal .item-detail-market-listing {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

#catalogItemModal .item-detail-copies { padding-top: 4px; }

#catalogItemModal .item-detail-copies .table-responsive {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

#catalogItemModal .item-detail-copies .table {
  min-width: 620px;
  margin: 0;
  font-size: 12px;
}

#catalogItemModal .catalog-detail-modal .modal-footer {
  gap: 10px;
  padding: 15px 24px !important;
  background: var(--surface) !important;
  border-top-color: var(--line) !important;
}

@media (max-width: 700px) {
  #catalogItemModal .modal-dialog {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
  }

  #catalogItemModal .catalog-detail-modal { border-radius: 14px !important; }
  #catalogItemModal .catalog-detail-modal-header { padding: 16px 18px !important; }
  #catalogItemModal #catalogItemModalBody { padding: 20px 18px 24px; }

  #catalogItemModal .item-detail-overview {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 22px;
    margin-bottom: 20px;
  }

  #catalogItemModal .item-detail-overview-media {
    max-width: 270px;
    margin: 0 auto;
  }

  #catalogItemModal .item-detail-overview--game .item-detail-overview-media {
    position: static;
  }

  #catalogItemModal .item-detail-overview .item-detail-photos figure img,
  #catalogItemModal .item-detail-cover-empty {
    height: 300px;
    min-height: 300px;
  }

  #catalogItemModal .item-detail-market { padding: 16px; }
  #catalogItemModal .catalog-detail-modal .modal-footer { padding: 13px 18px !important; }
  #catalogItemModal .catalog-detail-modal .modal-footer .btn { flex: 1 1 auto; }
}

/* Unified controls: one geometry and a restrained semantic color hierarchy. */
:root {
  --control-height: 42px;
  --control-height-sm: 38px;
  --control-radius: 8px;
  --control-danger: #b42338;
  --control-danger-soft: #fff1f2;
  --control-danger-line: #fecdd3;
}

[data-bs-theme="dark"] {
  --control-danger: #fda4af;
  --control-danger-soft: rgba(190, 24, 93, 0.14);
  --control-danger-line: rgba(251, 113, 133, 0.42);
}

.btn:not(.btn-close) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--control-height);
  padding: 0.62rem 0.95rem;
  border-radius: var(--control-radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  box-shadow: none !important;
}

.btn-sm:not(.btn-close),
.btn-group-sm > .btn {
  min-height: var(--control-height-sm);
  padding: 0.48rem 0.75rem;
  font-size: 13px;
}

.btn-lg:not(.btn-close) {
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  font-size: 15px;
}

.btn-link {
  min-height: auto !important;
  padding: 0.25rem 0 !important;
  color: var(--accent-strong);
}

.btn-primary,
.btn-success,
.btn-info,
.btn-warning {
  color: #fff;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus,
.btn-info:hover,
.btn-info:focus,
.btn-warning:hover,
.btn-warning:focus {
  color: #fff;
  background: var(--accent-strong) !important;
  border-color: var(--accent-strong) !important;
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning {
  color: var(--accent-strong);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-warning:hover,
.btn-outline-warning:focus {
  color: var(--accent-strong);
  background: var(--accent-light);
  border-color: var(--accent);
}

.btn-outline-secondary,
.btn-outline-light,
.btn-soft-light {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-soft-light:hover,
.btn-soft-light:focus {
  color: var(--ink);
  background: var(--warm);
  border-color: color-mix(in srgb, var(--ink) 24%, var(--line));
}

.btn-outline-primary.active,
.btn-outline-secondary.active,
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-secondary {
  color: #fff;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

.btn-danger {
  color: #fff;
  background: var(--control-danger) !important;
  border-color: var(--control-danger) !important;
}

.btn-outline-danger {
  color: var(--control-danger);
  background: var(--surface);
  border-color: var(--control-danger-line);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  color: var(--control-danger);
  background: var(--control-danger-soft);
  border-color: var(--control-danger);
}

.btn:disabled,
.btn.disabled { opacity: 0.48; }

.form-control,
.form-select,
.input-group-text {
  min-height: var(--control-height);
  border-color: var(--line) !important;
  border-radius: var(--control-radius);
  background-color: var(--surface) !important;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.form-control-sm,
.form-select-sm,
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
  min-height: var(--control-height);
  font-size: 14px;
}

.form-control-lg,
.form-select-lg { min-height: 48px; }

textarea.form-control,
select.form-select[multiple],
select.form-select[size] { height: auto; }

.form-control:focus,
.form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-light) !important;
}

.form-control::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }

.form-label,
.form-label.text-muted {
  color: var(--ink) !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.input-group-text {
  min-width: var(--control-height);
  justify-content: center;
  background: var(--warm) !important;
  color: var(--muted) !important;
}

.input-group > .input-group-text:first-child { border-radius: var(--control-radius) 0 0 var(--control-radius); }
.input-group > .btn:last-child { border-radius: 0 var(--control-radius) var(--control-radius) 0; }

.workspace-filter-form { gap: 14px !important; }
.workspace-filter-primary { --bs-gutter-y: 0.85rem; }

.workspace-filter-more {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.workspace-filter-more__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--control-height);
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: var(--warm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  list-style: none;
}

.workspace-filter-more__summary::-webkit-details-marker { display: none; }
.workspace-filter-more__summary:hover { border-color: var(--line); }
.workspace-filter-more__state { color: var(--muted); font-size: 12px; font-weight: 500; }
.workspace-filter-more__body { padding: 16px 4px 4px; }
.workspace-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.inventory-bulk-actions > .d-flex { flex-wrap: wrap; }
.catalog-action-button { flex: 0 1 auto; white-space: nowrap; }

.inventory-mobile-action-btn,
.catalog-mobile-action-btn {
  width: var(--control-height-sm);
  min-width: var(--control-height-sm);
  padding: 0 !important;
}

input[type="file"].form-control::file-selector-button {
  min-height: calc(var(--control-height) - 2px);
  margin: -0.55rem 0.75rem -0.55rem -0.75rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--warm);
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .workspace-filter-actions .btn { flex: 1 1 auto; }
  .catalog-action-button { white-space: normal; }
}

@media (max-width: 700px) {
  .dashboard-banner {
    align-items: flex-start;
    flex-direction: column;
    min-height: 290px;
  }

  .dashboard-banner__actions {
    width: 100%;
    margin: auto 0 0;
    justify-content: flex-start;
  }

  .dashboard-banner__actions .btn { flex: 1 1 auto; }

  .overview-metric { padding: 0; }

  .inventory-hero,
  .catalog-hero {
    margin-left: -17px !important;
    margin-right: -17px !important;
    padding: 24px 17px !important;
  }
}

/* Final modal overrides: these intentionally follow the legacy modal rules. */
#catalogItemModal .item-detail-overview--game {
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 34px;
  margin-bottom: 24px;
}

#catalogItemModal .item-detail-overview--game .item-detail-overview-media { position: static; }
#catalogItemModal .item-detail-overview--game .media-gallery__stage { max-height: 390px; }
#catalogItemModal .item-detail-overview--game .item-detail-section { margin: 26px 0 0; }
#catalogItemModal .item-detail-overview--game .item-detail-section-title { margin-bottom: 12px; }
#catalogItemModal .item-detail-overview--game .item-detail-facts { border-radius: 10px; }
#catalogItemModal .item-detail-overview--game .item-detail-fact { padding: 12px 13px; }
#catalogItemModal .item-detail-technical .item-detail-facts { margin-top: 4px; }

@media (max-width: 700px) {
  #catalogItemModal .item-detail-overview--game { grid-template-columns: 1fr; gap: 22px; }
  #catalogItemModal .item-detail-overview--game .item-detail-overview-media { width: min(100%, 280px); max-width: none; }
  #catalogItemModal .item-detail-overview--game .media-gallery__stage { height: auto; min-height: 0; aspect-ratio: 3 / 4; }
  #catalogItemModal .item-detail-overview--game .item-detail-facts { grid-template-columns: 1fr; }
  #catalogItemModal .item-detail-overview--game .item-detail-fact { border-right: 0; }
  #catalogItemModal .item-detail-overview--game .item-detail-fact:last-child { border-bottom: 0; }
}

/* Shared navigation, feedback, and dark-mode system states. */
:root,
[data-bs-theme="light"] {
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #1e2938;
  --muted: #64748b;
  --line: #dce3ec;
  --accent: #08afd8;
  --accent-strong: #087eaa;
  --accent-light: rgba(8, 175, 216, 0.12);
  --warm: #f3f6f9;
}

[data-bs-theme="dark"] {
  --paper: #101725;
  --surface: #172033;
  --ink: #edf4fb;
  --muted: #acb9ca;
  --line: #324159;
  --accent: #59d0ef;
  --accent-strong: #9aebfb;
  --accent-light: rgba(89, 208, 239, 0.15);
  --warm: rgba(255, 255, 255, 0.065);
}

.workspace-sidebar,
[data-bs-theme="dark"] .workspace-sidebar { background: var(--surface) !important; }

.workspace-brand .brand-mark { width: 38px; height: 38px; }
.workspace-caption { margin-left: 47px; }
.workspace-nav { gap: 3px; }

.workspace-nav a,
.sidebar-utility {
  border-radius: 8px;
  color: var(--muted);
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.workspace-nav a:hover,
.sidebar-utility:hover,
.workspace-sidebar .sidebar-utility.theme-toggle-btn:hover {
  background: var(--accent-light);
  color: var(--accent-strong);
}

.workspace-nav a.is-active {
  background: var(--accent-light);
  color: var(--accent-strong);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--accent);
}

.workspace-nav:not(.collection-shortcuts) a.is-parent-active {
  background: transparent;
  color: var(--accent-strong);
  font-weight: 600;
  box-shadow: none;
}

.collection-shortcuts { margin-left: 8px; }
.collection-shortcuts a { padding: 9px 11px; font-size: 14px; }
.sidebar-utility { width: 100%; padding: 9px 11px; font-size: 13px; }

.workspace-sidebar .sidebar-utility.theme-toggle-btn,
:root[data-bs-theme="dark"] .workspace-sidebar .sidebar-utility.theme-toggle-btn,
:root[data-bs-theme="dark"] .workspace-sidebar .sidebar-utility.theme-toggle-btn[aria-pressed="true"] {
  background: transparent;
  color: var(--muted);
}

.workspace-sidebar .sidebar-utility.theme-toggle-btn[aria-pressed="true"] {
  background: var(--accent-light);
  color: var(--accent-strong);
}

.btn-outline-secondary,
.btn-outline-light,
.btn-soft-light { border-color: var(--line); color: var(--ink); }

.btn-outline-secondary:hover,
.btn-outline-light:hover,
.btn-soft-light:hover { border-color: var(--line); background: var(--warm); color: var(--ink); }

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text { border-color: var(--line); background: var(--surface); }

.inventory-hero h1,
.catalog-hero h1,
.inventory-hero p,
.catalog-hero p { color: #fff !important; }

.inventory-hero a:not(.btn),
.catalog-hero a:not(.btn) { color: #d4f5fc; }

.flash-region,
.inventory-feedback {
  position: fixed;
  z-index: 1085;
  width: min(420px, calc(100vw - 48px));
  margin: 0;
  pointer-events: none;
}

.flash-region { top: 24px; right: 24px; }
.inventory-feedback { top: 96px; right: 24px; }

.flash-region .alert,
.inventory-feedback {
  margin: 0;
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
}

@media (max-width: 991.98px) {
  .flash-region,
  .inventory-feedback { top: 84px; right: 16px; width: calc(100vw - 32px); }
  .inventory-feedback { top: 156px; }
}

/* Collection forms keep type selection compact as supported types grow. */
.type-picker { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.collection-detail-product { min-height: 0; }
@media (max-width: 700px) {
  .type-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-choice { padding: 14px 10px; }
}
