/* ═══ Olobuild Admin Design System ═══ */
/* Shared across all Olobuild admin pages */
/* Palette: #1a1a1a (nero), #e8622a (arancione), #f5f0eb (warm gray), #eaeaea (bordi) */

/* ── Page wrapper ── */
.olo-admin-wrap {
    max-width: 960px;
    margin: 30px auto 40px;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
.olo-admin-wrap * { box-sizing: border-box; }

/* ── Topbar (logo + breadcrumb) ── */
.olo-admin-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.olo-admin-topbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.olo-admin-topbar-logo img {
    height: 28px;
    width: auto;
}
.olo-admin-topbar-sep {
    color: #d0d0d0;
    flex-shrink: 0;
}
.olo-admin-topbar-page {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}
.olo-admin-topbar-version {
    margin-left: auto;
    font-size: 11px;
    color: #ccc;
    font-weight: 500;
    flex-shrink: 0;
}

/* ── Page header ── */
.olo-admin-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}
.olo-admin-header-icon {
    width: 42px;
    height: 42px;
    background: #1a1a1a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.olo-admin-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.olo-admin-header p {
    font-size: 13px;
    color: #999;
    margin: 2px 0 0;
}
.olo-admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #f5f0eb;
    color: #1a1a1a;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Cards ── */
.olo-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    margin-bottom: 20px;
    overflow: hidden;
}
.olo-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid #f5f5f5;
}
.olo-card-head h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 2px;
    letter-spacing: -0.01em;
}
.olo-card-head p {
    font-size: 13px;
    color: #999;
    margin: 0;
    line-height: 1.4;
}
.olo-card-head p a {
    color: #e8622a;
    text-decoration: none;
}
.olo-card-head p a:hover {
    text-decoration: underline;
}
.olo-card-body {
    padding: 20px 24px;
}
.olo-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.olo-card-icon.black { background: #1a1a1a; color: #fff; }
.olo-card-icon.orange { background: #e8622a; color: #fff; }
.olo-card-icon.warm { background: #f5f0eb; color: #1a1a1a; }
.olo-card-icon.light { background: #f0f0f0; color: #1a1a1a; }
.olo-card-icon.media { background: #1a1a1a; color: #fff; }
.olo-card-icon.security { background: #e8622a; color: #fff; }
.olo-card-icon.mail { background: #f5f0eb; color: #1a1a1a; }
.olo-card-icon.responsive { background: #f0f0f0; color: #1a1a1a; }

/* ── Fields / Form rows ── */
.olo-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}
.olo-field-row:last-child { border-bottom: none; padding-bottom: 0; }
.olo-field-row:first-child { padding-top: 0; }
.olo-field-info label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}
.olo-field-hint {
    font-size: 12px;
    color: #aaa;
    margin: 2px 0 0;
}
.olo-field-hint a {
    color: #e8622a;
    text-decoration: none;
}
.olo-field-hint a:hover { text-decoration: underline; }
.olo-field-input-wrap {
    position: relative;
    flex-shrink: 0;
}
.olo-field-input {
    width: 280px;
    padding: 9px 14px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 13px;
    color: #1a1a1a;
    background: #fafafa;
    transition: all .15s;
    font-family: inherit;
}
.olo-field-input:focus {
    outline: none;
    border-color: #1a1a1a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0,.05);
}
.olo-field-input::placeholder { color: #ccc; }
.olo-field-input.wide { width: 100%; }
.olo-field-status {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
}
.olo-field-status.ok { color: #2ecc71; }

/* ── Select ── */
.olo-admin-wrap select,
select.olo-field-input {
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding-right: 36px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center !important;
}
.olo-admin-wrap select::ms-expand { display: none; }

/* ── Textarea ── */
textarea.olo-field-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

/* ── Buttons ── */
.olo-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.olo-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 24px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.olo-btn-save:hover {
    background: #333;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.olo-btn-save:disabled {
    opacity: .4;
    cursor: not-allowed;
    box-shadow: none;
}
.olo-btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #fff;
    color: #666;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.olo-btn-reset:hover {
    background: #fafafa;
    color: #1a1a1a;
    border-color: #ccc;
}
.olo-btn-orange {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 24px;
    background: #e8622a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.olo-btn-orange:hover {
    background: #d4561f;
    color: #fff;
    box-shadow: 0 4px 12px rgba(232,98,42,.25);
}
.olo-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    color: #ef4444;
    border: 1.5px solid #fecaca;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.olo-btn-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
}
.olo-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

/* ── Form controls (riusabili — palette admin) ──
   .olo-select / .olo-input / .olo-file / .olo-checkbox / .olo-radio / .olo-range
   Larghezze: .olo-w-sm (~110px) | .olo-w-md (~320px) | .olo-w-lg (~480px) */
.olo-input,
.olo-select {
    box-sizing: border-box;
    height: 38px;
    padding: 0 14px;
    border: 1.5px solid #e5e0d8;
    border-radius: 8px;
    background-color: #fff;
    font-size: 13px;
    color: #1a1a1a;
    font-family: inherit;
    max-width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.olo-input:focus,
.olo-select:focus {
    outline: none;
    border-color: #e8622a;
    box-shadow: 0 0 0 3px rgba(232,98,42,.18);
}
.olo-input::placeholder { color: #b9b1a6; }
.olo-input:disabled,
.olo-select:disabled {
    opacity: .5;
    cursor: not-allowed;
    background-color: #f5f0eb;
}

/* Select stilizzato: chevron SVG inline, niente freccia nativa */
select.olo-select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
select.olo-select::-ms-expand { display: none; }
select.olo-select[multiple] {
    height: auto;
    padding: 8px 12px;
    background-image: none;
}
select.olo-select[multiple] option { padding: 5px 8px; border-radius: 6px; }

/* Number: niente spinner nativi */
input.olo-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
input.olo-input[type="number"]::-webkit-outer-spin-button,
input.olo-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* File input coerente con gli altri controlli */
input.olo-file {
    box-sizing: border-box;
    width: 100%;
    padding: 7px;
    border: 1.5px dashed #e5e0d8;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #666;
    font-family: inherit;
    cursor: pointer;
    max-width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input.olo-file:hover { border-color: #d8d0c4; }
input.olo-file:focus {
    outline: none;
    border-color: #e8622a;
    box-shadow: 0 0 0 3px rgba(232,98,42,.18);
}
input.olo-file::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}
input.olo-file::file-selector-button:hover { background: #333; }
input.olo-file::-webkit-file-upload-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}
input.olo-file::-webkit-file-upload-button:hover { background: #333; }

/* Accent arancio per controlli nativi (opt-in) */
.olo-checkbox,
.olo-radio,
.olo-range,
.olo-check-row input.olo-checkbox { accent-color: #e8622a; }
.olo-checkbox,
.olo-radio {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Larghezze professionali — i campi non si stirano a tutta pagina */
.olo-w-sm { width: 110px; }
.olo-w-md { width: 320px; }
.olo-w-lg { width: 480px; }
@media (max-width: 782px) {
    .olo-w-md, .olo-w-lg { width: 100%; }
}

/* ── Tabs ── */
.olo-admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 12px;
}
.olo-admin-tab {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.olo-admin-tab:hover {
    color: #1a1a1a;
    background: rgba(255,255,255,.5);
}
.olo-admin-tab.active {
    background: #1a1a1a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* ── Toggle switch ── */
.olo-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.olo-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.olo-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #e5e7eb;
    border-radius: 24px;
    transition: .2s;
}
.olo-toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.olo-toggle input:checked + .olo-toggle-slider {
    background: #1a1a1a;
}
.olo-toggle input:checked + .olo-toggle-slider::before {
    transform: translateX(18px);
}

/* ── Status cards ── */
.olo-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.olo-status-card {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.olo-status-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    background: #f0f0f0;
    color: #666;
}
.olo-status-card-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.olo-status-card-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

/* ── Table ── */
.olo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.olo-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 14px;
    border-bottom: 2px solid #f0f0f0;
    background: none;
}
.olo-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f5f5f5;
    color: #1a1a1a;
    vertical-align: middle;
}
.olo-table tbody tr:last-child td { border-bottom: none; }
.olo-table tbody tr:hover td { background: #fafafa; }

/* ── Badge / Pill ── */
.olo-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.olo-badge.green { background: #ecfdf5; color: #059669; }
.olo-badge.orange { background: #fff7ed; color: #e8622a; }
.olo-badge.red { background: #fef2f2; color: #dc2626; }
.olo-badge.gray { background: #f5f5f5; color: #666; }
.olo-badge.black { background: #1a1a1a; color: #fff; }

/* ── Spinner ── */
.olo-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: olo-spin .6s linear infinite;
    display: inline-block;
}
.olo-spinner.dark {
    border-color: rgba(0,0,0,.15);
    border-top-color: #1a1a1a;
}
@keyframes olo-spin { to { transform: rotate(360deg); } }

/* ── Toast / Alert messages ── */
.olo-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}
.olo-msg.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}
.olo-msg.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}
.olo-msg.info {
    background: #f5f0eb;
    border: 1px solid #e8e0d6;
    color: #1a1a1a;
}

/* ── Two-column grid ── */
.olo-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 782px) {
    .olo-grid-2 { grid-template-columns: 1fr; }
}

/* ── Empty state ── */
.olo-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.olo-empty-icon {
    width: 48px;
    height: 48px;
    background: #f5f5f5;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #ccc;
}
.olo-empty p {
    font-size: 13px;
    margin: 0;
}

/* ── Modal / Overlay ── */
.olo-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.olo-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.olo-modal h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
}
.olo-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* ── Checkbox row ── */
.olo-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}
.olo-check-row label {
    font-size: 13px;
    color: #1a1a1a;
    cursor: pointer;
}
.olo-check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a1a1a;
    cursor: pointer;
}

/* ── Breakpoints ── */
.olo-bp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
}
.olo-bp-row:last-child { border-bottom: none; padding-bottom: 0; }
.olo-bp-row:first-child { padding-top: 0; }
.olo-bp-device {
    display: flex;
    align-items: center;
    gap: 12px;
}
.olo-bp-device-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    flex-shrink: 0;
}
.olo-bp-device label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: block;
}
.olo-bp-control {
    display: flex;
    align-items: center;
    gap: 6px;
}
.olo-bp-input { width: 100px !important; text-align: center; }
.olo-bp-unit { font-size: 12px; color: #aaa; font-weight: 600; }

/* ── Progress / Log box ── */
.olo-log-box {
    background: #1a1a1a;
    color: #a3e635;
    border-radius: 10px;
    padding: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 12px;
}

/* ── WP overrides for Olobuild admin pages ── */
.olo-admin-wrap h2.wp-heading-inline { display: none; }
.olo-admin-wrap .subsubsub { display: none; }

/* ═══════════════════════════════════════════════════════════
 * SHELL LAYOUT — Elementor-style admin (top bar + sidebar)
 * Applied when body has .olo-admin-shell
 * ═══════════════════════════════════════════════════════════ */

/* Keep WP sidebar visible — Olobuild shell sits inside #wpcontent */
body.olo-admin-shell #wpbody-content > .wrap { margin: 0; padding: 0; max-width: none; }

/* Remove default .olo-admin-wrap centering — now full-width inside shell */
body.olo-admin-shell .olo-admin-wrap {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Hide old topbar — replaced by shell topbar */
body.olo-admin-shell .olo-admin-topbar { display: none; }

/* ── Shell container ── */
.olo-shell { display: flex; flex-direction: column; min-height: calc(100vh - 32px); }

/* ── Top bar ── */
.olo-shell-topbar {
    height: 48px;
    background: #0c0d0e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 32px; /* below WP admin bar */
    z-index: 999;
    flex-shrink: 0;
}
.olo-shell-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.olo-shell-topbar-brand a { display: flex; align-items: center; }
.olo-shell-topbar-brand img { height: 22px; opacity: 0.95; }
.olo-shell-topbar-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.3px;
}
.olo-shell-topbar-actions { display: flex; align-items: center; gap: 12px; }
.olo-shell-topbar-version {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
}

/* ── Body = sidebar + content ── */
.olo-shell-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ── Sidebar ── */
.olo-shell-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid rgba(0,0,0,0.08);
    overflow-y: auto;
    position: sticky;
    top: 80px; /* 32px admin bar + 48px topbar */
    height: calc(100vh - 80px);
}
.olo-shell-sidebar-head {
    padding: 20px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}
.olo-shell-sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.2px;
}

/* ── Nav items ── */
.olo-shell-nav {
    list-style: none;
    margin: 0;
    padding: 4px 8px;
}
.olo-shell-nav li { margin: 0; }
.olo-shell-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s;
}
.olo-shell-nav-item:hover {
    background: #f5f0eb;
    color: #1a1a1a;
}
.olo-shell-nav-item.active {
    background: #f5f0eb;
    color: #e8622a;
    font-weight: 600;
}
.olo-shell-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.6;
}
.olo-shell-nav-item.active .olo-shell-nav-icon,
.olo-shell-nav-item:hover .olo-shell-nav-icon { opacity: 1; }

/* ── Nav groups (expandable) ── */
.olo-shell-nav-group { margin-top: 4px; }
.olo-shell-nav-group-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    text-align: left;
}
.olo-shell-nav-group-btn:hover { background: #f5f0eb; color: #1a1a1a; }
.olo-shell-nav-arrow {
    margin-left: auto;
    transition: transform 0.2s;
    opacity: 0.4;
}
.olo-shell-nav-group.open .olo-shell-nav-arrow { transform: rotate(180deg); }

.olo-shell-nav-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 0 38px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.olo-shell-nav-group.open .olo-shell-nav-sub { max-height: 300px; }
.olo-shell-nav-sub li { margin: 0; }
.olo-shell-nav-sub a {
    display: block;
    padding: 6px 12px;
    color: #777;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s;
}
.olo-shell-nav-sub a:hover { color: #1a1a1a; background: #f9f6f3; }
.olo-shell-nav-sub a.active { color: #e8622a; font-weight: 600; background: #fef6f2; }

/* ── Content area ── */
.olo-shell-content {
    flex: 1;
    padding: 24px 32px 40px;
    background: #f9f6f3;
    min-width: 0;
    overflow-y: auto;
}
.olo-shell-page-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px;
    padding: 0;
    line-height: 1.3;
}

/* ── Responsive ── */
@media (max-width: 960px) {
    .olo-shell-sidebar { width: 200px; }
    .olo-shell-content { padding: 20px 16px; }
}
@media (max-width: 782px) {
    .olo-shell-body { flex-direction: column; }
    .olo-shell-sidebar {
        width: 100%; height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }
    .olo-shell-topbar { top: 0; } /* no WP admin bar on mobile */
}

/* ═══════════════════════════════════════════════════════════════════
   APP MODE — applicato a TUTTE le pagine Olobuild quando attivo.
   La WP admin sidebar si riduce a 52px icon-only e il sotto-menu
   Olobuild è nascosto perché ridondante con la dashboard cockpit
   e con la sidebar interna del page-shell sulle altre pagine.
   ═══════════════════════════════════════════════════════════════════ */

/* Sidebar collapsed a 52px */
body.olobuild-app-mode #adminmenuwrap,
body.olobuild-app-mode #adminmenuback { width: 52px !important; }
body.olobuild-app-mode #adminmenu { width: 52px !important; overflow: visible; }
body.olobuild-app-mode #adminmenu a.menu-top {
    padding: 8px 0 !important;
    text-align: center !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
body.olobuild-app-mode #adminmenu .wp-menu-name { display: none !important; }
body.olobuild-app-mode #adminmenu .wp-menu-image {
    float: none !important; padding: 0 !important; width: 36px !important;
}
body.olobuild-app-mode #adminmenu .wp-menu-image::before {
    font-size: 18px !important; padding: 0 !important;
}

/* Sotto-menu di prodotti diversi da Olobuild restano accessibili al hover */
body.olobuild-app-mode #adminmenu .wp-submenu {
    left: 52px !important;
    min-width: 200px;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
body.olobuild-app-mode #adminmenu .wp-submenu-head { display: block !important; }
body.olobuild-app-mode #adminmenu li.menu-top:hover .wp-submenu,
body.olobuild-app-mode #adminmenu li.opensub .wp-submenu { display: block !important; }

/* Sotto-menu Olobuild: NASCOSTO sempre in app mode (ridondante con
   la dashboard cockpit e la sidebar interna del page-shell). */
body.olobuild-app-mode #adminmenu li#toplevel_page_olobuild .wp-submenu,
body.olobuild-app-mode #adminmenu li#toplevel_page_olobuild:hover .wp-submenu,
body.olobuild-app-mode #adminmenu li#toplevel_page_olobuild.opensub .wp-submenu,
body.olobuild-app-mode #adminmenu li#toplevel_page_olobuild .wp-submenu-wrap {
    display: none !important;
}

body.olobuild-app-mode #wpcontent,
body.olobuild-app-mode #wpfooter { margin-left: 52px !important; }

/* Reset folded state mai usato in app-mode */
body.folded.olobuild-app-mode #adminmenu .wp-submenu-wrap { display: none; }

/* Mobile: nasconde sidebar */
@media (max-width: 782px) {
    body.olobuild-app-mode #adminmenuwrap,
    body.olobuild-app-mode #adminmenu { width: 0 !important; display: none !important; }
    body.olobuild-app-mode #wpcontent { margin-left: 0 !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   Menu wp-admin SENZA blu nelle pagine Olobuild.

   La voce corrente prende il colore dello schema admin dell'utente (blu
   #2271b1 col "Predefinito", blu elettrico #3858e9 col "Moderno"): qui la
   riportiamo all'antracite della barra stessa (#3c434a, il grigio WP).
   Il foglio si carica solo sulle pagine Olobuild, quindi il resto di
   wp-admin non cambia. !important perche' i colors.css degli schemi
   possono arrivare dopo di noi.
   ═══════════════════════════════════════════════════════════════════ */
#adminmenu .wp-has-current-submenu .wp-submenu-head,
#adminmenu li.current a.menu-top,
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
.folded #adminmenu li.current.menu-top,
#adminmenu .wp-menu-arrow,
#adminmenu .wp-menu-arrow div {
    background: #3c434a !important;
    color: #fff !important;
}
#adminmenu li.current div.wp-menu-image::before,
#adminmenu li.wp-has-current-submenu div.wp-menu-image::before {
    color: #fff !important;
}
/* Il triangolino che "entra" nel contenuto resta del colore dello schema:
   senza blu non serve piu', via. */
#adminmenu li.current:after,
#adminmenu li.wp-has-current-submenu:after {
    display: none !important;
}
