/* ====================================================================
   ALZAR MOBILE SHELL — Component styles
   Today view, Tasks page, Schedule strip, Production queue, Reminders.
   These rules are only meaningful when body.is-mobile is active, but
   they are scoped tightly enough that they are inert on desktop.
   ==================================================================== */

/* ── Page wrappers ──────────────────────────────────────────────────── */
.msh-today-page,
.msh-tasks-page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-bottom: 16px;
}

/* ── Loading / error / empty states ────────────────────────────────── */
.msh-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 24px;
    color: var(--color-text-muted, #888);
    font-size: 14px;
}
@keyframes msh-spin { to { transform: rotate(360deg); } }
.msh-spin { animation: msh-spin 0.9s linear infinite; display: inline-block; }

.msh-error {
    padding: 32px 24px;
    text-align: center;
    color: #f87171;
    font-size: 13px;
}

.msh-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 16px;
    color: var(--color-text-muted, #888);
    font-size: 13px;
    text-align: center;
}
.msh-empty i { font-size: 28px; opacity: 0.4; }

/* ── TODAY header ───────────────────────────────────────────────────── */
.msh-today-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.07));
}
.msh-today-hdr-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.msh-today-dow {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-main, #e2e8f0);
    line-height: 1.2;
}
.msh-today-full {
    font-size: 12px;
    color: var(--color-text-muted, #888);
}

/* ── Stage summary pills (manufacturing) ────────────────────────────── */
.msh-stage-pills {
    display: flex;
    gap: 6px;
    padding: 10px 16px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.msh-stage-pills::-webkit-scrollbar { display: none; }

.msh-stage-pill {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid currentColor;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255,255,255,0.04);
}
.msh-stage-pill strong { font-weight: 800; }

/* ── Generic section container ──────────────────────────────────────── */
.msh-section {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}
.msh-section-hdr {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted, #888);
}
.msh-section-hdr i { font-size: 14px; }

/* ── Schedule list (service today / agency events) ──────────────────── */
.msh-sch-list { display: flex; flex-direction: column; gap: 1px; }

.msh-sch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--color-bg-card, rgba(255,255,255,0.03));
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}
.msh-sch-item:active { background: var(--color-bg-hover, rgba(255,255,255,0.07)); }

.msh-sch-time {
    min-width: 46px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary, #0ea5e9);
    text-align: right;
    flex-shrink: 0;
}
.msh-sch-allday {
    color: var(--color-text-muted, #888);
    font-weight: 400;
    font-size: 10px;
}
.msh-sch-body {
    flex: 1;
    min-width: 0;
}
.msh-sch-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msh-sch-sub {
    font-size: 11px;
    color: var(--color-text-muted, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.msh-sch-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

/* ── Reminders list ─────────────────────────────────────────────────── */
.msh-reminder-list { display: flex; flex-direction: column; gap: 1px; }

.msh-reminder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--color-bg-card, rgba(255,255,255,0.03));
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
    transition: opacity 0.2s;
}
.msh-reminder-overdue {
    border-left: 3px solid #ef4444;
}
.msh-reminder-body { flex: 1; min-width: 0; }
.msh-reminder-title {
    font-size: 14px;
    color: var(--color-text-main, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msh-reminder-sub {
    font-size: 11px;
    color: var(--color-text-muted, #888);
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.msh-overdue-label {
    background: rgba(239,68,68,0.18);
    color: #f87171;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}
.msh-due-label {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}
.msh-reminder-done {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: 50%;
    color: #4ade80;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── Task rows ──────────────────────────────────────────────────────── */
.msh-task-list { display: flex; flex-direction: column; gap: 1px; }

.msh-task-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 16px;
    background: var(--color-bg-card, rgba(255,255,255,0.03));
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
    transition: opacity 0.2s;
}
.msh-task-overdue { border-left: 3px solid #ef4444; }
.msh-task-done    { opacity: 0.45; }

.msh-task-check {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-primary, #0ea5e9);
    font-size: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    margin-top: -2px;
}
.msh-task-body { flex: 1; min-width: 0; }
.msh-task-title {
    font-size: 14px;
    color: var(--color-text-main, #e2e8f0);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.msh-task-done .msh-task-title { text-decoration: line-through; }
.msh-task-meta {
    font-size: 11px;
    color: var(--color-text-muted, #888);
    margin-top: 2px;
}

/* ── "View all" link ────────────────────────────────────────────────── */
.msh-view-all-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--color-primary, #0ea5e9);
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── Production groups (manufacturing today view) ───────────────────── */
.msh-prod-group { margin: 0 0 4px; }

.msh-prod-group-lbl {
    padding: 6px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.msh-prod-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--color-bg-card, rgba(255,255,255,0.03));
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}
.msh-prod-card:active { background: var(--color-bg-hover, rgba(255,255,255,0.07)); }

.msh-prod-card-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-main, #e2e8f0);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.msh-prod-card-sub {
    font-size: 11px;
    color: var(--color-text-muted, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.msh-prod-adv-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-hover, rgba(255,255,255,0.06));
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-radius: 50%;
    color: var(--color-primary, #0ea5e9);
    font-size: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── Tasks page header ──────────────────────────────────────────────── */
.msh-tasks-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.07));
}
.msh-tasks-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-main, #e2e8f0);
}

/* ── Filter tabs ────────────────────────────────────────────────────── */
.msh-task-filters {
    display: flex;
    gap: 0;
    padding: 8px 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}
.msh-task-filters::-webkit-scrollbar { display: none; }

.msh-filter-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    background: none;
    color: var(--color-text-muted, #888);
    font-size: 12px;
    font-family: var(--font-base, inherit);
    cursor: pointer;
    margin-right: 6px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.msh-filter-btn.active {
    background: var(--color-primary, #0ea5e9);
    border-color: var(--color-primary, #0ea5e9);
    color: #fff;
}
.msh-filter-count {
    display: inline-block;
    background: rgba(239,68,68,0.25);
    color: #f87171;
    border-radius: 8px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
}

/* ── Task groups ────────────────────────────────────────────────────── */
.msh-task-group { margin-top: 8px; }
.msh-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #888);
}
.msh-group-count {
    background: var(--color-bg-hover, rgba(255,255,255,0.08));
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 10px;
}

/* ── Shared icon button ─────────────────────────────────────────────── */
.msh-icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-hover, rgba(255,255,255,0.07));
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-radius: 50%;
    color: var(--color-primary, #0ea5e9);
    font-size: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.msh-icon-btn:active { background: rgba(14,165,233,0.18); }

/* ── New Task Modal ─────────────────────────────────────────────────── */
.msh-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    align-items: flex-end;
}
.msh-modal[aria-hidden="false"] { display: flex; }

.msh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}
.msh-modal-sheet {
    position: relative;
    width: 100%;
    background: var(--color-bg-surface, #1a1a2e);
    border-radius: 20px 20px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 90dvh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}
.msh-modal[aria-hidden="false"] .msh-modal-sheet {
    transform: translateY(0);
}

.msh-modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-main, #e2e8f0);
}
.msh-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    overflow-y: auto;
}
.msh-modal-foot {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border, rgba(255,255,255,0.08));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.msh-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--color-bg-card, rgba(255,255,255,0.05));
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--color-text-main, #e2e8f0);
    font-size: 14px;
    font-family: var(--font-base, inherit);
    outline: none;
    transition: border-color 0.15s;
}
.msh-input:focus { border-color: var(--color-primary, #0ea5e9); }
.msh-textarea { resize: none; min-height: 60px; }

.msh-btn-primary,
.msh-btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-base, inherit);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
}
.msh-btn-primary  { background: var(--color-primary, #0ea5e9); color: #fff; }
.msh-btn-secondary {
    background: var(--color-bg-hover, rgba(255,255,255,0.07));
    border: 1px solid var(--color-border, rgba(255,255,255,0.1));
    color: var(--color-text-muted, #888);
}
.msh-btn-primary:active,
.msh-btn-secondary:active { opacity: 0.75; }
