@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-accent: #fef8e7;
  --surface: #ffffff;
  --surface-muted: #f4efe7;
  --ink: #1f2024;
  --ink-soft: #5a5f68;
  --brand: #d14b36;
  --brand-2: #f2b366;
  --line: #e7dccb;
  --shadow: 0 24px 60px rgba(31, 32, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at top, #fff8e6 0%, var(--bg) 45%, #efe6d9 100%);
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

/* ── Login screen ── */

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px 48px;
  overflow: hidden;
  background: #f3efe8;
}

.login-screen__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-screen__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.login-screen__orb--red {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: #e85a45;
}

.login-screen__orb--green {
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: -60px;
  background: #3d8f5a;
}

.login-screen__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 32, 36, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 32, 36, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

.login-screen__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

.login-screen__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  text-align: center;
}

.login-screen__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 16px 20px;
  overflow: hidden;
}

.login-screen__logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 220px;
  max-height: 120px;
  object-fit: contain;
  background: #ffffff;
}

.is-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-screen__eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.login-screen__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.login-screen__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.login-screen__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field__input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 12px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(209, 75, 54, 0.15);
  background: var(--surface);
}

.field__password {
  position: relative;
}

.field__password .field__input {
  padding-right: 72px;
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.field__toggle:hover {
  color: var(--brand);
  background: rgba(209, 75, 54, 0.08);
}

.login-screen__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdecea;
  border: 1px solid #f5c2bc;
  color: #b42318;
  font-size: 13px;
}

.login-screen__submit {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand) 0%, #e86b3a 55%, var(--brand-2) 100%);
  box-shadow: 0 12px 28px rgba(209, 75, 54, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-screen__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(209, 75, 54, 0.4);
}

.login-screen__submit:active {
  transform: translateY(0);
}

.login-screen__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-screen__hint {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
}

.login-screen__footer {
  position: relative;
  z-index: 1;
  margin: 28px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 32px 24px;
  background: linear-gradient(160deg, #1f2024 0%, #2c2f36 55%, #1f2024 100%);
  color: #f7f4ef;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f07c5a, #f4c27b);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1f2024;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav button {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f7f4ef;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav button.active {
  background: rgba(242, 179, 102, 0.25);
  color: #fff5e6;
  transform: translateX(4px);
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.content {
  padding: 40px 48px 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

h1 {
  margin: 0 0 6px 0;
  font-size: 32px;
}

.topbar p {
  margin: 0;
  color: var(--ink-soft);
}

.topbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.topbar-user__label {
  font-size: 12px;
  color: var(--ink-soft);
}

.topbar-user__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
}

.primary {
  background: linear-gradient(135deg, var(--brand), #f08147);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.summary-card {
  background: var(--surface);
  padding: 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.summary-label {
  color: var(--ink-soft);
  font-size: 13px;
}

.summary-value {
  font-size: 20px;
  font-weight: 600;
  margin-top: 6px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
}

.workspace--table {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel--full {
  min-height: 420px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 12px;
  animation: fadeUp 0.4s ease both;
}

.list-item.active {
  border-color: var(--brand-2);
  background: #fff3dc;
}

.list-item__main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  color: inherit;
}

.list-item__thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.list-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.list-item__title {
  display: block;
  font-weight: 600;
}

.list-item__meta {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.list-item__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.crud-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.field__textarea {
  resize: vertical;
  min-height: 88px;
}

.field__textarea--mono {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
}

.image-field {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 0;
}

.image-field legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 4px;
}

.image-field__preview {
  min-height: 120px;
  border-radius: 12px;
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

.image-field__preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.image-field__preview--logo {
  min-height: 140px;
  background: #fff;
}

.image-field__preview--logo img {
  max-height: 120px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.image-field__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.image-field__sizes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-upload {
  display: inline-flex;
}

.file-upload__btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  white-space: nowrap;
}

.file-upload__btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.ghost--sm {
  padding: 6px 10px;
  font-size: 12px;
}

.ghost--danger {
  color: #b42318;
  border-color: #f5c2bc;
}

.ghost--danger:hover {
  background: #fdecea;
}

.danger {
  border: none;
  background: #b42318;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

.empty-state,
.empty-cell {
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
  padding: 24px 12px;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.data-table tbody tr:hover {
  background: #fff8ee;
}

.data-table a {
  color: var(--brand);
  text-decoration: none;
}

.data-table a:hover {
  text-decoration: underline;
}

.status-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
  cursor: pointer;
}

.status-select[value="sent"],
.status-select option[value="sent"] {
  color: #1a7f4b;
}

.toast {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}

.toast--success {
  background: #e8f7ee;
  border: 1px solid #b7e4c7;
  color: #1a7f4b;
}

.toast--error {
  background: #fdecea;
  border: 1px solid #f5c2bc;
  color: #b42318;
}

.toast--info {
  background: #eef4ff;
  border: 1px solid #c7d7fe;
  color: #3538cd;
}

.modal {
  border: none;
  border-radius: 18px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(31, 32, 36, 0.45);
}

.modal__content {
  padding: 24px;
}

.modal__title {
  margin: 0 0 8px;
  font-size: 20px;
}

.modal__text {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .login-screen__panel {
    padding: 32px 24px 28px;
  }

  .login-screen__logo-img {
    max-width: 180px;
    max-height: 100px;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .nav {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .content {
    padding: 24px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-user {
    align-items: flex-start;
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .list-item__actions {
    justify-content: flex-end;
  }
}
