:root {
  --blue: #1299e7;
  --blue-dark: #0874c6;
  --ink: #17131d;
  --cream: #fffaf0;
  --yellow: #f2f700;
  --pink: #f655a7;
  --purple: #7e45bd;
  --line: rgba(23, 19, 29, .15);
  --muted: #68616d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f5f1e8; color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.admin-header { min-height: 78px; padding: 14px clamp(20px, 5vw, 70px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--blue); color: white; border-bottom: 2px solid var(--ink); }
.admin-header > div { display: flex; align-items: center; gap: 12px; }
.admin-brand { display: flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 900; letter-spacing: .16em; }
.admin-brand span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 23px; }
.view-site, .logout-form button { min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.65); border-radius: 100px; background: transparent; color: white; text-decoration: none; font-size: 12px; font-weight: 800; cursor: pointer; }
.logout-form { margin: 0; }

.admin-shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: clamp(55px, 7vw, 100px) 0; }
.auth-shell { min-height: calc(100vh - 150px); display: grid; align-content: center; }
.kicker { margin: 0 0 13px; color: var(--purple); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-size: clamp(46px, 6vw, 86px); line-height: .92; letter-spacing: -.06em; text-transform: uppercase; }
h2 { margin-bottom: 0; font-size: clamp(30px, 3vw, 46px); line-height: 1; letter-spacing: -.045em; }

.notice { max-width: 760px; margin: 0 auto 24px; padding: 17px 20px; border: 1px solid; border-radius: 14px; line-height: 1.5; }
.notice ul { margin: 8px 0 0; padding-left: 21px; }
.notice-error { border-color: #c93169; background: #ffe6f1; color: #6b1638; }
.notice-success { border-color: #317b39; background: #e4f9e6; color: #174c1d; }
.notice-warning { border-color: #b78b17; background: #fff7d1; color: #655014; }

.auth-card { width: min(620px, 100%); margin: auto; padding: clamp(30px, 6vw, 64px); background: white; border: 1px solid var(--line); border-radius: 26px; box-shadow: 14px 14px 0 var(--yellow); }
.auth-card > p:not(.kicker, .security-note) { max-width: 480px; color: var(--muted); line-height: 1.7; }
.auth-form { margin-top: 34px; display: grid; gap: 20px; }
label { display: grid; gap: 8px; color: #37313b; font-size: 13px; font-weight: 800; }
label small { color: #8b838f; font-size: 10px; font-weight: 600; }
input, textarea { width: 100%; min-height: 50px; padding: 13px 14px; border: 1px solid #cbc5ce; border-radius: 10px; background: white; color: var(--ink); outline: 0; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,153,231,.17); }
.primary-button { min-height: 52px; padding: 0 20px; border: 2px solid var(--ink); border-radius: 10px; background: var(--yellow); color: var(--ink); font-weight: 900; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); }
.primary-button:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.security-note { margin: 25px 0 0; color: #817986; font-size: 12px; line-height: 1.6; }

.dashboard-intro { margin-bottom: 58px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 50px; }
.dashboard-intro > div:first-child > p:last-child { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.stats { display: flex; border: 1px solid var(--line); border-radius: 18px; background: white; }
.stats div { min-width: 120px; padding: 22px; display: grid; gap: 4px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats strong { font-size: 34px; }
.stats span { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 9px; font-weight: 900; }

.dashboard-nav { margin: -25px 0 34px; display: flex; flex-wrap: wrap; gap: 9px; }
.dashboard-nav a { padding: 10px 14px; border: 1px solid var(--line); border-radius: 100px; background: white; color: var(--blue-dark); text-decoration: none; font-size: 11px; font-weight: 900; }
.dashboard-nav a:hover { border-color: var(--blue); }

.dashboard-grid { display: grid; grid-template-columns: minmax(420px, .82fr) minmax(500px, 1.18fr); gap: 28px; align-items: start; }
.panel { padding: clamp(24px, 3vw, 40px); background: white; border: 1px solid var(--line); border-radius: 22px; scroll-margin-top: 20px; }
.panel-heading { margin-bottom: 32px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading a { color: var(--purple); font-size: 12px; font-weight: 800; }
.event-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.full-field { grid-column: 1 / -1; }
.checkbox-field { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.checkbox-field input { width: 19px; min-height: 19px; margin: 1px 0 0; accent-color: var(--purple); }
.checkbox-field span { display: grid; gap: 3px; }
.upload-field { display: grid; gap: 8px; }
input[type="file"] { padding: 10px; background: #fffcf6; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 9px 12px; border: 1px solid var(--ink); border-radius: 7px; background: var(--yellow); color: var(--ink); font-weight: 900; cursor: pointer; }
.file-selection { color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.5; }
.file-selection.is-error { color: #a42a55; font-weight: 900; }
.current-poster { margin-top: 8px; display: grid; grid-template-columns: 108px 1fr; gap: 14px; align-items: center; }
.current-poster > a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #eee; }
.current-poster img { width: 100%; aspect-ratio: 3 / 4; display: block; object-fit: cover; }

.admin-events { display: grid; gap: 12px; }
.admin-event { padding: 18px; display: grid; grid-template-columns: 70px 1fr auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fffcf6; }
.admin-event.is-past { opacity: .62; }
.admin-event-date { width: 64px; height: 68px; display: grid; place-content: center; text-align: center; border-radius: 10px; background: var(--blue); color: white; }
.admin-event-date strong { font-size: 27px; line-height: 1; }
.admin-event-date span { margin-top: 4px; color: var(--yellow); font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.admin-event-info { min-width: 0; }
.admin-event-info h3 { margin: 8px 0 6px; font-size: 20px; }
.admin-event-info p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status-row { display: flex; flex-wrap: wrap; gap: 5px; }
.status { padding: 4px 7px; border-radius: 100px; text-transform: uppercase; letter-spacing: .08em; font-size: 8px; font-weight: 900; }
.status.published { background: #dcf8df; color: #206d2a; }
.status.draft { background: #eee8f3; color: #63407d; }
.status.past { background: #ececec; color: #5d5d5d; }
.status.poster { background: #fff9b9; color: #6c6400; }
.status.kind { background: #dff2ff; color: #12649a; }
.status.optimized { background: #dcf8df; color: #206d2a; }
.admin-event-actions { display: grid; justify-items: end; gap: 8px; }
.admin-event-actions a, .admin-event-actions button { border: 0; background: none; color: var(--blue-dark); font-size: 11px; font-weight: 900; cursor: pointer; text-decoration: underline; }
.admin-event-actions button { color: #a42a55; padding: 0; }
.empty-state { min-height: 360px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state > span { width: 70px; height: 70px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 35px; }
.empty-state h3 { margin-bottom: 8px; color: var(--ink); }

.media-manager { margin-top: 28px; }
.media-heading p:last-child { max-width: 650px; margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.optimize-form { margin: 0; }
.optimize-form button { min-height: 43px; padding: 0 15px; border: 1px solid var(--ink); border-radius: 100px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.media-add-grid { margin-bottom: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.media-upload-form { margin: 0; padding: 24px; display: grid; grid-template-columns: 1fr; gap: 18px; align-content: start; border: 1px solid var(--line); border-radius: 16px; background: #fffcf6; }
.youtube-add-form { background: #f4edff; }
.form-title { display: flex; align-items: center; gap: 12px; }
.form-title > span { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: white; font-size: 10px; font-weight: 900; }
.youtube-add-form .form-title > span { background: var(--purple); }
.form-title > div { display: grid; gap: 3px; }
.form-title strong { font-size: 16px; }
.form-title small { color: var(--muted); font-size: 10px; }
.media-upload-form .primary-button { height: 50px; }
.upload-progress { padding: 15px; display: grid; gap: 10px; border: 1px solid #9bcce9; border-radius: 13px; background: #f3fbff; }
.upload-progress[hidden] { display: none; }
.upload-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upload-progress-heading strong { font-size: 12px; line-height: 1.4; }
.upload-progress-heading span { flex: 0 0 auto; color: var(--blue-dark); font-size: 11px; font-weight: 900; }
.upload-progress-track { height: 12px; overflow: hidden; border: 1px solid #85b8d8; border-radius: 100px; background: #dceff9; }
.upload-progress-track > span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue-dark), var(--blue)); transition: width .18s ease; }
.upload-progress p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.upload-progress.is-processing { border-color: #d5b45d; background: #fff9dc; }
.upload-progress.is-processing .upload-progress-heading span { color: #775b0d; }
.upload-progress.is-processing .upload-progress-track { border-color: #d5b45d; background: #f1e4ac; }
.upload-progress.is-processing .upload-progress-track > span { width: 100% !important; background: repeating-linear-gradient(115deg, #f1c928 0, #f1c928 16px, #ffe874 16px, #ffe874 32px); background-size: 64px 100%; animation: upload-processing .8s linear infinite; }
.upload-progress.is-success { border-color: #81c68a; background: #f0fff2; }
.upload-progress.is-success .upload-progress-track { border-color: #81c68a; background: #d9f4dd; }
.upload-progress.is-success .upload-progress-track > span { background: #36a64a; }
.upload-progress.is-error { border-color: #d7778f; background: #fff2f6; }
.upload-progress.is-error .upload-progress-heading span { color: #9c2450; }
.upload-progress.is-error .upload-progress-track { border-color: #d7778f; background: #f8dce4; }
.upload-progress.is-error .upload-progress-track > span { background: #b63160; }
@keyframes upload-processing { to { background-position: 64px 0; } }
@media (prefers-reduced-motion: reduce) { .upload-progress-track > span { transition: none; } .upload-progress.is-processing .upload-progress-track > span { animation: none; } }
.active-upload-limit { margin: 0 0 34px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.admin-media-card { min-width: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--line); border-radius: 16px; background: #fffcf6; }
.admin-media-preview { min-height: 210px; display: grid; place-items: center; overflow: hidden; background: #17131d; }
.admin-media-preview a { width: 100%; height: 100%; display: block; }
.admin-media-preview img, .admin-media-preview video { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.admin-media-preview video { object-fit: contain; }
.admin-youtube-preview { position: relative; }
.admin-youtube-preview span { position: absolute; left: 50%; top: 50%; width: 60px; height: 44px; display: grid; place-items: center; transform: translate(-50%, -50%); border-radius: 12px; background: #ff0033; color: white; box-shadow: 0 8px 24px rgba(0,0,0,.3); text-indent: 3px; }
.missing-file { color: white; font-size: 12px; font-weight: 900; }
.admin-media-copy { padding: 17px; }
.admin-media-copy p { margin: 13px 0 8px; line-height: 1.5; }
.admin-media-copy small { color: var(--muted); }
.admin-media-actions { padding: 0 17px 17px; display: flex; flex-wrap: wrap; gap: 9px; }
.admin-media-actions form { margin: 0; }
.admin-media-actions button { padding: 8px 11px; border: 1px solid var(--blue-dark); border-radius: 100px; background: white; color: var(--blue-dark); font-size: 10px; font-weight: 900; cursor: pointer; }
.admin-media-actions .danger-action { border-color: #b63160; color: #9c2450; }
.media-empty { min-height: 240px; }

.admin-footer { padding: 25px clamp(20px, 5vw, 70px); display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.admin-footer p { margin: 0; }

a:focus-visible, button:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

@media (max-width: 1080px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .event-form-panel { order: 1; }
  .event-overview { order: 2; }
  .admin-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-add-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .admin-header { align-items: flex-start; }
  .admin-header > div { align-items: flex-end; flex-direction: column; }
  .view-site, .logout-form button { min-height: 34px; padding: 0 10px; font-size: 10px; }
  .admin-shell { width: min(100% - 24px, 1480px); padding: 40px 0; }
  .dashboard-intro { grid-template-columns: 1fr; gap: 24px; }
  .stats { width: 100%; }
  .stats div { min-width: 0; flex: 1; padding: 16px 8px; }
  .stats strong { font-size: 27px; }
  .panel { padding: 22px 16px; }
  .event-form { grid-template-columns: 1fr; }
  .event-form > * { grid-column: 1; }
  .admin-event { grid-template-columns: 56px 1fr; gap: 12px; }
  .admin-event-date { width: 54px; height: 61px; }
  .admin-event-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 18px; }
  .current-poster { grid-template-columns: 82px 1fr; }
  .media-heading { align-items: stretch; flex-direction: column; }
  .optimize-form button { width: 100%; }
  .media-upload-form { padding: 17px; }
  .admin-media-grid { grid-template-columns: 1fr; }
  .admin-footer { align-items: flex-start; flex-direction: column; }
}
