:root {
  color-scheme: light;
  --bg: #fff7ed;
  --bg-deep: #eef8f5;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-muted: #fff3df;
  --ink: #26312f;
  --muted: #6a7774;
  --line: #eadfce;
  --accent: #15a38f;
  --accent-dark: #087766;
  --accent-soft: #dff7f1;
  --coral: #ff7a59;
  --coral-soft: #ffe4d9;
  --sun: #f6b73c;
  --sun-soft: #fff2cf;
  --reserved: #4865d8;
  --reserved-soft: #e6eaff;
  --own: #9c4dcc;
  --own-soft: #f5e7ff;
  --danger: #d64545;
  --danger-soft: #ffe0df;
  --shadow: 0 22px 55px rgba(71, 54, 29, 0.14);
  --shadow-soft: 0 12px 30px rgba(71, 54, 29, 0.09);
  --radius: 8px;
  --font-main: "Century Gothic", CenturyGothic, AppleGothic, "Trebuchet MS", Arial, sans-serif;
  font-family: var(--font-main);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  font-size: 17px;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    linear-gradient(135deg, rgba(255, 122, 89, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(21, 163, 143, 0.2), transparent 38%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: var(--font-main);
  line-height: 1.55;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

img {
  display: block;
  max-width: 100%;
}

[hidden],
.is-hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card,
.admin-panel,
.calendar-panel,
.upcoming-sidebar,
.profile-panel,
.modal {
  border: 1px solid rgba(234, 223, 206, 0.88);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-card {
  width: min(480px, 100%);
  padding: 38px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--reserved));
  color: white;
  font-size: 1.08rem;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(21, 163, 143, 0.26);
}

.auth-card h1,
.topbar h1,
.section-heading h2,
.modal h2,
.detail-hero h3 {
  margin: 0;
  letter-spacing: 0;
}

.auth-card h1 {
  font-size: clamp(2.1rem, 5vw, 2.7rem);
  line-height: 1.08;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  margin: 28px 0 24px;
  background: #f7ead6;
  border-radius: var(--radius);
}

.auth-tab {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tab.is-active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.auth-form,
.event-form {
  display: grid;
  gap: 17px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(21, 163, 143, 0.15);
  background: #ffffff;
}

input[type="file"] {
  padding: 10px;
  background: #fff9f0;
}

textarea {
  resize: vertical;
}

.primary-button,
.ghost-button,
.danger-button,
.small-button,
.today-button {
  min-height: 46px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(21, 163, 143, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(21, 163, 143, 0.3);
}

.ghost-button,
.small-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button:hover,
.small-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.today-button {
  background: var(--sun-soft);
  color: #85570b;
  border-color: rgba(246, 183, 60, 0.36);
}

.today-button:hover {
  background: #ffe6a8;
  transform: translateY(-1px);
}

.danger-button {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.danger-button:hover {
  background: #ffc9c6;
  transform: translateY(-1px);
}

.message {
  min-height: 23px;
  margin: 13px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.message.is-error {
  color: var(--danger);
}

.message.is-success {
  color: var(--accent-dark);
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 26px;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 0 28px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: clamp(2.2rem, 4vw, 3.65rem);
  line-height: 1.06;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid rgba(234, 223, 206, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.user-chip img {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
}

.workspace {
  padding-bottom: 30px;
}

.profile-panel {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.profile-form {
  display: grid;
  gap: 18px;
}

.profile-preview {
  min-height: 170px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(21, 163, 143, 0.45);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff8ec, #eaf9f5);
}

.profile-preview img,
.profile-preview .brand-mark {
  width: 150px;
  height: 150px;
  margin: 0;
  border-radius: var(--radius);
}

.profile-preview img {
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.locked-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2px 0 18px;
}

.mobile-month-label {
  display: none;
}

.icon-button {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 2.2rem;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  transition:
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(21, 163, 143, 0.14);
}

.month-selectors {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.65fr);
  gap: 10px;
  width: min(430px, 100%);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 700;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.legend-dot.free {
  background: var(--accent);
}

.legend-dot.reserved {
  background: var(--reserved);
}

.legend-dot.own {
  background: var(--own);
}

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

.upcoming-sidebar,
.calendar-panel {
  padding: 18px;
}

.upcoming-sidebar {
  position: sticky;
  top: 18px;
}

.compact-heading {
  align-items: flex-start;
  margin-bottom: 14px;
}

.compact-heading h2 {
  font-size: 1.28rem;
  line-height: 1.2;
}

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

.upcoming-card,
.empty-upcoming {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(234, 223, 206, 0.9);
  border-radius: var(--radius);
  background: #fffdf9;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(71, 54, 29, 0.07);
}

.upcoming-card {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.upcoming-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(21, 163, 143, 0.12);
}

.upcoming-card strong,
.empty-upcoming strong {
  font-size: 1rem;
  line-height: 1.3;
}

.upcoming-card span,
.empty-upcoming span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.upcoming-card em {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 700;
}

.upcoming-date {
  width: max-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark) !important;
}

.calendar-panel {
  min-width: 0;
}

.weekday-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}

.calendar-grid {
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.weekday {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.day-cell {
  min-width: 0;
  min-height: 142px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(234, 223, 206, 0.9);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fff9ef);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(71, 54, 29, 0.07);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.day-cell:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 15px 30px rgba(21, 163, 143, 0.16);
}

.day-cell.is-empty {
  min-height: 142px;
  border-style: dashed;
  background: rgba(255, 249, 239, 0.55);
  box-shadow: none;
  cursor: default;
}

.day-cell.is-empty:hover {
  transform: none;
  border-color: rgba(234, 223, 206, 0.9);
  box-shadow: none;
}

.day-cell.is-reserved {
  border-color: rgba(72, 101, 216, 0.36);
  background: linear-gradient(180deg, #ffffff, var(--reserved-soft));
}

.day-cell.is-own {
  border-color: rgba(156, 77, 204, 0.38);
  background: linear-gradient(180deg, #ffffff, var(--own-soft));
}

.day-cell.is-selected {
  outline: 3px solid rgba(255, 122, 89, 0.36);
  outline-offset: 2px;
  border-color: var(--coral);
}

.day-number {
  width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 700;
  background: #fff2d7;
}

.day-cell.is-today .day-number {
  background: linear-gradient(135deg, var(--coral), var(--sun));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(255, 122, 89, 0.28);
}

.day-free {
  align-self: end;
  width: max-content;
  margin-top: auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.event-preview {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.event-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid rgba(234, 223, 206, 0.9);
}

.event-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.28;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-panel {
  padding: 20px;
}

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

.count-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.count-pill {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill.pending {
  background: var(--sun-soft);
  color: #85570b;
}

.status-pill.approved {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill.rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.table-wrap {
  width: 100%;
}

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

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  font-weight: 700;
}

.org-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.org-cell img {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(38, 49, 47, 0.48);
  backdrop-filter: blur(10px);
}

.modal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  padding: 26px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-size: 1.55rem;
  line-height: 1;
}

.modal-header {
  padding-right: 46px;
  margin-bottom: 20px;
}

.modal h2 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  line-height: 1.12;
}

.event-details {
  display: grid;
  gap: 15px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff8ec, #eefaf6);
}

.detail-hero img,
.detail-hero .media-button {
  width: 128px;
  height: 96px;
}

.detail-hero img {
  border-radius: 7px;
  object-fit: cover;
}

.detail-hero .brand-mark {
  width: 128px;
  height: 96px;
  margin: 0;
}

.detail-hero h3 {
  font-size: 1.35rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.media-button,
.flyer-preview {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
}

.media-button {
  overflow: hidden;
}

.media-button:focus-visible,
.flyer-preview:focus-visible {
  outline: 3px solid rgba(21, 163, 143, 0.32);
  outline-offset: 3px;
}

.flyer-preview {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--accent-dark);
  text-align: left;
  font-weight: 700;
}

.flyer-preview img {
  width: 120px;
  height: 82px;
  border-radius: 7px;
  object-fit: cover;
}

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

.detail-item {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-item p {
  margin: 0;
  line-height: 1.45;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.description-box {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.password-reset-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.password-reset-form label {
  color: var(--danger);
}

.password-reset-form input {
  border-color: rgba(214, 69, 69, 0.36);
}

.password-reset-form .message {
  margin-top: 0;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 62px 22px 22px;
  background: rgba(20, 25, 25, 0.84);
  backdrop-filter: blur(10px);
}

.lightbox-backdrop img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 96px);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.7rem;
  line-height: 1;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #26312f;
  color: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .upcoming-sidebar {
    position: static;
  }

  .upcoming-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  html {
    font-size: 16px;
  }

  .app-shell {
    padding: 18px;
  }

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

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

  .calendar-panel,
  .upcoming-sidebar,
  .profile-panel,
  .admin-panel {
    padding: 14px;
  }

  .weekday-grid,
  .calendar-grid {
    gap: 6px;
  }

  .weekday {
    padding-inline: 2px;
    font-size: 0.74rem;
  }

  .day-cell,
  .day-cell.is-empty {
    min-height: 106px;
    padding: 8px;
  }

  .day-number {
    width: 32px;
    height: 30px;
  }

  .event-title,
  .day-free {
    font-size: 0.82rem;
  }

  .event-thumb {
    aspect-ratio: 1 / 1;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  table {
    border-collapse: separate;
    border-spacing: 0;
  }

  thead {
    display: none;
  }

  tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fffdf9;
  }

  td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  td::before {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  #users-table td:nth-child(1)::before {
    content: "Organizacija";
  }

  #users-table td:nth-child(2)::before {
    content: "Email";
  }

  #users-table td:nth-child(3)::before {
    content: "Status";
  }

  #users-table td:nth-child(4)::before {
    content: "Rezervacije";
  }

  #users-table td:nth-child(5)::before {
    content: "Akcije";
  }

  #events-table td:nth-child(1)::before {
    content: "Datum";
  }

  #events-table td:nth-child(2)::before {
    content: "Događaj";
  }

  #events-table td:nth-child(3)::before {
    content: "Organizacija";
  }

  #events-table td:nth-child(4)::before {
    content: "Vreme";
  }

  #events-table td:nth-child(5)::before {
    content: "Lokacija";
  }

  #events-table td:nth-child(6)::before {
    content: "Akcije";
  }

  .actions {
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  html {
    font-size: 15.5px;
  }

  .auth-screen {
    padding: 16px;
  }

  .auth-card {
    padding: 24px;
  }

  .topbar-actions,
  .calendar-toolbar,
  .form-row,
  .locked-profile-grid,
  .detail-grid,
  .detail-hero,
  .flyer-preview {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .calendar-toolbar {
    display: grid;
  }

  .calendar-toolbar {
    justify-items: stretch;
  }

  .user-chip {
    max-width: none;
    width: 100%;
  }

  #previous-month,
  #next-month,
  .month-selectors {
    display: none;
  }

  .mobile-month-label {
    display: block;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
  }

  .icon-button,
  .today-button,
  .topbar-actions .ghost-button,
  .modal-actions button {
    width: 100%;
  }

  .calendar-legend {
    justify-content: flex-start;
  }

  .upcoming-list {
    grid-template-columns: 1fr;
  }

  .calendar-panel {
    touch-action: pan-y;
    user-select: none;
  }

  .day-cell-top {
    gap: 4px;
  }

  .date-status-dots {
    gap: 3px;
    min-width: 16px;
  }

  .status-dot {
    width: 8px;
    height: 8px;
    box-shadow:
      0 0 0 2px rgba(68, 56, 41, 0.035),
      0 1px 4px rgba(68, 56, 41, 0.14);
  }

  .status-dot--secondary {
    width: 6px;
    height: 6px;
  }

  .weekday-grid,
  .calendar-grid {
    gap: 4px;
  }

  .weekday {
    font-size: 0.68rem;
  }

  .day-cell,
  .day-cell.is-empty {
    min-height: 88px;
    padding: 6px;
  }

  .day-number {
    width: 28px;
    height: 26px;
    font-size: 0.82rem;
  }

  .event-thumb {
    display: none;
  }

  .event-title {
    font-size: 0.74rem;
    line-height: 1.2;
    -webkit-line-clamp: 3;
  }

  .day-free {
    padding: 3px 6px;
    font-size: 0.7rem;
    display: none;
  }

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

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
    padding: 20px;
  }

  .detail-hero img,
  .detail-hero .media-button,
  .detail-hero .brand-mark,
  .flyer-preview img {
    width: 100%;
    height: 180px;
  }

  .modal-actions {
    display: grid;
  }

  td {
    display: grid;
    gap: 5px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .actions button {
    width: 100%;
  }

  .lightbox-backdrop {
    padding: 70px 12px 12px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 12px;
  }

  .calendar-panel,
  .upcoming-sidebar,
  .profile-panel,
  .admin-panel {
    padding: 10px;
  }

  .weekday-grid,
  .calendar-grid {
    gap: 3px;
  }

  .day-cell,
  .day-cell.is-empty {
    min-height: 78px;
    padding: 5px;
  }

  .day-number {
    width: 25px;
    height: 24px;
    font-size: 0.75rem;
  }

  .event-title {
    font-size: 0.68rem;
  }
}
/* Premium visual layer */
:root {
  --bg: #f5f7fb;
  --bg-deep: #eef3f8;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-solid: #ffffff;
  --surface-muted: #faf7ef;
  --ink: #26332d;
  --muted: #667085;
  --line: #e5eaf1;
  --accent: #6b8f71;
  --accent-dark: #345635;
  --accent-soft: #e3efd3;
  --cream: #faf7ef;
  --sand: #efe3d0;
  --gold: #c9a86a;
  --gold-soft: #f4e8cc;
  --terracotta: #c97b63;
  --terracotta-soft: #f5ded6;
  --rose: #c88f8a;
  --rose-soft: #f3e1df;
  --sky: #afc7d5;
  --sky-soft: #e7f0f5;
  --lavender: #b8b1d9;
  --lavender-soft: #ece9f7;
  --coral: #c97b63;
  --coral-soft: #f5ded6;
  --sun: #c9a86a;
  --sun-soft: #f4e8cc;
  --reserved: #afc7d5;
  --reserved-soft: #e7f0f5;
  --own: #0d2b1d;
  --own-soft: #e5ece3;
  --danger: #a94f40;
  --danger-soft: #f5ded6;
  --status-free: #6b8f71;
  --status-reserved: #afc7d5;
  --status-today: #c9a86a;
  --status-mine: #0d2b1d;
  --status-other: #b8b1d9;
  --warning: #c97b63;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 12px 34px rgba(15, 23, 42, 0.07);
  --shadow-tight: 0 8px 20px rgba(15, 23, 42, 0.06);
  --topbar: #0d2b1d;
  --topbar-muted: #d9dfcf;
  --font-main: "Century Gothic", Arial, sans-serif;
  font-family: var(--font-main);
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(5, 150, 105, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: var(--font-main);
}

.auth-card,
.admin-panel,
.calendar-panel,
.upcoming-sidebar,
.profile-panel,
.modal {
  border: 1px solid rgba(229, 234, 241, 0.9);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 70px;
  width: 100%;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(201, 168, 106, 0.18), transparent 36%),
    linear-gradient(315deg, rgba(175, 199, 213, 0.14), transparent 38%),
    linear-gradient(180deg, #153825, var(--topbar));
  box-shadow: 0 16px 38px rgba(13, 43, 29, 0.22);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -24px;
  height: 24px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), transparent);
}

.topbar-inner {
  width: min(1500px, 100%);
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(360px, 1fr);
  align-items: center;
  gap: 24px;
  margin: 0 auto;
  padding: 10px 28px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-logo,
.brand-mark.site-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(250, 247, 239, 0.78);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(13, 43, 29, 0.22);
}

.app-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.brand-mark.site-logo {
  color: transparent;
}

.app-logo img,
.brand-mark.site-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.brand-mark:not(.site-logo) {
  background: linear-gradient(135deg, var(--gold), var(--accent) 52%, var(--accent-dark));
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(13, 43, 29, 0.2);
}

.app-title {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
}

.topbar-subtitle {
  margin: 2px 0 0;
  color: var(--topbar-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.topbar-context {
  min-width: 220px;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 16px;
  border: 1px solid rgba(250, 247, 239, 0.14);
  border-radius: 8px;
  background: rgba(250, 247, 239, 0.08);
}

.topbar-context span {
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
}

.topbar-context small {
  max-width: 300px;
  overflow: hidden;
  color: var(--topbar-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  justify-content: flex-end;
  min-width: 0;
}

.public-auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .user-chip {
  max-width: 260px;
  border-color: rgba(250, 247, 239, 0.14);
  background: rgba(250, 247, 239, 0.08);
  color: #ffffff;
  box-shadow: none;
}

.topbar .ghost-button {
  min-height: 40px;
  border-color: rgba(250, 247, 239, 0.14);
  background: rgba(250, 247, 239, 0.08);
  color: #f8fafc;
}

.topbar .ghost-button:hover {
  border-color: rgba(201, 168, 106, 0.42);
  background: rgba(250, 247, 239, 0.14);
  color: #ffffff;
}

.topbar .primary-button {
  min-height: 40px;
  background: linear-gradient(135deg, #f0dfb5, var(--gold));
  color: #0d2b1d;
  box-shadow: 0 12px 26px rgba(201, 168, 106, 0.24);
}

.topbar .primary-button:hover {
  color: #0d2b1d;
  box-shadow: 0 16px 30px rgba(201, 168, 106, 0.32);
}

.workspace {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 28px 28px 36px;
}

.auth-tabs {
  background: rgba(239, 227, 208, 0.78);
}

.auth-tab.is-active {
  color: var(--ink);
  background: #ffffff;
}

input,
select,
textarea,
.detail-item,
.description-box,
.upcoming-card,
.today-event-card,
.empty-upcoming,
.calendar-legend span,
.mobile-month-label {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(107, 143, 113, 0.18);
}

input[type="file"] {
  background: #fbf3e7;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 14px 28px rgba(52, 86, 53, 0.2);
}

.primary-button:hover {
  box-shadow: 0 18px 34px rgba(52, 86, 53, 0.28);
}

.ghost-button,
.small-button {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.ghost-button:hover,
.small-button:hover,
.icon-button:hover {
  border-color: var(--terracotta);
  color: var(--accent-dark);
  box-shadow: 0 16px 30px rgba(201, 123, 99, 0.1);
}

.today-button {
  color: #725518;
  background: linear-gradient(180deg, #fff8e8, var(--gold-soft));
  border-color: rgba(201, 168, 106, 0.34);
}

.eyebrow {
  color: var(--terracotta);
}

.calendar-layout {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 22px;
}

.calendar-main {
  min-width: 0;
}

.upcoming-sidebar,
.calendar-panel,
.admin-panel,
.profile-panel,
.modal {
  border-color: rgba(229, 234, 241, 0.95);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.upcoming-sidebar {
  display: grid;
  gap: 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 227, 208, 0.45));
}

.sidebar-widget {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(229, 234, 241, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-tight);
}

.sidebar-widget-heading {
  display: grid;
  gap: 2px;
}

.sidebar-widget-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.2;
}

.today-widget,
.today-event-card {
  border-color: rgba(201, 168, 106, 0.28);
  background:
    linear-gradient(135deg, rgba(201, 168, 106, 0.18), rgba(255, 255, 255, 0.96) 56%),
    #ffffff;
}

.upcoming-sidebar > .sidebar-widget:not(#today-events-widget):not(.legend-accordion) {
  border-color: rgba(175, 199, 213, 0.34);
  background:
    linear-gradient(135deg, rgba(175, 199, 213, 0.15), transparent 50%),
    rgba(255, 255, 255, 0.96);
}

.upcoming-card,
.today-event-card {
  position: relative;
  width: 100%;
  display: grid;
  gap: 6px;
  overflow: hidden;
  padding: 14px;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.upcoming-card::before,
.today-event-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--sky);
}

.today-event-card::before {
  background: var(--gold);
}

.upcoming-card:hover,
.today-event-card:hover {
  border-color: rgba(201, 123, 99, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(201, 123, 99, 0.08);
}

.today-badge,
.upcoming-date {
  width: max-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.upcoming-date {
  background: var(--sky-soft);
  color: #335466 !important;
}

.today-badge {
  background: var(--gold-soft);
  color: #725518 !important;
}

.today-event-card strong,
.upcoming-card strong,
.empty-upcoming strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.28;
}

.today-event-card span,
.upcoming-card span,
.empty-upcoming span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.today-event-card em,
.upcoming-card em {
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 700;
}

.empty-upcoming {
  background:
    linear-gradient(135deg, rgba(200, 143, 138, 0.12), transparent 52%),
    #ffffff;
}

.legend-accordion {
  padding: 0;
  overflow: hidden;
  border-color: rgba(184, 177, 217, 0.3);
  background:
    linear-gradient(135deg, rgba(184, 177, 217, 0.13), transparent 48%),
    rgba(255, 255, 255, 0.96);
}

.legend-accordion summary {
  list-style: none;
}

.legend-accordion summary::-webkit-details-marker {
  display: none;
}

.legend-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
}

.legend-summary span {
  display: grid;
  gap: 2px;
}

.legend-summary strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.legend-summary .eyebrow {
  margin: 0;
}

.legend-chevron {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.legend-accordion[open] .legend-chevron {
  transform: rotate(225deg);
}

.legend-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  opacity: 0;
  transition:
    max-height 240ms ease,
    opacity 180ms ease,
    padding 240ms ease;
}

.legend-accordion[open] .legend-content {
  max-height: 360px;
  padding: 0 16px 16px;
  opacity: 1;
}

.calendar-legend {
  display: grid;
  justify-content: stretch;
  gap: 8px;
  margin: 0;
}

.calendar-legend span {
  min-height: 34px;
  justify-content: flex-start;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: #344054;
  font-size: 0.88rem;
}

.calendar-legend span:nth-child(1) {
  background: rgba(227, 239, 211, 0.7);
}

.calendar-legend span:nth-child(2) {
  background: rgba(175, 199, 213, 0.26);
}

.calendar-legend span:nth-child(3) {
  background: rgba(201, 168, 106, 0.24);
}

.calendar-legend span:nth-child(4) {
  background: rgba(13, 43, 29, 0.08);
}

.calendar-legend span:nth-child(5) {
  background: rgba(184, 177, 217, 0.26);
}

.calendar-panel {
  background: #ffffff;
}

.calendar-toolbar {
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
}

.calendar-toolbar .icon-button,
.calendar-toolbar .today-button,
.month-selectors select {
  min-height: 44px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-tight);
}

.month-selectors {
  width: min(380px, 100%);
}

.weekday {
  color: #667085;
  font-size: 0.86rem;
}

.day-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.date-status-dots {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 24px;
}

.status-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  background: var(--status-free);
  box-shadow:
    0 0 0 3px rgba(38, 51, 45, 0.035),
    0 2px 7px rgba(38, 51, 45, 0.18);
}

.status-dot--free {
  background: var(--status-free);
}

.status-dot--reserved {
  background: var(--status-reserved);
  box-shadow:
    0 0 0 3px rgba(175, 199, 213, 0.28),
    0 2px 7px rgba(38, 51, 45, 0.16);
}

.status-dot--today {
  background: var(--status-today);
  box-shadow:
    0 0 0 3px rgba(201, 168, 106, 0.28),
    0 2px 7px rgba(38, 51, 45, 0.16);
}

.status-dot--mine {
  background: var(--status-mine);
}

.status-dot--other {
  background: var(--status-other);
  box-shadow:
    0 0 0 3px rgba(184, 177, 217, 0.3),
    0 2px 7px rgba(38, 51, 45, 0.16);
}

.status-dot--secondary {
  width: 8px;
  height: 8px;
  opacity: 0.95;
}

.day-cell {
  border-color: rgba(229, 234, 241, 0.95);
  background: linear-gradient(180deg, #ffffff, #fbf6ec);
  box-shadow: 0 8px 18px rgba(38, 51, 45, 0.055);
}

.day-cell:hover {
  border-color: rgba(201, 123, 99, 0.42);
  background: linear-gradient(180deg, #ffffff, #f8ecdf);
  box-shadow: 0 15px 30px rgba(201, 123, 99, 0.11);
}

.day-cell.is-empty {
  background: linear-gradient(180deg, #ffffff, #f6efe4);
}

.day-cell.is-reserved {
  border-color: rgba(175, 199, 213, 0.82);
  background: linear-gradient(180deg, #ffffff, var(--reserved-soft));
}

.day-cell.is-own {
  border-color: rgba(13, 43, 29, 0.46);
  background: linear-gradient(180deg, #ffffff, var(--own-soft));
}

.day-cell.is-selected {
  border-color: var(--sun);
  outline: 3px solid rgba(201, 168, 106, 0.28);
}

.day-number {
  color: var(--accent-dark);
  background: #eee6d8;
}

.day-cell.is-today .day-number {
  background: linear-gradient(135deg, #d9bd7d, var(--gold));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(201, 168, 106, 0.26);
}

.day-cell.is-reserved:not(.is-own) .day-number {
  color: #294b5a;
  background: var(--sky-soft);
}

.day-cell.is-own .day-number {
  color: #ffffff;
  background: var(--own);
}

.day-free {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.event-thumb,
.detail-hero,
.flyer-preview,
tr {
  border-color: var(--line);
}

.detail-hero,
.profile-preview {
  background: linear-gradient(135deg, #fffaf0, #edf5f8 54%, #f4eadf);
}

.count-pill,
.status-pill.approved {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill.pending {
  background: var(--sun-soft);
  color: #725518;
}

.toast {
  background: var(--topbar);
}

.modal-backdrop {
  background: rgba(13, 43, 29, 0.5);
}

.public-lock-message {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-context {
    justify-items: start;
    width: 100%;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .upcoming-sidebar {
    position: static;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: static;
  }

  .topbar-inner {
    min-height: 60px;
    padding: 8px 16px;
  }

  .workspace {
    padding: 22px 18px 30px;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 54px;
  }

  .topbar::after {
    bottom: -18px;
    height: 18px;
  }

  .topbar-inner {
    min-height: 54px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
  }

  .app-logo {
    width: 32px;
    height: 32px;
  }

  .app-title {
    font-size: 0.9rem;
  }

  .topbar-subtitle,
  .topbar-context {
    display: none;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
  }

  .topbar .user-chip {
    max-width: 116px;
    min-height: 34px;
    padding: 5px 7px;
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .user-chip img {
    width: 24px;
    height: 24px;
  }

  .topbar .ghost-button,
  .topbar .primary-button {
    min-height: 34px;
    width: auto;
    padding: 0 9px;
    font-size: 0.76rem;
  }

  .topbar .public-auth-actions {
    gap: 6px;
  }

  .calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 12px;
  }

  #previous-month,
  #next-month,
  .month-selectors {
    display: none;
  }

  .calendar-toolbar .today-button {
    width: 100%;
  }

  .mobile-month-label {
    margin-bottom: 12px;
  }

  .workspace {
    padding: 14px 12px 26px;
  }

  .upcoming-sidebar {
    display: contents;
  }

  #today-events-widget {
    order: 1;
  }

  .upcoming-sidebar > .sidebar-widget:not(#today-events-widget):not(.legend-accordion) {
    order: 2;
  }

  .calendar-main {
    order: 3;
  }

  .legend-accordion {
    order: 4;
  }

  .sidebar-widget {
    padding: 13px;
  }

  .legend-summary {
    padding: 13px;
  }

  .legend-accordion[open] .legend-content {
    padding: 0 13px 13px;
  }
}
