:root {
  --navy: #0b1220;
  --navy-2: #121a2b;
  --navy-3: #1a2438;
  --ink: #122033;
  --muted: #5b6b82;
  --bg: #e9eef6;
  --panel: #ffffff;
  --line: #d5deea;
  --accent: #e11d48;
  --accent-hover: #be123c;
  --accent-soft: #ffe4ea;
  --gold: #d97706;
  --blue: #1d4ed8;
  --ok: #15803d;
  --danger: #b91c1c;
  --menu-text: #dbe4f3;
  --menu-muted: #93a4bf;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body.wp-admin {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

#wpadminbar {
  position: sticky; top: 0; z-index: 50;
  height: 36px;
  background: linear-gradient(90deg, #07090f, var(--navy) 40%, #1a1020);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; font-size: 13px;
  border-bottom: 2px solid var(--accent);
}
#wpadminbar a, #wpadminbar span, #wpadminbar button { color: #fff; }
#wpadminbar .ab-left { display: flex; align-items: center; gap: 16px; }
#wpadminbar .ab-site { font-weight: 800; letter-spacing: 0.04em; }
#wpadminbar .ab-right { display: flex; align-items: center; gap: 14px; }
#wpadminbar button {
  background: var(--accent); border: 0; cursor: pointer; font: inherit;
  padding: 4px 10px; border-radius: 999px; font-weight: 700;
}
#wpadminbar button:hover { background: var(--accent-hover); }
#wpadminbar .ab-purge button {
  background: var(--gold); color: #fff; letter-spacing: 0.02em;
}
#wpadminbar .ab-purge button:hover { background: #b45309; }

#wpwrap { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 36px); }
#adminmenumain {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--menu-text);
  border-right: 1px solid #243049;
}
.menu-logo {
  display: block; padding: 18px 16px 14px;
  font-weight: 800; font-size: 20px; color: #fff; letter-spacing: 0.03em;
}
.menu-logo span { color: var(--accent); }
#adminmenu { list-style: none; margin: 0; padding: 8px 0 24px; }
#adminmenu li > a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; color: var(--menu-text); font-weight: 600;
  border-left: 3px solid transparent;
}
#adminmenu li.is-active > a {
  background: var(--navy-3); color: #fff; border-left-color: var(--accent);
}
#adminmenu li > a:hover { background: #1c2740; color: #fff; }
#adminmenu .dashicons { font-size: 18px; width: 18px; height: 18px; color: var(--accent); }
.wp-submenu { list-style: none; margin: 0; padding: 0 0 8px; background: #0a101c; display: none; }
#adminmenu li.wp-has-submenu.is-active .wp-submenu,
#adminmenu li.wp-has-submenu:hover .wp-submenu { display: block; }
.wp-submenu a { display: block; padding: 7px 16px 7px 47px; color: var(--menu-muted); font-weight: 500; }
.wp-submenu li.is-active a { color: #fff; font-weight: 700; }

#wpcontent { min-width: 0; }
#wpcontent .wrap { padding: 18px 24px 48px; }
#wpcontent h1 { font-size: 26px; font-weight: 700; margin: 0 0 18px; color: var(--ink); letter-spacing: -0.02em; }

.button, .btn, button.button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #c9d4e3; background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit;
  font-weight: 700; line-height: 1.2; min-height: 38px;
}
.button:hover { background: #f7f9fc; }
button.button-primary, a.button-primary, .button.button-primary, .button-hero, .btn {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
button.button-primary:hover, a.button-primary:hover, .button.button-primary:hover, .btn:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}
.button-hero { padding: 12px 22px; font-size: 16px; border-radius: 10px; }
.button:disabled, .btn:disabled {
  opacity: 0.7; cursor: not-allowed;
}
.btn-text { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; font-weight: 700; min-height: 0; }
.btn-text.danger { color: var(--danger); }

input, select, textarea {
  width: 100%; border: 1px solid #c5d0e0; border-radius: 8px; padding: 9px 11px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #fecdd3; border-color: var(--accent);
}
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
label { display: grid; gap: 6px; margin-bottom: 10px; font-weight: 600; color: #334155; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }

.notice { border-left: 4px solid var(--blue); background: #fff; padding: 10px 14px; margin: 0 0 16px; border-radius: 0 10px 10px 0; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.notice-success { border-left-color: var(--ok); }
.notice-error { border-left-color: var(--danger); background: #fff5f5; }
.alert { padding: 10px 14px; margin-bottom: 12px; border-radius: 8px; }
.alert.success, .notice-success p, .notice-error p { margin: 0; }
.alert.error { border-left: 4px solid var(--danger); background: #fff; }

.welcome-panel {
  background: linear-gradient(135deg, #fff 0%, #fff 58%, var(--accent-soft) 100%);
  border: 1px solid var(--line); padding: 22px 26px; margin-bottom: 22px;
  border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}
.welcome-panel h2 { margin: 0 0 6px; font-size: 24px; font-weight: 800; color: var(--navy); }
.about-description { color: var(--muted); }
.welcome-panel-column-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 16px; }
.welcome-panel-column h3 { margin: 0 0 8px; color: var(--navy); }
.welcome-panel-column ul { margin: 0; padding-left: 18px; }

.metabox-holder { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.postbox { background: var(--panel); border: 1px solid var(--line); min-width: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 24px rgba(15, 23, 42, .04); }
.postbox-header { border-bottom: 1px solid var(--line); padding: 12px 16px; background: #f8fafc; }
.postbox-header h2 { margin: 0; font-size: 15px; color: var(--navy); }
.postbox .inside { padding: 14px 16px; }
.at-a-glance, .activity-list { list-style: none; margin: 0; padding: 0; }
.at-a-glance li, .activity-list li { padding: 8px 0; border-bottom: 1px solid #eef2f7; display: flex; gap: 8px; align-items: center; }
.activity-list span, .activity-list em { color: var(--muted); }
.community-events-footer { color: var(--muted); margin-bottom: 0; }
.at-a-glance .dashicons { color: var(--accent); }

.toolbar, .inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.inline { display: inline; }
.table, .wp-list-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #e8eef6; }
.table thead { background: var(--navy); color: #fff; }
.table tbody tr:hover { background: #f8fbff; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.brand-block { margin: 0; }
.brand-preview { margin: 8px 0 0; padding: 10px; background: #0b1220; border-radius: 10px; display: inline-block; }
.brand-preview img { max-height: 56px; width: auto; display: block; }
.brand-preview-icon img { max-height: 32px; max-width: 32px; }
.post-form, .stack { display: grid; gap: 14px; max-width: 1100px; }
.form-actions-top {
  position: sticky; top: 36px; z-index: 30;
  margin: 0; padding: 8px 0;
  background: var(--bg);
}
fieldset { border: 1px solid var(--line); background: var(--panel); padding: 14px; border-radius: 12px; }
legend { font-weight: 800; padding: 0 8px; color: var(--navy); }
.check-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link-row { display: grid; grid-template-columns: 1fr 2fr 0.7fr 0.7fr; gap: 6px; margin-bottom: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media-grid figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.media-grid img { aspect-ratio: 1; object-fit: cover; width: 100%; display: block; }
.media-grid figcaption { padding: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); padding: 12px; border-radius: 12px; }
.player-example { background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px; }

.hls-box { margin-top: 8px; }
.hls-status {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.hls-status p { margin: 0 0 6px; }
.hls-status p:last-child { margin-bottom: 0; }
.hls-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  padding: 18px 18px 16px;
  margin-bottom: 18px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.tmdb-box h2 { margin: 0 0 6px; font-size: 18px; color: var(--navy); }
.tmdb-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) 180px 180px;
  gap: 12px;
  align-items: end;
}
.tmdb-action { display: grid; gap: 6px; min-width: 160px; }
.tmdb-action-label { font-weight: 600; color: var(--muted); font-size: 13px; }
.tmdb-action .button {
  width: 100%;
  min-width: 160px;
  min-height: 42px;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(225, 29, 72, .28);
}
.tmdb-preview { display: none; gap: 12px; margin-top: 12px; align-items: center; }
.tmdb-preview:not([hidden]) { display: flex; }
[hidden] { display: none !important; }
.tmdb-preview img { width: 72px; height: 108px; object-fit: cover; background: #dcdcde; border-radius: 8px; }
.meta { color: var(--muted); font-weight: 500; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; }
.page-title-action {
  margin-left: 10px;
  padding: 5px 11px;
  position: relative;
  top: -4px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  line-height: 1.5;
}
.page-title-action:hover { background: var(--accent-hover); color: #fff; }
.row-actions { color: var(--muted); font-size: 12px; visibility: hidden; }
tr:hover .row-actions { visibility: visible; }
.row-actions form { display: inline; }
.pagination { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.hls-status {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.hls-status p { margin: 0 0 6px; }
.hls-status p:last-child { margin-bottom: 0; }
.hls-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

body.login {
  background:
    radial-gradient(circle at top right, rgba(225, 29, 72, .18), transparent 36%),
    linear-gradient(180deg, #07090f, #121a2b);
  min-height: 100vh;
  display: block;
  font-family: "Segoe UI", system-ui, sans-serif;
}
#login { width: 340px; margin: 64px auto 24px; padding: 26px 0; }
#login h1 { text-align: center; margin: 0 0 24px; }
#login h1 a {
  display: block;
  width: 92px; height: 92px; margin: 0 auto;
  background: var(--navy);
  color: #fff;
  border: 3px solid var(--accent);
  border-radius: 50%;
  font-weight: 800; font-size: 13px; line-height: 86px;
  text-align: center; text-indent: 0;
}
#login form {
  background: #fff;
  border: 1px solid #dbe3ef;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  padding: 26px 24px;
  margin-bottom: 20px;
  border-radius: 16px;
}
#login label { font-size: 14px; color: var(--ink); margin-bottom: 0; }
#login .input { font-size: 18px; padding: 10px 12px; margin: 2px 0 16px; width: 100%; min-height: 44px; }
#login .submit { text-align: right; margin: 0; }
#login .button-large { float: right; padding: 0 18px; height: 40px; line-height: 38px; font-size: 14px; }
#login .captcha-img { display: block; margin: 4px 0 8px; border-radius: 8px; border: 1px solid #c5d0e0; }
#login_error {
  border-left: 4px solid var(--danger);
  background: #fff;
  padding: 12px;
  margin: 0 0 16px;
  border-radius: 0 10px 10px 0;
}
#backtoblog { margin: 16px 0; font-size: 13px; padding: 0 24px; }
#backtoblog a { color: #cbd5e1; }

.cache-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 18px; }
.cache-grid .postbox { margin: 0; }
.cache-grid .stack .button { width: auto; justify-self: start; }
.cache-switch { margin-top: 12px; }
.button.button-danger {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff;
}
.button.button-danger:hover { background: #fef2f2; }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.bulk-bar select { width: auto; min-width: 180px; }
.table .check-col { width: 36px; }
.table .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; }
.ssl-badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.ssl-on { background: #dcfce7; color: var(--ok); }
.ssl-off { background: #e2e8f0; color: #475569; }
.ssl-err { background: #fee2e2; color: var(--danger); }
.migration-pre {
  background: #0b1220; color: #e2e8f0; padding: 12px 14px; border-radius: 8px;
  overflow: auto; font-size: 12px; line-height: 1.45; white-space: pre-wrap;
}

@media (max-width: 960px) {
  #wpwrap { grid-template-columns: 1fr; }
  .metabox-holder, .welcome-panel-column-container, .tmdb-row, .cache-grid { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr; }
  .wp-submenu { display: block; }
  .tmdb-action .button { min-width: 0; }
}
