﻿:root {
  --claret: #3a080a;
  --pink: #9f183a;
  --orange: #e7381c;
  --red: #c31b22;
  --silver: #9facbe;
  --silver-light: #d6dbe3;
  --white: #fcfcfd;
  --ink: #241a1f;
  --muted: #6a7380;
  --radius-xl: 26px;
  --radius-lg: 18px;
  --shadow: 0 16px 44px rgba(58, 8, 10, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 7% 11%, rgba(159, 24, 58, 0.08), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(231, 56, 28, 0.14), transparent 26%),
    linear-gradient(165deg, #f1f4f8 0%, #eef2f7 42%, #fafbfc 100%);
}

.bg-shape {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(42px);
  pointer-events: none;
  z-index: 0;
}

.bg-shape-top {
  top: -140px;
  right: -100px;
  background: rgba(159, 24, 58, 0.26);
}

.bg-shape-bottom {
  bottom: -180px;
  left: -100px;
  background: rgba(156, 172, 190, 0.26);
}

.layout {
  width: min(1180px, calc(100% - 2.2rem));
  margin: 1.8rem auto;
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.auth-layout {
  grid-template-columns: 1fr 1.1fr;
  align-items: stretch;
}

.brand-panel,
.card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.brand-panel {
  background: linear-gradient(165deg, var(--claret) 0%, var(--pink) 68%, var(--red) 100%);
  color: var(--white);
  padding: 2rem;
}

.card {
  background: rgba(252, 252, 253, 0.94);
  border: 1px solid rgba(159, 172, 190, 0.35);
  padding: 1.2rem;
  backdrop-filter: blur(6px);
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  line-height: 1.1;
}

h1 {
  margin-top: 0.75rem;
  font-size: clamp(1.75rem, 2.6vw, 2.6rem);
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.76rem;
  opacity: 0.88;
}

.lead {
  margin-top: 1rem;
  line-height: 1.55;
  max-width: 48ch;
}

.palette-row {
  margin-top: 1.4rem;
  display: flex;
  gap: 0.5rem;
}

.palette-row span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.form-shell {
  display: grid;
  gap: 1rem;
}

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.mode-switch {
  display: flex;
  border-radius: 999px;
  padding: 0.2rem;
  background: #eff2f5;
  gap: 0.2rem;
}

.mode-switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  color: #445467;
}

.mode-switch button.active {
  background: linear-gradient(120deg, var(--pink), var(--orange));
  color: #fff;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.93rem;
}

input,
textarea,
button,
a {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid #ced5df;
  border-radius: 14px;
  padding: 0.72rem 0.88rem;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(159, 24, 58, 0.12);
}

button,
.btn {
  border: 0;
  border-radius: 14px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-primary {
  background: linear-gradient(120deg, var(--pink), var(--orange));
  color: #fff;
}

.btn-ghost {
  background: #fff;
  color: var(--claret);
  border: 1px solid #d5dbe3;
}

.btn-soft {
  background: #eef2f6;
  color: #33485f;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.notice {
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
  font-size: 0.92rem;
}

.notice-info {
  border: 1px solid #c4d4e7;
  background: #ebf3fe;
  color: #274567;
}

.notice-ok {
  border: 1px solid #b9e0cc;
  background: #ebfaef;
  color: #22523b;
}

.notice-error {
  border: 1px solid #efc4cc;
  background: #fff0f3;
  color: #7a1f34;
}

.hidden {
  display: none !important;
}

.app-layout,
.media-layout {
  grid-template-columns: 1fr;
}

.topbar,
.toolbar,
.order-head,
.actions-inline,
.media-header,
.upload-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.toolbar input {
  max-width: 500px;
}

.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.toolbar-toggle.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--pink), var(--orange));
}

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

.order-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.8rem;
  align-content: start;
  max-height: 620px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.order-card:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 24, 58, 0.32);
}

.order-card:focus-visible {
  outline: none;
  border-color: rgba(159, 24, 58, 0.52);
  box-shadow:
    var(--shadow),
    0 0 0 4px rgba(159, 24, 58, 0.12);
}

.badge {
  border-radius: 999px;
  padding: 0.33rem 0.62rem;
  font-size: 0.78rem;
  background: #e9eef4;
  color: #4f5e71;
}

.badge-live {
  background: linear-gradient(120deg, var(--red), var(--orange));
  color: #fff;
}

.badge-status {
  color: #1f5633;
  border: 1px solid #9ad6ac;
  background: linear-gradient(120deg, #def8e5, #b9ebc8);
}

.badge-photo-report {
  color: #fff;
  background: linear-gradient(120deg, var(--pink), var(--red));
}

.badge-hidden-media {
  color: #fff;
  background: linear-gradient(120deg, #48525f, #2f3641);
}

.badge-disabled {
  color: #6e2431;
  border: 1px solid #efc0cb;
  background: linear-gradient(120deg, #f9dde3, #f3c2cc);
}

.badge-stack {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.line-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.order-card .line-items {
  min-height: 0;
  max-height: 390px;
  overflow-y: auto;
  align-content: start;
  padding-right: 0.2rem;
}

.public-line-items {
  max-height: 460px;
  overflow-y: auto;
  align-content: start;
  padding-right: 0.2rem;
}

.line-items li {
  border-radius: 12px;
  background: #f6f8fa;
  padding: 0.62rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
}

.line-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.line-item-side {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
}

.production-badge {
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  color: #fff;
  white-space: nowrap;
  background: linear-gradient(120deg, var(--red), var(--orange));
}

.line-item-qty {
  min-width: 1.5rem;
  text-align: right;
}

.admin-panel {
  display: grid;
  gap: 1rem;
}

.admin-tabs {
  width: fit-content;
}

.admin-section {
  display: grid;
  gap: 1rem;
}

.users-list {
  display: grid;
  gap: 0.9rem;
}

.user-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(159, 172, 190, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 250, 0.96));
}

.user-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.staff-picker {
  display: grid;
  gap: 0.35rem;
  min-width: 220px;
}

.order-assignee {
  min-height: 1.4rem;
}

.admin-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.check-row input {
  width: auto;
  margin: 0;
}

.pagination-wrap {
  display: flex;
  justify-content: center;
}

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

.page-btn {
  min-width: 38px;
  border: 1px solid #d3dbe5;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  background: #fff;
  color: #2f4357;
  cursor: pointer;
}

.page-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--pink), var(--orange));
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-gap {
  padding: 0 0.25rem;
  color: #6c7682;
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  min-width: 0;
}

.links-row a {
  color: var(--pink);
  text-decoration: none;
  font-weight: 600;
}

.gallery-grid {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
  min-width: 0;
  max-width: 100%;
  overscroll-behavior-x: contain;
}

.media-item {
  margin: 0;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid #d3dae3;
  background: #fff;
  flex: 0 0 min(320px, 86vw);
  scroll-snap-align: start;
  min-width: 0;
  max-width: min(320px, 86vw);
}

.media-item img,
.media-item video {
  width: 100%;
  height: 170px;
  display: block;
  background: #dbe2ea;
}

.media-item img {
  object-fit: cover;
}

.media-item video {
  object-fit: cover;
}

.media-preview-btn {
  all: unset;
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.media-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem;
  font-size: 0.82rem;
  min-width: 0;
  max-width: 100%;
}

.media-caption span {
  flex: 1 1 100%;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
}

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

.feed-item {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(176, 188, 201, 0.4);
}

.feed-item-head,
.feed-item-body,
.feed-copy {
  display: flex;
  gap: 0.9rem;
}

.feed-item-head {
  justify-content: space-between;
  align-items: flex-start;
}

.feed-item-body {
  align-items: center;
}

.feed-copy {
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}

.feed-thumb {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
  background: #dde5ec;
  flex: 0 0 auto;
}

.media-link-btn {
  border: 1px solid #d2dae4;
  background: #f4f8fc;
  color: #27405a;
  border-radius: 999px;
  padding: 0.26rem 0.58rem;
  font-size: 0.74rem;
}

.media-original-link {
  border: 1px solid #d2dae4;
  background: #fff;
  color: #27405a;
  border-radius: 999px;
  padding: 0.26rem 0.58rem;
  font-size: 0.74rem;
  text-decoration: none;
}

.media-file-link {
  display: grid;
  place-items: center;
  width: 100%;
  height: 170px;
  color: #27405a;
  background: #eef4fa;
  text-decoration: none;
}

.messages {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.message {
  border-radius: 14px;
  border: 1px solid #d7dee7;
  background: #fff;
  padding: 0.75rem;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.message p {
  margin-top: 0.5rem;
  line-height: 1.42;
}

.chat-message {
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.chat-message.message-focus {
  transform: scale(1.018);
  box-shadow: 0 10px 28px rgba(20, 31, 44, 0.16);
}

.message-author {
  display: flex;
  align-items: center;
  gap: 0.58rem;
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #cfd8e3;
  background: #f3f7fb;
  flex: 0 0 38px;
}

.message-avatar-image,
.message-avatar-placeholder {
  width: 100%;
  height: 100%;
}

.message-avatar-image {
  display: block;
  object-fit: cover;
}

.message-avatar-placeholder {
  display: grid;
  place-items: center;
  color: #374f69;
  font-size: 0.74rem;
  font-weight: 700;
}

.message-meta {
  display: grid;
  gap: 0.18rem;
}

.reactions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.reaction {
  border: 1px solid #d7dee7;
  background: #f5f8fb;
  border-radius: 999px;
  padding: 0.3rem 0.58rem;
  font-size: 0.8rem;
}

.reaction.active {
  border-color: #9f183a;
  background: #ffe5ed;
  color: #7b1230;
}

.message-attachments {
  margin-top: 0.52rem;
  display: grid;
  gap: 0.42rem;
}

.message-attachment {
  color: #27405a;
  text-decoration: none;
  border: 1px solid #d4dce7;
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  background: #f8fbff;
}

.chat-compose-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.clip-btn {
  min-width: 42px;
  padding: 0.6rem 0.7rem;
}

.reaction-popover {
  position: fixed;
  z-index: 52;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid #d2dbe6;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px rgba(24, 36, 51, 0.18);
  padding: 0.34rem;
}

.reaction-choice {
  border-radius: 999px;
  min-width: 38px;
  min-height: 38px;
  font-size: 1.15rem;
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
}

.reaction-choice:hover {
  border-color: #d3dce6;
  background: #f3f8fe;
}

.empty-block {
  border-radius: 14px;
  padding: 0.9rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #c7d0db;
  background: #f7f9fc;
}

.loading {
  color: var(--muted);
  font-size: 0.95rem;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(14, 18, 24, 0.9);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
}

.lightbox-stage {
  margin: 0;
  width: 100%;
  max-width: min(1240px, 100%);
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
}

.lightbox-image-shell {
  position: relative;
  width: min(100%, 1240px);
  height: min(82vh, calc(100dvh - 9rem));
  min-height: 240px;
  max-height: 82vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.lightbox-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 220ms ease;
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.lightbox-slide-next {
  pointer-events: none;
}

.lightbox-image,
.lightbox-image-next {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: #111823;
}

.lightbox-slide.dragging {
  transition: none;
}

.lightbox-stage,
.lightbox-image-shell {
  touch-action: pan-y;
}

.lightbox-caption {
  color: #f3f7fb;
  text-align: center;
  font-size: 0.92rem;
}

.lightbox-nav,
.lightbox-close {
  border: 1px solid rgba(214, 224, 236, 0.35);
  border-radius: 999px;
  background: rgba(18, 25, 34, 0.72);
  color: #f0f4fa;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav {
  font-size: 1.6rem;
  line-height: 1;
}

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

.single-photo-card {
  display: grid;
  gap: 1rem;
}

.single-photo-meta {
  display: grid;
  gap: 0.35rem;
}

.single-photo-shell {
  min-height: min(82vh, calc(100dvh - 10rem));
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(17, 24, 35, 0.92);
}

.single-photo-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(82vh, calc(100dvh - 10rem));
  object-fit: contain;
}

.profile-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
}

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

.pwa-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(159, 172, 190, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 250, 0.96));
}

.avatar-panel {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.avatar-preview-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid #d5dde6;
  overflow: hidden;
  background: #f4f7fa;
}

.avatar-preview,
.avatar-placeholder {
  width: 100%;
  height: 100%;
}

.avatar-preview {
  display: block;
  object-fit: cover;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  color: #6d7783;
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .layout {
    width: min(1180px, calc(100% - 1.25rem));
  }

  .auth-layout,
  .orders-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

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

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

  .form-meta,
  .topbar,
  .toolbar,
  .order-head,
  .actions-inline,
  .media-header,
  .upload-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar input {
    max-width: 100%;
  }

  .feed-item-head,
  .feed-item-body {
    flex-direction: column;
  }

  .pagination-wrap {
    justify-content: flex-start;
  }

  .order-card {
    max-height: none;
  }

  .admin-field-grid {
    grid-template-columns: 1fr;
  }

  .order-card .line-items,
  .public-line-items {
    max-height: none;
    overflow: visible;
  }

  .media-lightbox {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.7rem;
  }

  .lightbox-stage img {
    max-height: 76vh;
  }

  .lightbox-nav {
    position: fixed;
    bottom: 1rem;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }

  .chat-compose-row {
    align-items: stretch;
  }

  .gallery-grid {
    overflow-x: auto;
  }

  .media-item {
    flex-basis: min(286px, 84vw);
  }

  .chat-message,
  .chat-message * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}

@media (max-width: 640px) {
  .layout {
    margin: 1rem auto;
    width: calc(100% - 1rem);
    max-width: calc(100vw - 1rem);
  }

  .brand-panel,
  .card {
    border-radius: var(--radius-lg);
  }

  .brand-panel,
  .card {
    padding: 1rem;
  }

  .btn,
  button {
    width: 100%;
  }

  .badge-stack {
    justify-content: flex-start;
  }

  .media-lightbox button {
    width: auto;
  }

  .chat-compose-row .btn {
    width: auto;
  }

  .reactions {
    align-items: center;
  }

  .reactions .reaction,
  .reactions button.reaction,
  .reaction-remove-btn,
  .add-reaction-btn {
    width: auto;
    min-width: 0;
    max-width: max-content;
    flex: 0 0 auto;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
  }

  .media-layout,
  .gallery-card,
  .gallery-grid,
  .media-item,
  .media-caption {
    max-width: 100%;
  }
}
