@import "https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap";

/* client/style.css */
:root {
  --bg: #f4f2e9;
  --ink: #1f1a14;
  --paper: #fffdf7;
  --line: #d3c9b8;
  --primary: #0e7a59;
  --primary-ink: #ecfff7;
  --danger: #a53131;
  --danger-bg: #ffe8e8;
  --success: #1b6a4d;
  --success-bg: #e6f8ef;
  --muted: #665f52;
  --shadow: 0 12px 30px #21180f14;
}

* {
  box-sizing: border-box;
}

body {
  color: var(--ink);
  background: radial-gradient(circle at 85% 15%, #e5d8b8 0, #e5d8b800 35%), radial-gradient(circle at 10% 90%, #d8efe4 0, #d8efe400 38%), var(--bg);
  min-height: 100vh;
  margin: 0;
  font-family: Space Grotesk, Avenir Next, Segoe UI, sans-serif;
}

.page {
  width: min(920px, 92vw);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

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

.brand {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .02em;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
}

.menu {
  display: flex;
  align-items:  center;
  gap: .75rem;
}

.langswitch {
  display: inline-flex;
  color: var(--muted);
  align-items:  center;
  gap: .4rem;
  font-size: .9rem;
}

.langswitch select {
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  background: #fff;
  border-radius: .48rem;
  padding: .32rem .44rem;
}

.menu a, .linklike {
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  opacity: .84;
  background: none;
  border: 0;
}

.menu a:hover, .linklike:hover {
  opacity: 1;
}

.banner {
  border: 1px solid #0000;
  border-radius: .7rem;
  margin: 0 0 1rem;
  padding: .72rem .95rem;
  font-size: .95rem;
}

.banner.success {
  color: var(--success);
  background: var(--success-bg);
  border-color: #a9e2c8;
}

.banner.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #efbaba;
}

.content {
  animation: reveal .22s ease-out;
}

.panel {
  background: linear-gradient(170deg, var(--paper) 0%, #fef9ef 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 1rem;
  padding: 1.2rem;
}

.panel h1, .panel h2 {
  margin-top: 0;
  margin-bottom: .7rem;
}

.panel p {
  color: var(--muted);
  margin-top: .35rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
  cursor: pointer;
  border-radius: .66rem;
  justify-content: center;
  align-items:  center;
  padding: .55rem .9rem;
  transition: transform .14s, opacity .14s, background .14s;
  font-family: Space Grotesk, Avenir Next, sans-serif;
  font-weight: 600;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: .66;
  cursor: not-allowed;
}

.button.ghost {
  color: var(--ink);
  border-color: var(--line);
  background: none;
}

.button.danger {
  color: var(--danger);
  background: none;
  border-color: #d9a1a1;
}

.asset-page {
  display: grid;
  gap: 1.15rem;
}

.asset-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  align-items:  start;
  gap: 1.5rem;
}

.asset-upload-form {
  display: grid;
  gap: .7rem;
}

.asset-upload-form label {
  display: grid;
  color: var(--muted);
  gap: .3rem;
  font-size: .9rem;
}

.asset-upload-form input {
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  background: #fff;
  border-radius: .62rem;
  width: 100%;
  padding: .58rem .65rem;
}

.asset-list-heading {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 1rem;
}

.asset-list-heading h3 {
  margin: 0;
}

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

.asset-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: .85rem;
  min-width: 0;
  box-shadow: 0 6px 18px #21180f0f;
}

.asset-preview {
  display: grid;
  color: var(--ink);
  text-decoration: none;
  background-color: #ece8de;
  background-image: linear-gradient(45deg, #dfd9ce 25%, #0000 25%), linear-gradient(-45deg, #dfd9ce 25%, #0000 25%), linear-gradient(45deg, #0000 75%, #dfd9ce 75%), linear-gradient(-45deg, #0000 75%, #dfd9ce 75%);
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
  place-items:  center;
  height: 170px;
}

.asset-preview img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

.asset-file-icon {
  display: grid;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .45rem .9rem .45rem .45rem;
  place-items:  center;
  width: 72px;
  height: 86px;
  padding: .4rem;
  font-family: IBM Plex Mono, monospace;
  font-size: .78rem;
  font-weight: 700;
}

.asset-info {
  display: grid;
  gap: .2rem;
  padding: .75rem;
}

.asset-info strong, .asset-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-info span {
  color: var(--muted);
  font-size: .82rem;
}

.asset-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  padding: 0 .75rem .75rem;
}

.asset-actions .button {
  padding-inline-start: .45rem;
  padding-inline-end: .45rem;
  font-size: .85rem;
}

.asset-empty {
  text-align: center;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr);
  align-items:  start;
  gap: 1rem;
}

.profile-avatar-panel {
  display: grid;
  text-align: center;
  justify-items: center;
  gap: .85rem;
}

.profile-avatar {
  display: grid;
  overflow: hidden;
  border: 4px solid var(--paper);
  outline: 1px solid var(--line);
  color: var(--primary);
  box-shadow: var(--shadow);
  background: #dcece5;
  border-radius: 50%;
  place-items:  center;
  width: 156px;
  height: 156px;
  font-size: 3rem;
  font-weight: 700;
}

.profile-avatar img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.profile-picker {
  display: grid;
  color: var(--muted);
  text-align: left;
  gap: .35rem;
  width: 100%;
  font-size: .88rem;
}

.profile-picker select {
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  background: #fff;
  border-radius: .6rem;
  width: 100%;
  padding: .55rem;
}

.profile-password {
  border-top: 1px solid var(--line);
  margin-top: .5rem;
  padding-top: .8rem;
}

.profile-password h3, .profile-password p {
  margin: 0;
}

.danger-text {
  color: var(--danger);
}

.visually-hidden {
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
}

.form {
  display: grid;
  gap: .78rem;
  max-width: 520px;
}

.form label {
  display: grid;
  color: var(--muted);
  gap: .35rem;
  font-size: .92rem;
}

.form input {
  border: 1px solid var(--line);
  outline: none;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border-radius: .62rem;
  padding: .6rem .7rem;
}

.form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #0e7a5926;
}

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

.rowactions {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: .6rem;
}

.muted {
  color: var(--muted);
  margin: .45rem 0 0;
  font-size: .92rem;
}

.userlist {
  list-style: none;
  display: grid;
  gap: .68rem;
  margin: .75rem 0 0;
  padding: 0;
}

.userrow {
  display: flex;
  background: #fff;
  border: 1px solid #e4dccd;
  border-radius: .66rem;
  justify-content: space-between;
  align-items:  center;
  gap: .8rem;
  padding: .7rem;
}

.userrow strong {
  display: block;
  margin-bottom: .2rem;
}

.userrow p {
  margin: 0;
  font-size: .9rem;
}

.status {
  border-radius: 999px;
  padding: .25rem .5rem;
  font-size: .78rem;
  font-weight: 700;
}

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

.status.inactive {
  color: var(--danger);
  background: var(--danger-bg);
}

.pagination {
  display: flex;
  border-top: 1px solid #e7dece;
  flex-wrap: wrap;
  align-items:  center;
  gap: .65rem;
  margin-top: 1rem;
  padding-top: .9rem;
}

.limitcontrol {
  display: inline-flex;
  color: var(--muted);
  align-items:  center;
  gap: .42rem;
  font-size: .9rem;
}

.limitcontrol select {
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  background: #fff;
  border-radius: .52rem;
  padding: .38rem .48rem;
}

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .4rem 1rem;
  margin: 0 0 1rem;
}

.details dt {
  font-weight: 700;
}

.details dd {
  color: var(--muted);
  margin: 0;
  font-family: IBM Plex Mono, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88rem;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (width <= 680px) {
  .page {
    width: min(980px, 94vw);
    padding-top: 1rem;
  }

  .topbar {
    flex-direction: column;
    align-items:  flex-start;
  }

  .menu {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

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

  .row, .userrow {
    flex-direction: column;
    align-items:  flex-start;
  }

  .rowactions, .button {
    width: 100%;
  }

  .pagination .button {
    width: auto;
  }

  .asset-upload, .profile-layout {
    grid-template-columns: 1fr;
  }

  .asset-actions .button, .asset-list-heading .button {
    width: auto;
  }
}
