/* Remontu mobilā lietotne — papildinājumi public/shop.css pamatkomponentēm (tie paši --shop-* tēmas
 * žetoni: tumšais ir bāze, gaišais — pārrakstījums shop.css). Šeit tikai tas, kā veikalam nav. */

/* Četras cilnes (veikalam — trīs) */
.rm-tabbar {
    grid-template-columns: repeat(4, 1fr);
}

/* «Vairāk»: lietotājs un tenant tips */
.rm-profile {
    text-align: center;
}

.rm-profile-name {
    font-size: 20px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.rm-profile-mode {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--shop-primary-soft);
    color: var(--shop-primary);
    font-size: 14px;
    font-weight: 600;
}

/* Segmentu slēdzis (tēma u.c.) */
.rm-segment {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 4px;
    margin-top: 8px;
    padding: 4px;
    border: 1px solid var(--shop-border);
    border-radius: 12px;
    background: var(--shop-surface-2);
}

.rm-segment-btn {
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--shop-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}

.rm-segment-btn.is-active {
    background: var(--shop-surface);
    color: var(--shop-text);
    box-shadow: 0 1px 2px rgba(2, 6, 23, 0.25);
}

/* ======================================================================
   3. posms: saraksts, meklēšana, remonta kartiņa
   ====================================================================== */

/* Meklēšana un statusa čipi paliek redzami, ritinot sarakstu */
.rm-feed-head {
    position: sticky;
    top: 56px;
    z-index: 5;
    margin: -16px -16px 0;
    padding: 12px 16px 10px;
    background: var(--shop-bg);
}

.rm-chips {
    display: flex;
    gap: 8px;
    margin: 10px -16px 0;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.rm-chips::-webkit-scrollbar { display: none; }

.rm-chip {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--shop-border);
    border-radius: 999px;
    background: var(--shop-surface);
    color: var(--shop-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
}
.rm-chip.is-active {
    border-color: transparent;
    background: var(--shop-primary);
    color: var(--shop-primary-ink);
}

.rm-count { margin: 4px 0 8px; font-size: 14px; }
.rm-more { min-height: 24px; padding: 12px 0; text-align: center; font-size: 14px; }

.rm-list { display: grid; gap: 10px; }

.rm-item {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--shop-border);
    border-radius: 14px;
    background: var(--shop-surface);
    color: var(--shop-text);
    text-decoration: none;
    touch-action: manipulation;
}
.rm-item:active { background: var(--shop-surface-2); }

.rm-item-top,
.rm-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.rm-item-number { font-weight: 700; }
.rm-item-title {
    margin: 6px 0 4px;
    font-size: 17px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.rm-item-meta {
    min-width: 0;
    overflow: hidden;
    color: var(--shop-muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rm-item-sum { flex: 0 0 auto; font-weight: 700; }

/* Valsts numurs kā numura zīme */
.rm-plate {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    background: var(--shop-surface-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.04em;
}

/* Statusa birkas: krāsa pēc statusa grupas */
.rm-status {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--shop-primary-soft);
    color: var(--shop-primary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.rm-status--received,
.rm-status--repairing { background: rgba(56, 189, 248, 0.14); color: var(--shop-accent); }
.rm-status--diagnosing,
.rm-status--approving,
.rm-status--waiting_parts { background: var(--shop-warning-soft); color: var(--shop-warning); }
.rm-status--issued { background: var(--shop-surface-2); color: var(--shop-muted); }
.rm-status--cancelled { background: var(--shop-danger-soft); color: var(--shop-danger); }

/* Kartiņa */
.rm-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.rm-head-number { font-size: 24px; font-weight: 800; }
.rm-locked {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--shop-warning-soft);
    color: var(--shop-warning);
    font-size: 14px;
    font-weight: 600;
}

.rm-card-title {
    margin: 0 0 10px;
    color: var(--shop-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.rm-card-empty { margin: 0; }

.rm-client-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.rm-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--shop-surface-2);
    color: var(--shop-muted);
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}
.rm-break { overflow-wrap: anywhere; }

.rm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rm-actions--footer { margin-top: 16px; }
.rm-actions--footer .shop-btn { flex: 1 1 140px; }

.rm-field { padding: 8px 0; border-top: 1px solid var(--shop-border); }
.rm-field:first-of-type { border-top: 0; padding-top: 0; }
.rm-field-label { color: var(--shop-muted); font-size: 13px; }
.rm-field-value { white-space: pre-line; overflow-wrap: anywhere; }

.rm-money {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.rm-money > div { padding: 10px 12px; border-radius: 12px; background: var(--shop-surface-2); }
.rm-money small { display: block; color: var(--shop-muted); font-size: 13px; }
.rm-money b { font-size: 18px; }

.rm-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--shop-border);
}
.rm-line:first-child { border-top: 0; padding-top: 0; }
.rm-line-main { min-width: 0; }
.rm-line-name { font-weight: 600; overflow-wrap: anywhere; }
.rm-line-meta { color: var(--shop-muted); font-size: 13px; }
.rm-line-sum { flex: 0 0 auto; font-weight: 700; }
.rm-lines-total,
.rm-lines-pvn { display: flex; justify-content: space-between; gap: 12px; }
.rm-lines-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--shop-border); font-size: 17px; }
.rm-lines-pvn { font-size: 14px; }

.rm-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rm-photos img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
    background: var(--shop-surface-2);
}

.rm-pre { white-space: pre-line; overflow-wrap: anywhere; }

.rm-invoice {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: var(--shop-text);
    text-decoration: none;
    font-weight: 600;
}
.rm-invoice span:first-child { color: var(--shop-accent); }

.rm-history summary { margin: 0; cursor: pointer; list-style: none; }
.rm-history summary::-webkit-details-marker { display: none; }
.rm-history summary::after { content: ' ▾'; }
.rm-history[open] summary { margin-bottom: 10px; }
.rm-log { padding: 8px 0; border-top: 1px solid var(--shop-border); font-size: 14px; }
.rm-log .shop-muted { font-size: 13px; }

/* ======================================================================
   4. posms: remonta pieņemšana un labošana
   ====================================================================== */

.rm-form-field { position: relative; margin-bottom: 12px; }
.shop-input.is-invalid { border-color: var(--shop-danger); }
.rm-error { margin-top: 4px; color: var(--shop-danger); font-size: 14px; font-weight: 600; }
.rm-error--form {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--shop-danger-soft);
}

/* Izvēles rūtiņa kā liela pieskāriena rinda */
.rm-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    margin-top: 4px;
    cursor: pointer;
}
.rm-switch input { flex: 0 0 auto; width: 24px; height: 24px; accent-color: var(--shop-primary); }

/* Piesaistītais klients */
.rm-picked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px 6px 6px 12px;
    border-radius: 12px;
    background: var(--shop-primary-soft);
    color: var(--shop-primary);
    font-weight: 600;
}
.rm-picked span { min-width: 0; overflow-wrap: anywhere; }
.rm-picked-x {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
}

/* «Atrasts klients» pēc tālruņa */
.rm-hint {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px dashed var(--shop-accent);
    border-radius: 12px;
    background: transparent;
    color: var(--shop-accent);
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

/* Ieteikumu saraksts zem lauka un klientu meklēšanā */
.rm-suggest {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 6;
    margin-top: 4px;
    overflow: hidden;
    border: 1px solid var(--shop-border);
    border-radius: 12px;
    background: var(--shop-surface);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}
.rm-suggest-item {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 0;
    border-top: 1px solid var(--shop-border);
    background: transparent;
    color: var(--shop-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.rm-suggest-item:first-child { border-top: 0; }
.rm-suggest-item:active { background: var(--shop-surface-2); }
.rm-sheet-results { margin-top: 12px; }
.rm-sheet-results .rm-suggest-item { border-radius: 0; }

.rm-chips--wrap { flex-wrap: wrap; margin: 6px 0 12px; padding: 0; overflow: visible; }

/* Transportlīdzeklis pieder citam klientam */
.rm-conflict {
    display: grid;
    gap: 8px;
    margin-top: 4px;
    padding: 12px;
    border-radius: 12px;
    background: var(--shop-warning-soft);
}
.rm-conflict p { margin: 0; color: var(--shop-warning); font-weight: 600; }

/* Atjaunots melnraksts */
.rm-draft {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 8px 8px 12px;
    border-radius: 12px;
    background: var(--shop-warning-soft);
    color: var(--shop-warning);
    font-size: 14px;
    font-weight: 600;
}
.is-offline #rmSave { opacity: 0.4; pointer-events: none; }

/* «Vairāk»: lietotnes instalēšana uz sākuma ekrāna */
.rm-install p { margin: 0 0 12px; line-height: 1.45; }
.rm-install p:last-child { margin-bottom: 0; }
.rm-install-done { color: var(--shop-primary); font-weight: 600; }
.rm-install-steps { margin: 0; padding-left: 20px; line-height: 1.5; }
.rm-install-steps li + li { margin-top: 6px; }
.rm-ios-share {
    display: inline-flex;
    vertical-align: -4px;
    color: var(--shop-accent);
}
.rm-ios-share svg { width: 20px; height: 20px; }

/* ======================================================================
   5. posms: tāmes rindas — pievienošana, labošana, dzēšana
   ====================================================================== */
.rm-line-main,
.rm-line-name,
.rm-line-meta { display: block; }

/* Rinda kā poga (labošanai) — izskatās tāpat kā lasāmā rinda */
.rm-line--tap {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--shop-border);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}
.rm-line--tap:first-child { border-top: 0; }
.rm-line--tap:active { background: var(--shop-surface-2); }
.rm-add-lines { margin-top: 14px; }

/* Rindas logs */
.rm-line-head { margin-bottom: 12px; overflow-wrap: anywhere; }
.rm-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
}
.rm-grid2 > .rm-form-field { min-width: 0; }
.rm-markup {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rm-markup .shop-input { flex: 1; min-width: 0; }
.rm-markup-cost { color: var(--shop-muted); font-size: 14px; white-space: nowrap; }
.rm-danger { color: var(--shop-danger); }
.rm-cat-meta { display: block; font-size: 13px; }

/* ======================================================================
   6. posms: statuss, foto, SMS, akts uz e-pastu
   ====================================================================== */
.rm-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--shop-muted);
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
}
.rm-status-list { display: grid; gap: 8px; }
.rm-status-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid var(--shop-border);
    border-radius: 12px;
    background: var(--shop-surface-2);
    color: var(--shop-text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
}
.rm-status-option.is-current { border-color: var(--shop-primary); }

/* Foto režģis: sīktēli un «+ Foto» flīze tādā pašā izmērā */
.rm-photo {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
}
.rm-photo-add {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px dashed var(--shop-border);
    color: var(--shop-accent);
    font-weight: 700;
}
.rm-photo-full {
    display: block;
    width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    object-fit: contain;
    background: var(--shop-surface-2);
}

.rm-sms-sent {
    margin-top: 6px;
    color: var(--shop-primary);
    font-size: 14px;
    font-weight: 600;
}

/* 7. posms: saraksta zīmes (foto, rēķins) */
.rm-badge { white-space: nowrap; font-size: 13px; }

/* emax.lv/mobile — instalēšanas lapa */
.emax-install-card { text-align: center; }
.emax-install-icon { display: block; width: 96px; height: 96px; margin: 0 auto 12px; border-radius: 22px; }
.emax-install-hint { margin: 0 0 12px; line-height: 1.45; }
.emax-install .rm-install-steps { margin: 0 0 12px; text-align: left; }
.emax-install-qr { width: 200px; margin: 0 auto 8px; padding: 10px; border-radius: 12px; background: #fff; }
.emax-install-qr svg { display: block; width: 100%; height: auto; }
.emax-install-url { margin: 0 0 8px; font-size: 14px; overflow-wrap: anywhere; }
.rm-install-share { margin: 12px 0 0; font-size: 14px; }
.rm-install-share a { color: var(--shop-accent); }
