.app-page {
  background: #f3f7fb;
}

[hidden] {
  display: none !important;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.app-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-header nav a,
.small-action,
.stack-form button,
.form-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand-2);
  border: 0;
  border-radius: 7px;
  font-weight: 800;
  cursor: pointer;
}

.secondary-action {
  color: var(--brand);
  background: #eef4f7;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 60px;
}

.auth-shell {
  width: min(480px, calc(100% - 32px));
  margin: 50px auto;
}

.auth-shell.wide {
  width: min(720px, calc(100% - 32px));
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-logo img {
  width: 210px;
}

.app-title {
  margin-bottom: 22px;
}

.app-title h1,
.auth-shell h1 {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.app-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(19, 32, 43, 0.08);
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.45fr) minmax(140px, 0.35fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(19, 32, 43, 0.07);
}

.filter-panel label {
  display: grid;
  gap: 6px;
  color: #304455;
  font-weight: 780;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.filter-panel button,
.filter-panel a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 7px;
  font-weight: 800;
}

.filter-panel button {
  color: #fff;
  background: var(--brand);
  border: 0;
}

.filter-panel a {
  color: var(--brand);
  background: #eef4f7;
}

.admin-search-panel {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 0.35fr) minmax(140px, 0.3fr) auto auto;
}

.admin-client-search {
  grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(130px, 0.32fr)) auto auto;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deposit-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.client-form-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}

.client-form-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--brand);
  background: #eef4f7;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 850;
  text-align: center;
}

.client-form-tabs a.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.client-publish-form h3 {
  margin: 4px 0 2px;
  color: var(--brand);
  font-size: 1.2rem;
}

.client-publish-form[hidden] {
  display: none !important;
}

.stats-grid,
.two-column {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}

.two-column {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.stats-grid .app-card span {
  display: block;
  color: var(--muted);
  font-weight: 750;
}

.stats-grid .app-card strong {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-size: 1.7rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.plan-card {
  display: grid;
  gap: 18px;
  align-content: start;
}

.plan-card.is-current {
  border-color: var(--brand-2);
  box-shadow: 0 16px 34px rgba(33, 122, 204, 0.14);
}

.plan-card h2 {
  margin: 0 0 6px;
  color: var(--brand);
}

.plan-price {
  margin: 0;
  color: var(--ink);
  font-weight: 850;
}

.plan-quotas {
  display: grid;
  gap: 10px;
  margin: 0;
}

.plan-quotas div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.plan-quotas dt {
  color: var(--muted);
  font-weight: 750;
}

.plan-quotas dd {
  margin: 0;
  color: var(--brand);
  font-weight: 900;
}

.subscription-empty {
  margin-top: 18px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.plan-choice-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.plan-choice-group legend {
  margin-bottom: 8px;
  color: #304455;
  font-weight: 780;
}

.register-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-choice {
  display: block;
  cursor: pointer;
}

.plan-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-choice-card {
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.plan-choice-card:hover,
.plan-choice input:focus-visible + .plan-choice-card {
  border-color: var(--brand-2);
  box-shadow: 0 12px 28px rgba(33, 122, 204, 0.12);
}

.plan-choice input:checked + .plan-choice-card {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px var(--brand), 0 14px 28px rgba(33, 122, 204, 0.14);
}

.plan-choice-name {
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 900;
}

.plan-choice-price {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

.plan-choice-quota {
  color: var(--muted);
  font-weight: 750;
}

.stack-form label,
.form-group {
  display: grid;
  gap: 6px;
  color: #304455;
  font-weight: 780;
}

.form-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.edit-table input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.stack-form textarea {
  resize: vertical;
}

.field-help {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.check-line {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.check-line input {
  width: auto;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--brand);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.table-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4f7;
}

.empty-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 54px;
  color: var(--muted);
  background: #eef4f7;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.edit-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.form-action {
  margin-top: 18px;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form select {
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.inline-form button {
  min-height: 38px;
  padding: 8px 10px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 7px;
  font-weight: 800;
}

.inline-action-form {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.inline-action-form .small-action {
  width: 100%;
}

.inline-action-form select {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.alert {
  padding: 12px 14px;
  border-radius: 7px;
  font-weight: 760;
}

.alert.error {
  color: #8b281b;
  background: #ffe8e2;
}

.alert.success {
  color: #135d38;
  background: #e2f7ec;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.muted a {
  color: var(--brand-2);
  font-weight: 800;
}

.legal-shell {
  width: min(920px, calc(100% - 32px));
  margin: 34px auto 60px;
}

.detail-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 60px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.detail-main h1 {
  color: var(--brand);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.detail-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f7;
}

.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gallery-modal[hidden] {
  display: none;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 16, 26, 0.82);
}

.gallery-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(980px, 100%);
}

.gallery-modal-image {
  width: 100%;
  max-height: min(78vh, 760px);
  object-fit: contain;
  background: #08131e;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.gallery-modal-close,
.gallery-modal-nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(11, 45, 91, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.gallery-modal-close {
  top: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 1.8rem;
  line-height: 1;
}

.gallery-modal-nav {
  top: 50%;
  width: 46px;
  height: 58px;
  border-radius: 7px;
  font-size: 2.4rem;
  transform: translateY(-50%);
}

.gallery-modal-prev {
  left: 12px;
}

.gallery-modal-next {
  right: 12px;
}

.gallery-modal-count {
  margin: 12px 0 0;
  color: #fff;
  font-weight: 800;
}

.detail-description {
  color: #33485a;
  font-size: 1.05rem;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding-left: 20px;
  color: #33485a;
}

.page-job-list,
.page-newsletter-form {
  max-width: 760px;
}

.candidate-shell {
  width: min(920px, calc(100% - 32px));
}

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

.match-list h4 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--brand);
}

.match-list h4 span {
  color: var(--brand-2);
}

.supplier-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-side {
  position: sticky;
  top: 90px;
}

.contact-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.contact-form h3 {
  margin-bottom: 0;
  color: var(--brand);
  font-size: 1.1rem;
}

.legal-content h1 {
  color: var(--brand);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.legal-content h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 1.25rem;
}

.legal-content p {
  color: #33485a;
}

.pages-admin {
  grid-template-columns: 280px minmax(0, 1fr);
}

.page-list {
  display: grid;
  gap: 8px;
}

.page-list a,
.filter-tabs a {
  padding: 10px 12px;
  color: #304455;
  background: #eef4f7;
  border-radius: 7px;
  font-weight: 780;
}

.page-list .is-active,
.filter-tabs .is-active {
  color: #fff;
  background: var(--brand);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.moderation-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.moderation-list {
  display: grid;
  gap: 10px;
}

.moderation-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.moderation-row.is-active {
  border-color: var(--brand-2);
  background: #edf6ff;
}

.moderation-row img {
  width: 64px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: #e6eef4;
}

.client-row {
  grid-template-columns: 46px minmax(0, 1fr);
}

.client-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
  font-weight: 900;
}

.moderation-row strong,
.moderation-row small {
  display: block;
}

.moderation-row small {
  color: var(--muted);
}

.review-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.review-data div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.review-data dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.review-data dd {
  margin: 4px 0 0;
}

.review-text {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.review-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.review-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f7;
}

.moderation-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 850px) {
  .app-header,
  .card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .two-column,
  .pages-admin,
  .plan-grid,
  .register-plan-grid,
  .moderation-layout,
  .detail-layout,
  .filter-panel,
  .form-group,
  .deposit-choice-actions,
  .client-form-tabs {
    grid-template-columns: 1fr;
  }

  .review-data,
  .review-gallery,
  .detail-gallery,
  .supplier-page-grid {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }
}
