/* Panel de administracion — iOS Wallpaper */

:root {
    --blue: #0a84ff;
    --blue-dark: #0060df;
    --ink: #10121a;
    --ink-2: #4b5162;
    --muted: #8a90a2;
    --line: #e6e8ef;
    --bg: #f5f6fa;
    --card: #ffffff;
    --green: #1eae5c;
    --red: #e0333d;
    --amber: #f0a000;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 18, 26, .06), 0 8px 24px rgba(16, 18, 26, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef0f6; padding: 2px 6px; border-radius: 6px; font-size: .86em; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--card);
    border-right: 1px solid var(--line);
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand h1 { font-size: 17px; margin: 0; }
.brand p { margin: 0; font-size: 12px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(140deg, #0a84ff, #5e5ce6 60%, #ff375f);
    color: #fff; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 40px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: #f1f3f8; text-decoration: none; }
.nav a.active { background: rgba(10, 132, 255, .1); color: var(--blue); font-weight: 600; }
.nav .nav-sep { margin-top: 14px; padding: 0 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.content { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

/* ---------- Tarjetas ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-tight { padding: 0; overflow: hidden; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.stat .label { font-size: 13px; color: var(--muted); }

/* ---------- Formularios ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=url], input[type=email], input[type=number],
input[type=password], input[type=search], select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(10, 132, 255, .35); border-color: var(--blue); }
textarea { min-height: 84px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.inline input { width: auto; margin: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; background: #eef0f6; color: var(--ink);
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-danger { background: #fdecec; color: var(--red); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Avisos ---------- */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-ok { background: #e7f8ee; color: #12673a; }
.alert-error { background: #fdecec; color: #9c1f27; }
.alert-warn { background: #fff5e0; color: #8a5a00; }
.alert p { margin: 6px 0 0; }

.check-list { list-style: none; padding: 0; margin: 0 0 18px; }
.check-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check-list li span { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; flex: 0 0 20px; }
.check-list li.ok span { background: var(--green); }
.check-list li.ko span { background: var(--red); }

/* ---------- Tablas y rejillas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfd; }
tbody tr:hover { background: #fafbfd; }
td img.thumb { width: 46px; height: 82px; object-fit: cover; border-radius: 8px; background: #eef0f6; display: block; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { position: relative; border-radius: 12px; overflow: hidden; background: #eef0f6; border: 1px solid var(--line); }
.tile img { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; }
.tile .tile-body { padding: 8px 10px; }
.tile .tile-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.badge-4k { background: #10121a; color: #fff; }
.badge-off { background: #fdecec; color: var(--red); }
.badge-on { background: #e7f8ee; color: #12673a; }
.badge-star { background: #fff5e0; color: #8a5a00; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar > form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { margin-top: 0; width: auto; min-width: 170px; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.pager .current { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }

/* ---------- Subida ---------- */
.dropzone {
    border: 2px dashed #c3c9d8;
    border-radius: var(--radius);
    padding: 44px 20px;
    text-align: center;
    background: #fbfcfe;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.dropzone.over { border-color: var(--blue); background: rgba(10, 132, 255, .06); }
.dropzone h3 { margin: 0 0 6px; font-size: 17px; }
.dropzone p { margin: 0; color: var(--muted); font-size: 14px; }

.queue { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.queue-item img { width: 34px; height: 60px; object-fit: cover; border-radius: 6px; background: #eef0f6; flex: 0 0 34px; }
.queue-item .qname { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item .qstate { font-size: 12px; font-weight: 600; flex: 0 0 auto; }
.queue-item.done .qstate { color: var(--green); }
.queue-item.fail .qstate { color: var(--red); }
.queue-item.busy .qstate { color: var(--blue); }
.progress { height: 4px; border-radius: 4px; background: #eef0f6; overflow: hidden; margin-top: 14px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }

/* ---------- Login / instalador ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 430px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 20px; }

@media (max-width: 860px) {
    .shell { flex-direction: column; }
    .sidebar { width: auto; flex: none; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .content { padding: 20px 16px 50px; }
}
