@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f3ee;
  --paper: #fffdf9;
  --paper-soft: #fff8ef;
  --ink: #251f1b;
  --muted: #756b62;
  --line: #e6ded5;
  --wine: #7b1f1f;
  --wine-dark: #5f1717;
  --taupe: #6b625b;
  --danger: #9b2226;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Manrope, system-ui, -apple-system, Segoe UI, sans-serif;
  background: radial-gradient(circle at top left, #fff7ed 0, var(--bg) 34%, #eee7dd 100%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

h1,
h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  letter-spacing: .01em;
  color: #221b17;
}

h1 {
  font-size: 46px;
  line-height: 1;
  margin: 0 0 24px;
  font-weight: 700;
}

h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 14px;
  font-weight: 700;
}

a {
  color: var(--wine);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--wine-dark);
}

header {
  background: linear-gradient(135deg, #251f1b, #3a2821);
  color: white;
  padding: 18px 24px;
  display: flex;
  gap: 15px;
  align-items: center;
  box-shadow: 0 10px 28px #00000018;
}

header strong {
  font-size: 18px;
  letter-spacing: .02em;
}

header span {
  color: #e9d7c3;
}

.logo {
  width: 58px;
  height: 58px;
  max-width: 58px;
  max-height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: #fffaf4cc;
  padding: 12px 24px;
  box-shadow: 0 1px 10px #00000012;
  backdrop-filter: blur(10px);
}

nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: #4b3830;
}

nav a:hover {
  background: #f0e7dc;
  color: var(--wine);
}

nav form {
  margin-left: auto;
}

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

.nav-actions form {
  margin: 0;
}

.reload-button {
  background: linear-gradient(135deg, #dfbb79, #b7864b);
  color: #281e16;
}

.reload-button:hover {
  background: linear-gradient(135deg, #c99b5d, #a2733e);
  color: #281e16;
}

main {
  max-width: 1180px;
  margin: 30px auto;
  padding: 0 20px;
}

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

.card {
  background: var(--paper);
  border: 1px solid #ede4da;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 14px 34px #3a261414;
  margin-bottom: 18px;
}

.dashboard-card {
  position: relative;
  min-height: 260px;
  padding: 0;
  overflow: hidden;
  color: white;
  background: #251f1b center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  border: 0;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #00000010 0%, #0000008c 70%, #000000dc 100%);
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px #00000038;
  filter: saturate(1.05);
}

.dashboard-card-content {
  position: relative;
  padding: 24px;
  width: 100%;
}

.dashboard-card h2 {
  font-size: 38px;
  line-height: .98;
  margin: 0 0 10px;
  color: white;
  text-shadow: 0 2px 14px #000c;
}

.dashboard-card p {
  margin: 0;
  color: #fff4e8;
  font-size: 18px;
  text-shadow: 0 1px 8px #000c;
}

.dashboard-card span {
  display: inline-block;
  margin-top: 16px;
  color: #fff;
  background: #ffffff24;
  border: 1px solid #ffffff4d;
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.login-logo {
  display: block;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 24px;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  border: 1px solid #ede4da;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 26px #3a26140f;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #eee4d8;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f4ece2;
  color: #59483f;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
}

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

tr:hover td {
  background: #fff8f0;
}

label {
  font-weight: 700;
  color: #3b302a;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 13px;
  border: 1px solid #d8ccbf;
  border-radius: 14px;
  font: inherit;
  background: #fffdf9;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 4px #7b1f1f1a;
  background: white;
}

textarea {
  min-height: 120px;
}

input[type=file] {
  background: white;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  min-height: 42px;
  padding: 10px 17px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--wine), #8d2b2b);
  color: white;
  cursor: pointer;
  font: 700 14px/1 Manrope, system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 9px 18px #7b1f1f24;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px #7b1f1f30;
  color: white;
  background: linear-gradient(135deg, var(--wine-dark), var(--wine));
}

button:active,
.button:active {
  transform: translateY(0);
}

.secondary {
  background: linear-gradient(135deg, #756b62, #5c534c);
  box-shadow: 0 9px 18px #4b403824;
}

.secondary:hover {
  background: linear-gradient(135deg, #5c534c, #4b433d);
}

.danger {
  background: linear-gradient(135deg, var(--danger), #7f1d22);
  box-shadow: 0 9px 18px #9b222626;
}

.danger:hover {
  background: linear-gradient(135deg, #7f1d22, #68181c);
}

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

.actions form {
  display: inline-flex;
  margin: 0;
}

.actions button,
.actions .button {
  flex: 0 0 auto;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 22px;
}

.page-actions form {
  display: inline-flex;
  margin: 0;
}

.page-actions button,
.page-actions .button {
  min-width: 0;
  padding-left: 17px;
  padding-right: 17px;
}

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

.table .actions form,
.table td > form,
.table .actions button,
.table .actions .button,
.table td > form > button {
  width: auto;
  max-width: max-content;
}

.table .actions button,
.table .actions .button,
.table td > form > button {
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: none;
}

.table td > form {
  display: inline-flex;
  margin: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.checkbox {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 8px 0;
  font-weight: 600;
}

.checkbox input {
  width: auto;
  margin-top: 0;
  accent-color: var(--wine);
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

.actor-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 9px;
  align-items: center;
  margin-bottom: 9px;
}

.actor-line button,
#cast-table button,
.row > div > button.secondary {
  width: fit-content;
  max-width: max-content;
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: none;
  justify-self: start;
}

.actor-line input {
  min-width: 0;
}

#cast-table td {
  vertical-align: top;
}

#cast-table [data-actors] {
  margin-bottom: 9px;
}

#cast-table .actor-line:last-child {
  margin-bottom: 0;
}

@media (min-width: 721px) {
  #cast-table td:nth-child(2) {
    padding-right: 0;
  }

  #cast-table td:last-child {
    padding-left: 9px;
  }

  #cast-table .actor-line button,
  #cast-table td:last-child > button {
    margin-top: 12px;
  }

  #cast-table .actor-line button {
    align-self: start;
  }

  #cast-table td:last-child > button {
    display: flex;
  }
}

.error {
  background: #ffe9e6;
  color: #7a1111;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid #ffc9c1;
  font-weight: 700;
}

.success {
  background: #e9f7e8;
  color: #145214;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid #c9eac5;
  font-weight: 700;
}

img.poster {
  max-width: 170px;
  border-radius: 14px;
  box-shadow: 0 10px 24px #00000018;
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-card {
    min-height: 230px;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 38px;
  }

  .cards,
  .row,
  .row-3 {
    grid-template-columns: 1fr;
  }

  nav form,
  .nav-actions {
    margin-left: 0;
  }

  th,
  td {
    display: block;
  }

  .dashboard-card {
    min-height: 190px;
  }

  .login-logo {
    width: 200px;
    height: 200px;
  }

  .table .actions {
    flex-wrap: wrap;
  }
}
