:root {
  --ink: #272727;
  --ink-soft: #343434;
  --gold: #c3ac5f;
  --gold-soft: rgba(195, 172, 95, 0.16);
  --paper: #f5f6f8;
  --white: #ffffff;
  --text: #272727;
  --text-on-dark: #e9eef8;
  --muted: #747474;
  --muted-on-dark: #aab6d1;
  --line: #e5e1d5;
  --danger: #a84242;
  --ok: #39745a;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.badge.access-area {
  border-color: rgba(195, 172, 95, 0.45);
  background: rgba(195, 172, 95, 0.12);
  color: #6f5d20;
}

.options-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.options-layout > section {
  min-width: 0;
}

.options-groups {
  position: sticky;
  top: 112px;
}

.options-groups > p {
  margin: 4px 0 18px;
  color: var(--muted);
}

.options-groups nav {
  display: grid;
  gap: 6px;
}

.options-groups nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.options-groups nav a:hover,
.options-groups nav a.active {
  border-color: rgba(195, 172, 95, 0.42);
  background: rgba(195, 172, 95, 0.1);
}

.options-groups nav small {
  color: var(--muted);
  white-space: nowrap;
}

.option-help {
  margin: 16px 0;
}

.option-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 82px auto;
  gap: 8px;
  align-items: center;
  min-width: 390px;
}

.option-inline-form input {
  min-width: 0;
}

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

.option-create-form .btn {
  margin-bottom: 1px;
}

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

  .options-groups {
    position: static;
  }

  .options-groups nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .options-groups nav,
  .option-create-form {
    grid-template-columns: 1fr;
  }

  .option-inline-form {
    grid-template-columns: minmax(180px, 1fr) 78px auto;
  }
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 14px Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
}

.app > main {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(circle at 20% 0, rgba(195, 172, 95, 0.13), transparent 34%),
    var(--ink);
  color: var(--text-on-dark);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(195, 172, 95, 0.2);
}

.brand {
  color: var(--white);
  text-decoration: none;
  display: block;
  padding: 4px 8px 21px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-brand-logo {
  width: 100%;
  max-width: 205px;
  height: auto;
  display: block;
}

.brand-context {
  display: block;
  margin-top: 11px;
  color: var(--white);
  font: 600 15px "Playfair Display", Georgia, serif;
  letter-spacing: 0.02em;
}

.brand-context small,
.sidebar-user small {
  display: block;
  color: var(--muted-on-dark);
  font: 500 10px Inter, sans-serif;
  letter-spacing: 0.09em;
  margin-top: 4px;
  text-transform: uppercase;
}

.sidebar nav {
  margin-top: 22px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar nav a {
  color: rgba(233, 238, 248, 0.78);
  text-decoration: none;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  gap: 13px;
  align-items: center;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sidebar nav a b {
  color: var(--gold);
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(195, 172, 95, 0.24);
  color: var(--white);
}

.sidebar nav a.active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-user {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user > span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #211d10;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.sidebar-user div {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user a {
  color: var(--muted-on-dark);
  text-decoration: none;
  font-size: 20px;
}

.sidebar-user a:hover {
  color: var(--gold);
}

.topbar {
  min-height: 92px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 18px rgba(39, 39, 39, 0.035);
  display: flex;
  align-items: center;
  padding: 18px 32px;
  gap: 18px;
}

.topbar h1 {
  color: var(--ink);
  font: 700 27px "Playfair Display", Georgia, serif;
  line-height: 1.15;
  margin: 0;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.menu {
  display: none;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.clock {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.bell {
  position: relative;
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
  text-decoration: none;
}

.bell:hover {
  color: var(--gold);
}

.bell i {
  position: absolute;
  right: -7px;
  top: -5px;
  background: var(--gold);
  color: #211d10;
  font: 700 10px Inter, sans-serif;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 3px var(--white);
}

.content {
  width: 100%;
  max-width: 1500px;
  padding: 30px 32px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat,
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 21px;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
}

.stat small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat strong {
  color: var(--ink);
  font: 700 27px "Playfair Display", Georgia, serif;
  display: block;
  margin-top: 10px;
}

.stat em {
  font-style: normal;
  color: var(--ok);
  font-size: 11px;
}

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

.card {
  padding: 22px;
  margin-bottom: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card h2 {
  color: var(--ink);
  font: 700 19px "Playfair Display", Georgia, serif;
  margin: 0;
}

.btn {
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--gold);
  color: #1a1406;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--ink);
  color: var(--white);
}

.btn.secondary:hover {
  background: var(--ink-soft);
}

.btn.ghost {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.btn.danger {
  background: #f2dede;
  border-color: #eacbcb;
  color: var(--danger);
}

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

th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 13px 10px;
  border-bottom: 1px solid #eeeeee;
}

tr:last-child td {
  border: 0;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  background: #eeeeee;
  font-size: 11px;
}

.badge.ok {
  background: #e1f0e8;
  color: var(--ok);
}

.badge.warn {
  background: #f5edd2;
  color: #806b26;
}

.badge.danger {
  background: #f3dede;
  color: var(--danger);
}

.bar {
  height: 7px;
  background: #eeeeee;
  border-radius: 9px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--gold);
}

.empty {
  padding: 35px;
  text-align: center;
  color: var(--muted);
}

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

.actions a {
  font-size: 12px;
}

.alert {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  background: #e0efe7;
  color: var(--ok);
}

.alert.error {
  background: #f3dddd;
  color: var(--danger);
}

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

label span {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d8d4ca;
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

textarea {
  min-height: 100px;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  grid-column: span 2;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.event {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.event time {
  border-right: 2px solid var(--gold);
  font-weight: 700;
}

.event strong,
.event small {
  display: block;
}

.event small {
  color: var(--muted);
  margin-top: 3px;
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
}

.login-art {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(39, 39, 39, 0.9), rgba(17, 17, 17, 0.96)),
    url("img/hero.jpg") center / cover;
  display: grid;
  place-items: center;
  color: var(--white);
  padding: 70px;
}

.login-art::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(700px 420px at 20% 20%, rgba(195, 172, 95, 0.18), transparent 58%);
  pointer-events: none;
}

.login-art-content {
  width: 100%;
  max-width: 590px;
}

.login-brand {
  display: block;
  width: min(100%, 360px);
  margin-bottom: 52px;
}

.login-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.login-kicker,
.form-kicker {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-art h1 {
  font: 700 clamp(38px, 4vw, 54px) / 1.12 "Playfair Display", Georgia, serif;
  margin: 17px 0;
}

.login-art p {
  max-width: 530px;
  color: rgba(233, 238, 248, 0.78);
  font-size: 16px;
  line-height: 1.75;
}

.login-box {
  background: var(--white);
  display: grid;
  place-items: center;
  padding: 48px;
}

.login-box form {
  width: 100%;
  max-width: 390px;
}

.login-box h2 {
  color: var(--ink);
  font: 700 34px "Playfair Display", Georgia, serif;
  margin: 10px 0 8px;
}

.login-box p {
  color: var(--muted);
  margin: 0 0 30px;
}

.login-box label {
  display: block;
  margin-bottom: 17px;
}

.login-box .btn {
  width: 100%;
  margin-top: 8px;
  padding-block: 12px;
}

.hint {
  background: rgba(195, 172, 95, 0.13);
  border: 1px solid rgba(195, 172, 95, 0.25);
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-top: 20px;
}

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

.search input {
  max-width: 300px;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 7px;
}

.form-section-title {
  grid-column: span 2;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 12px;
}

.form-section-title h3 {
  margin: 0;
  color: var(--ink);
  font: 700 22px "Playfair Display", Georgia, serif;
}

.form-section-title small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}

.landing-image-setting {
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}

.landing-image-setting > label {
  display: block;
  margin-bottom: 12px;
}

.cover-preview {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.cover-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 9px;
  background: var(--ink);
}

.cover-preview.portrait-preview {
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
}

.cover-preview.portrait-preview img {
  aspect-ratio: 4 / 5;
  object-position: center 15%;
}

.cover-preview b,
.cover-preview small {
  display: block;
}

.cover-preview b {
  color: var(--ink);
  font: 700 18px "Playfair Display", Georgia, serif;
}

.cover-preview small {
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.6;
}

.pagination-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.paginator {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.paginator_item {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  font-weight: 600;
}

a.paginator_item:hover,
.paginator_active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1406;
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 10px;
  }

  .brand {
    padding-inline: 4px;
  }

  .app-brand-logo {
    width: 64px;
    margin: auto;
  }

  .brand-context,
  .sidebar nav span,
  .sidebar-user div,
  .sidebar-user a {
    display: none;
  }

  .sidebar nav a {
    justify-content: center;
  }

  .sidebar-user {
    justify-content: center;
  }

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

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 24px;
  }

  .topbar {
    padding-inline: 24px;
  }
}

@media (max-width: 760px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    left: -276px;
    width: 276px;
    padding: 24px 18px;
    transition: left 0.2s ease;
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.28);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar .brand-context,
  .sidebar nav span,
  .sidebar-user div,
  .sidebar-user a {
    display: block;
  }

  .sidebar .app-brand-logo {
    width: 100%;
    max-width: 205px;
    margin: 0;
  }

  .sidebar nav a {
    justify-content: flex-start;
  }

  .sidebar-user {
    justify-content: flex-start;
  }

  .menu {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-size: 20px;
    cursor: pointer;
  }

  .topbar {
    min-height: 76px;
    padding: 14px 16px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar p,
  .clock {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .card-head,
  .search {
    align-items: stretch;
    flex-direction: column;
  }

  .search input {
    max-width: none;
  }

  .login {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: auto;
    padding: 27px 24px;
    place-items: start;
  }

  .login-brand {
    width: min(100%, 270px);
    margin: 0;
  }

  .login-kicker,
  .login-art h1,
  .login-art p {
    display: none;
  }

  .login-box {
    min-height: calc(100vh - 126px);
    padding: 32px 24px;
  }

  form.grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .form-actions,
  .form-section-title {
    grid-column: auto;
  }

  .card {
    overflow-x: auto;
  }

  .cover-preview {
    grid-template-columns: 1fr;
  }

  .cover-preview.portrait-preview {
    grid-template-columns: 1fr;
  }
}
