:root {
  --ink: #f6f1f3;
  --cream: #100e10;
  --rose: #e989a4;
  --rose-deep: #d56b8c;
  --silver: rgba(213, 219, 227, 0.35);
  --sans: Outfit, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: light; }

body {
  margin: 0;
  background: #0c0a0b;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

button, input { font: inherit; }

.desk-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.7rem;
  padding: calc(0.8rem + env(safe-area-inset-top)) 1rem 0.75rem;
  background: var(--ink);
  color: white;
}

.desk-brand {
  color: white;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  margin-right: auto;
}

.lang-switch { display: flex; gap: 0.3rem; }

.lang-switch button {
  min-width: 40px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: white;
  cursor: pointer;
}

.lang-switch button.is-active {
  background: white;
  color: var(--ink);
}

.sync {
  flex: 1 0 100%;
  margin: 0;
  color: #d5dbe3;
  font-size: 0.82rem;
}
.sync.is-down { color: #f3c6d0; }

.count {
  min-width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--rose);
  font-size: 0.8rem;
  font-weight: 600;
}

.desk-main {
  width: min(760px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.2rem 0 3rem;
}

.login {
  padding: 1.5rem 0;
  text-align: center;
}

.login img {
  width: 140px;
  height: auto;
  margin: 0 auto 0.6rem;
  background: transparent;
}

.login h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 9vw, 3rem);
  font-weight: 600;
  line-height: 1;
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}

.login form, .ticket, .desk-tools, .filters {
  text-align: left;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input[type="password"],
input[type="search"] {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--silver);
  background: #0e0c0d;
  color: var(--ink);
  font-size: 1rem;
}

.btn {
  width: 100%;
  min-height: 52px;
  margin-top: 0.8rem;
  border: 0;
  border-radius: 999px;
  background: #e989a4;
  color: #1a1216;
  font-weight: 600;
  cursor: pointer;
}

.btn.is-on { background: var(--rose-deep); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--silver);
}

.form-error { color: var(--rose-deep); }

.desk-tools {
  display: grid;
  gap: 0.4rem;
}

.hint,
.ticket__status,
.ticket__meta,
.ticket__extra,
.empty {
  color: #c8c0c6;
  font-size: 0.92rem;
}

.filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin: 0.8rem 0 1rem;
}

.filters button {
  min-height: 40px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--silver);
  background: #171316;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.filters button.is-active {
  background: #e989a4;
  color: #1a1216;
  border-color: #e989a4;
}

.ticket {
  margin-bottom: 0.8rem;
  padding: 1rem;
  background: #171316;
  border: 1px solid rgba(213, 219, 227, 0.18);
  border-left: 5px solid var(--rose);
  border-radius: 18px;
}

.ticket--contacted { border-left-color: var(--silver); }
.ticket--done { border-left-color: #8e97a6; opacity: 0.78; }

.ticket__top, .ticket__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.ticket__top { justify-content: space-between; }

.ticket__code {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
}

.ticket__status, .ticket__meta, .ticket__extra {
  margin: 0;
  color: #c8c0c6;
  font-size: 0.9rem;
}

.ticket h2 {
  margin: 0.25rem 0;
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
}

.ticket__phone, .ticket__theme { margin: 0.15rem 0; font-weight: 600; }
.ticket__details { white-space: pre-wrap; }

.desk-btn {
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--silver);
  background: #100e10;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.desk-btn--dark {
  background: #e989a4;
  color: #1a1216;
  border-color: #e989a4;
}

.empty { color: #c8c0c6; }

@media (min-width: 720px) {
  .desk-tools { grid-template-columns: 1.4fr auto auto; align-items: center; }
  .desk-tools .btn { margin-top: 0; }
}
