/**
 * Design System iOS para la app móvil del CRM (app.aris.do)
 *
 * Tokens y componentes propios — NO depende de Bootstrap, jQuery, gijgo, etc.
 * Tipografía: SF Pro nativa (-apple-system) sin descarga.
 * Compatible con light/dark mode (prefers-color-scheme).
 *
 * @author Aris Mota <soy@aris.do>
 * @version 3.38.1
 */

/* ============================================================
 * 1. Tokens (light)
 * ============================================================ */
:root {
    --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Tipografía iOS */
    --ios-fs-large-title: 34px;
    --ios-fs-title-1:     28px;
    --ios-fs-title-2:     22px;
    --ios-fs-title-3:     20px;
    --ios-fs-headline:    17px;
    --ios-fs-body:        17px;
    --ios-fs-callout:     16px;
    --ios-fs-subhead:     15px;
    --ios-fs-footnote:    13px;
    --ios-fs-caption:     12px;

    /* Pesos */
    --ios-fw-regular: 400;
    --ios-fw-medium:  500;
    --ios-fw-semibold:600;
    --ios-fw-bold:    700;

    /* Colores sistema iOS — light */
    --ios-blue:    #007aff;
    --ios-green:   #34c759;
    --ios-indigo:  #5856d6;
    --ios-orange:  #ff9500;
    --ios-pink:    #ff2d55;
    --ios-purple:  #af52de;
    --ios-red:     #ff3b30;
    --ios-teal:    #5ac8fa;
    --ios-yellow:  #ffcc00;

    /* Grises iOS */
    --ios-gray:    #8e8e93;
    --ios-gray2:   #aeaeb2;
    --ios-gray3:   #c7c7cc;
    --ios-gray4:   #d1d1d6;
    --ios-gray5:   #e5e5ea;
    --ios-gray6:   #f2f2f7;

    /* Fondos / texto / separadores */
    --ios-bg:               #f2f2f7;
    --ios-bg-grouped:       #f2f2f7;
    --ios-bg-elevated:      #ffffff;
    --ios-bg-cell:          #ffffff;
    --ios-bg-cell-active:   #d1d1d6;
    --ios-bg-tabbar:        rgba(249, 249, 249, 0.85);
    --ios-bg-titlebar:      rgba(249, 249, 249, 0.85);
    --ios-text:             #000000;
    --ios-text-secondary:   #3c3c4399;
    --ios-text-tertiary:    #3c3c434d;
    --ios-separator:        #3c3c432e;
    --ios-separator-opaque: #c6c6c8;

    /* Layout */
    --ios-titlebar-h:       44px;
    --ios-titlebar-large-h: 96px;
    --ios-tabbar-h:         50px;
    --ios-radius-sm:        6px;
    --ios-radius-md:        10px;
    --ios-radius-lg:        14px;
    --ios-radius-sheet:     16px;

    /* Safe areas */
    --ios-safe-top:    env(safe-area-inset-top, 0px);
    --ios-safe-bottom: env(safe-area-inset-bottom, 0px);
    --ios-safe-left:   env(safe-area-inset-left, 0px);
    --ios-safe-right:  env(safe-area-inset-right, 0px);
}

/* ============================================================
 * 2. Tokens (dark)
 * ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --ios-bg:               #000000;
        --ios-bg-grouped:       #000000;
        --ios-bg-elevated:      #1c1c1e;
        --ios-bg-cell:          #1c1c1e;
        --ios-bg-cell-active:   #2c2c2e;
        --ios-bg-tabbar:        rgba(22, 22, 22, 0.85);
        --ios-bg-titlebar:      rgba(22, 22, 22, 0.85);
        --ios-text:             #ffffff;
        --ios-text-secondary:   #ebebf599;
        --ios-text-tertiary:    #ebebf54d;
        --ios-separator:        #54545899;
        --ios-separator-opaque: #38383a;

        --ios-gray:    #8e8e93;
        --ios-gray2:   #636366;
        --ios-gray3:   #48484a;
        --ios-gray4:   #3a3a3c;
        --ios-gray5:   #2c2c2e;
        --ios-gray6:   #1c1c1e;
    }
}

/* ============================================================
 * 3. Reset / base
 * ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ios-bg);
    color: var(--ios-text);
    font-family: var(--ios-font);
    font-size: var(--ios-fs-body);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: contain;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

a { color: var(--ios-blue); text-decoration: none; }
a:active { opacity: 0.6; }

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: var(--ios-fw-semibold); }

::selection { background: rgba(0, 122, 255, 0.25); }

/* ============================================================
 * 4. Shell layout
 * ============================================================ */
.ios-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.ios-main {
    flex: 1 1 auto;
    padding-top: calc(var(--ios-titlebar-large-h) + var(--ios-safe-top));
    padding-bottom: calc(var(--ios-tabbar-h) + var(--ios-safe-bottom) + 16px);
    padding-left:  var(--ios-safe-left);
    padding-right: var(--ios-safe-right);
    background: var(--ios-bg);
}

/* ============================================================
 * 5. Titlebar (large title estilo iOS)
 * ============================================================ */
.ios-titlebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--ios-bg-titlebar);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding-top: var(--ios-safe-top);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.ios-titlebar.is-scrolled { border-bottom-color: var(--ios-separator); }

.ios-titlebar-compact {
    height: var(--ios-titlebar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    position: relative;
}
.ios-titlebar-compact .ios-titlebar-title {
    font-size: var(--ios-fs-headline);
    font-weight: var(--ios-fw-semibold);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}
.ios-titlebar.is-scrolled .ios-titlebar-compact .ios-titlebar-title { opacity: 1; }

.ios-titlebar-back, .ios-titlebar-action {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 8px;
    color: var(--ios-blue);
    font-size: var(--ios-fs-body);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.ios-titlebar-back { left: 8px; }
.ios-titlebar-action { right: 8px; }
.ios-titlebar-back:active, .ios-titlebar-action:active { opacity: 0.5; }
.ios-titlebar-back i { font-size: 18px; }

.ios-titlebar-large {
    padding: 4px 16px 12px;
}
.ios-titlebar-large h1 {
    font-size: var(--ios-fs-large-title);
    font-weight: var(--ios-fw-bold);
    letter-spacing: -0.4px;
    margin: 0;
    transition: opacity 0.2s ease;
}
.ios-titlebar.is-scrolled .ios-titlebar-large { display: none; }
.ios-titlebar.is-scrolled + .ios-main { padding-top: calc(var(--ios-titlebar-h) + var(--ios-safe-top) + 8px); }

/* ============================================================
 * 6. Tabbar inferior
 * ============================================================ */
.ios-tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    height: calc(var(--ios-tabbar-h) + var(--ios-safe-bottom));
    padding-bottom: var(--ios-safe-bottom);
    background: var(--ios-bg-tabbar);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--ios-separator);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}
.ios-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    color: var(--ios-gray);
    font-size: 10px;
    font-weight: var(--ios-fw-medium);
    text-decoration: none;
    border: 0;
    background: none;
    cursor: pointer;
}
.ios-tab i { font-size: 22px; line-height: 1; }
.ios-tab.is-active { color: var(--ios-blue); }
.ios-tab:active { opacity: 0.6; }

/* ============================================================
 * 7. Listas (inset grouped)
 * ============================================================ */
.ios-section-header {
    text-transform: uppercase;
    color: var(--ios-text-secondary);
    font-size: var(--ios-fs-footnote);
    font-weight: var(--ios-fw-regular);
    padding: 8px 32px 6px;
    letter-spacing: 0.2px;
}
.ios-section-footer {
    color: var(--ios-text-secondary);
    font-size: var(--ios-fs-footnote);
    padding: 6px 32px 16px;
}

.ios-list {
    background: var(--ios-bg-cell);
    margin: 0 16px 24px;
    border-radius: var(--ios-radius-md);
    overflow: hidden;
    list-style: none;
    padding: 0;
}
.ios-list-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    min-height: 44px;
    background: var(--ios-bg-cell);
    color: var(--ios-text);
    text-decoration: none;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    position: relative;
}
.ios-list-cell + .ios-list-cell::before {
    content: "";
    position: absolute;
    top: 0; left: 56px; right: 0;
    height: 1px;
    background: var(--ios-separator);
    transform: scaleY(0.5);
}
.ios-list-cell:active { background: var(--ios-bg-cell-active); }

.ios-cell-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}
.ios-cell-icon--blue   { background: var(--ios-blue); }
.ios-cell-icon--green  { background: var(--ios-green); }
.ios-cell-icon--red    { background: var(--ios-red); }
.ios-cell-icon--orange { background: var(--ios-orange); }
.ios-cell-icon--purple { background: var(--ios-purple); }
.ios-cell-icon--indigo { background: var(--ios-indigo); }
.ios-cell-icon--gray   { background: var(--ios-gray); }
.ios-cell-icon--teal   { background: var(--ios-teal); }
.ios-cell-icon--pink   { background: var(--ios-pink); }
.ios-cell-icon--yellow { background: var(--ios-yellow); color: #fff; }

.ios-cell-body {
    flex: 1 1 auto;
    min-width: 0;
}
.ios-cell-title {
    font-size: var(--ios-fs-body);
    font-weight: var(--ios-fw-regular);
    color: var(--ios-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ios-cell-subtitle {
    font-size: var(--ios-fs-footnote);
    color: var(--ios-text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ios-cell-detail {
    font-size: var(--ios-fs-body);
    color: var(--ios-text-secondary);
    flex-shrink: 0;
}
.ios-cell-chevron {
    color: var(--ios-gray3);
    font-size: 14px;
    flex-shrink: 0;
}
.ios-cell-stack { /* contenido vertical libre dentro de la celda */
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ============================================================
 * 8. Botones
 * ============================================================ */
.ios-button-primary,
.ios-button-secondary,
.ios-button-destructive {
    appearance: none;
    border: 0;
    border-radius: var(--ios-radius-md);
    padding: 12px 20px;
    font-size: var(--ios-fs-body);
    font-weight: var(--ios-fw-semibold);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    width: 100%;
    transition: opacity 0.15s ease;
}
.ios-button-primary    { background: var(--ios-blue);  color: #fff; }
.ios-button-secondary  { background: var(--ios-gray5); color: var(--ios-text); }
.ios-button-destructive{ background: var(--ios-red);   color: #fff; }
.ios-button-primary:active,
.ios-button-secondary:active,
.ios-button-destructive:active { opacity: 0.6; }

.ios-button-link {
    background: none; border: 0; padding: 8px 12px;
    color: var(--ios-blue); font-size: var(--ios-fs-body);
    cursor: pointer;
}
.ios-button-link:active { opacity: 0.5; }

/* ============================================================
 * 9. Formularios
 * ============================================================ */
.ios-form-group { margin: 0 0 16px; }
.ios-form-label {
    display: block;
    font-size: var(--ios-fs-footnote);
    color: var(--ios-text-secondary);
    margin: 0 4px 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ios-input-wrap {
    display: flex;
    align-items: center;
    background: var(--ios-bg-cell);
    border-radius: var(--ios-radius-md);
    padding: 0 12px;
    min-height: 48px;
    gap: 10px;
}
.ios-input-icon { color: var(--ios-gray); width: 18px; text-align: center; }
.ios-input {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    outline: none;
    font-size: var(--ios-fs-body);
    padding: 12px 0;
    min-width: 0;
}
.ios-input-action {
    background: none; border: 0; padding: 8px;
    color: var(--ios-gray);
    cursor: pointer;
}
.ios-input-action:active { opacity: 0.5; }

.ios-search-bar {
    display: flex;
    align-items: center;
    background: var(--ios-gray5);
    border-radius: 10px;
    padding: 7px 10px;
    margin: 0 16px 12px;
    gap: 8px;
}
.ios-search-bar input {
    border: 0; background: transparent; outline: none;
    flex: 1; font-size: var(--ios-fs-body); min-width: 0;
}
.ios-search-bar i { color: var(--ios-gray); }

/* ============================================================
 * 10. Segmented control
 * ============================================================ */
.ios-segmented {
    display: flex;
    background: var(--ios-gray5);
    border-radius: 9px;
    padding: 2px;
    margin: 0 16px 16px;
    gap: 2px;
}
.ios-segmented-item {
    flex: 1 1 0;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: var(--ios-text);
    font-size: var(--ios-fs-subhead);
    font-weight: var(--ios-fw-medium);
    border-radius: 7px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ios-segmented-item.is-active {
    background: var(--ios-bg-elevated);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 3px 8px rgba(0,0,0,0.06);
}

/* ============================================================
 * 11. Badges, tags y meta
 * ============================================================ */
.ios-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--ios-red);
    color: #fff;
    font-size: var(--ios-fs-caption);
    font-weight: var(--ios-fw-semibold);
}
.ios-badge--gray  { background: var(--ios-gray3); color: #fff; }
.ios-badge--blue  { background: var(--ios-blue); }
.ios-badge--green { background: var(--ios-green); }
.ios-badge--orange{ background: var(--ios-orange); }

.ios-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--ios-gray5);
    color: var(--ios-text-secondary);
    font-size: var(--ios-fs-caption);
    font-weight: var(--ios-fw-medium);
}
.ios-tag--red    { background: rgba(255,59,48,0.12);   color: var(--ios-red); }
.ios-tag--orange { background: rgba(255,149,0,0.12);   color: var(--ios-orange); }
.ios-tag--green  { background: rgba(52,199,89,0.12);   color: var(--ios-green); }
.ios-tag--blue   { background: rgba(0,122,255,0.12);   color: var(--ios-blue); }

/* ============================================================
 * 12. Sheet (modal slide-up)
 * ============================================================ */
.ios-sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 200;
}
.ios-sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ios-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 201;
    background: var(--ios-bg-elevated);
    border-radius: var(--ios-radius-sheet) var(--ios-radius-sheet) 0 0;
    max-height: 92vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: var(--ios-safe-bottom);
}
.ios-sheet.is-open { transform: translateY(0); }
.ios-sheet-handle {
    width: 36px; height: 5px;
    background: var(--ios-gray3);
    border-radius: 3px;
    margin: 8px auto 4px;
    flex-shrink: 0;
}
.ios-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 12px;
    border-bottom: 1px solid var(--ios-separator);
    flex-shrink: 0;
    gap: 12px;
}
.ios-sheet-header h2 {
    font-size: var(--ios-fs-headline);
    font-weight: var(--ios-fw-semibold);
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ios-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}
.ios-sheet-footer {
    flex-shrink: 0;
    padding: 12px 16px calc(12px + var(--ios-safe-bottom));
    border-top: 1px solid var(--ios-separator);
    background: var(--ios-bg-elevated);
}

/* ============================================================
 * 13. Toast (alertas inline)
 * ============================================================ */
.ios-toast {
    position: fixed;
    top: calc(var(--ios-safe-top) + 12px);
    left: 12px; right: 12px;
    z-index: 300;
    background: rgba(60,60,67,0.92);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--ios-radius-md);
    font-size: var(--ios-fs-subhead);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    text-align: center;
    animation: iosToastIn 0.4s ease;
}
.ios-toast--error { background: rgba(255,59,48,0.95); }
.ios-toast--info  { background: rgba(0,122,255,0.95); }
@keyframes iosToastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ios-alert {
    background: var(--ios-bg-cell);
    border-radius: var(--ios-radius-md);
    padding: 12px 16px;
    margin: 0 0 16px;
    font-size: var(--ios-fs-subhead);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.ios-alert--error { background: rgba(255,59,48,0.10); color: var(--ios-red); }
.ios-alert--info  { background: rgba(0,122,255,0.10); color: var(--ios-blue); }

/* ============================================================
 * 14. Empty state
 * ============================================================ */
.ios-empty {
    text-align: center;
    padding: 64px 32px;
    color: var(--ios-text-secondary);
}
.ios-empty i {
    font-size: 48px;
    color: var(--ios-gray3);
    margin-bottom: 16px;
}
.ios-empty h3 {
    font-size: var(--ios-fs-title-3);
    font-weight: var(--ios-fw-semibold);
    color: var(--ios-text);
    margin: 0 0 6px;
}
.ios-empty p { margin: 0 0 20px; font-size: var(--ios-fs-subhead); }
.ios-empty .ios-button-primary { display: inline-flex; width: auto; }

/* ============================================================
 * 15. Login (estilo iOS)
 * ============================================================ */
.ios-login {
    max-width: 420px;
    margin: 0 auto;
    padding: calc(48px + var(--ios-safe-top)) 24px calc(32px + var(--ios-safe-bottom));
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ios-login-hero {
    text-align: center;
    margin-bottom: 32px;
}
.ios-login-logo {
    width: 80px; height: 80px;
    margin: 0 auto 16px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.ios-login-title {
    font-size: var(--ios-fs-title-1);
    font-weight: var(--ios-fw-bold);
    margin: 0 0 6px;
}
.ios-login-subtitle {
    font-size: var(--ios-fs-subhead);
    color: var(--ios-text-secondary);
    margin: 0;
}
.ios-login-form { margin-top: 8px; }
.ios-login-submit { margin-top: 12px; }
.ios-login-help {
    text-align: center;
    margin-top: 24px;
    color: var(--ios-text-secondary);
    font-size: var(--ios-fs-footnote);
}

/* ============================================================
 * 16. Cards / KPI
 * ============================================================ */
.ios-card {
    background: var(--ios-bg-cell);
    border-radius: var(--ios-radius-lg);
    padding: 16px;
    margin: 0 16px 16px;
}
.ios-card-title {
    font-size: var(--ios-fs-footnote);
    text-transform: uppercase;
    color: var(--ios-text-secondary);
    margin: 0 0 6px;
    letter-spacing: 0.2px;
}
.ios-card-value {
    font-size: var(--ios-fs-title-1);
    font-weight: var(--ios-fw-bold);
    margin: 0;
}
.ios-card-foot {
    color: var(--ios-text-secondary);
    font-size: var(--ios-fs-footnote);
    margin-top: 8px;
}

.ios-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 16px 16px;
}
.ios-kpi-grid .ios-card { margin: 0; }

/* ============================================================
 * 17. Avatares y misceláneo
 * ============================================================ */
.ios-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--ios-gray3);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ios-fs-footnote);
    font-weight: var(--ios-fw-semibold);
    flex-shrink: 0;
}

.ios-checkbox {
    appearance: none;
    width: 22px; height: 22px;
    border: 1.5px solid var(--ios-gray3);
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
}
.ios-checkbox:checked {
    background: var(--ios-blue);
    border-color: var(--ios-blue);
}
.ios-checkbox:checked::after {
    content: "\2713";
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.ios-divider {
    height: 1px;
    background: var(--ios-separator);
    margin: 16px;
    transform: scaleY(0.5);
}

.ios-text-secondary { color: var(--ios-text-secondary); }
.ios-text-tertiary  { color: var(--ios-text-tertiary); }
.ios-text-red       { color: var(--ios-red); }
.ios-text-orange    { color: var(--ios-orange); }
.ios-text-green     { color: var(--ios-green); }
.ios-text-blue      { color: var(--ios-blue); }
.ios-text-center    { text-align: center; }
.ios-mb-0 { margin-bottom: 0; }
.ios-mb-1 { margin-bottom: 8px; }
.ios-mb-2 { margin-bottom: 16px; }
.ios-mt-2 { margin-top: 16px; }

/* Spinner */
.ios-spinner {
    width: 22px; height: 22px;
    border: 2px solid var(--ios-gray4);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: iosSpin 0.8s linear infinite;
    display: inline-block;
}
@keyframes iosSpin { to { transform: rotate(360deg); } }
.ios-loading {
    text-align: center;
    padding: 32px;
    color: var(--ios-text-secondary);
}

/* Pull-to-refresh visual hint (manual; lo activa app.js) */
.ios-refresh {
    text-align: center;
    color: var(--ios-text-secondary);
    font-size: var(--ios-fs-footnote);
    padding: 8px;
    height: 0;
    overflow: hidden;
    transition: height 0.25s ease;
}
.ios-refresh.is-visible { height: 36px; }

/* Skeletons */
.ios-skeleton {
    background: linear-gradient(90deg, var(--ios-gray5) 0%, var(--ios-gray6) 50%, var(--ios-gray5) 100%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: iosShimmer 1.5s infinite;
}
@keyframes iosShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* iPad / pantallas grandes: limitar el ancho de la app a 540px y centrar */
@media (min-width: 768px) {
    .ios-app {
        max-width: 540px;
        margin: 0 auto;
        box-shadow: 0 0 0 1px var(--ios-separator);
    }
    .ios-titlebar, .ios-tabbar {
        max-width: 540px;
        left: 50%;
        transform: translateX(-50%);
    }
}
