:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #11182c;
}

* {
  box-sizing: border-box;
}

body {
  background: #f6f7fb;
  display: grid;
  grid-template-columns: 248px 1fr;
  margin: 0;
  min-height: 100vh;
}

body:not(.is-authenticated) .sidebar,
body:not(.is-authenticated) main {
  display: none;
}

.login-screen {
  align-items: center;
  background:
    linear-gradient(rgba(246, 247, 251, 0.84), rgba(246, 247, 251, 0.9)),
    url("https://ztxwqvjckvocvppvsiox.supabase.co/storage/v1/object/public/city-media/cities/prizren/riverside-cafes-prizren-1780403896962.webp");
  background-position: center;
  background-size: cover;
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

body.is-authenticated .login-screen {
  display: none;
}

.login-card {
  background: #ffffff;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  box-shadow: 0 20px 56px rgba(17, 24, 44, 0.16);
  display: grid;
  gap: 16px;
  max-width: 440px;
  padding: 28px;
  width: 100%;
}

.login-card h1 {
  font-size: 32px;
  line-height: 1;
  margin: 0;
}

.login-copy,
.login-status {
  color: #64718a;
  line-height: 1.45;
  margin: 0;
}

.login-status {
  color: #a5342a;
  font-size: 13px;
  font-weight: 900;
  min-height: 20px;
}

.logout-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  margin-top: auto;
  padding: 12px 14px;
  text-align: left;
}

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

.sidebar {
  background: #11182c;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  padding: 22px;
  position: sticky;
  top: 0;
}

.sidebar h1,
.hero h2,
.section-heading h2,
.panel h3 {
  margin: 0;
}

.sidebar h1 {
  font-size: 23px;
  line-height: 1.08;
}

.eyebrow {
  color: #ffb31a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: #347cff;
}

nav {
  display: grid;
  gap: 10px;
}

.nav-group-label {
  color: #ffb31a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 10px 0 0;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-button,
.primary-button,
.secondary-button,
.danger-button,
.back-link,
.add-story {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.nav-button {
  background: transparent;
  color: #b9c5d8;
  padding: 13px 14px;
  text-align: left;
}

.nav-button.active {
  background: #ffffff;
  color: #11182c;
}

main {
  margin: 0 auto;
  max-width: 1280px;
  padding: 22px;
  width: 100%;
}

.hero {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(17, 24, 44, 0.06);
  color: #11182c;
  display: flex;
  min-height: 128px;
  justify-content: flex-start;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
  text-align: left;
}

.language-pill,
.profile-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #64718a;
  display: flex;
  font-size: 14px;
  font-weight: 900;
  gap: 8px;
  min-height: 38px;
  padding: 4px;
  position: absolute;
  top: 22px;
}

.language-pill {
  right: 156px;
}

.profile-pill {
  color: #11182c;
  padding: 0 16px;
  right: 16px;
}

.top-logout-button {
  cursor: pointer;
}

.language-pill span {
  border-radius: 6px;
  padding: 8px 12px;
}

.language-pill .active {
  background: #347cff;
  color: #ffffff;
}

.hero-copy {
  max-width: 720px;
  padding: 22px;
}

.brand-mark {
  color: #347cff;
  font-size: 13px;
  font-weight: 900;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.hero h2 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.03;
}

.hero-copy > p:last-child {
  color: #64718a;
  font-size: 15px;
  line-height: 1.4;
  margin: 8px 0 0;
}

.quick-create {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px 4px;
}

.add-story {
  align-items: center;
  background: #eef5ff;
  border: 3px dashed #b5cef8;
  border-radius: 999px;
  color: #347cff;
  display: flex;
  font-size: 28px;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.quick-create span {
  font-size: 15px;
  font-weight: 900;
}

.toolbar {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr auto;
  margin-bottom: 28px;
}

.save-status {
  background: #eef7f1;
  border: 1px solid #b9dec4;
  border-radius: 8px;
  color: #24643a;
  font-size: 13px;
  font-weight: 900;
  margin: -16px 0 22px;
  padding: 10px 12px;
}

.save-status.error {
  background: #fff0ef;
  border-color: #efc0bc;
  color: #a5342a;
}

#search-input {
  background: #ffffff;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 16px 38px rgba(17, 24, 44, 0.12);
  color: #11182c;
  font-size: 15px;
  min-height: 48px;
  padding: 0 18px;
}

.primary-button {
  background: #347cff;
  color: #ffffff;
  min-height: 50px;
  padding: 0 20px;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  color: #347cff;
  padding: 10px 12px;
}

.danger-button {
  background: #a5342a;
  color: #ffffff;
  padding: 10px 12px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 24px;
}

.section-heading {
  display: grid;
  gap: 4px;
}

.section-heading h2 {
  font-size: 24px;
}

.section-heading p:last-child {
  color: #64718a;
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.city-grid,
.tour-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.tours-by-city-heading {
  margin-top: 18px;
}

.tours-by-city {
  display: grid;
  gap: 14px;
}

.tour-city-filter {
  max-width: 360px;
}

.city-tour-group {
  background: #ffffff;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(17, 24, 44, 0.06);
  display: grid;
  gap: 12px;
  padding: 16px;
}

.city-tour-group-heading,
.grouped-tour-item {
  align-items: center;
  display: grid;
  gap: 12px;
}

.city-tour-group-heading {
  grid-template-columns: 1fr auto;
}

.city-tour-group-heading h3 {
  font-size: 19px;
  margin: 0;
}

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

.grouped-tour-item {
  background: #f6f7fb;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  cursor: pointer;
  grid-template-columns: 74px 1fr auto;
  padding: 8px;
}

.grouped-tour-photo {
  background-position: center;
  background-size: cover;
  border-radius: 6px;
  height: 52px;
}

.empty-state {
  color: #64718a;
  font-size: 14px;
  margin: 0;
}

.city-card,
.tour-card,
.detail-card,
.panel,
.list-item {
  background: #ffffff;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(17, 24, 44, 0.08);
  overflow: hidden;
}

.city-photo,
.tour-photo {
  background-position: center;
  background-size: cover;
  min-height: 160px;
  position: relative;
}

.city-photo::after,
.tour-photo::after {
  background: linear-gradient(transparent, rgba(17, 24, 44, 0.78));
  content: "";
  inset: 0;
  position: absolute;
}

.city-title,
.tour-title {
  bottom: 16px;
  color: #ffffff;
  left: 18px;
  position: absolute;
  z-index: 1;
}

.city-title h3,
.tour-title h3 {
  font-size: 22px;
  margin: 0 0 5px;
}

.city-title p,
.tour-title p {
  color: #d9e1ee;
  font-size: 14px;
  margin: 0;
}

.heart {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: #11182c;
  display: flex;
  font-size: 20px;
  height: 40px;
  justify-content: center;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 40px;
  z-index: 2;
}

.city-footer,
.tour-stats {
  align-items: center;
  color: #64718a;
  display: flex;
  font-size: 14px;
  font-weight: 900;
  justify-content: space-between;
  padding: 12px 16px;
}

.back-link {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  color: #11182c;
  padding: 12px 16px;
}

.city-summary {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(17, 24, 44, 0.08);
  display: grid;
  gap: 14px;
  padding: 22px;
}

.city-summary h2 {
  font-size: 26px;
  margin: 0;
}

.city-summary p {
  color: #64718a;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.summary-stats {
  background: #f5f8fc;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
  padding: 18px;
  text-align: center;
}

.summary-stats strong {
  display: block;
  font-size: 24px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-chip {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  color: #11182c;
  font-size: 14px;
  font-weight: 900;
  padding: 9px 12px;
}

.filter-chip.active {
  background: #11182c;
  color: #ffffff;
}

.tour-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.tour-stats strong {
  color: #11182c;
  display: block;
  font-size: 15px;
}

.tour-detail-hero {
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  min-height: 280px;
  position: relative;
}

.gallery-strip {
  align-items: center;
  bottom: 18px;
  display: flex;
  gap: 12px;
  left: 32px;
  overflow-x: auto;
  position: absolute;
  right: 32px;
}

.thumb {
  background: rgba(255, 255, 255, 0.8);
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  border: 3px solid transparent;
  flex: 0 0 86px;
  height: 56px;
}

.thumb.active {
  border-color: #347cff;
}

.detail-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.detail-card h2 {
  font-size: 26px;
  margin: 0;
}

.detail-meta {
  color: #347cff;
  font-size: 15px;
  font-weight: 900;
}

.info-stats {
  background: #f5f8fc;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 20px;
  text-align: center;
}

.route-card {
  align-items: center;
  background: #f5f8fc;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: 52px 1fr 52px;
  padding: 18px;
}

.route-number,
.route-send {
  align-items: center;
  background: #eaf1fb;
  border-radius: 999px;
  display: flex;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  width: 52px;
}

.panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

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

.category-form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 1fr) auto auto;
}

label {
  color: #45536a;
  display: grid;
  font-size: 13px;
  font-weight: 900;
  gap: 7px;
}

.check-label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.check-label input {
  min-height: auto;
  width: auto;
}

.permission-fieldset {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 14px;
}

.permission-fieldset legend {
  color: #45536a;
  font-size: 13px;
  font-weight: 900;
  padding: 0 6px;
}

.permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.story-permission-editor {
  display: grid;
  gap: 10px;
  justify-items: start;
}

input,
select,
textarea {
  background: #f6f7fb;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #11182c;
  min-height: 46px;
  padding: 10px 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

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

.list-item {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 14px;
}

.item-title {
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 4px;
}

.item-meta {
  color: #64718a;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.actions {
  display: flex;
  gap: 8px;
}

.card-actions,
.detail-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 0 16px 14px;
}

.detail-actions {
  padding: 0;
}

.compact-button {
  font-size: 12px;
  padding: 7px 9px;
}

.hidden {
  display: none;
}

body.story-maker-only .admin-hero,
body.story-maker-only .quick-create,
body.story-maker-only .toolbar {
  display: none;
}

body.story-maker-only main {
  padding-top: 22px;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  main {
    padding: 0;
  }

  .hero {
    border-radius: 0;
    min-height: 520px;
  }

  .language-pill {
    right: 132px;
  }

  .profile-pill {
    display: none;
  }

  .toolbar,
  .category-form,
  .form-grid,
  .list-item,
  .grouped-tour-item,
  .summary-stats,
  .tour-stats,
  .info-stats {
    grid-template-columns: 1fr;
  }

  .grouped-tour-photo {
    height: 120px;
  }

  .view,
  .toolbar {
    padding: 0 20px;
  }
}
