:root {
    color-scheme: light dark;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #d9e0ea;
    --accent: #2457c5;
    --success: #18794e;
    --warning: #9a6700;
}

* { box-sizing: border-box; }
html { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
.site { width: min(100% - 2rem, 980px); margin: 0 auto; padding: 2rem 0 3rem; }
.hero { padding: 1.5rem 0; }
.eyebrow { margin: 0 0 .4rem; color: var(--accent); font-weight: 700; }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.05; }
.lead { max-width: 64ch; color: var(--muted); font-size: 1.05rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 1.15rem; }
.card h2 { margin-top: 0; font-size: 1.05rem; }
.status { display: flex; align-items: center; gap: .55rem; }
.dot { width: .75rem; height: .75rem; border-radius: 999px; background: var(--warning); flex: 0 0 auto; }
.dot.ok { background: var(--success); }
.dot.danger { background: var(--mp-danger, #b56a6a); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.notice { margin-top: 1rem; border-left: .3rem solid var(--accent); padding: 1rem; background: var(--surface); border-radius: .4rem 1rem 1rem .4rem; }
footer { margin-top: 2rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) {
    .site { width: min(100% - 1rem, 980px); padding-top: 1rem; }
    .grid { grid-template-columns: 1fr; }
    dl { grid-template-columns: 1fr; gap: .15rem; }
    dd { margin-bottom: .65rem; }
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #0f1520; --surface: #171f2d; --text: #edf2f7; --muted: #a8b3c5; --border: #344054; --accent: #8fb3ff; --success: #5bd6a2; --warning: #f0c36a; }
}

.success { border-color: #78a88b; }
.danger { border-color: #b56a6a; }
.migration-list { margin: 1rem 0 1.5rem; padding-left: 1.25rem; }
form { display: grid; gap: .75rem; max-width: 34rem; }
label { font-weight: 600; }
input[type="password"] { width: 100%; box-sizing: border-box; border: 1px solid #b8c4d0; border-radius: .65rem; padding: .8rem .9rem; font: inherit; }
button { width: fit-content; border: 0; border-radius: .65rem; padding: .8rem 1.1rem; background: #163b68; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(1.08); }

input[type="text"], input[type="email"], input[type="password"] {
    width: 100%; border: 1px solid var(--border); border-radius: .65rem;
    padding: .8rem .9rem; font: inherit; background: var(--surface); color: var(--text);
}
.narrow { max-width: 620px; }
.section-gap { margin-top: 1rem; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem max(1rem, calc((100% - 980px) / 2)); background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-bar span { color: var(--muted); margin-left: .4rem; }
.logout-form { display: block; }
.button-secondary, .button-link { display: inline-block; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: .65rem; padding: .65rem .9rem; text-decoration: none; font-weight: 600; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.module p { color: var(--muted); margin-bottom: 0; }
@media (max-width: 760px) { .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .module-grid { grid-template-columns: 1fr; } .admin-bar { align-items: flex-start; } }

/* Build 0007: panel administrativo */
.admin-body { min-height: 100vh; }
.admin-topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-brand { display: flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; }
.admin-brand small { display: block; color: var(--muted); margin-top: .1rem; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: .8rem; background: var(--accent); color: #fff; font-weight: 800; }
.admin-user { display: flex; align-items: center; gap: .8rem; }
.admin-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.admin-nav { padding: 1rem; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: .25rem; }
.admin-nav a, .admin-nav span { padding: .7rem .8rem; border-radius: .65rem; color: var(--text); text-decoration: none; }
.admin-nav span { color: var(--muted); }
.admin-nav .active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 700; }
.admin-main { width: min(100%, 1180px); padding: 2rem; }
.admin-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.admin-heading h1 { font-size: clamp(2rem, 5vw, 3rem); }
.version-badge { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .5rem .75rem; font-weight: 700; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 1rem; }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; font-size: 2rem; margin: .25rem 0; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 1rem; }
.logo-placeholder { min-height: 150px; margin-top: 1rem; border: 1px dashed var(--border); border-radius: .9rem; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.activity-card { margin-top: 1rem; }
.activity-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.activity-list li { display: grid; grid-template-columns: 100px 1fr; gap: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.activity-list li:first-child { border-top: 0; padding-top: 0; }
.activity-list span { color: var(--muted); }
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .admin-nav a, .admin-nav span { white-space: nowrap; }
    .admin-main { padding: 1.25rem; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .admin-topbar { align-items: flex-start; }
    .admin-user { flex-direction: column; align-items: flex-end; }
    .admin-heading { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .activity-list li { grid-template-columns: 1fr; gap: .2rem; }
}

/* Build 0008: gestión de idiomas */
.section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.section-heading-row p { margin-bottom: 0; color: var(--muted); }
.count-badge { border: 1px solid var(--border); border-radius: 999px; padding: .4rem .65rem; white-space: nowrap; color: var(--muted); }
.wide-form { max-width: none; }
.table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.admin-table th, .admin-table td { padding: .7rem .55rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: .9rem; }
.admin-table input:not([type="checkbox"]) { min-width: 120px; }
.admin-table .small-input { min-width: 78px; width: 78px; }
select, input[type="number"] { width: 100%; border: 1px solid var(--border); border-radius: .65rem; padding: .8rem .9rem; font: inherit; background: var(--surface); color: var(--text); }
.form-grid { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid label { display: grid; gap: .45rem; }
.form-action { display: flex; align-items: end; }
@media (max-width: 680px) {
    .section-heading-row { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
}


/* Build 0009: gestión inicial de charts */
.empty-state { display: grid; gap: .35rem; place-items: center; min-height: 130px; color: var(--muted); border: 1px dashed var(--border); border-radius: .9rem; margin-top: 1rem; text-align: center; }
.chart-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.chart-card { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 1rem; border: 1px solid var(--border); border-top: 4px solid var(--chart-accent); border-radius: 1rem; padding: 1rem; background: var(--surface); }
.chart-card h3 { margin: .45rem 0 .2rem; }
.chart-card p { color: var(--muted); margin: 0 0 .75rem; overflow-wrap: anywhere; }
.chart-logo-preview { min-height: 105px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: .75rem; overflow: hidden; background: color-mix(in srgb, var(--chart-accent) 7%, var(--surface)); color: var(--muted); }
.chart-logo-preview img { width: 100%; height: 100%; max-height: 120px; object-fit: contain; }
.chart-type-badge { display: inline-block; padding: .25rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--chart-accent) 14%, transparent); color: var(--chart-accent); font-size: .85rem; font-weight: 700; }
.compact-dl { grid-template-columns: max-content 1fr; gap: .25rem .7rem; font-size: .9rem; }
.chart-form { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.chart-form label { display: grid; gap: .45rem; align-content: start; }
.chart-form small { color: var(--muted); font-weight: 400; }
.chart-form .full-width { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: .75rem; padding: .85rem; }
legend { font-weight: 700; padding: 0 .35rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.radio-row label { display: flex; align-items: center; gap: .45rem; }
input[type="file"], input[type="color"] { width: 100%; border: 1px solid var(--border); border-radius: .65rem; padding: .55rem; background: var(--surface); color: var(--text); }
input[type="color"] { min-height: 47px; }
@media (max-width: 820px) { .chart-card-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .chart-form { grid-template-columns: 1fr; } .chart-form .full-width { grid-column: auto; } .chart-card { grid-template-columns: 1fr; } }

/* Build 0010: identidad MEGATOP Producciones y temas administrables */
:root {
    --sidebar-width: 260px;
    --topbar-height: 76px;
    --sidebar-bg: #ffffff;
    --topbar-bg: rgba(255,255,255,.94);
    --panel-soft: #f8faff;
    --accent-soft: #eaf1ff;
    --shadow: 0 10px 30px rgba(34, 55, 92, .06);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1424;
    --surface: #111d30;
    --text: #f3f7ff;
    --muted: #a9b7cb;
    --border: #273750;
    --accent: #4b8dff;
    --success: #55cf8d;
    --warning: #ffbf5b;
    --sidebar-bg: #0c1728;
    --topbar-bg: rgba(11, 20, 36, .94);
    --panel-soft: #0f1b2d;
    --accent-soft: #15294a;
    --shadow: 0 12px 36px rgba(0,0,0,.18);
}

html[data-theme="light"] { color-scheme: light; }
.admin-body { background: var(--bg); }
.admin-topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar-height); min-height: var(--topbar-height);
    margin-left: var(--sidebar-width); padding: .75rem 1.25rem; background: var(--topbar-bg);
    backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--border); border: 0;
}
.admin-shell { display: block; min-height: calc(100vh - var(--topbar-height)); }
.admin-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width);
    overflow-y: auto; padding: .85rem .8rem 1rem; background: var(--sidebar-bg); border-right: 1px solid var(--border);
}
.admin-brand { display: block; min-height: 76px; padding: 0 .35rem .9rem; border-bottom: 1px solid var(--border); }
.admin-brand picture { display: grid; place-items: center; }
.brand-logo { display: block; width: 100%; max-width: 220px; height: 66px; object-fit: contain; }
.brand-logo-dark { display: none; }
html[data-theme="dark"] .brand-logo-light { display: none; }
html[data-theme="dark"] .brand-logo-dark { display: block; }
.admin-nav { padding: .85rem 0 0; border: 0; background: transparent; gap: .1rem; }
.admin-nav a, .admin-nav span { padding: .58rem .7rem; font-size: .95rem; }
.admin-nav .active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.admin-nav .nav-section { margin-top: .65rem; padding-bottom: .25rem; color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.admin-main { margin-left: var(--sidebar-width); padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: none; }
.nav-toggle { border: 0; background: transparent; color: var(--text); font-size: 1.35rem; padding: .55rem; }
.theme-switcher { display: flex; margin-left: auto; border: 1px solid var(--border); border-radius: .7rem; overflow: hidden; background: var(--surface); }
.theme-switcher button { border-radius: 0; border: 0; border-right: 1px solid var(--border); padding: .6rem .8rem; background: transparent; color: var(--text); font-weight: 600; }
.theme-switcher button:last-child { border-right: 0; }
.theme-switcher button.active { background: var(--accent-soft); color: var(--accent); }
.admin-user { min-width: 0; }
.user-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #183a74; color: #fff; font-weight: 800; }
.user-copy { display: grid; }
.user-copy small { color: var(--muted); }
.admin-heading { align-items: flex-start; }
.admin-heading h1 { font-size: clamp(2rem, 4vw, 3rem); }
.metric, .card, .chart-card { box-shadow: var(--shadow); }
.metric { background: var(--surface); min-height: 126px; }
.card { background: var(--surface); }
input, select, textarea, fieldset { background-color: var(--surface); color: var(--text); }
.admin-table th { background: var(--panel-soft); }
.button-secondary { background: var(--surface); }

@media (max-width: 920px) {
    :root { --sidebar-width: 0px; }
    .admin-sidebar { transform: translateX(-100%); width: 260px; transition: transform .2s ease; }
    .admin-body.nav-open .admin-sidebar { transform: translateX(0); box-shadow: 12px 0 30px rgba(0,0,0,.22); }
    .admin-topbar, .admin-main { margin-left: 0; }
    .admin-topbar { padding-inline: .75rem; }
    .theme-switcher button { font-size: 0; }
    .theme-switcher button::first-letter { font-size: 1rem; }
    .user-copy, .logout-form { display: none; }
}
@media (max-width: 540px) {
    .admin-main { padding: 1.25rem .75rem 2rem; }
    .theme-switcher button { padding: .6rem .7rem; }
}

/* Build 0011: edición visual de charts */
.chart-card-actions { margin-top: 1rem; }
.button-small { display: inline-flex; padding: .48rem .75rem; font-size: .88rem; }
.edit-toolbar { margin: 1rem 0; }
.chart-edit-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); gap: 1.5rem; align-items: start; }
.chart-live-preview { position: sticky; top: 96px; border: 1px solid var(--border); border-top: 5px solid var(--chart-accent); border-radius: 1rem; padding: 1rem; background: var(--panel-soft); text-align: center; }
.preview-label { display: inline-block; margin-bottom: .8rem; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.chart-preview-logo { min-height: 150px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: .8rem; background: var(--surface); overflow: hidden; }
.chart-preview-logo img { max-width: 100%; max-height: 180px; object-fit: contain; }
.chart-live-preview h2 { margin: 1rem 0 .25rem; }
.chart-live-preview p { margin: 0; color: var(--muted); }
.preview-accent { height: 12px; margin-top: 1rem; border-radius: 999px; background: var(--chart-accent); }
.remove-logo { display: flex; align-items: center; gap: .6rem; padding: .8rem; border: 1px solid var(--border); border-radius: .7rem; }
.remove-logo input { width: auto; margin: 0; }
@media (max-width: 980px) { .chart-edit-layout { grid-template-columns: 1fr; } .chart-live-preview { position: static; } }
.notice.warning { border-left-color: var(--warning); }
.notice.warning ul { margin: .6rem 0; }
.admin-table td small { display: block; color: var(--muted); margin-top: .2rem; }
.checkbox-label { display: flex !important; align-items: center; gap: .6rem; }
.checkbox-label input { width: auto !important; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.button-warning { background: var(--warning); color: #1d2430; }


/* Build 0014: legibilidad y formularios cómodos */
.admin-body { font-size: 17px; line-height: 1.55; }
.admin-nav a, .admin-nav span { font-size: 1rem; padding: .72rem .8rem; }
.admin-nav .nav-section { font-size: .82rem; }
.card { padding: 1.35rem; }
.card h2 { font-size: 1.3rem; }
.chart-form, .form-grid, .wide-form { gap: 1.25rem; }
.chart-form label, .form-grid label, form label { font-size: 1rem; gap: .55rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], select, textarea, input[type="file"] {
    min-height: 50px; padding: .9rem 1rem; font-size: 1.05rem; line-height: 1.35;
}
textarea { min-height: 120px; resize: vertical; }
button, .button-secondary, .button-link { min-height: 46px; padding: .8rem 1.05rem; font-size: 1rem; }
.admin-table th, .admin-table td { padding: .9rem .7rem; font-size: 1rem; }
.admin-table th { font-size: .95rem; }
.artist-uppercase { text-transform: uppercase; letter-spacing: .01em; }
@media (max-width: 640px) {
  .admin-body { font-size: 16px; }
  .card { padding: 1rem; }
  input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], select, textarea { font-size: 16px; }
}

.docs-grid{display:grid;gap:1rem}.docs-card pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.6;color:var(--muted);margin:0}.admin-table code,.card code{font-size:.95em}

/* Build 0017: sistema global de controles de formulario */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) {
    width: 100%;
    min-height: 54px;
    padding: .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: .7rem;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1.05rem;
    line-height: 1.35;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea):focus {
    border-color: var(--accent);
    outline: 3px solid color-mix(in srgb, var(--accent) 20%, transparent);
    outline-offset: 1px;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea)::placeholder {
    color: color-mix(in srgb, var(--muted) 78%, transparent);
}

input[type="file"] {
    padding: .65rem .75rem;
}

input[type="color"] {
    min-height: 54px;
}

@media (max-width: 640px) {
    :where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) {
        min-height: 52px;
        font-size: 16px;
    }
}


/* =========================================================
   MEGATOP Design System 1.0 — Build 0020 "Blue Pen"
   ========================================================= */
:root {
    --mp-primary: #0057b8;
    --mp-primary-hover: #00479a;
    --mp-primary-soft: #e9f2ff;
    --mp-success: #16824b;
    --mp-warning: #c56a00;
    --mp-danger: #c93434;
    --mp-input-ink: #0057b8;
    --mp-input-height: 54px;
    --mp-control-font-size: 18px;
    --mp-radius: 12px;
    --mp-transition: 160ms ease;
}

html[data-theme="dark"] {
    --mp-primary: #78aef6;
    --mp-primary-hover: #9bc4fb;
    --mp-primary-soft: #152d4a;
    --mp-success: #59d394;
    --mp-warning: #ffb454;
    --mp-danger: #ff7777;
    --mp-input-ink: #78aef6;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea) {
    min-height: var(--mp-input-height);
    padding: 0.78rem 0.95rem;
    border-radius: var(--mp-radius);
    border: 1px solid var(--border);
    font-size: var(--mp-control-font-size);
    line-height: 1.35;
    color: var(--mp-input-ink) !important;
    caret-color: var(--mp-input-ink);
    transition: border-color var(--mp-transition), box-shadow var(--mp-transition), background-color var(--mp-transition);
}

textarea {
    min-height: 132px;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea):focus {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-primary) 22%, transparent);
    outline: none;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea)::placeholder {
    color: var(--muted);
    opacity: .78;
}

:where(input, select, textarea):disabled,
:where(input, select, textarea)[readonly] {
    color: var(--muted) !important;
    cursor: not-allowed;
}

select option {
    color: var(--text);
    background: var(--surface);
}

.mp-form-status {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1200;
    display: none;
    align-items: center;
    gap: .55rem;
    max-width: min(92vw, 420px);
    padding: .8rem 1rem;
    border: 1px solid color-mix(in srgb, var(--mp-warning) 55%, var(--border));
    border-radius: var(--mp-radius);
    background: var(--surface);
    color: var(--mp-warning);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 12px 34px rgba(0,0,0,.18);
}

.mp-form-status.is-visible { display: flex; }
.mp-form-status[data-state="saved"] {
    border-color: color-mix(in srgb, var(--mp-success) 55%, var(--border));
    color: var(--mp-success);
}

.notice.success { border-left-color: var(--mp-success); }
.notice.warning { border-left-color: var(--mp-warning); }
.notice.danger { border-left-color: var(--mp-danger); }

button,
.button,
.button-primary,
.button-secondary,
.button-warning,
.button-danger {
    min-height: 44px;
    border-radius: 10px;
    transition: transform var(--mp-transition), background-color var(--mp-transition), border-color var(--mp-transition);
}
button:hover,
.button:hover,
.button-primary:hover,
.button-secondary:hover,
.button-warning:hover,
.button-danger:hover { transform: translateY(-1px); }

.admin-table tbody tr { transition: background-color var(--mp-transition); }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--mp-primary) 7%, transparent); }

.admin-footer {
    margin-top: 2rem;
    padding: 1.1rem 0 .4rem;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

@media (max-width: 720px) {
    :root { --mp-control-font-size: 16px; --mp-input-height: 52px; }
    .mp-form-status { left: .8rem; right: .8rem; bottom: .8rem; max-width: none; }
}

/* Build 0020a: hotfix para el tamaño de los covers en la lista de canciones */
.admin-table .song-cover-thumb,
.song-cover-thumb {
    display: block;
    width: 80px !important;
    height: 80px !important;
    min-width: 80px;
    max-width: 80px;
    min-height: 80px;
    max-height: 80px;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
}

.admin-table .song-cover-placeholder,
.song-cover-placeholder {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    min-width: 80px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 1.65rem;
}

.admin-table th:first-child,
.admin-table td:first-child {
    width: 104px;
}

.song-cover-preview {
    display: block;
    width: min(240px, 100%);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-soft);
}

@media (max-width: 720px) {
    .admin-table .song-cover-thumb,
    .song-cover-thumb,
    .admin-table .song-cover-placeholder,
    .song-cover-placeholder {
        width: 64px !important;
        height: 64px !important;
        min-width: 64px;
        max-width: 64px;
        min-height: 64px;
        max-height: 64px;
    }

    .admin-table th:first-child,
    .admin-table td:first-child {
        width: 84px;
    }
}

/* Build 0021: varios artistas por canción */
.contributors-block {
    border: 1px solid var(--border);
    border-radius: var(--mp-radius);
    padding: 1.25rem;
    background: var(--panel-soft);
}

.contributors-block h3 { margin: 0 0 .25rem; }
.contributors-block p { margin: 0; color: var(--muted); }

.contributor-row {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(160px, 1fr) minmax(150px, 1fr) 48px;
    gap: .85rem;
    align-items: end;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.contributor-row:first-child { border-top: 0; }
.contributor-row select[data-locked="true"] {
    background: color-mix(in srgb, var(--mp-primary) 7%, var(--panel));
}

.contributor-remove {
    width: 48px;
    height: var(--mp-input-height);
    padding: 0;
    font-size: 1.35rem;
}

@media (max-width: 900px) {
    .contributor-row { grid-template-columns: 1fr 1fr; }
    .contributor-remove { width: 100%; }
}

@media (max-width: 560px) {
    .contributor-row { grid-template-columns: 1fr; }
}

/* Build 0025 · Streaming */
.song-platform-links{display:flex;flex-wrap:wrap;gap:.4rem;min-width:9rem}.song-platform-links a{display:inline-flex;align-items:center;padding:.3rem .55rem;border:1px solid var(--mp-border,#d9e2ef);border-radius:999px;font-size:.82rem;font-weight:700;text-decoration:none;color:var(--mp-primary,#1565c0);background:var(--mp-surface,#fff)}.song-platform-links a:hover{border-color:var(--mp-primary,#1565c0)}


/* Build 0032b: robuste Breitenberechnung in Admin-Grids */
.admin-shell,
.admin-main,
.admin-main > * {
    min-width: 0;
}
.admin-main {
    box-sizing: border-box;
}

/* Build 0040f: kompakte Standardschrift und schwebende Eingabemasken */
.admin-body {
    font-size: 16px;
    line-height: 1.5;
}

.admin-body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea) {
    min-height: 48px;
    padding: .75rem .85rem;
    font-size: 1rem;
}

.admin-body :where(button, .button-secondary, .button-link) {
    min-height: 42px;
    padding: .68rem .9rem;
    font-size: .95rem;
}

.floating-create-button {
    position: fixed;
    right: clamp(1rem, 2.5vw, 2rem);
    bottom: clamp(1rem, 2.5vw, 2rem);
    z-index: 25;
    min-height: 50px !important;
    padding-inline: 1.15rem !important;
    border: 1px solid color-mix(in srgb, var(--accent) 76%, #000);
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 30px rgba(20, 50, 105, .28);
}

.creation-dialog {
    width: min(900px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 0 1.25rem 1.35rem;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 22px 70px rgba(10, 24, 48, .35);
}
.creation-dialog-wide { width: min(1120px, calc(100vw - 2rem)); }
.creation-dialog::backdrop { background: rgba(8, 18, 36, .62); backdrop-filter: blur(3px); }
.creation-dialog .chart-form { max-width: none; }
.creation-dialog > p { color: var(--muted); }
.creation-dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 -1.25rem 1rem;
    padding: 1rem 1.25rem .85rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
}
.creation-dialog-header h2 { margin: 0; }
.creation-dialog-header .preview-label { margin: 0; }
.creation-dialog-close {
    display: grid !important;
    place-items: center;
    width: 42px;
    min-width: 42px;
    padding: 0 !important;
    font-size: 1.35rem !important;
}
.creation-dialog[open] ~ .floating-create-button { visibility: hidden; }

@media (max-width: 640px) {
    .creation-dialog,
    .creation-dialog-wide {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        padding-inline: .9rem;
    }
    .creation-dialog-header { margin-inline: -.9rem; padding-inline: .9rem; }
    .floating-create-button { right: .75rem; bottom: .75rem; }
}

/* Build 0040g: volle Adminbreite und optionales Blue-Theme */
.admin-main {
    width: calc(100% - var(--sidebar-width));
    max-width: none;
}

.admin-main > :where(.card, .notice, .chart-editor-grid),
.admin-main > section {
    width: 100%;
    max-width: none;
}

.artist-name-cell {
    min-width: 240px;
    white-space: nowrap;
}

html[data-theme-choice="blue"] {
    color-scheme: light;
    --bg: #dfeaf4;
    --surface: #ffffff;
    --text: #17263a;
    --muted: #5c6e82;
    --border: #c4d3e1;
    --accent: #205f9c;
    --sidebar-bg: #28577f;
    --topbar-bg: rgba(238, 245, 251, .95);
    --panel-soft: #edf4fa;
    --accent-soft: #d8e8f6;
    --shadow: 0 10px 28px rgba(38, 76, 112, .10);
    --mp-primary: #1765aa;
    --mp-primary-hover: #0f528f;
    --mp-primary-soft: #dcecf9;
    --mp-input-ink: #1765aa;
}

html[data-theme-choice="blue"] .admin-sidebar {
    color: #ffffff;
    border-right-color: #1e486c;
}

html[data-theme-choice="blue"] .admin-brand {
    border-bottom-color: rgba(255,255,255,.22);
}

html[data-theme-choice="blue"] .brand-logo-light { display: none; }
html[data-theme-choice="blue"] .brand-logo-dark { display: block; }
html[data-theme-choice="blue"] .admin-nav a { color: #f8fbff; }
html[data-theme-choice="blue"] .admin-nav .nav-section { color: #c9dcec; }
html[data-theme-choice="blue"] .admin-nav .active {
    background: rgba(255,255,255,.16);
    color: #ffffff;
}

html[data-theme-choice="blue"] .admin-nav a:hover {
    background: rgba(255,255,255,.10);
}

@media (max-width: 920px) {
    .admin-main { width: 100%; }
}
