:root {
    --bg: #f5f7f8;
    --ink: #000000;
    --muted: #083d7d;
    --brand: #083d7d;
    --line: #d9e0e4;
    --panel: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #ffffff;
    color: var(--ink);
    font-family: sans-serif;
}

a {
    color: var(--brand);
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card,
.panel {
    background: var(--panel);
    border: 1px solid #ffc002;
    border-radius: 9px;
    box-shadow: 0 16px 40px rgba(23, 32, 38, 0.08);
}

.login-card {
    width: min(420px, 100%);
    padding: 32px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-logo {
    display: block;
    width: auto;
    height: 90px;
    max-width: min(420px, 100%);
    object-fit: contain;
}

.login-card .admin-logo {
    margin: 0 auto 18px;
}

.admin-header .admin-logo,
.setup-hero .admin-logo {
    margin-bottom: 14px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 6px;
    color: #32424c;
    font-size: 14px;
    font-weight: 700;
}

input,
textarea,
select,
button {
    width: 100%;
    border-radius: 6px;
    font: inherit;
}

input,
textarea,
select {
    border: 1px solid var(--line);
    padding: 12px 14px;
    color: var(--ink);
    background: #fff;
}

input[type="color"] {
    height: 46px;
    padding: 4px;
}

button,
.primary-action {
    border: 0;
    padding: 13px 16px;
    background: var(--brand);
    color: white;
    cursor: pointer;
    font-weight: 700;
}

.alert {
    margin-bottom: 18px;
    border: 1px solid #f2b8a2;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff2ec;
    color: #83391f;
}

.alert p {
    margin: 0;
}

.setup-hero,
.admin-header {
    padding: 27px clamp(20px, 6vw, 72px);
    background: #ffffff;
    border-bottom: 1px solid #ffc002;
}

.setup-hero h1,
.admin-header h1 {
    margin-bottom: 8px;
}

.setup-layout,
.admin-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 28px auto;
}

.setup-form {
    gap: 18px;
}

.panel {
    position: relative;
    padding: 12px;
}

.step {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}

.admin-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 72px;
    padding-top: 72px;
    padding-bottom: 12px;
}

.admin-header::before {
    content: "Desarrollo y produccion : Infinity Group SAS";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    height: 54px;
    padding: 0 clamp(20px, 6vw, 72px);
    background: #050505;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.admin-header h1 {
    position: absolute;
    left: clamp(20px, 6vw, 72px);
    bottom: -58px;
    margin: 0;
    color: var(--ink);
    font-size: 30px;
    line-height: 1.2;
}

.admin-header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-header nav a,
.admin-header .nav-button {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 13px;
    background: #ffffff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.admin-header nav a:hover,
.admin-header .nav-button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.admin-shell {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
}

.data-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 16px;
}

.data-list dt {
    color: var(--muted);
    font-weight: 700;
}

.data-list dd {
    margin: 0;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border-radius: 6px;
    padding: 0 16px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.success-panel {
    border-color: #9bd0bd;
}

.notice {
    margin-bottom: 18px;
    border: 1px solid #9bd0bd;
    border-radius: 8px;
    padding: 12px 14px;
    background: #effaf5;
    color: #176b50;
    font-weight: 700;
}

.quick-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: stretch;
}

.admin-preview {
    width: min(420px, 100%);
    max-height: 220px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-preview.small {
    width: 150px;
    max-height: 90px;
    object-fit: contain;
    background: #f9fbfc;
}

.admin-preview.favicon-preview {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #f9fbfc;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 13px;
}

.admin-table p {
    margin: 6px 0 0;
    color: var(--muted);
}


.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #f8fafb;
}

.editor-toolbar button {
    width: auto;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
}

.editor-toolbar button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.editor-toolbar select {
    width: auto;
    min-height: 34px;
    padding: 0 10px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
}

.rich-textarea {
    min-height: 300px;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

.editor-preview {
    width: 100%;
    max-height: 560px;
    margin-top: 12px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    background: #ffffff;
}

.editor-preview[hidden] {
    display: none;
}



.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.actions form,
.admin-header nav form {
    display: inline;
}

.link-button,
.nav-button {
    width: auto;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.nav-button {
    min-height: 0;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto;
}

.message-list {
    display: grid;
    gap: 16px;
}

.panel-separator {
    margin: 22px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.message-card header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.message-card.unread {
    border-color: #79b7cc;
}

.badge {
    align-self: flex-start;
    border-radius: 999px;
    padding: 5px 10px;
    background: #e8f5f9;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-admin-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.gallery-admin-card h2 {
    margin: 14px 0 6px;
    font-size: 20px;
}

.admin-footer {
    width: min(1040px, calc(100% - 32px));
    margin: 28px auto;
    padding: 18px 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    border-top: 1px solid var(--line);
}

@media (max-width: 760px) {

    .admin-header,
    .admin-shell {
        display: grid;
    }

    .admin-header {
        margin-bottom: 86px;
        padding-top: 72px;
    }

    .admin-header h1 {
        bottom: -64px;
        font-size: 24px;
    }

    .admin-header nav {
        gap: 8px;
    }

    .gallery-admin-grid {
        grid-template-columns: 1fr;
    }
}


.menu-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.menu-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 14px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.menu-tabs a.active,
.menu-tabs a:hover {
    border-color: var(--brand);
    background: #e8f5f9;
    color: var(--brand);
}

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

.form-check-bottom {
    align-self: end;
    min-height: 46px;
}

.secondary-link {
    display: inline-flex;
    margin-left: 10px;
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.submenu-row td:first-child,
.submenu-row strong {
    color: var(--muted);
}

@media (max-width: 760px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Admin console layout */
.admin-header { justify-content: center; margin-bottom: 0; padding-top: 72px; padding-bottom: 12px; }
.admin-header h1 { position: static; margin: 0; color: var(--ink); font-size: 28px; line-height: 1.2; }
.admin-header .admin-logo { margin-bottom: 0; }
.admin-header nav { display: none; }
.admin-workspace { display: grid; grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) minmax(220px, 280px); align-items: start; gap: 18px; width: min(1440px, calc(100% - 32px)); margin: 28px auto; }
.admin-workspace .setup-layout, .admin-workspace .admin-shell { width: 100%; margin: 0; }
.admin-content { min-width: 0; }
.admin-sidebar, .admin-summary { position: sticky; top: 18px; }
.admin-main-menu { display: flex; flex-direction: column; gap: 12px; }
.admin-main-menu a, .primary-link { display: inline-flex; align-items: center; min-height: 42px; border-radius: 6px; padding: 0 16px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.admin-main-menu a:hover, .primary-link:hover { background: #052d5d; }
.admin-shell { display: block; min-height: 120px; }
.accordion-panel { padding: 0; overflow: hidden; }
.accordion-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 14px; color: var(--brand); font-weight: 800; cursor: pointer; list-style: none; }
.accordion-panel summary::-webkit-details-marker { display: none; }
.accordion-panel summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .18s ease; }
.accordion-panel[open] summary::after { transform: rotate(225deg); }
.accordion-panel > label, .accordion-panel > .admin-preview, .accordion-panel > .check-row { margin: 0 14px 14px; }

.accordion-panel > .admin-subpanel {
    margin: 0 14px 14px;
}

.admin-subpanel {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfcfd;
}

.admin-subpanel + .admin-subpanel {
    margin-top: 14px;
}

.admin-subpanel h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
}

.admin-subpanel label,
.admin-subpanel .check-row {
    margin: 0;
}
.accordion-panel > label:first-of-type { margin-top: 2px; }
.inline-action-form { margin: 0; }
.inline-action-form button, .nav-button { width: auto; }
@media (max-width: 1120px) { .admin-workspace { grid-template-columns: minmax(170px, 220px) minmax(0, 1fr); } .admin-summary { position: static; grid-column: 1 / -1; } }
@media (max-width: 760px) { .admin-workspace { grid-template-columns: 1fr; } .admin-sidebar, .admin-summary { position: static; } }

.module-actions { display: flex; justify-content: flex-start; gap: 10px; margin-bottom: 14px; }
.module-actions .primary-action { width: auto; }
.admin-content > .panel:first-child, .admin-content > .gallery-admin-grid:first-child, .admin-content > .message-list:first-child { margin-top: 0; }

.admin-summary { min-width: 0; overflow: hidden; }
.admin-summary .data-list { grid-template-columns: minmax(72px, max-content) minmax(0, 1fr); }
.admin-summary dd { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.accordion-panel > .gallery-admin-grid, .accordion-panel > .message-list, .accordion-panel > .message-empty, .accordion-panel > .table-wrap, .accordion-panel > .form-grid-2 { margin: 0 14px 14px; }
.accordion-panel > .step { margin-left: 14px; }

.message-controls,
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 14px 14px;
}

.message-controls a,
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 12px;
    font-weight: 700;
    text-decoration: none;
}

.message-controls a.active,
.message-controls a:hover,
.pagination a:hover {
    border-color: var(--brand);
    background: #e8f5f9;
    color: var(--brand);
}

.message-delete {
    margin-top: 12px;
}

.secondary-action {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.nested-panel {
    margin: 14px;
    border-color: var(--line);
    box-shadow: none;
}

.nested-panel h2 {
    margin-top: 0;
    color: var(--brand);
    font-size: 18px;
}

.nested-accordion {
    padding: 0;
    overflow: hidden;
}

.nested-accordion summary {
    min-height: 42px;
    padding: 10px 12px;
    color: var(--ink);
    background: #ffffff;
}

.nested-accordion > label,
.nested-accordion > .admin-preview,
.nested-accordion > .check-row {
    margin: 0 12px 12px;
}

.nested-accordion > label:first-of-type,
.nested-accordion > .check-row:first-of-type {
    margin-top: 12px;
}
