/* ============================================================
   پنل مدیریت راهو - استایل
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

/* ============================================================
   صفحه ورود
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a2458 0%, #0b7a5a 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #0b7a5a, #0a9b6d);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
}

.login-header h1 {
    font-size: 22px;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: #6b7280;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.login-form label i {
    color: #0b7a5a;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #9ca3af;
}

/* ============================================================
   فرم‌ها
   ============================================================ */
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #0b7a5a;
    box-shadow: 0 0 0 3px rgba(11, 122, 90, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ============================================================
   دکمه‌ها
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #0b7a5a;
    color: #fff;
}

.btn-primary:hover {
    background: #0a9b6d;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-block {
    width: 100%;
}

/* ============================================================
   هشدارها
   ============================================================ */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert i {
    margin-top: 3px;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* ============================================================
   چیدمان اصلی
   ============================================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* سایدبار */
.sidebar {
    width: 250px;
    background: #0a2458;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex: 0 0 auto;
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.admin-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-right-color: #16d9e3;
}

.sidebar-nav a.logout {
    color: #fca5a5;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 16px;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

/* محتوای اصلی */
.main-content {
    flex: 1;
    margin-right: 250px;
    padding: 24px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.top-bar h1 {
    font-size: 22px;
    color: #1a1a2e;
}

.date-time {
    font-size: 13px;
    color: #6b7280;
    background: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   کارت‌های آمار
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}

.stat-icon.blue { background: #3b82f6; }
.stat-icon.green { background: #10b981; }
.stat-icon.orange { background: #f59e0b; }
.stat-icon.purple { background: #8b5cf6; }
.stat-icon.teal { background: #14b8a6; }
.stat-icon.pink { background: #ec4899; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
}

/* ============================================================
   کارت‌ها
   ============================================================ */
.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h3 {
    font-size: 16px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: #0b7a5a;
}

.card-body {
    padding: 24px;
}

/* ============================================================
   ریسپانسیو
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: 0;
        max-height: 190px;
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
    }

    .app-container {
        display: block;
    }

    .sidebar-header {
        padding: 14px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .sidebar-header h2 { font-size: 16px; margin: 0; }
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 6px 8px 10px;
        gap: 4px;
        scrollbar-width: thin;
    }
    .sidebar-nav a {
        flex: 0 0 auto;
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        border-right: 0;
        border-bottom: 3px solid transparent;
        border-radius: 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    .sidebar-nav a.active { border-right-color: transparent; border-bottom-color: #16d9e3; }
    .sidebar-nav a.logout { border-top: 0; margin-top: 0; }
    .sidebar-nav a i { width: auto; font-size: 16px; }

    .main-content {
        margin-right: 0;
        padding: 14px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card { padding: 14px 10px; gap: 10px; }
    .stat-icon { width: 40px; height: 40px; flex: 0 0 40px; font-size: 17px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 11px; }
    .top-bar { align-items: flex-start; gap: 10px; }
    .top-bar h1 { font-size: 18px; }
    .date-time { font-size: 11px; padding: 6px 8px; white-space: nowrap; }
}

/* ============================================================
   چیدمان‌های شبکه‌ای
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 1100px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ============================================================
   جداول داده
   ============================================================ */
.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 13px;
}
.card-body { overflow-x: auto; }
.data-table th, .data-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #eef0f3;
}
.data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}
.data-table tbody tr:hover { background: #f9fafb; }
.data-table td { color: #334155; }

/* ============================================================
   نشان‌ها (Badge)
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-pink { background: #fce7f3; color: #be185d; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* ============================================================
   دکمه‌های کوچک
   ============================================================ */
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; margin: 2px; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-info { background: #0ea5e9; color: #fff; }
.btn-info:hover { background: #0284c7; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ============================================================
   بارگذاری و خط کل
   ============================================================ */
.loading { padding: 40px; text-align: center; color: #6b7280; font-size: 14px; }
.total-line { font-size: 14px; margin-bottom: 12px; color: #334155; }
.total-line b { color: #0b7a5a; font-size: 16px; }

/* ============================================================
   چیپ و تصاویر بندانگشتی
   ============================================================ */
.chip {
    display: inline-block;
    background: #eef2ff;
    color: #4338ca;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 12px;
    margin: 2px;
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumb { width: 90px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; }
.prop-detail h4 { margin: 16px 0 6px; color: #0b7a5a; font-size: 14px; }

/* ============================================================
   نوار پیشرفت
   ============================================================ */
.progress {
    background: #e5e7eb;
    border-radius: 20px;
    height: 10px;
    width: 100px;
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
    margin-left: 8px;
}
.progress-bar { background: linear-gradient(90deg, #0b7a5a, #0a9b6d); height: 100%; }

/* ============================================================
   مودال
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: #fff; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 16px;
    width: min(100%, 760px); max-height: min(88vh, 820px); overflow-y: auto;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
    animation: modal-enter 0.18s ease-out;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { font-size: 16px; color: #1a1a2e; }
.modal-close { background: none; border: none; font-size: 26px; cursor: pointer; color: #9ca3af; line-height: 1; }
.modal-close:hover { color: #374151; }
.modal-body { padding: 24px; }
.modal-body .form-group { margin-bottom: 14px; }
.modal-body label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.modal-body .data-table { min-width: 560px; }
.modal-open { overflow: hidden; }
@keyframes modal-enter {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .modal-overlay { align-items: flex-end; padding: 10px; }
    .modal-box { width: 100%; max-height: 92vh; border-radius: 16px 16px 10px 10px; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 16px; }
    .modal-body .grid-2, .modal-body .grid-3, .modal-body .grid-4 { grid-template-columns: 1fr; }
    .modal-body .btn { width: 100%; }
}

/* ============================================================
   توست
   ============================================================ */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1a1a2e; color: #fff; padding: 12px 24px; border-radius: 10px;
    font-size: 14px; opacity: 0; transition: all 0.3s; z-index: 2000; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }