:root {
  --bg: #05070c;
  --panel: #111522;
  --border-subtle: #252b3a;
  --accent: #f5b362;
  --accent-soft: rgba(245, 179, 98, 0.16);
  --text-main: #f5f7ff;
  --text-muted: #a2a9c5;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #151b2b, #05070c);
  color: var(--text-main);
  padding: 24px;
}

.app-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}

.app-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.app-title h1 {
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 14, 26, 0.9);
  color: var(--text-muted);
}

.tagline {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.layout-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-bottom: 16px;
}

.panel {
  background: radial-gradient(circle at top left, #181d30, #090b11);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.panel-summary {
  position: sticky;
  top: 18px;
  align-self: flex-start;
}

.identity-panel {
  margin-top: 10px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.panel-title.small {
  font-size: 0.95rem;
  margin-top: 4px;
}

.subhead {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 6px 0 4px;
}

.grid-2,
.grid-3,
.grid-5 {
  display: grid;
  gap: 10px;
}

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

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

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.field {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(7, 10, 20, 0.95);
  color: var(--text-main);
  padding: 7px 9px;
  font-size: 0.9rem;
  outline: none;
}

.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.field::placeholder {
  color: #616881;
}

textarea.field {
  resize: vertical;
  min-height: 60px;
}

.block-sep {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  margin: 12px 0;
}

.block-sep.small {
  margin: 8px 0;
}

.block-sep.tiny {
  margin: 4px 0 8px;
}

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

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(10, 14, 26, 0.9);
  border: 1px solid var(--border-subtle);
}

.checkbox-group label {
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: normal;
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-group input[type="checkbox"] {
  accent-color: var(--accent);
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(9, 11, 20, 0.9);
  color: var(--text-main);
  padding: 7px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, #f5b362, #f47a4a);
  color: #1a1205;
  font-weight: 600;
}

.btn:hover {
  filter: brightness(1.05);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-ghost.btn-xs {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-ghost.btn-xs:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-grid .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
}

.summary-grid .row.total {
  font-size: 1rem;
  font-weight: 600;
}

.summary-grid hr {
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin: 6px 0;
}

.summary-grid strong {
  font-variant-numeric: tabular-nums;
}

.micro-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.photo-thumb {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.photo-thumb img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.photo-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-preview img.slab-thumb {
  width: 100px;
  max-height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Reuse your existing button styling if you have it;
   otherwise this is a light, neutral style. */
.btn-secondary {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
  color: #f4f5f7;
  font-size: 13px;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
}

@media (max-width: 900px) {
  body { padding: 16px; }
  .layout-two-col { grid-template-columns: minmax(0, 1fr); }
  .panel-summary { position: static; }
}
.breakdown {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}

.breakdown-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.breakdown-row span:first-child {
  color: var(--text-muted);
}

.breakdown-row span:last-child {
  font-variant-numeric: tabular-nums;
}

.breakdown-formula {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
}
.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  opacity: 0.7;
}


/* --- Inventory panel --- */
.inventory-panel {
  margin-top: 2rem;
}

.inventory-panel .inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.inventory-panel .inventory-table-wrapper {
  overflow-x: auto;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.inventory-table th,
.inventory-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.inventory-table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

.inventory-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.inventory-empty td {
  text-align: center;
  font-style: italic;
  opacity: 0.7;
}

.inventory-actions-cell .btn.tiny {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
}

.inv-notes-hint {
  margin-left: 0.25rem;
  cursor: help;
}

/* subtle pill */
.panel-title .tag.subtle {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-left: 0.5rem;
  opacity: 0.85;
}

/* button variants used in inventory */
.btn.primary {
  background: #4ade80;
  color: #022c22;
}

.btn.subtle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
}

.btn.tiny {
  border-radius: 999px;
}


/* --- Ursa Slab Manager 0.4.3 — thumbnail photo preview tweaks (Dec 8) --- */
.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-preview .preview-slot {
  width: 110px;
  max-width: 33%;
}

.photo-preview img.preview-img,
.photo-preview img.slab-thumb {
  display: block;
  width: 100%;
  max-height: 110px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}


/* Website sync settings */
.sync-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.sync-status {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sync-status.ok {
  color: #4ade80;
}

.sync-status.err {
  color: #fecaca;
}

.sync-status.pending {
  color: var(--text-muted);
}


/* Toast */
.ut-toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(20,20,24,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}
.ut-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}
