/* Panel administrativo avanzado. */

/* BEGIN CARAJILLO_ADMIN_PANEL_V2_EMBEDDED_V4 */
.cc-admin-v2-backdrop {
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 14px !important;
    overflow: hidden !important;
}

.cc-admin-v2 {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #f7fbfe;
    border: 1px solid #c8ddeb;
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(32, 78, 111, .23);
    overflow: hidden;
    color: #18344b;
}

.cc-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 20px;
    border-bottom: 1px solid #d4e5f0;
    background: rgba(255, 255, 255, .92);
}

.cc-admin-header h2 {
    margin: 2px 0 0;
    font-size: 24px;
    line-height: 1.1;
}

.cc-admin-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    color: #4790c4;
}

.cc-admin-header-actions,
.cc-admin-section-actions,
.cc-admin-form-actions,
.cc-admin-card-title-row,
.cc-admin-value-line,
.cc-admin-pagination,
.cc-admin-table-toolbar {
    display: flex;
    align-items: center;
}

.cc-admin-header-actions,
.cc-admin-section-actions {
    gap: 8px;
}

.cc-admin-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
}

.cc-admin-sidebar {
    min-height: 0;
    padding: 14px 11px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #d4e5f0;
    background: #eef7fc;
}

.cc-admin-sidebar nav {
    display: grid;
    gap: 5px;
}

.cc-admin-nav-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #284c67;
    font: inherit;
    font-weight: 690;
    text-align: left;
    cursor: pointer;
}

.cc-admin-nav-button > span {
    width: 24px;
    text-align: center;
    color: #3b8fc8;
    font-size: 17px;
}

.cc-admin-nav-button:hover {
    background: #e1f0fa;
}

.cc-admin-nav-button.active {
    color: #fff;
    background: linear-gradient(135deg, #3d94cb, #2c7fb5);
    box-shadow: 0 8px 18px rgba(50, 137, 193, .22);
}

.cc-admin-nav-button.active > span {
    color: #fff;
}

.cc-admin-sidebar-foot {
    margin-top: auto;
    padding: 12px 9px 3px;
    display: grid;
    gap: 2px;
    color: #6b879c;
}

.cc-admin-sidebar-foot span {
    font-weight: 800;
    color: #42657e;
}

.cc-admin-content {
    min-width: 0;
    min-height: 0;
    padding: 19px;
    overflow: auto;
}

.cc-admin-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
}

.cc-admin-section-heading h3 {
    margin: 0;
    font-size: 23px;
}

.cc-admin-section-heading p {
    margin: 4px 0 0;
    color: #71899b;
}

.cc-admin-metrics-grid,
.cc-admin-state-grid,
.cc-admin-mount-summary-grid,
.cc-admin-services-grid,
.cc-admin-fields-grid,
.cc-admin-switch-grid {
    display: grid;
    gap: 12px;
}

.cc-admin-metrics-grid {
    grid-template-columns: repeat(6, minmax(135px, 1fr));
    margin-bottom: 14px;
}

.cc-admin-metric {
    min-width: 0;
    min-height: 104px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border: 1px solid #d4e5f0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(57, 103, 136, .06);
}

.cc-admin-metric span,
.cc-admin-metric small {
    color: #748da0;
}

.cc-admin-metric strong {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 24px;
    line-height: 1.15;
}

.cc-admin-metric.danger {
    border-color: #efc4c9;
    background: #fff8f8;
}

.cc-admin-metric.danger strong {
    color: #c54452;
}

.cc-admin-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.cc-admin-card {
    min-width: 0;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid #d4e5f0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(57, 103, 136, .055);
}

.cc-admin-card.no-padding {
    padding: 0;
    overflow: hidden;
}

.cc-admin-card h4 {
    margin: 0 0 11px;
    font-size: 16px;
}

.cc-admin-card-subtitle {
    margin-top: 19px !important;
}

.cc-admin-card-title-row {
    justify-content: space-between;
    gap: 13px;
    margin-bottom: 11px;
}

.cc-admin-card-title-row > div {
    min-width: 0;
}

.cc-admin-card-title-row h4 {
    margin-bottom: 3px;
}

.cc-admin-value-line {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.cc-admin-value-line strong {
    font-size: 19px;
}

.cc-admin-value-line span {
    color: #71899b;
}

.cc-admin-value-line.compact {
    margin-top: 12px;
    font-size: 12px;
}

.cc-admin-value-line.compact strong {
    font-size: inherit;
}

.cc-admin-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e3eff6;
}

.cc-admin-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #48a8d9, #2d87bf);
}

.cc-admin-stat-list {
    display: grid;
    gap: 9px;
}

.cc-admin-stat-list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf3f7;
}

.cc-admin-stat-list > div:last-child {
    border-bottom: 0;
}

.cc-admin-stat-list span {
    color: #71899b;
}

.cc-admin-mount-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.cc-admin-mount-summary-grid article {
    min-width: 0;
    padding: 13px;
    border: 1px solid #e0ebf2;
    border-radius: 12px;
    background: #f9fcfe;
}

.cc-admin-mount-summary-grid code,
.cc-admin-mount-editor code,
.cc-admin-service-card code {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #58758a;
}

.cc-admin-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 780;
    text-transform: lowercase;
    background: #eaf1f5;
    color: #5c7486;
}

.cc-admin-badge.good { background: #e4f7ef; color: #1c8a62; }
.cc-admin-badge.info { background: #e4f2fb; color: #247fb6; }
.cc-admin-badge.warn { background: #fff3d8; color: #a06d08; }
.cc-admin-badge.bad { background: #fde7ea; color: #c43f50; }

.cc-admin-table-wrap {
    max-width: 100%;
    overflow: auto;
}

.cc-admin-table-wrap.tall { max-height: 450px; }
.cc-admin-table-wrap.extra-tall { max-height: calc(100vh - 310px); }

.cc-admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 12px;
}

.cc-admin-table th,
.cc-admin-table td {
    padding: 10px 11px;
    border-bottom: 1px solid #e7eff4;
    text-align: left;
    vertical-align: top;
}

.cc-admin-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #567287;
    background: #f4f9fc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cc-admin-table tbody tr:hover {
    background: #f7fbfe;
}

.cc-admin-path-cell {
    min-width: 220px;
}

.cc-admin-path-cell strong,
.cc-admin-path-cell code {
    display: block;
}

.cc-admin-path-cell code {
    max-width: 390px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6e8798;
}

.cc-admin-error-text {
    max-width: 430px;
    color: #b13c49;
    white-space: pre-wrap;
    word-break: break-word;
}

.cc-admin-empty {
    padding: 26px !important;
    text-align: center !important;
    color: #7890a1;
}

.cc-admin-loading {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #638097;
}

.cc-admin-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid #d9e9f3;
    border-top-color: #3b92c9;
    border-radius: 50%;
    animation: cc-admin-spin .8s linear infinite;
}

@keyframes cc-admin-spin { to { transform: rotate(360deg); } }

.cc-admin-error-card,
.cc-admin-inline-error {
    padding: 14px;
    border: 1px solid #efc4c9;
    border-radius: 12px;
    color: #a83040;
    background: #fff6f7;
}

.cc-admin-error-card p {
    margin-bottom: 0;
    white-space: pre-wrap;
}

.cc-admin-state-grid {
    grid-template-columns: repeat(7, minmax(95px, 1fr));
    margin-bottom: 14px;
}

.cc-admin-state-grid article {
    padding: 12px;
    display: grid;
    gap: 8px;
    border: 1px solid #d7e6ef;
    border-radius: 13px;
    background: #fff;
}

.cc-admin-state-grid strong {
    font-size: 22px;
}

.cc-admin-form-stack {
    display: grid;
    gap: 0;
}

.cc-admin-fields-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cc-admin-fields-grid.single-column {
    grid-template-columns: 1fr;
}

.cc-admin-field {
    display: grid;
    gap: 6px;
    color: #48667d;
    font-weight: 680;
}

.cc-admin-field input,
.cc-admin-filterbar input,
.cc-admin-filterbar select,
.cc-admin-title-input,
.cc-admin-number-input {
    min-width: 0;
}

.cc-admin-field input,
.cc-admin-filterbar input,
.cc-admin-filterbar select,
.cc-admin-title-input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cbdde8;
    border-radius: 10px;
    background: #fff;
    color: #18344b;
    font: inherit;
}

.cc-admin-field small {
    color: #8298a8;
    font-weight: 500;
}

.cc-admin-number-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid #cbdde8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.cc-admin-number-input input {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    outline: 0;
    font: inherit;
}

.cc-admin-number-input b {
    padding: 0 10px;
    color: #71899b;
    font-size: 12px;
}

.cc-admin-form-actions {
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: #71899b;
}

.cc-admin-form-actions.compact-actions {
    margin-top: 13px;
}

.cc-admin-muted {
    color: #71899b;
}

.cc-admin-note {
    padding: 13px 14px;
    border: 1px solid #cfe2ee;
    border-radius: 12px;
    color: #4e7188;
    background: #eff8fd;
}

.cc-admin-note.warning {
    border-color: #eed9a7;
    color: #866220;
    background: #fff9e9;
}

.cc-admin-filterbar {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(220px, 1.5fr) auto;
    gap: 8px;
    margin-bottom: 13px;
}

.cc-admin-filterbar.log-filterbar {
    grid-template-columns: minmax(220px, 1fr) 150px auto;
}

.cc-admin-table-toolbar,
.cc-admin-pagination {
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px;
    color: #6f8798;
    background: #f8fbfd;
}

.cc-admin-pagination {
    border-top: 1px solid #e0ebf2;
}

.cc-admin-mount-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
    gap: 14px;
}

.cc-admin-mount-editor {
    margin-bottom: 0;
}

.cc-admin-title-input {
    margin-bottom: 5px;
    font-weight: 790;
    font-size: 16px;
}

.cc-admin-switch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 13px;
}

.cc-admin-switch-row {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.cc-admin-switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cc-admin-switch {
    width: 37px;
    height: 21px;
    padding: 3px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cad9e2;
    transition: .18s ease;
}

.cc-admin-switch::after {
    content: "";
    display: block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(45, 76, 98, .25);
    transition: .18s ease;
}

.cc-admin-switch-row input:checked + .cc-admin-switch {
    background: #3a95cc;
}

.cc-admin-switch-row input:checked + .cc-admin-switch::after {
    transform: translateX(16px);
}

.cc-admin-switch-row b {
    font-size: 12px;
}

.cc-admin-services-grid {
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

.cc-admin-service-card {
    margin-bottom: 0;
}

.cc-admin-inline-error {
    margin-top: 10px;
    font-size: 12px;
}

.cc-admin-path-list {
    display: grid;
    gap: 0;
}

.cc-admin-path-list > div {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e8f0f5;
}

.cc-admin-path-list > div:last-child {
    border-bottom: 0;
}

.cc-admin-path-list span {
    color: #71899b;
    text-transform: capitalize;
}

.cc-admin-path-list code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-admin-log-card {
    padding: 0;
    overflow: hidden;
}

.cc-admin-log-card pre {
    height: calc(100vh - 265px);
    min-height: 320px;
    margin: 0;
    padding: 15px;
    overflow: auto;
    color: #d6e8f3;
    background: #132838;
    font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.cc-admin-security-card {
    max-width: 720px;
}

.button.small {
    min-height: 29px;
    padding: 5px 8px;
    font-size: 11px;
}

@media (max-width: 1250px) {
    .cc-admin-metrics-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .cc-admin-state-grid { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
}

@media (max-width: 900px) {
    .cc-admin-v2-backdrop { padding: 0 !important; }
    .cc-admin-v2 { border-radius: 0; border: 0; }
    .cc-admin-layout { grid-template-columns: 68px minmax(0, 1fr); }
    .cc-admin-sidebar { padding-inline: 7px; }
    .cc-admin-nav-button { justify-content: center; padding: 11px 5px; font-size: 0; }
    .cc-admin-nav-button > span { font-size: 18px; }
    .cc-admin-sidebar-foot { display: none; }
    .cc-admin-metrics-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .cc-admin-two-columns { grid-template-columns: 1fr; }
    .cc-admin-filterbar { grid-template-columns: 1fr 1fr; }
    .cc-admin-filterbar input { grid-column: 1 / -1; }
    .cc-admin-filterbar .button { grid-column: 1 / -1; }
    .cc-admin-mount-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .cc-admin-header { padding: 13px; }
    .cc-admin-header h2 { font-size: 19px; }
    .cc-admin-header-actions .button:not(.icon) { display: none; }
    .cc-admin-content { padding: 12px; }
    .cc-admin-section-heading { align-items: stretch; flex-direction: column; }
    .cc-admin-section-actions { flex-wrap: wrap; }
    .cc-admin-metrics-grid { grid-template-columns: 1fr 1fr; }
    .cc-admin-state-grid { grid-template-columns: repeat(2, 1fr); }
    .cc-admin-switch-grid { grid-template-columns: 1fr; }
    .cc-admin-path-list > div { grid-template-columns: 1fr auto; }
    .cc-admin-path-list > div span { grid-column: 1 / -1; }
}

/* ============================================================
   PANEL V2 V3 · CONTENEDOR Y BOTÓN INDEPENDIENTES
   ============================================================ */
.cc-admin-v2-root {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 14px;
    overflow: hidden;
    background: rgba(55, 82, 103, .42);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.cc-admin-v2-root.hidden {
    display: none !important;
}

.cc-admin-v2-open,
.cc-admin-v2-open body {
    overflow: hidden !important;
}

.cc-admin-v2-launcher {
    position: relative;
}

.cc-admin-v2-launcher svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.cc-admin-v2-launcher::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6ee7b7;
    box-shadow: 0 0 0 2px rgba(255,255,255,.9);
}

@media (max-width: 900px) {
    .cc-admin-v2-root {
        padding: 0;
    }
}
/* END CARAJILLO_ADMIN_PANEL_V2_EMBEDDED_V4 */
