/* =====================================================================
   Item sheet — iOS 26 (app/Views/items/modal_form.php + insights.php)
   ---------------------------------------------------------------------
   The add / edit modal of a product or service. A hero says what the
   item is (picture, name, type, price); under it ONE card holds the tab
   strip and its panes (.nz-ptabs26, project-ios26.css). Panes are flat
   sections divided by a hairline, never cards in a card.

   Colours come only from the --ios26-* tokens (ios26-tokens.css), which
   are re-set for the dark theme, so one rule set covers both. The only
   fixed colours are the search-result preview (a search page is white
   in every theme — it shows the page OUTSIDE the app) and the status
   chips, which carry an icon and a figure, never colour alone.
   ===================================================================== */

.nz-item26 {
    --nz-i26-good: #1f8f4a;
    --nz-i26-warn: #b26a00;
    --nz-i26-bad: #c8331f;
}
body.color-1E202D .nz-item26 {
    --nz-i26-good: #5fd08b;
    --nz-i26-warn: #f2b45a;
    --nz-i26-bad: #ff8a78;
}

/* ---------------------------------------------------------- hero */
.nz-i26-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 4px 0 6px;
}
.nz-i26-hero-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: var(--ios26-radius);
    background: var(--ios26-accent-soft);
    color: var(--ios26-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--ios26-inset);
    font-size: 26px;
}
.nz-i26-hero-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nz-i26-hero-text {
    flex: 1 1 auto;
    min-width: 0;
}
.nz-i26-hero-text h3 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ios26-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nz-i26-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13px;
    color: var(--ios26-muted);
}
.nz-i26-hero-meta > span + span:not(.nz-i26-pill)::before {
    content: "·";
    margin-right: 10px;
}
.nz-i26-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--ios26-pill);
    background: var(--ios26-accent-soft);
    color: var(--ios26-accent-strong);
    font-weight: 600;
    font-size: 12px;
}
body.color-1E202D .nz-i26-pill {
    color: var(--ios26-text);
}
.nz-i26-hero-help {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ios26-muted);
}
.nz-i26-hero-price {
    flex: 0 0 auto;
    text-align: right;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ios26-text);
    font-variant-numeric: tabular-nums;
}
.nz-i26-hero-price small {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--ios26-muted);
}

/* ------------------------------------------------- flat sections */
.nz-item26 .nz-ptabs26 {
    margin-bottom: 0;
}
.nz-i26-section {
    padding: 4px 4px 18px;
}
.nz-i26-section + .nz-i26-section {
    padding-top: 18px;
    border-top: 1px solid var(--ios26-hairline);
}
.nz-i26-section-title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 650;
    color: var(--ios26-text);
}
.nz-i26-section-help {
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--ios26-muted);
}
.nz-i26-optional {
    margin-left: 4px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ios26-muted);
}
.nz-item26 label {
    font-weight: 500;
}
.nz-i26-type-help {
    margin-top: -6px;
}
.nz-i26-type-help [data-type] {
    display: none;
}
.nz-i26-add-photo {
    border-radius: var(--ios26-pill) !important;
}

/* a switch row: label and help on the left, the switch on the right */
.nz-i26-switch-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.nz-i26-switch-row label {
    margin-bottom: 2px;
}
.nz-item26 .form-switch .form-check-input {
    width: 2.6em;
    height: 1.45em;
    margin-top: 0;
    cursor: pointer;
}

/* --------------------------------------- inset grouped list rows */
.nz-i26-list {
    border: 1px solid var(--ios26-hairline);
    border-radius: var(--ios26-radius);
    background: var(--ios26-fill);
    overflow: hidden;
}
.nz-i26-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    margin: 0;
    padding: 10px 14px;
    color: var(--ios26-text);
}
.nz-i26-row + .nz-i26-row {
    border-top: 1px solid var(--ios26-hairline);
}
.nz-i26-check-row {
    cursor: pointer;
    font-weight: 500 !important;
}
.nz-i26-check-row:hover {
    background: var(--ios26-fill-hover);
}
.nz-i26-row-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--ios26-accent-soft);
    color: var(--ios26-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}
.nz-i26-row-label {
    flex: 1 1 auto;
    min-width: 0;
}
.nz-i26-row-value {
    flex: 0 1 auto;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.nz-i26-row-value .text-off {
    font-weight: 400;
}

/* ------------------------------------------- margin + status chips */
.nz-i26-margin {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: var(--ios26-radius-sm);
    background: var(--ios26-fill);
    color: var(--ios26-muted);
    font-variant-numeric: tabular-nums;
    white-space: pre;
}
.nz-i26-margin.is-good, .nz-i26-chip.is-good { color: var(--nz-i26-good); }
.nz-i26-margin.is-warn, .nz-i26-chip.is-warn { color: var(--nz-i26-warn); }
.nz-i26-margin.is-bad, .nz-i26-chip.is-bad { color: var(--nz-i26-bad); }
.nz-i26-margin.is-good, .nz-i26-margin.is-warn, .nz-i26-margin.is-bad {
    font-weight: 600;
}
.nz-i26-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: var(--ios26-pill);
    background: var(--ios26-fill);
    font-size: 12px;
    font-weight: 600;
}

/* --------------------------------------- search result preview */
.nz-i26-serp {
    display: flex;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--ios26-hairline);
    border-radius: var(--ios26-radius);
    background: #fff;
    color: #4d5156;
    font-family: Arial, sans-serif;
}
.nz-i26-serp-text {
    flex: 1 1 auto;
    min-width: 0;
}
.nz-i26-serp-site {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}
.nz-i26-serp-site img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}
.nz-i26-serp-name {
    display: block;
    color: #202124;
    font-size: 14px;
}
.nz-i26-serp-url {
    display: block;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nz-i26-serp-title {
    margin: 6px 0 2px;
    color: #1a0dab;
    font-size: 18px;
    line-height: 1.3;
}
.nz-i26-serp-desc {
    font-size: 13px;
    line-height: 1.5;
}
.nz-i26-serp-img {
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
    border-radius: 10px;
    object-fit: cover;
}

/* ------------------------------------------------------ insights */
.nz-i26-loading {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nz-i26-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.nz-i26-kpi {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-areas: "plate label" "figure figure" "sub sub";
    align-items: center;
    column-gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--ios26-hairline);
    border-radius: var(--ios26-radius);
    background: var(--ios26-fill);
    min-width: 0;
}
.nz-i26-kpi-plate {
    grid-area: plate;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--nz-i26-plate);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.nz-i26-kpi-label {
    grid-area: label;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios26-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* the figure gets the tile's full width: "€79,650.00" and a date must fit whole */
.nz-i26-kpi-figure {
    grid-area: figure;
    margin-top: 8px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--ios26-text);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.nz-i26-kpi-sub {
    grid-area: sub;
    margin-top: 2px;
    font-size: 12px;
    color: var(--ios26-muted);
    overflow-wrap: anywhere;
}

/* 12 thin bars, one hue, rounded data-end, recessive baseline */
.nz-i26-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2px;
    align-items: end;
    height: 150px;
    padding: 0 2px;
}
.nz-i26-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    border-radius: 8px;
    outline: none;
    cursor: default;
}
.nz-i26-bar-track {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 1px solid var(--ios26-hairline-strong);
}
.nz-i26-bar {
    width: min(22px, 70%);
    border-radius: 4px 4px 0 0;
    background: var(--ios26-accent);
    transition: background .15s var(--ios26-ease);
}
.nz-i26-bar.is-zero {
    height: 0 !important;
}
.nz-i26-bar-value {
    min-height: 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ios26-text);
    font-variant-numeric: tabular-nums;
    visibility: hidden;
}
.nz-i26-bar-label {
    margin-top: 6px;
    font-size: 11px;
    color: var(--ios26-muted);
}
.nz-i26-bar-col:hover,
.nz-i26-bar-col:focus-visible {
    background: var(--ios26-fill);
}
.nz-i26-bar-col:hover .nz-i26-bar,
.nz-i26-bar-col:focus-visible .nz-i26-bar {
    background: var(--ios26-accent-strong);
}
.nz-i26-bar-col:hover .nz-i26-bar-value,
.nz-i26-bar-col:focus-visible .nz-i26-bar-value,
.nz-i26-bar-col:last-child .nz-i26-bar-value {
    visibility: visible;
}

/* -------------------------------------------------------- phone */
@media (max-width: 767px) {
    .nz-i26-hero {
        flex-wrap: wrap;
    }
    .nz-i26-hero-price {
        flex-basis: 100%;
        text-align: left;
        font-size: 20px;
    }
    .nz-i26-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nz-i26-serp-img {
        display: none;
    }
}
.nz-i26-pill:empty {
    display: none;
}
