:root {
    --panel-orange: #ff6c2c;
    --panel-orange-dark: #e05a1f;
    --panel-bg: #f4f5f7;
    --panel-card: #ffffff;
    --panel-border: #e2e4e8;
    --panel-text: #2c2f36;
    --panel-muted: #767c88;
    --panel-danger: #d9412f;
    --panel-ok: #2e9e5b;
    --panel-blue: #2569c9;
    --panel-blue-dark: #1c53a1;
    --panel-teal: #0f8b7f;
    --panel-teal-dark: #0b6f65;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--panel-bg);
    color: var(--panel-text);
}

a { color: var(--panel-orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.panel-header {
    background: var(--panel-card);
    border-bottom: 1px solid var(--panel-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header .brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--panel-orange);
}

.panel-header .brand span { color: var(--panel-text); }

.panel-search input {
    padding: 8px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    width: 320px;
}

.panel-user { color: var(--panel-muted); font-size: 14px; }
.panel-user a { margin-left: 12px; }

.panel-layout {
    display: flex;
    gap: 24px;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.panel-main { flex: 1; }
.panel-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.panel-section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--panel-muted);
    text-transform: uppercase;
    margin: 24px 0 10px;
}
.panel-section-title:first-child { margin-top: 0; }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.tile {
    background: var(--panel-card);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--panel-text);
}
.tile:hover { border-color: var(--panel-orange); text-decoration: none; }
.tile .icon { font-size: 28px; color: var(--panel-orange); }
.tile .label { font-size: 13px; }

.card {
    background: var(--panel-card);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.stat-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--panel-border); }
.stat-row:last-child { border-bottom: none; }

.progress-bar { background: var(--panel-bg); border-radius: 6px; overflow: hidden; height: 8px; margin-top: 4px; }
.progress-bar-fill { background: var(--panel-orange); height: 100%; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th, table.data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--panel-border); }
table.data-table th { color: var(--panel-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.btn {
    display: inline-block;
    background: var(--panel-orange);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
}
.btn:hover { background: var(--panel-orange-dark); text-decoration: none; }
.btn.btn-danger { background: var(--panel-danger); }
.btn.btn-secondary { background: var(--panel-teal); }
.btn.btn-secondary:hover { background: var(--panel-teal-dark); }
.btn.btn-info { background: var(--panel-blue); }
.btn.btn-info:hover { background: var(--panel-blue-dark); }

.sortable-col { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-col:hover { color: var(--panel-orange-dark); }
.sortable-col .sort-arrow { font-size: 11px; opacity: 0.6; margin-left: 4px; }

.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--panel-muted); }
.form-row input, .form-row select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    font-size: 14px;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--panel-bg);
    padding: 20px 0;
}
.login-logo { width: 240px; height: auto; }
.login-box {
    background: var(--panel-card);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 48px;
    width: 460px;
    max-width: 90vw;
}
.login-box .brand { text-align: center; margin-bottom: 20px; font-size: 20px; font-weight: 700; color: var(--panel-orange); }

.form-row-checkbox label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--panel-text); margin-bottom: 0; cursor: pointer; }
.form-row-checkbox input[type="checkbox"] { width: auto; padding: 0; border: none; }

.pw-field { position: relative; }
.pw-field input { padding-right: 36px; }
.pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 6px;
    color: var(--panel-muted);
}
.error-msg { background: #fdecea; color: var(--panel-danger); padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.ok-msg { background: #e8f6ee; color: var(--panel-ok); padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }

.field-error { color: var(--panel-danger); font-size: 12px; margin-top: 4px; }

.btn-link {
    background: none;
    border: none;
    color: var(--panel-muted);
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
    margin-left: 12px;
}
.btn-link:hover { color: var(--panel-text); }

.pw-checklist {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--panel-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}
.pw-checklist li::before { content: "○ "; }
.pw-checklist li.ok { color: var(--panel-ok); }
.pw-checklist li.ok::before { content: "✓ "; }

.perms-grid { width: 100%; border-collapse: collapse; margin-top: 4px; }
.perms-grid th, .perms-grid td { text-align: center; padding: 4px 8px; font-size: 13px; }
.perms-grid th { color: var(--panel-muted); font-weight: 500; }
.perms-grid td:first-child { text-align: left; color: var(--panel-muted); }
.perms-grid input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--panel-teal); cursor: pointer; }
.perms-octal-readout {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--panel-teal);
    background: color-mix(in srgb, var(--panel-teal) 12%, transparent);
    border-radius: 8px;
    font-family: monospace;
    text-align: center;
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-ok { background: #e8f6ee; color: var(--panel-ok); }
.badge-warn { background: #fdecea; color: var(--panel-danger); }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 10px; padding: 24px; width: 360px; }

.tile-disabled { opacity: .45; cursor: default; }
.tile-disabled small { font-size: 10px; color: #888; }

.lang-switcher {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.lang-switcher a { color: var(--panel-muted); }
.lang-switcher .lang-current { color: var(--panel-orange-dark); font-weight: 700; }

.panel-user .lang-switcher {
    display: inline-flex;
    margin: 0 12px 0 0;
    gap: 6px;
}

.domain-switcher {
    margin-left: 6px;
    font-size: 14px;
    font-weight: 400;
    color: var(--panel-text);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 2px 6px;
    background: var(--panel-card);
}

.breadcrumb { font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.breadcrumb a { color: var(--panel-orange-dark); }
.breadcrumb span.sep { color: var(--panel-muted); }
.breadcrumb span.current { color: var(--panel-text); font-weight: 600; }

.files-name-cell { cursor: pointer; }
.files-name-cell:hover { text-decoration: underline; }
.files-icon { margin-right: 6px; }

.file-editor-textarea {
    width: 100%;
    height: 420px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    padding: 10px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    resize: vertical;
}

.spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid var(--panel-border);
    border-top-color: var(--panel-orange);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cron jobs */
.cron-fields { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cron-human { font-size: 13px; color: var(--panel-teal); margin: 4px 0 12px; min-height: 1.2em; }
.cron-help { font-size: 12px; color: var(--panel-muted); }
.mono, .cron-cmd { font-family: ui-monospace, Menlo, Consolas, monospace; }
.cron-cmd { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.badge-lock { background: #eef1f5; color: var(--panel-muted); }
@media (max-width: 600px) { .cron-fields { grid-template-columns: repeat(2, 1fr); } }
.cron-mailto-form { display: flex; gap: 8px; align-items: flex-start; }
.cron-mailto-form .form-row { flex: 1; margin-bottom: 0; }
.totp-qr { max-width: 220px; }
/* Ocultos por defecto (la CSP bloquea style inline); el JS los muestra con style.display explicito */
#totpEnroll, #totpRecovery, #cf_cancel, #cronShellWarning, #cronVars { display: none; }
.hint { font-size: 13px; color: var(--panel-muted); }
.totp-h { margin: 18px 0 6px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-orange); color: #fff; font-size: 13px; }
#cronStepup, #suForm { display: none; }
.cron-cmd { white-space: normal; word-break: break-all; text-overflow: clip; max-width: 560px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; line-height: 1.35; }

/* ======================================================================
   Shell estilo cPanel Jupiter (2026-11-10): sidebar azul + barra superior,
   categorias plegables con iconos SVG, panel derecho Informacion/Estadisticas.
   Acento azul #003da6 (igual al WHM). Sin estilos inline (CSP default-src 'self').
   ====================================================================== */
:root {
    --panel-orange: #003da6;       /* nombre historico: ahora es el azul de acento */
    --panel-orange-dark: #002f80;
    --panel-bg: #fafafa;
    --panel-text: #333333;
    --panel-border: #e2e4e8;
    --side-bg: #1c2159;
    --side-hover: #2a3180;
    --side-text: #dfe3f7;
    --side-w: 240px;
    --ico-main: #4a5568;
    --ico-accent: #ff6c2c;
}
body { font-family: "Open Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; }
a { color: #365aa2; }
.btn { border-radius: 3px; }
.card { border-radius: 4px; }
.inline-form { display: inline; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico { width: 24px; height: 24px; fill: none; stroke: var(--ico-main); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico-sm { width: 16px; height: 16px; }

/* Sidebar */
.app-side { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); background: var(--side-bg); color: var(--side-text); overflow-y: auto; z-index: 50; padding: 0 0 24px; }
.side-brand { display: block; padding: 18px 16px 14px; font-size: 26px; font-weight: 800; font-style: italic; color: #fff; letter-spacing: .5px; }
.side-brand:hover { text-decoration: none; }
.side-actions { display: flex; gap: 8px; padding: 0 12px 10px; }
.side-actions button { flex: 1; background: transparent; color: var(--side-text); border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: 6px 4px; font-size: 13px; cursor: pointer; font-family: inherit; }
.side-actions button:hover { background: var(--side-hover); }
.side-home, .side-cat-h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 16px; color: var(--side-text); font-size: 15px; background: none; border: 0; text-align: left; cursor: pointer; font-family: inherit; }
.side-home:hover, .side-cat-h:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.side-home.active { background: var(--side-hover); color: #fff; font-weight: 600; }
.side-home .side-ico { width: 18px; height: 18px; stroke: var(--side-text); }
.chev { display: inline-block; width: 14px; font-size: 17px; line-height: 1; transition: transform .15s; }
.side-cat.open > .side-cat-h .chev { transform: rotate(90deg); }
.side-items { list-style: none; margin: 0; padding: 0; display: none; background: rgba(0,0,0,.18); }
.side-cat.open > .side-items { display: block; }
.side-items a { display: block; padding: 9px 16px 9px 38px; color: var(--side-text); font-size: 14px; }
.side-items a:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.side-items a.active { color: #fff; font-weight: 600; border-left: 3px solid #fff; padding-left: 35px; }

/* Barra superior */
.app-wrap { margin-left: var(--side-w); min-height: 100vh; }
.app-top { background: #fff; border-bottom: 1px solid var(--panel-border); padding: 8px 24px; display: flex; align-items: center; gap: 20px; min-height: 60px; }
.top-domain { font-size: 14px; color: var(--panel-text); }
.top-domain .domain-switcher { margin-left: 0; }
.top-search { flex: 1; display: flex; justify-content: flex-end; }
.top-search input { width: 100%; max-width: 380px; padding: 8px 12px; border: 1px solid #6b7280; border-radius: 3px; font-size: 14px; font-family: inherit; }
.top-search input:focus { outline: 2px solid #365aa2; outline-offset: 0; }
.panel-user { display: flex; align-items: center; gap: 14px; }
.panel-user .lang-switcher { margin: 0; }
.top-user { display: inline-flex; align-items: center; gap: 6px; }
.panel-user .btn-link { margin-left: 0; }
.burger { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--side-bg); }
.app-wrap .panel-layout { max-width: none; margin: 0; padding: 24px 28px; align-items: flex-start; }
.panel-section-title { font-size: 30px; font-weight: 400; color: var(--panel-text); text-transform: none; letter-spacing: 0; margin: 4px 0 16px; }
.panel-main { min-width: 0; }

/* Home: categorias plegables */
.tools-list { display: flex; flex-direction: column; gap: 14px; }
.tools-cat { background: #fff; border: 1px solid var(--panel-border); border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tools-cat-h { display: flex; align-items: center; gap: 16px; width: 100%; background: none; border: 0; cursor: pointer; padding: 16px 18px; font-size: 15px; font-family: inherit; color: var(--panel-text); text-align: left; }
.tools-cat-h .cat-ico { width: 30px; height: 30px; }
.tools-cat-h .cat-name { flex: 1; }
.tools-cat-h .chev { transform: rotate(90deg); color: #365aa2; font-size: 22px; }
.tools-cat.open > .tools-cat-h .chev { transform: rotate(-90deg); }
.tools-cat-body { display: none; padding: 6px 18px 18px; border-top: 1px solid var(--panel-border); grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 16px; }
.tools-cat.open > .tools-cat-body { display: grid; }
.tool-row { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 3px; color: #365aa2; }
.tool-row:hover { background: #f1f4fb; text-decoration: none; }
.tool-row .tool-ico { width: 38px; height: 38px; }
.tool-name { font-size: 14px; line-height: 1.3; }

/* Panel derecho: Informacion general / Estadisticas */
.panel-sidebar { width: 300px; flex-shrink: 0; }
.info-card { background: #fff; border: 1px solid var(--panel-border); border-radius: 3px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.info-card h3 { margin: 0; padding: 14px 16px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--panel-border); }
.info-row { padding: 10px 16px; border-bottom: 1px solid var(--panel-border); }
.info-row:last-child { border-bottom: 0; }
.info-row span { display: block; font-size: 12px; color: var(--panel-muted); margin-bottom: 2px; }
.info-row b { font-weight: 400; font-size: 14px; word-break: break-word; }
.usage-bar { height: 6px; background: #e8ebf0; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.usage-bar i { display: block; height: 100%; width: 0; background: var(--ico-accent); }
.usage-bar.bar-warn i { background: #e6a817; }
.usage-bar.bar-danger i { background: var(--panel-danger); }

@media (max-width: 1100px) {
    .app-wrap .panel-layout { flex-direction: column; }
    .panel-sidebar { width: 100%; }
}
@media (max-width: 900px) {
    .app-side { transform: translateX(-100%); transition: transform .2s; }
    body.side-open .app-side { transform: none; box-shadow: 4px 0 18px rgba(0,0,0,.3); }
    .app-wrap { margin-left: 0; }
    .burger { display: block; }
    .app-top { gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
    .app-wrap .panel-layout { padding: 16px; }
}

.is-hidden { display: none; }
.lang-card { max-width: 460px; }
.hint { margin: 0 0 16px; }

/* ---- Paginas de lista estilo cPanel (2026-11-10) ---- */
.hint { margin: 0 0 14px; }
.row-flex { display: flex; align-items: center; gap: 6px; }
.row-flex input { flex: 1; min-width: 0; }
.row-gap { margin-top: 8px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.list-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; }
.list-search { flex: 1; min-width: 200px; max-width: 420px; padding: 8px 12px; border: 1px solid #b6bcc8; border-radius: 3px; font-size: 14px; font-family: inherit; background: #fff; }
.list-search:focus { outline: 2px solid #365aa2; outline-offset: 0; }
.list-stat { margin: 0 0 0 auto; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--panel-muted); background: #fff; border: 1px solid var(--panel-border); border-radius: 3px; }
.list-head > .btn-create:only-child { margin-left: auto; }
.btn.btn-create { background: #3b82d6; padding: 9px 18px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.btn.btn-create:hover { background: #2f6fbb; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: none; border: 0; padding: 4px 10px; border-radius: 3px; font-size: 13px; font-family: inherit; color: #365aa2; cursor: pointer; }
.chip:hover { background: #eef2fb; }
.chip.on { background: #3b82d6; color: #fff; }
.bulk-bar { display: flex; align-items: center; gap: 14px; background: #fff7e0; border: 1px solid #ecd9a0; border-radius: 3px; padding: 8px 14px; margin-bottom: 12px; font-size: 14px; }
.bulk-bar .btn { padding: 5px 14px; }
.bulk-bar.is-hidden { display: none; }
.list-card { padding: 0; overflow-x: auto; }
.list-card .hint { padding: 12px 18px 0; margin: 0; }
.list-card table.data-table th { background: #f4f6fa; font-size: 13px; text-transform: none; color: var(--panel-text); letter-spacing: 0; border-bottom: 2px solid #d5dae3; }
.list-card table.data-table th, .list-card table.data-table td { padding: 12px 14px; }
.list-card table.data-table tbody tr:hover { background: #f8faff; }
.col-check { width: 36px; text-align: center; }
.col-check input { width: 16px; height: 16px; cursor: pointer; }
tr.is-hidden { display: none; }
/* botones de fila con contorno */
table.data-table td .btn { background: #fff; color: #365aa2; border: 1px solid #365aa2; padding: 5px 12px; font-size: 13px; }
table.data-table td .btn:hover { background: #eef2fb; }
table.data-table td .btn.btn-danger { color: var(--panel-danger); border-color: var(--panel-danger); }
table.data-table td .btn.btn-danger:hover { background: #fdecea; }
/* modal de alta */
.modal-box.modal-wide { width: min(520px, 94vw); position: relative; max-height: 92vh; overflow-y: auto; }
.modal-x { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--panel-muted); cursor: pointer; }
.modal-x:hover { color: var(--panel-text); }
.modal-box h3 { margin-top: 0; }
