* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(59, 130, 246, 0.14), transparent 52%),
    linear-gradient(180deg, #f1f5ff 0%, #f8fafc 40%, #eef2ff 100%);
  color: #0f172a;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.hero p {
  margin: 0 0 16px;
  color: #475569;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero--branded {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.hero-brand-row {
  align-items: center;
}

.hero-brand-row .hero-brand-text {
  flex: 1;
  min-width: 0;
}

.hero-brand-row .hero-brand-text h1 {
  margin: 0 0 8px;
}

.hero-brand-row .hero-brand-text p {
  margin: 0;
}

.portal-logo {
  height: 52px;
  width: auto;
  max-width: min(220px, 42vw);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.portal-logo--sm {
  height: 40px;
  max-width: min(180px, 36vw);
}

.hero-brand-stack {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-brand-stack .hero-brand-text {
  flex: 1;
  min-width: 0;
}

.hero-brand-stack .hero-brand-text h1 {
  margin: 0 0 8px;
}

.hero-brand-stack .hero-brand-text p {
  margin: 0;
}

.home-icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #1e293b;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.home-icon-btn:hover {
  background: rgba(239, 246, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

.home-icon-btn:active {
  transform: translateY(0);
}

.home-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.subcard {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}

.portal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.inline-form,
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.filter-help {
  margin: 6px 0 10px;
  color: #475569;
  font-size: 0.92rem;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field select,
.filter-field input {
  min-height: 44px;
}

.filter-action {
  align-content: end;
}

.always-sort-row {
  display: grid;
  grid-template-columns: minmax(220px, 360px);
  margin: 4px 0 10px;
  gap: 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

input,
textarea,
select,
button {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

select,
option {
  color: #0f172a;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
  font-family: inherit;
}

button {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-color: #2563eb;
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  border-color: #475569;
}

.btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-color: #dc2626;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

button:active {
  transform: translateY(0);
}

.list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-head h3 {
  margin: 0;
}

.work-panel,
.inventory-panel {
  margin-top: 12px;
}

.work-panel {
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.product-form {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submit-wide {
  width: 100%;
}

.item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #fff;
}

.item-main {
  flex: 1;
  min-width: 0;
}

.item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.item-code {
  font-size: 0.98rem;
  word-break: break-all;
}

.item-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.item-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.item-status.status-available {
  background: #dcfce7;
  color: #166534;
}

.item-status.status-delivering {
  background: #dbeafe;
  color: #1d4ed8;
}

.item-status.status-repair {
  background: #ede9fe;
  color: #5b21b6;
}

.item-status.status-lost {
  background: #fef3c7;
  color: #92400e;
}

.item-status.status-disposed {
  background: #fee2e2;
  color: #991b1b;
}

.item-status.status-default {
  background: #e2e8f0;
  color: #334155;
}

.item-status.status-redeliver {
  background: #fee2e2;
  color: #991b1b;
}

.item-status.status-archived {
  background: #e5e7eb;
  color: #374151;
}

.item-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.item-line:last-child {
  border-bottom: none;
}

.item-line span {
  color: #64748b;
  font-size: 0.8rem;
  white-space: nowrap;
}

.item-line strong {
  font-size: 0.88rem;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
  text-align: right;
}

.item-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 106px;
}

.item-actions a {
  text-decoration: none;
}

.action-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #2563eb;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
}

.action-link-btn.btn-secondary-link {
  border-color: #475569;
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
}

.item-line-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-bottom: none;
}

.item-line-2col > div {
  display: grid;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #f8fafc;
}

.item-line-2col strong {
  text-align: left;
}

@media (max-width: 720px) {
  .container {
    padding: 14px;
  }

  .hero h1 {
    font-size: 1.95rem;
    line-height: 1.18;
    margin-bottom: 6px;
    word-break: keep-all;
  }

  .hero p {
    font-size: 0.98rem;
    line-height: 1.4;
    margin-bottom: 12px;
    word-break: keep-all;
  }

  .hero-top {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 10px;
  }

  .hero-brand-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
  }

  .hero-brand-row .portal-logo {
    grid-column: 1;
    height: 44px;
    max-width: min(160px, 34vw);
  }

  .hero-brand-row .hero-brand-text {
    grid-column: 2;
  }

  .hero-brand-row .home-icon-btn {
    grid-column: 3;
    align-self: start;
  }

  .hero--branded {
    padding: 14px;
  }

  .hero-brand-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero-brand-stack .portal-logo {
    height: 44px;
  }

  .home-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

  .portal-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .portal-top h2 {
    margin: 0;
    font-size: 1.85rem;
    line-height: 1.22;
    word-break: keep-all;
    letter-spacing: -0.02em;
  }

  .portal-top .row {
    width: 100%;
    justify-content: flex-start;
  }

  .portal-top .row button {
    min-width: 74px;
  }

  .always-sort-row {
    grid-template-columns: 1fr;
  }

  .mobile-select-native {
    display: none;
  }

  .mobile-select-trigger {
    min-height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    padding: 10px 12px;
  }

  select {
    min-height: 46px;
    font-size: 16px;
    line-height: 1.4;
  }

  option {
    font-size: 16px;
    line-height: 1.45;
    min-height: 36px;
  }

  .item {
    flex-direction: column;
  }

  .item-actions {
    width: 100%;
    justify-content: space-between;
  }

  .item-actions img {
    width: 74px;
    height: 74px;
  }
}

.movement {
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.movement:last-child {
  border-bottom: none;
}

.movement--voided {
  opacity: 0.88;
}

.movement-void-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9a3412;
  background: #ffedd5;
  border-radius: 6px;
  vertical-align: middle;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.kv span {
  color: #64748b;
}

.kv:last-child {
  border-bottom: none;
}

.kv-list {
  margin-top: 6px;
}

.hidden {
  display: none;
}

.panel-collapsible {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: max-height 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease, transform 0.32s ease;
}

.panel-collapsible.is-open {
  max-height: 1400px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.muted {
  color: #64748b;
  font-size: 0.9rem;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  color: #334155;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.inline-check input {
  width: 16px;
  height: 16px;
}

.entry-staff-login {
  display: flex;
  justify-content: center;
  align-items: center;
}

#staff-entry-btn {
  text-decoration: none;
  min-width: 150px;
}

#staff-entry-btn:hover,
#staff-entry-btn:focus,
#staff-entry-btn:active,
#staff-entry-btn:visited {
  text-decoration: none;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
}

.action-buttons button {
  min-width: 108px;
}

.section-head {
  justify-content: space-between;
}

.section-head h3 {
  margin: 0;
}

.mt-8 {
  margin-top: 8px;
}

.small-hint {
  font-size: 0.82rem;
  margin: 6px 0 0;
  line-height: 1.4;
}

.catalog-admin-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

@media (min-width: 900px) {
  .catalog-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.error-message {
  margin-top: 10px;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
}

.panel-block {
  margin-top: 12px;
}

#settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 80;
}

.floating-settings-card {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  z-index: 81;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.staff-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.staff-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

dialog {
  border: 0;
  border-radius: 12px;
  padding: 16px;
  width: min(520px, 92vw);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.25);
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialog-form .row {
  margin-top: 8px;
}

.mobile-select-options {
  display: grid;
  gap: 8px;
  max-height: min(56vh, 420px);
  overflow: auto;
}

.mobile-select-option {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
}

.mobile-select-option.is-active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
}

.field-label {
  font-size: 0.9rem;
  color: #334155;
  font-weight: 600;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}
