﻿/* ================================================
   style.css — سامانه مدیریت ناوگان و GPS
   مشترک بین login.html و admin-panel.html
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

/* ---- متغیرهای رنگ و اندازه ---- */
:root {
    --navy-900: #0a1f3d;
    --navy-800: #0f2a52;
    --navy-700: #15366a;
    --blue-600: #1c66d0;
    --blue-500: #2f7ff0;
    --blue-100: #e7f0ff;
    --bg: #f3f6fb;
    --ink: #12203a;
    --muted: #5c6b85;
    --line: #dde6f3;
    --radius: 14px;
}

/* ---- ریست پایه ---- */
*, *::before, *::after {
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

/* ================================================
   SHARED — مشترک بین هر دو صفحه
   ================================================ */

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink);
    margin-bottom: 6px;
}

/* ================================================
   LOGIN PAGE — login.html
   ================================================ */

.page-login {
    margin: 0;
    min-height: 100vh;
    display: flex;
    background: var(--navy);
    overflow: hidden;
}

/* پنل چپ (بصری) */
.left-panel {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    overflow: hidden;
    background: linear-gradient(145deg, var(--navy-900) 0%, var(--navy-700) 60%, #0d3878 100%);
}

    .left-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle, rgba(47,127,240,.18) 1.5px, transparent 1.5px);
        background-size: 22px 22px;
        z-index: 0;
    }

/* مسیر SVG متحرک */
.route-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.route-path {
    fill: none;
    stroke: rgba(47,127,240,.28);
    stroke-width: 1.5;
    stroke-dasharray: 8 6;
    animation: march 18s linear infinite;
}

.route-path-2 {
    fill: none;
    stroke: rgba(255,255,255,.07);
    stroke-width: 1;
    stroke-dasharray: 4 10;
    animation: march 24s linear infinite reverse;
}

@keyframes march {
    to {
        stroke-dashoffset: -200;
    }
}

/* آیکون لوکیشن پالس‌دار */
.pin-wrap {
    position: relative;
    z-index: 1;
    margin-bottom: 36px;
}

.pin-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(47,127,240,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

    .pin-ring::before, .pin-ring::after {
        content: '';
        position: absolute;
        border-radius: 50%;
        border: 1.5px solid rgba(47,127,240,.3);
        animation: ripple 2.4s ease-out infinite;
    }

    .pin-ring::before {
        width: 100%;
        height: 100%;
        animation-delay: 0s;
    }

    .pin-ring::after {
        width: 140%;
        height: 140%;
        animation-delay: .8s;
    }

@keyframes ripple {
    0% {
        transform: scale(.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.pin-inner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(47,127,240,.55);
    font-size: 1.5rem;
    color: #fff;
}

.panel-headline {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
}

    .panel-headline h2 {
        font-size: 1.6rem;
        font-weight: 800;
        margin-bottom: 10px;
        line-height: 1.35;
        color: #94b3d8;
    }

    .panel-headline p {
        color: #94b3d8;
        font-size: .9rem;
        line-height: 1.7;
        max-width: 320px;
        margin: 0 auto;
    }

.feature-list {
    position: relative;
    z-index: 1;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 340px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 13px 16px;
    color: #c8d9f0;
    font-size: .87rem;
    font-weight: 500;
}

    .feature-item i {
        font-size: 1.1rem;
        color: var(--blue-500);
        flex-shrink: 0;
    }

/* پنل راست (فرم) */
.right-panel {
    width: 440px;
    flex-shrink: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    position: relative;
}

.login-box {
    margin: 0 auto;
    width: 100%;
}

.login-logo {
    width: 70px;
    height: 70px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(47,127,240,.35);
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 22px;
    margin-left: auto;
    margin-right: auto;
}

.login-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 4px;
    margin-left: auto;
    margin-right: auto;
}

.login-sub {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 30px;
    margin-left: auto;
    margin-right: auto;
}

.login-title, .login-sub {
    text-align: center;
}

.input-wrap {
    position: relative;
}

    .input-wrap i.fi {
        position: absolute;
        right: 13px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        font-size: .95rem;
        pointer-events: none;
    }

    .input-wrap input {
        width: 100%;
        padding: 11px 38px 11px 14px;
        border: 1.5px solid var(--line);
        border-radius: 11px;
        background: #fff;
        font-size: .92rem;
        color: var(--ink);
        outline: none;
        transition: border-color .15s, box-shadow .15s;
    }

        .input-wrap input:focus {
            border-color: var(--blue-500);
            box-shadow: 0 0 0 3px rgba(47,127,240,.13);
        }

.toggle-pass {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    font-size: .95rem;
    line-height: 1;
}

    .toggle-pass:hover {
        color: var(--blue-600);
    }

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, var(--blue-600), var(--blue-500));
    border: none;
    border-radius: 11px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    box-shadow: 0 4px 18px rgba(47,127,240,.35);
}

    .btn-login:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }

    .btn-login:active {
        transform: translateY(0);
    }

.divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 24px 0;
}

.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

    .remember-row label {
        font-size: .83rem;
        color: var(--muted);
        display: flex;
        align-items: center;
        gap: 7px;
        cursor: pointer;
    }

    .remember-row a {
        font-size: .83rem;
        color: var(--blue-600);
        text-decoration: none;
        font-weight: 600;
    }

        .remember-row a:hover {
            text-decoration: underline;
        }

.custom-check {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1.5px solid var(--line);
    background: #fff;
    appearance: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

    .custom-check:checked {
        background: var(--blue-500);
        border-color: var(--blue-500);
    }

        .custom-check:checked::after {
            content: '✓';
            color: #fff;
            font-size: .65rem;
            font-weight: 800;
        }

.alert-error {
    background: #fff0f0;
    border: 1px solid #f5c2c2;
    border-radius: 10px;
    color: #b91c1c;
    font-size: .84rem;
    padding: 11px 14px;
    margin-bottom: 18px;
    display: none;
}

.footer-note {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .74rem;
    color: var(--muted);
}

.spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 680px) {
    body.page-login {
        flex-direction: column;
        overflow: auto;
    }

    .left-panel {
        min-height: 240px;
        padding: 36px 24px;
    }

    .feature-list {
        display: none;
    }

    .right-panel {
        width: 100%;
        padding: 36px 24px 60px;
    }
}


/* ================================================
   ADMIN PANEL — admin-panel.html
   ================================================ */

body.page-admin {
    background: var(--bg);
    color: var(--ink);
}

/* الگوی نقطه‌چین GPS */
.route-pattern {
    background-image: radial-gradient(circle, rgba(255,255,255,.16) 1.6px, transparent 1.6px);
    background-size: 14px 14px;
}

/* سایدبار */
#sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: #fff;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

    #sidebar .brand {
        padding: 22px 20px 18px;
        border-bottom: 1px solid rgba(255,255,255,.09);
    }

    #sidebar .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px rgba(47,127,240,.45);
    }

    #sidebar .brand-title {
        font-weight: 800;
        font-size: 1.02rem;
        letter-spacing: .2px;
    }

    #sidebar .brand-sub {
        font-size: .72rem;
        color: #9fb3d6;
    }

    #sidebar nav {
        padding: 14px 12px;
        flex: 1;
    }

    #sidebar .nav-link {
        color: #c9d8f2;
        border-radius: 10px;
        padding: 11px 14px;
        margin-bottom: 4px;
        font-size: .92rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: background .15s ease, color .15s ease;
    }

        #sidebar .nav-link i {
            font-size: 1.05rem;
            width: 20px;
            text-align: center;
        }

        #sidebar .nav-link:hover {
            background: rgba(255,255,255,.06);
            color: #fff;
        }

        #sidebar .nav-link.active {
            background: linear-gradient(90deg, var(--blue-600), var(--blue-500));
            color: #fff;
            box-shadow: 0 4px 14px rgba(28,102,208,.35);
        }

    #sidebar .side-footer {
        padding: 14px 18px;
        border-top: 1px solid rgba(255,255,255,.09);
        font-size: .72rem;
        color: #8ea3c9;
    }

/* محتوای اصلی */
#main {
    margin-right: 260px;
    padding: 28px 30px 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

    .topbar h1 {
        font-size: 1.35rem;
        font-weight: 800;
        margin: 0;
    }

    .topbar p {
        color: var(--muted);
        font-size: .86rem;
        margin: 2px 0 0;
    }

/* کارت‌ها */
.card-soft {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(18,32,58,.04);
}

.stat-card {
    padding: 20px 22px;
}

    .stat-card .num {
        font-size: 1.9rem;
        font-weight: 800;
        color: var(--navy-900);
    }

    .stat-card .lbl {
        color: var(--muted);
        font-size: .82rem;
    }

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-100);
    color: var(--blue-600);
    font-size: 1.2rem;
}

/* دکمه‌ها */
.btn-primary-navy {
    background: linear-gradient(90deg, var(--blue-600), var(--blue-500));
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 18px;
}

    .btn-primary-navy:hover {
        filter: brightness(1.05);
        color: #fff;
    }

.btn-outline-navy {
    border: 1px solid var(--line);
    color: var(--navy-800);
    background: #fff;
    border-radius: 10px;
    font-weight: 600;
}

    .btn-outline-navy:hover {
        background: var(--blue-100);
        border-color: var(--blue-100);
    }

/* بج دسته‌بندی */
.badge-cat {
    background: var(--blue-100);
    color: var(--blue-600);
    font-weight: 600;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: .75rem;
}

.section-title {
    font-weight: 800;
    font-size: 1.08rem;
    margin-bottom: 2px;
}

.section-sub {
    color: var(--muted);
    font-size: .83rem;
}

/* فرم‌ها */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 9px 12px;
    font-size: .9rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--blue-500);
        box-shadow: 0 0 0 .2rem rgba(47,127,240,.15);
    }

/* آیتم دسته‌بندی */
.cat-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    background: #fff;
}

    .cat-pill .cat-dot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--blue-500);
    }

/* کارت محصول */
.product-card {
    overflow: hidden;
}

.product-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--blue-100);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .product-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .product-img-wrap .placeholder {
        color: var(--blue-600);
        font-size: 1.8rem;
    }

.product-body {
    padding: 14px 16px;
}

.product-title {
    font-weight: 700;
    font-size: .96rem;
    margin-bottom: 4px;
}

.product-price {
    color: var(--blue-600);
    font-weight: 800;
    font-size: .95rem;
}

/* تامب‌نیل تصاویر */
.thumb-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    position: relative;
}

    .thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .thumb .rm {
        position: absolute;
        top: 2px;
        left: 2px;
        background: rgba(10,31,61,.75);
        color: #fff;
        border: none;
        border-radius: 5px;
        font-size: .65rem;
        width: 18px;
        height: 18px;
        line-height: 1;
    }

/* حالت خالی */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

    .empty-state i {
        font-size: 2.4rem;
        color: var(--blue-500);
        opacity: .5;
    }

/* پیش‌نمایش لوگو شرکت */
.company-logo-preview {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    background: var(--blue-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--line);
}

    .company-logo-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* توست ذخیره */
.save-toast {
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 2000;
}

.download-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 900px) {
    #sidebar {
        width: 74px;
    }

        #sidebar .brand-title,
        #sidebar .brand-sub,
        #sidebar .nav-link span,
        #sidebar .side-footer {
            display: none;
        }

        #sidebar .nav-link {
            justify-content: center;
        }

    #main {
        margin-right: 74px;
    }
}
