﻿/* ======= Theme: Orange / Full-Page ======= */
:root {
    --primary: #ff7a00;
    --primary-700: #e56f00;
    --bg: #0b0f14;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --radius: 16px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f7fb;
        --text: #1f2937;
        --muted: #6b7280;
    }
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    background: #d7d7d7;
    color: var(--text);
    font-family: 'Vazirmatn',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

/* جلوگیری از زوم iOS و یکدست‌سازی فونت روی کنترل‌ها */
body, button, .btn, input, select, textarea {
    font-family: 'Vazirmatn',sans-serif !important;
    font-size: 16px;
}

/* Full-page container */
.container {
    width: 100%;
    max-width: 1200px; /* تمام‌صفحه اما محدودیت منطقی روی دسکتاپ */
    margin: clamp(16px,3vw,40px) auto;
    padding: 0 clamp(10px,2vw,24px);
}

/* Card */
.card {
    background: var(--card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,.25);
}

.card-head {
    background: var(--primary);
    color: #fff;
    padding: 16px 18px;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.card-title {
    letter-spacing: .2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.card-body {
    padding: 16px 18px
}

.card-foot {
    padding: 12px 18px;
    border-top: 1px dashed #e5e7eb
}

.section-title {
    margin: 12px 0 6px;
    font-weight: 700;
    color: #374151;
    opacity: .9;
}

/* Rows (label / value) */
.row {
    display: grid;
    grid-template-columns: 160px 1fr; /* بازتر برای فول‌عرض */
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

    .row:last-child {
        border-bottom: none
    }

.label {
    color: var(--muted);
    font-size: .92rem
}

.value {
    font-weight: 700
}

/* List card */
.list-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 6px;
}

    .list-card .row {
        padding: 10px 8px
    }

.empty {
    padding: 14px;
    text-align: center
}

/* Search */
.search-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid #cfd8e3;
    border-radius: 12px;
    outline: none;
    background: #fff;
}

    .input:focus {
        border-color: var(--primary)
    }

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-fill,
.btn-primary {
    background: var(--primary);
    color: #fff;
}

    .btn-fill:hover,
    .btn-primary:hover {
        background: var(--primary-700);
        color: #fff;
    }

.btn-primary-soft {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

    .btn-primary-soft:hover {
        background: var(--primary);
        color: #fff
    }

.btn-cta {
    width: 100%;
    margin-top: 12px;
    background: var(--primary);
    color: #fff;
    padding: 14px;
    border-radius: 16px;
    font-weight: 800;
}

    .btn-cta:hover {
        background: var(--primary-700)
    }

/* Suggest dropdown */
.suggest-list {
    margin-top: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(0,0,0,.15);
    background: #fff;
    z-index: 10;
    position: relative;
}

.suggest-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
}

    .suggest-item:hover {
        background: #fff7f0
    }
/* نارنجی خیلی روشن */

/* Tabs */
.card-tabs {
    margin-top: 12px
}

.tab-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 11;
    background: #fff;
    padding: 6px 0;
    border-bottom: 1px solid #eef2f7;
}

.pill {
    flex: 1;
    padding: 10px;
    border-radius: 999px;
    border: 1.5px solid #ffd7b3;
    background: #fff5eb;
    color: #7a2e0e;
    font-weight: 700;
}

    .pill.active {
        background: #ffe8d6;
        border-color: #ffb078
    }

/* Tabs content */
.card-tabs .list-card {
    display: none;
    max-height: 65vh;
    overflow: auto;
    padding: 0;
}

    .card-tabs .list-card.active {
        display: block
    }

/* List item (attachments/consumables) */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px dashed #e5e7eb;
}

    .list-item:last-child {
        border-bottom: none
    }

.badge {
    background: #fff0e6;
    color: #7a2e0e;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .8rem;
}

.muted {
    color: var(--muted);
    font-size: .86rem
}

/* Toast */
.toast {
    position: fixed;
    inset-inline: 0;
    bottom: 18px;
    margin: auto;
    max-width: 420px;
    background: #111827;
    color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    display: none;
}

    .toast.show {
        display: block
    }

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 14px;
    overflow: hidden;
    font-size: .92rem;
}

    .table thead th {
        background: #fff5eb;
        border-bottom: 1px solid #e5e7eb;
        text-align: right;
        padding: 10px 12px;
        font-weight: 800;
        white-space: nowrap;
    }

    .table tbody td {
        border-bottom: 1px dashed #eef2f7;
        padding: 10px 12px;
        vertical-align: top;
    }

    .table tbody tr:last-child td {
        border-bottom: none
    }

    .table .num {
        text-align: left;
        font-variant-numeric: tabular-nums
    }

.table-wrap {
    overflow: auto
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    z-index: 1000;
}

    .modal-backdrop.show {
        display: block
    }

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1001;
}

.modal-card {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden;
    animation: modalIn .15s ease-out;
}

@keyframes modalIn {
    from {
        transform: translateY(6px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

.modal-head {
    padding: 12px 16px;
    background: #fff5eb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-weight: 800
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer
}

.modal-body {
    padding: 12px 16px;
    max-height: 70vh;
    overflow: auto
}

.modal-rows .mrow {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #eef2f7;
}

    .modal-rows .mrow:last-child {
        border-bottom: none
    }

.mlabel {
    color: var(--muted)
}

.mvalue {
    font-weight: 700;
    white-space: pre-wrap;
    line-height: 1.6
}

.tag {
    background: #fff0e6;
    color: #7a2e0e;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .8rem;
    font-weight: 700;
}

.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
    margin-inline-start: 6px;
}

/* Error message */
.error {
    color: #b45309;
    background: #ffedd5;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px;
    text-align: center;
    font-weight: 700;
}

/* Filters (work orders) */
.filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.filter-btn.active {
    background: var(--primary);
    color: #fff
}

/* Responsive polish */
@media (max-width: 960px) {
    .row {
        grid-template-columns: 140px 1fr;
    }
}

@media (max-width: 640px) {
    .row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .tab-pills {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        gap: 6px;
        padding-bottom: 8px;
        position: static;
    }

    .pill {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        padding: 10px 14px;
    }

    .table thead {
        display: none
    }

    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%
    }

        .table tbody tr {
            border-bottom: 1px solid #eef2f7;
            padding: 8px 0;
            background: #fff;
            border-radius: 12px;
            margin: 8px 0;
            box-shadow: 0 6px 16px rgba(0,0,0,.06);
        }

            .table tbody tr:last-child {
                border-bottom: none
            }

        .table td {
            padding: 6px 12px;
            border: none !important
        }

            .table td::before {
                content: attr(data-label);
                display: block;
                color: var(--muted);
                margin-bottom: 4px;
                font-weight: 600;
            }

        .table .num {
            text-align: inherit
        }
}

@media (max-width:480px) {
    .search-inline {
        flex-wrap: wrap;
        gap: 6px
    }

        .search-inline .input {
            flex: 1 1 100%;
            min-width: 0
        }

        .search-inline .btn {
            flex: 1 1 calc(50% - 3px)
        }

    .container {
        margin: 20px auto;
        padding: 0 10px
    }

    .card {
        border-radius: 20px;
        box-shadow: 0 12px 28px rgba(0,0,0,.22)
    }

    .btn-cta {
        border-radius: 14px
    }
}

/* Safe area */
@supports (padding: max(0px)) {
    body {
        padding-bottom: max(0px, env(safe-area-inset-bottom))
    }
}
/* --- App & Auth --- */
.app {
    min-height: 100svh;
}

.page-wrap {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: clamp(16px,4vw,32px);
}

.card .header {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    border-bottom: 1px solid #ffe0c2;
}

.stack {
    display: grid;
    gap: 12px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cfd8e3;
    border-radius: 12px;
    background: #fff; /* روی تم تیره هم خواناست */
    color: var(--text);
    outline: 0;
}

    .form-control:focus {
        border-color: var(--primary)
    }

