@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* { box-sizing: border-box; }

body.site-body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    background: #f4f6f8;
    color: #222;
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* -------- ساید‌بار سایت (دقیقاً مطابق ساختار ساید‌بار پنل مدیریت) -------- */
.site-sidebar {
    width: 12%;
    background: #fdfcfc;
    color: #425984;
    flex-shrink: 0;
    padding: 20px 0;
}

.site-sidebar h2 {
    text-align: center;
    font-size: 16px;
    margin: 0 0 20px;
    padding: 0 10px;
    color: #425984;
}
.site-sidebar nav a.membership i {
    color:#16C60C;
}
.site-sidebar nav a i {
    margin-left: 7px;
    color: #F9A11C;
    -webkit-text-stroke: 0.3px #9c5c00;
    text-shadow: 1px 2px 2px rgba(0,0,0,.4);
}

.site-sidebar nav a:hover i {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(249, 161, 28, 0.8));
}
.site-sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: #425984;
    text-decoration: none;
    font-size: 14px;
    border-right: 3px solid transparent;
}

.site-sidebar nav a:hover {
    background: #f9f9f9;
    color: #123456;
}

.site-sidebar nav a.active {
    background: #F4F6F8;
    color: #123456;
    border-right-color: #2563eb;
}

/* -------- محتوای اصلی سایت -------- */
.notice-box a{
    font-weight:bold;
    color:#EB4456 !important;
    text-decoration:none !important;
}
.site-main {
    flex-grow: 1;
    padding: 0;
    min-width: 0;
}

.site-topbar {
    background: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.site-topbar .site-user { font-size: 14px; color: #444; }
.site-topbar a.logout-link {
    color: #dc2626;
    text-decoration: none;
    font-size: 14px;
}

.site-content {
    padding: 24px;
    max-width: 1080px;
    margin: 0 auto;
}

.page-heading {
    font-size: 20px;
    margin-bottom: 18px;
}

/* -------- کارت‌های لیست مناقصه -------- */
:root {
    --brand-sky: #26A9E0;
    --brand-sky-deep: #1c8bbd;
    --brand-navy: #123456;
    --card-ink: #0f172a;
    --card-muted: #64748b;
    --card-surface: #ffffff;
    --card-border: #e7edf3;
    --urgency-normal: var(--brand-sky);
    --urgency-warning: #f59e0b;
    --urgency-critical: #ef4444;
}

.tender-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 20px;
}

.tender-card {
    position: relative;
    background: var(--card-surface);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
}

.tender-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

/* نوار فوریت زمانی - عنصر امضادار: رنگش با نزدیک شدن به پایان مناقصه تغییر می‌کند */
.tender-card .urgency-bar {
    height: 4px;
    width: 100%;
    background: #eef2f6;
    flex-shrink: 0;
}
.tender-card .urgency-bar-fill {
    height: 100%;
    background: var(--urgency-normal);
    transition: width .3s ease;
}
.tender-card.urgency-warning .urgency-bar-fill { background: var(--urgency-warning); }
.tender-card.urgency-critical .urgency-bar-fill { background: var(--urgency-critical); }

.tender-card .thumb-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.tender-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; transition: transform .4s ease; }
.tender-card:hover .thumb-wrap img { transform: scale(1.045); }
.tender-card .thumb-wrap .no-image-text { color: #94a3b8; font-size: 13px; }

.tender-card .card-body { padding: 16px; flex-grow: 1; display: flex; flex-direction: column; }

/* چیپ فوریت زمانی - رنگ و آیکن با وضعیت زمان باقی‌مانده هماهنگ است */
.time-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 11px;
    border-radius: 20px;
    margin-bottom: 12px;
    background: rgba(38, 169, 224, 0.12);
    color: var(--brand-sky-deep);
}
.time-chip .dot {margin-right: -10px; width: 17px; height: 25px; border-radius: 0px 20px 20px 0px; background: currentColor; flex-shrink: 0; }

.tender-card.urgency-warning .time-chip {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}
.tender-card.urgency-critical .time-chip {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}
.tender-card.urgency-critical .time-chip .dot {
    animation: chip-pulse 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .tender-card.urgency-critical .time-chip .dot { animation: none; }
}
@keyframes chip-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(1.4); }
}

.tender-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--card-ink);
    line-height: 1.5;
}
.tender-card .product-name {
    font-size: 13px;
    color: var(--card-muted);
    margin-bottom: 12px;
}

.tender-card .stat-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.tender-card .stat-pill {
    flex: 1;
    background: #f7f9fb;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    color: var(--card-muted);
    text-align: center;
}
.tender-card .stat-pill strong {
    display: block;
    font-size: 14px;
    color: var(--card-ink);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.tender-card .view-link {
    margin-top: auto;
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--brand-sky), var(--brand-navy));
    color: #fff;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: filter .2s ease, transform .2s ease;
}
.tender-card .view-link:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* نگهداری سازگاری با نشان‌های قدیمی‌تر که هنوز جای دیگری استفاده می‌شوند */
.remaining-badge {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    margin-bottom: 12px;
}

.empty-state {
    text-align:center;
    color:#F90707;
    padding:60px 0;
    font-size:18px;
    font-weight: 600;
    background: #fcfdfd; 
    border-radius: 10px; 
    padding: 20px;
    box-shadow: 0 10px 14px rgba(0,0,0,0.06);
}
.empty-state a{ text-decoration: none;}
/* -------- صفحه جزئیات -------- */
.tender-detail {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}

.tender-detail .detail-image {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tender-detail .detail-image img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12); }
.detail-info h1 { font-size: 19px; margin: 0 0 8px; }
.detail-info .product-name { color: #666; font-size: 14px; margin-bottom: 14px; }

.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f1f1; font-size: 14px; }
.info-row .label { color: #666; }
.info-row .value { font-weight: 600; }

.description-box { margin-top: 16px; font-size: 14px; color: #444; line-height: 2; white-space: pre-line; }

.bid-box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    margin-top: 20px;
}
.bid-box h2 { font-size: 16px; margin-top: 0; }

.bid-box label { display: block; margin: 12px 0 6px; font-size: 14px; color: #444; }
.bid-box input[type=number],
.bid-box input[type=text],
.bid-box input[type=datetime-local],
.bid-box input[type=file],
.bid-box textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}
.bid-box textarea { resize: vertical; min-height: 80px; }
.bid-box .hint-text { font-size: 12px; color: #888; margin-top: 4px; }
.bid-box .btn-primary-full {
    width: 100%;
    padding: 11px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
}
.bid-box .btn-primary-full:hover { background: #1d4ed8; }

.notice-box { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.notice-info { background: #dbeafe; color: #1d4ed8; }
.notice-warn { background: #fef3c7; color: #92400e; }
.notice-success { background: #dcfce7; color: #166534; }
.notice-error { background: #fee2e2; color: #991b1b; }

.contact-reveal-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    margin-top: 10px;
}
.reveal-contact-btn {
    padding: 9px 18px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.reveal-contact-btn:hover { background: #1d4ed8; }
.contact-details { font-size: 14px; line-height: 2; }
.contact-details strong { color: #444; margin-left: 4px; }

@media (max-width: 720px) {
    .tender-detail { grid-template-columns: 1fr; }
    .tender-detail .detail-image { aspect-ratio: 4/3; }
}

/* -------- جدول پیشنهادهای من -------- */
table.my-bids-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
table.my-bids-table th, table.my-bids-table td {
    padding: 12px 10px;
    text-align: right;
    border-bottom: 1px solid #f1f1f1;
}
table.my-bids-table th { background: #f9fafb; color: #555; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #e2e8f0; color: #475569; }

@media (max-width: 768px) {
    body.site-body { flex-direction: column; }
    .site-sidebar { width: 100%; padding: 10px 0; }
    .site-sidebar nav { display: flex; overflow-x: auto; }
    .site-sidebar nav a {
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
        padding: 10px 14px;
    }
    .site-sidebar nav a.active { border-bottom-color: #2563eb; }
    .site-content { padding: 14px; }
}

@media (max-width: 640px) {
    table.my-bids-table { display: block; overflow-x: auto; white-space: nowrap; }
}

.pwa-install-banner {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 2000;
    background: #1e293b;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}
.pwa-install-text { font-size: 13px; flex: 1 1 200px; }
.pwa-install-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pwa-install-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.pwa-install-btn:hover { background: #1d4ed8; }
.pwa-install-close {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}
.pwa-install-close:hover { color: #fff; }

@media (max-width: 480px) {
    .pwa-install-banner { flex-direction: column; align-items: stretch; text-align: center; }
    .pwa-install-actions { justify-content: center; }
}