:root {
  --page-bg: #f5f7fb;
  --page-bg-soft: #fbfcfe;
  --card-bg: #ffffff;
  --card-border: #d9e0ea;
  --text-main: #1d2a38;
  --text-soft: #607181;
  --accent: #18324d;
  --accent-strong: #0d2236;
  --accent-soft: #edf3f9;
  --success-bg: #e8f7ed;
  --success-text: #17603a;
  --error-bg: #fdeceb;
  --error-text: #922626;
  --warning-bg: #fff4db;
  --warning-text: #8a5a00;
  --paused-bg: #f4e7e7;
  --paused-text: #7f2f2f;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 24px 70px rgba(15, 34, 54, 0.08);
  --font-ui: "Trebuchet MS", "Aptos", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text-main);
  font-family: var(--font-ui);
}

body {
  min-height: 100vh;
}

.environment-banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1200;
  padding: 0.85rem 1rem;
  background: #8a1c1c;
  color: #fff7f4;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 14px 28px rgba(138, 28, 28, 0.22);
}

.environment-banner-spacer {
  height: 3.25rem;
}

a {
  color: inherit;
}

.public-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(circle at top, rgba(24, 50, 77, 0.06), transparent 36%),
    linear-gradient(180deg, #fdfefe 0%, #f4f6f9 100%);
}

.brand-logo {
  display: block;
  width: min(76vw, 460px);
  height: auto;
  object-fit: contain;
}

.auth-shell,
.client-screen,
.simple-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(circle at top, rgba(24, 50, 77, 0.08), transparent 32%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
}

.auth-card,
.simple-card,
.panel-card {
  width: min(100%, 520px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
}

.content-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 1.6rem;
}

.content-card-narrow {
  width: min(100%, 560px);
}

.content-card-soft {
  background: var(--page-bg-soft);
}

.auth-title,
.simple-title,
.panel-title {
  margin: 0 0 0.6rem;
  color: var(--accent-strong);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.auth-subtitle,
.simple-text,
.panel-text {
  margin: 0 0 1.6rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.auth-form,
.client-form,
.form-grid {
  display: grid;
  gap: 1rem;
}

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

.field-group {
  display: grid;
  gap: 0.45rem;
}

.field-group.full-width {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--accent);
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  border: 1px solid #c7d0da;
  border-radius: 14px;
  background: #fcfdff;
  color: var(--text-main);
  padding: 0.9rem 1rem;
  font: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

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

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: #587a9d;
  box-shadow: 0 0 0 4px rgba(88, 122, 157, 0.18);
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.flash {
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.button,
.button-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.button:hover,
.button-link:hover,
.ghost-link:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.button {
  border: 0;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
}

.button.full-width {
  width: 100%;
}

.button-light {
  background: #eef3f8;
  color: var(--accent);
  border: 1px solid #d3dde8;
}

.button.is-disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.button-danger {
  background: #8f3131;
  color: #ffffff;
}

.button-warning {
  background: #a06a06;
  color: #ffffff;
}

.button-plain {
  background: transparent;
  color: var(--accent);
  border: 1px solid #d3dde8;
}

.ghost-link {
  color: var(--accent);
}

.admin-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  background: linear-gradient(180deg, #fbfcfe 0%, #f2f5f9 100%);
}

.admin-sidebar {
  background: var(--accent-strong);
  color: #f6f9fc;
  padding: 2rem 1.5rem;
  display: grid;
  align-content: start;
  gap: 1.6rem;
}

.admin-brand-title {
  margin: 0;
  font-size: 1.8rem;
}

.admin-brand-text {
  margin: 0.35rem 0 0;
  color: rgba(246, 249, 252, 0.76);
  line-height: 1.5;
}

.admin-nav {
  display: grid;
  gap: 0.75rem;
}

.admin-nav-link {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  color: #f6f9fc;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}

.admin-nav-link.is-active,
.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.client-sidebar {
  gap: 1.25rem;
}

.client-brand-block {
  display: grid;
  gap: 0.35rem;
}

.client-brand-meta {
  margin: 0;
  color: rgba(246, 249, 252, 0.76);
  font-size: 0.95rem;
}

.client-brand-meta-strong {
  color: #f6f9fc;
  font-size: 1rem;
  font-weight: 700;
}

.client-nav {
  gap: 0.55rem;
}

.client-menu-group {
  display: grid;
  gap: 0.45rem;
}

.client-menu-toggle {
  width: 100%;
  border: 0;
  text-align: left;
  position: relative;
}

.client-menu-toggle::after {
  content: "v";
  position: absolute;
  right: 1rem;
  transition: transform 120ms ease;
}

.client-menu-group.is-open .client-menu-toggle::after {
  transform: rotate(180deg);
}

.client-submenu {
  display: none;
  gap: 0.45rem;
  padding-left: 0.75rem;
}

.client-menu-group.is-open .client-submenu {
  display: grid;
}

.client-submenu-link {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(246, 249, 252, 0.92);
  text-decoration: none;
  font-size: 0.92rem;
}

.client-submenu-link:hover,
.client-submenu-link.is-active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-content {
  padding: 2rem;
  display: grid;
  align-content: start;
  gap: 1.4rem;
}

.client-content {
  gap: 1.2rem;
}

.content-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.content-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--accent-strong);
}

.content-subtitle {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-soft);
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.stat-value {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.table-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

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

.empty-table-message {
  padding: 1.25rem 1.4rem;
  color: var(--text-soft);
}

.piece-summary-list {
  display: grid;
  gap: 1rem;
}

.piece-summary-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 1.15rem 1.3rem;
}

.piece-summary-primary {
  display: grid;
  grid-template-columns: minmax(170px, 1.15fr) minmax(260px, 2.7fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(130px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.piece-summary-item-with-date .piece-summary-primary {
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) minmax(240px, 2.3fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(120px, 0.9fr);
}

.piece-summary-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.95rem;
  margin-top: 0.95rem;
  border-top: 1px solid #e6ebf1;
}

.piece-summary-cell,
.piece-summary-photo {
  min-width: 0;
}

.piece-summary-label {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.piece-summary-value {
  display: block;
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.piece-summary-cell-name .piece-summary-value {
  font-weight: 700;
}

.piece-summary-photo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.piece-summary-photo .piece-summary-label {
  margin-bottom: 0;
}

.piece-summary-actions {
  justify-content: flex-end;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e6ebf1;
  vertical-align: top;
}

.data-table th {
  background: #f6f9fc;
  color: var(--accent);
  font-size: 0.92rem;
}

.status-badge,
.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-active,
.alert-active {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-paused {
  background: var(--paused-bg);
  color: var(--paused-text);
}

.alert-inactive {
  background: #eef2f6;
  color: var(--text-soft);
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.action-stack form {
  margin: 0;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  padding: 0.6rem 0.95rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  color: #ffffff;
  background: var(--accent);
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.mini-button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.mini-button.light {
  background: #eef3f8;
  color: var(--accent);
  border: 1px solid #d3dde8;
}

.mini-button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(24, 50, 77, 0.14);
}

.mini-button.muted {
  background: #d9e0ea;
  color: #7a8896;
  border: 1px solid #c9d2de;
  cursor: not-allowed;
  pointer-events: none;
}

.mini-button.warning {
  background: #a06a06;
}

.mini-button.danger {
  background: #8f3131;
}

.action-stack-photo {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.action-button-photo {
  min-width: 138px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #d3dde8;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--accent);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background-color 120ms ease, color 120ms ease;
}

.icon-button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.icon-button-danger {
  border-color: #e0c9c9;
  background: #faf2f2;
  color: #8f3131;
}

.icon-button-danger:hover {
  background: #f6e7e7;
}

.icon-trash {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.inline-note {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.pagination-panel {
  padding: 1rem 1.2rem;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.pagination-current {
  cursor: default;
  pointer-events: none;
}

.storage-summary-card {
  display: grid;
  gap: 1rem;
}

.storage-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.storage-summary-item {
  padding: 1rem 1.1rem;
  border: 1px solid #dfe7f0;
  border-radius: 18px;
  background: #f8fbfe;
}

.storage-summary-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.storage-summary-value {
  display: block;
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.storage-table {
  min-width: 920px;
}

.storage-share-cell {
  min-width: 190px;
}

.storage-meter {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.storage-meter-bar {
  position: relative;
  flex: 1 1 auto;
  height: 10px;
  border-radius: 999px;
  background: #e4ebf3;
  overflow: hidden;
}

.storage-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.storage-meter-text {
  min-width: 46px;
  text-align: right;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.split-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.split-header-compact {
  margin-bottom: 1rem;
}

.ordered-help-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
}

.ordered-help-list li + li {
  margin-top: 0.35rem;
}

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

@media (max-width: 720px) {
  .piece-summary-item {
    padding: 1rem;
  }

  .piece-summary-primary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
  }

  .piece-summary-value {
    white-space: normal;
  }

  .piece-summary-secondary {
    flex-direction: column;
    align-items: stretch;
  }

  .piece-summary-photo {
    justify-content: space-between;
  }

  .piece-summary-actions {
    justify-content: flex-start;
  }

  .pagination-row {
    align-items: stretch;
  }
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.inline-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.field-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
}

.field-input-row-catalog {
  align-items: start;
}

.button-inline {
  white-space: nowrap;
}

.catalog-mini-button {
  min-width: 3rem;
  padding-inline: 0.9rem;
}

.catalog-autocomplete {
  position: relative;
}

.catalog-suggestion-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 15;
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 1px solid #d5dfea;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 34, 54, 0.12);
}

.catalog-suggestion-item {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #f4f8fc;
  color: var(--text-main);
  text-align: left;
  padding: 0.75rem 0.85rem;
  font: inherit;
  cursor: pointer;
}

.catalog-suggestion-item:hover {
  background: #eaf2fa;
}

.catalog-suggestion-item-empty {
  color: var(--text-soft);
}

.catalog-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.catalog-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 32, 0.45);
}

.catalog-modal-dialog {
  position: relative;
  width: min(100% - 2rem, 760px);
  max-height: calc(100dvh - 3rem);
  margin: 1.5rem auto;
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 34, 54, 0.18);
  padding: 1.4rem;
}

.catalog-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.catalog-modal-title {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.35rem;
}

.catalog-modal-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.catalog-modal-close {
  border: 0;
  background: #eef3f8;
  color: var(--accent);
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.4rem;
  cursor: pointer;
}

.catalog-modal-status {
  margin: 1rem 0 0;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  line-height: 1.45;
}

.catalog-modal-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.catalog-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.catalog-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #dce5ef;
  border-radius: 18px;
  background: #f8fbfe;
  padding: 0.95rem 1rem;
}

.catalog-list-content {
  display: grid;
  gap: 0.2rem;
}

.catalog-list-name {
  color: var(--accent-strong);
}

.catalog-list-meta-button,
.catalog-list-meta,
.catalog-list-empty {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.catalog-list-meta-button {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.12rem;
}

.catalog-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.catalog-linked-pieces {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.7rem;
  margin-top: 0.4rem;
  border-top: 1px solid #dbe4ee;
  padding-top: 0.9rem;
}

.catalog-linked-piece {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid #e1e8f0;
  border-radius: 16px;
  background: #ffffff;
  padding: 0.8rem 0.9rem;
}

.catalog-linked-piece-info {
  display: grid;
  gap: 0.18rem;
}

.catalog-linked-piece-title {
  color: var(--accent-strong);
}

.catalog-linked-piece-meta,
.catalog-linked-empty {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.catalog-modal-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.piece-form-grid {
  gap: 1.15rem;
}

.form-section-title {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.panel-text-compact {
  margin-bottom: 0.8rem;
}

.checkbox-row {
  margin-top: -0.1rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: start;
  gap: 0.7rem;
  color: var(--text-main);
  line-height: 1.45;
}

.checkbox-label input {
  margin-top: 0.2rem;
}

.info-banner {
  border: 1px solid #d8e4f0;
  border-radius: 18px;
  background: #f5f9fd;
  color: var(--accent);
  padding: 0.95rem 1rem;
  line-height: 1.5;
}

.form-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.credential-grid {
  display: grid;
  gap: 1rem;
}

.credential-item {
  border: 1px solid #d9e0ea;
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: #f8fbfe;
}

.credential-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.credential-value {
  display: block;
  margin-top: 0.35rem;
  word-break: break-word;
  font-weight: 700;
  color: var(--accent-strong);
}

.client-screen.white-screen {
  background: #ffffff;
  position: relative;
}

.client-panel-stack {
  width: min(100%, 520px);
  display: grid;
  gap: 1.25rem;
}

.client-flash-list {
  margin: 0;
}

.client-logout {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid #d7dde5;
  background: #eef3f8;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.client-center-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--accent-strong);
  text-align: center;
}

.client-password-card {
  background: #f7fafd;
  border: 1px solid #dce5ef;
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: 0 18px 42px rgba(15, 34, 54, 0.08);
}

.client-password-header {
  margin-bottom: 1rem;
}

.client-home-grid {
  display: grid;
  gap: 1rem;
}

.client-home-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.hero-search-card {
  display: grid;
  gap: 1.1rem;
  padding: 1.45rem;
}

.hero-search-card-compact {
  padding-top: 1.35rem;
}

.hero-search-copy {
  max-width: 720px;
}

.hero-search-card .panel-title {
  font-size: 1.45rem;
  margin-bottom: 0.45rem;
}

.hero-search-card .panel-text {
  margin-bottom: 0;
}

.hero-search-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.client-password-title {
  margin: 0 0 0.45rem;
  color: var(--accent-strong);
  font-size: 1.4rem;
}

.client-password-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.search-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.search-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.search-form-row-stacked {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.search-primary-field {
  display: grid;
  gap: 0.45rem;
}

.search-type-field {
  display: grid;
  gap: 0.45rem;
}

.search-type-select {
  min-height: 52px;
  font-size: 0.98rem;
}

.partnumber-search-input {
  min-height: 62px;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.search-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-button-row .button {
  min-width: 132px;
}

.search-help,
.search-voice-status {
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.search-voice-status {
  color: var(--warning-text);
}

.piece-photo-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.camera-capture-card {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d8e4f0;
  border-radius: 20px;
  background: #f7fbfe;
}

.camera-preview-frame {
  position: relative;
  width: 100%;
  min-height: 280px;
  border-radius: 18px;
  overflow: hidden;
  background: #dfe8f2;
}

.camera-preview-video,
.camera-preview-image {
  display: block;
  width: 100%;
  min-height: 280px;
  max-height: 420px;
  object-fit: cover;
  background: #dfe8f2;
}

.camera-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.photo-preview-grid,
.photo-link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
}

.photo-preview-card,
.photo-link-card {
  display: grid;
  gap: 0.65rem;
  text-decoration: none;
  border: 1px solid #dde6ef;
  border-radius: 18px;
  background: #f8fbfe;
  overflow: hidden;
  padding: 0.75rem;
}

.photo-preview-card img,
.photo-link-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: #eef3f8;
}

.photo-preview-card span,
.photo-link-card span {
  color: var(--accent);
  font-size: 0.9rem;
  word-break: break-word;
}

.photo-link-card-external {
  align-content: center;
  min-height: 132px;
}

.existing-photo-list {
  display: grid;
  gap: 0.75rem;
}

.client-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 0.85rem;
}

.client-stat-card {
  background: #f8fbfe;
  border: 1px solid #dee6ee;
  border-radius: 20px;
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.25rem;
}

.client-stat-label {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.client-stat-value {
  color: var(--accent-strong);
  font-size: 1.3rem;
  line-height: 1.2;
}

.stat-value-compact {
  font-size: 1.3rem;
  line-height: 1.3;
}

.result-list {
  display: grid;
  gap: 1rem;
}

.result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 1.4rem;
}

.result-topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-code {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.3rem;
}

.result-subcode {
  margin: 0.3rem 0 0;
  color: var(--text-soft);
}

.result-date {
  color: var(--text-soft);
  font-size: 0.92rem;
  white-space: nowrap;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.result-field {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 18px;
  background: #f7fafd;
  border: 1px solid #dde6ef;
}

.delete-summary {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.result-label {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.result-value {
  color: var(--accent-strong);
  line-height: 1.5;
  word-break: break-word;
}

.piece-detail-stack {
  display: grid;
  gap: 0.9rem;
}

.piece-detail-field {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: #f7fafd;
  border: 1px solid #dde6ef;
}

.piece-detail-label {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.piece-detail-value {
  color: var(--accent-strong);
  line-height: 1.55;
  word-break: break-word;
}

.piece-detail-photos {
  gap: 0.85rem;
}

.piece-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 160px));
  gap: 0.9rem;
}

.piece-photo-thumb {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dde6ef;
  border-radius: 18px;
  background: #f8fbfe;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
}

.piece-photo-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: #eef3f8;
}

.piece-photo-thumb span {
  font-size: 0.88rem;
  font-weight: 700;
  word-break: break-word;
}

.piece-photo-thumb-drive {
  align-content: center;
  min-height: 160px;
}

.piece-photo-thumb-title {
  display: block;
}

.piece-photo-thumb-note {
  display: block;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.detail-actions form {
  margin: 0;
}

.photo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.photo-button.disabled {
  background: #d9e0ea;
  color: #7a8896;
  cursor: not-allowed;
  pointer-events: none;
}

.button-danger-soft {
  border-color: #e3cbcb;
  background: #faf1f1;
  color: #8f3131;
}

.photo-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 25, 40, 0.68);
}

.photo-viewer-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 980px);
  max-height: calc(100vh - 3rem);
  margin: 1.5rem auto;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 32px 80px rgba(10, 22, 36, 0.34);
  overflow: hidden;
}

.photo-viewer-content {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 1.2rem 1.35rem;
}

.photo-viewer-media {
  display: grid;
  place-items: center;
  min-height: 320px;
  max-height: calc(100vh - 14rem);
  border-radius: 22px;
  background: #f3f7fb;
  overflow: hidden;
}

.photo-viewer-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 15rem);
  object-fit: contain;
}

.photo-viewer-drive {
  display: grid;
  gap: 0.9rem;
  width: min(100%, 420px);
  text-align: center;
}

.photo-viewer-drive-title {
  color: var(--accent-strong);
  font-size: 1.1rem;
}

.photo-viewer-drive-text,
.photo-viewer-position {
  margin: 0;
  color: var(--text-soft);
}

.photo-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.photo-viewer-title {
  color: var(--accent-strong);
  font-size: 1rem;
}

.photo-viewer-close,
.photo-viewer-nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(10, 22, 36, 0.15);
}

.photo-viewer-close {
  top: 1rem;
  right: 1rem;
  font-size: 1.7rem;
  line-height: 1;
}

.photo-viewer-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  line-height: 1;
}

.photo-viewer-nav-prev {
  left: 1rem;
}

.photo-viewer-nav-next {
  right: 1rem;
}

.photo-viewer-nav:disabled,
.photo-viewer-close:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .piece-photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .photo-viewer-dialog {
    width: min(96vw, 980px);
    margin: 1rem auto;
    max-height: calc(100vh - 2rem);
  }

  .photo-viewer-content {
    padding: 4.25rem 0.95rem 1rem;
  }

  .photo-viewer-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .photo-viewer-nav-prev {
    left: 0.65rem;
  }

  .photo-viewer-nav-next {
    right: 0.65rem;
  }
}

.empty-state {
  display: grid;
  gap: 1rem;
}

.data-table-compact {
  min-width: 780px;
}

.field-select:disabled {
  cursor: not-allowed;
  background: #eef3f7;
  color: #758392;
}

.payment-modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(13, 34, 54, 0.52);
  z-index: 1000;
}

.payment-modal {
  width: min(100%, 420px);
  background: #ffffff;
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid #edd39e;
  box-shadow: 0 20px 70px rgba(13, 34, 54, 0.2);
}

.payment-modal-title {
  margin: 0 0 0.7rem;
  color: #8a5a00;
  font-size: 1.4rem;
}

.payment-modal-text {
  margin: 0 0 1.2rem;
  color: #5d4b1c;
  line-height: 1.55;
}

.payment-modal-actions {
  display: flex;
  justify-content: end;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    gap: 1rem;
  }

  .admin-content {
    padding: 1.5rem 1rem 2rem;
  }

  .client-home-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .form-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .content-header {
    flex-direction: column;
  }

  .search-card-header,
  .hero-search-header,
  .result-topbar,
  .form-action-row {
    flex-direction: column;
  }

  .search-form-row {
    grid-template-columns: 1fr;
  }

  .split-header {
    flex-direction: column;
    align-items: stretch;
  }

  .field-input-row,
  .piece-photo-inputs {
    grid-template-columns: 1fr;
  }

  .catalog-modal-tools,
  .catalog-list-row {
    grid-template-columns: 1fr;
  }

  .catalog-list-row {
    display: grid;
  }

  .catalog-list-actions {
    justify-content: flex-start;
  }

  .catalog-linked-piece {
    display: grid;
  }

  .client-stat-strip {
    grid-template-columns: 1fr;
  }

  .client-logout {
    top: 1rem;
    right: 1rem;
  }
}

.workflow-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.workflow-card-link {
  text-decoration: none;
}

.workflow-card {
  display: grid;
  gap: 0.35rem;
  min-height: 132px;
  padding: 1.05rem 1.1rem;
  border: 1px solid #dce5ef;
  border-radius: 22px;
  background: #f8fbfe;
  box-shadow: 0 18px 44px rgba(15, 34, 54, 0.06);
}

.workflow-card-label {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workflow-card-value {
  color: var(--accent-strong);
  font-size: 2rem;
  line-height: 1.1;
}

.workflow-card-note {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.panel-title-compact {
  margin-bottom: 0.35rem;
  font-size: 1.2rem;
}

.workflow-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.workflow-chip-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.workflow-chip-info {
  background: #e9f2fb;
  color: #22527f;
}

.workflow-chip-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.workflow-chip-danger {
  background: var(--error-bg);
  color: var(--error-text);
}

.workflow-chip-neutral {
  background: #eef3f8;
  color: var(--accent);
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.detail-summary-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
  border: 1px solid #dce5ef;
  border-radius: 20px;
  background: #f8fbfe;
}

.detail-summary-label {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-summary-value {
  color: var(--accent-strong);
  font-size: 1rem;
  line-height: 1.4;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.button-row form {
  margin: 0;
}

.release-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.release-detail-field {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
  border: 1px solid #dce5ef;
  border-radius: 18px;
  background: #f8fbfe;
}

.release-detail-field.full-width {
  grid-column: 1 / -1;
}

.release-detail-label {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.release-detail-value {
  color: var(--accent-strong);
  font-size: 1rem;
  line-height: 1.45;
  word-break: break-word;
}

.release-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.release-panel-title {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.release-event-list {
  display: grid;
  gap: 0.8rem;
}

.release-event-card {
  border: 1px solid #dce5ef;
  border-radius: 18px;
  background: #f8fbfe;
  padding: 1rem 1.05rem;
  display: grid;
  gap: 0.45rem;
}

.release-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.release-event-title {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.release-event-message {
  margin: 0;
  color: var(--text-main);
  line-height: 1.55;
}

.release-log-output {
  margin: 0;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: #0f172a;
  color: #e7eef8;
  border: 1px solid #17203a;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}

.table-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.table-filter-actions {
  align-items: end;
}

.table-toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.table-selection-cell {
  width: 48px;
  text-align: center;
}

.table-selection-cell input {
  width: 18px;
  height: 18px;
}

.piece-photo-form-grid {
  gap: 1.1rem;
}

.field-textarea-compact {
  min-height: 88px;
}

@media (max-width: 760px) {
  .table-toolbar,
  .table-toolbar-actions {
    flex-direction: column;
  }
}

.status-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.piece-summary-platforms {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ad-form,
.ad-platform-stack {
  display: grid;
  gap: 1.1rem;
}

.ad-photo-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.ad-photo-option {
  display: block;
  cursor: pointer;
}

.ad-photo-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ad-photo-option-body {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid #d7e0ef;
  border-radius: 20px;
  background: #f8fbff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ad-photo-option input:checked + .ad-photo-option-body {
  border-color: #163a63;
  box-shadow: 0 10px 24px rgba(22, 58, 99, 0.14);
  transform: translateY(-2px);
}

.ad-photo-option-body img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 16px;
  background: #eaf1fb;
}

.ad-photo-option.is-readonly {
  cursor: default;
}

.ad-photo-option.is-readonly .ad-photo-option-body {
  box-shadow: none;
  transform: none;
}

.ad-photo-drive-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border-radius: 16px;
  background: #eef3fb;
  color: #163a63;
  font-weight: 700;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #eef3fb;
  color: #163a63;
  font-weight: 700;
}

.toggle-chip input {
  width: 16px;
  height: 16px;
}

.ad-platform-card.is-disabled {
  opacity: 0.72;
}

.ad-platform-summary-grid,
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.ad-platform-summary-card,
.integration-card,
.ad-log-item {
  padding: 1rem;
  border: 1px solid #d7e0ef;
  border-radius: 22px;
  background: #f8fbff;
}

.ad-log-list {
  display: grid;
  gap: 0.85rem;
}

.ad-log-item strong,
.ad-log-item span {
  display: block;
}

.ad-log-item p {
  margin: 0.45rem 0 0;
}

.ad-manual-card {
  display: grid;
  gap: 1rem;
}

.ad-manual-copy-grid {
  display: grid;
  gap: 1rem;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #163a63;
  font-weight: 700;
  text-decoration: underline;
}

.ad-ai-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.ad-ai-feedback {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 600;
}

.ad-ai-feedback.is-success {
  background: #eefaf2;
  color: #1f6b37;
  border: 1px solid #b7e2c3;
}

.ad-ai-feedback.is-error {
  background: #fff1f1;
  color: #8f2e2e;
  border: 1px solid #efc6c6;
}

.ad-ai-feedback.is-loading {
  background: #eef3fb;
  color: #163a63;
  border: 1px solid #c7d7ef;
}
