/* ============================================================
   استایل‌های پنل مدیریت - نسخه نهایی
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background: #0b0a0a;
    color: #f5f0eb;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.admin-container {
    max-width: 700px;
    width: 100%;
    background: #1a1717;
    border-radius: 48px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    padding: 30px 24px;
}

/* ============================================================
   هدر
   ============================================================ */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #3f332c;
}

.admin-header h1 {
    font-weight: 900;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #f2dac4, #e6b68b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.admin-header .back-link {
    color: #dbaa7a;
    text-decoration: none;
    font-weight: 700;
    padding: 8px 16px;
    border: 1px solid rgba(219, 170, 122, 0.3);
    border-radius: 60px;
    transition: 0.3s;
}

.admin-header .back-link:hover {
    background: rgba(219, 170, 122, 0.1);
}

/* ============================================================
   فرم ورود
   ============================================================ */
.login-form {
    background: rgba(40, 33, 30, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 30px 24px;
    border: 1px solid rgba(255, 210, 170, 0.08);
}

.login-form h2 {
    color: #dbaa7a;
    margin-bottom: 20px;
    text-align: center;
}

.login-form input {
    width: 100%;
    padding: 14px 18px;
    background: #2b2420;
    border: 1px solid #3f332c;
    border-radius: 60px;
    color: #f0e3d8;
    font-size: 1rem;
    outline: none;
    margin-bottom: 16px;
    transition: 0.25s ease;
}

.login-form input:focus {
    border-color: #dbaa7a;
    box-shadow: 0 0 0 3px #dbaa7a33;
}

.login-form .login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, #dbaa7a, #c28d5e);
    border: none;
    border-radius: 60px;
    font-weight: 900;
    font-size: 1.1rem;
    color: #1f1714;
    cursor: pointer;
    transition: 0.25s ease;
}

.login-form .login-btn:hover {
    transform: scale(1.02);
    background: #e8bc92;
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

/* ============================================================
   تب‌ها
   ============================================================ */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(40, 33, 30, 0.4);
    border-radius: 60px;
    padding: 4px;
    border: 1px solid rgba(255, 210, 170, 0.06);
}

.admin-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #a68f7d;
    font-weight: 700;
    border-radius: 60px;
    cursor: pointer;
    transition: 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-tab-btn.active {
    background: #dbaa7a;
    color: #1a1717;
    box-shadow: 0 4px 15px rgba(219, 170, 122, 0.3);
}

.admin-tab-btn .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 700;
}

.admin-tab-btn.active .badge {
    background: rgba(26, 23, 23, 0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   بخش خدمات
   ============================================================ */
.section-title {
    color: #dbaa7a;
    font-size: 1.1rem;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #3f332c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title .count {
    color: #a68f7d;
    font-size: 0.8rem;
    font-weight: 400;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #2f2621;
}

.service-item:last-child {
    border-bottom: none;
}

.service-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-name {
    font-weight: 700;
    color: #f0e3d8;
}

.service-price {
    color: #dbaa7a;
    font-size: 0.9rem;
}

.service-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.service-controls input {
    width: 80px;
    padding: 6px 8px;
    background: #2b2420;
    border: 1px solid #3f332c;
    border-radius: 40px;
    color: #f0e3d8;
    text-align: center;
}

.service-controls button {
    background: #dbaa7a;
    border: none;
    color: #1a1717;
    padding: 6px 12px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s;
    font-size: 0.8rem;
}

.service-controls button:hover {
    background: #e8bc92;
}

.service-controls .delete-btn {
    background: #6d3a3a;
    color: #f0d0d0;
}

.service-controls .delete-btn:hover {
    background: #8a4a4a;
}

.add-service {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.add-service input {
    flex: 1;
    padding: 10px 14px;
    background: #2b2420;
    border: 1px solid #3f332c;
    border-radius: 40px;
    color: #f0e3d8;
    min-width: 100px;
}

.add-service button {
    padding: 10px 20px;
    background: #dbaa7a;
    border: none;
    border-radius: 40px;
    color: #1a1717;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.add-service button:hover {
    background: #e8bc92;
}

/* ============================================================
   بخش رزروها
   ============================================================ */
.reservations-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #2b2420;
    border-radius: 16px;
    padding: 12px 16px;
    text-align: center;
    border: 1px solid #3f332c;
}

.stat-card .stat-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: #f0e3d8;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    color: #a68f7d;
    margin-top: 4px;
}

.stat-card.pending .stat-number {
    color: #f39c12;
}
.stat-card.completed .stat-number {
    color: #2ecc71;
}
.stat-card.cancelled .stat-number {
    color: #e74c3c;
}

/* فیلتر تاریخ */
.date-filter-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.date-filter-btn {
    padding: 6px 16px;
    background: #2b2420;
    border: 1px solid #3f332c;
    border-radius: 40px;
    color: #a68f7d;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
    font-weight: 500;
}

.date-filter-btn:hover {
    border-color: #dbaa7a;
    color: #f0e3d8;
}

.date-filter-btn.active {
    background: #dbaa7a;
    color: #1a1717;
    border-color: #dbaa7a;
}

.filter-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 16px;
    background: #2b2420;
    border: 1px solid #3f332c;
    border-radius: 40px;
    color: #a68f7d;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #dbaa7a;
    color: #f0e3d8;
}

.filter-btn.active {
    background: #dbaa7a;
    color: #1a1717;
    border-color: #dbaa7a;
}

.reservations-list {
    max-height: 450px;
    overflow-y: auto;
}

.reservation-item {
    padding: 14px 16px;
    background: #2b2420;
    border-radius: 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 4px solid #f39c12;
    transition: 0.2s;
    cursor: pointer;
    flex-wrap: wrap;
    gap: 10px;
}

.reservation-item:hover {
    background: #322925;
    border-color: #dbaa7a;
}

.reservation-item .details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 200px;
}

.reservation-item .details .name {
    font-weight: 700;
    color: #f0e3d8;
    font-size: 1rem;
}

.reservation-item .details .info {
    font-size: 0.8rem;
    color: #a68f7d;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.reservation-item .details .info .service-tag {
    background: rgba(219, 170, 122, 0.15);
    color: #dbaa7a;
    padding: 2px 10px;
    border-radius: 40px;
    font-size: 0.7rem;
}

.status-badge {
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
}

.status-badge.pending {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.status-badge.completed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-badge.cancelled {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* ============================================================
   بخش تنظیمات
   ============================================================ */
.settings-group {
    background: #2b2420;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid #3f332c;
}

.settings-group .group-title {
    font-weight: 700;
    color: #dbaa7a;
    margin-bottom: 12px;
    font-size: 1rem;
}

.settings-group .group-desc {
    color: #a68f7d;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.settings-group label {
    display: block;
    font-weight: 400;
    font-size: 0.85rem;
    color: #cbb5a3;
    margin-bottom: 5px;
}

.settings-group input[type="text"],
.settings-group input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    background: #1a1717;
    border: 1px solid #3f332c;
    border-radius: 40px;
    color: #f0e3d8;
    outline: none;
    transition: 0.25s ease;
    margin-bottom: 10px;
}

.settings-group input:focus {
    border-color: #dbaa7a;
    box-shadow: 0 0 0 3px #dbaa7a33;
}

.settings-group .file-upload-area {
    border: 2px dashed #3f332c;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: #a68f7d;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 10px;
}

.settings-group .file-upload-area:hover {
    border-color: #dbaa7a;
    background: rgba(219, 170, 122, 0.05);
}

.settings-group .file-upload-area .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    color: #dbaa7a;
}

.settings-group .file-upload-area .hint {
    font-size: 0.8rem;
}

.settings-group .slide-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.settings-group .slide-preview .slide-item {
    position: relative;
    width: 100px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #3f332c;
}

.settings-group .slide-preview .slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-group .slide-preview .slide-item .remove-slide {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #6d3a3a;
    border: none;
    color: #f0d0d0;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-group .slide-preview .slide-item .remove-slide:hover {
    background: #8a4a4a;
}

.settings-group .btn-save-settings {
    width: 100%;
    padding: 12px;
    background: linear-gradient(145deg, #dbaa7a, #c28d5e);
    border: none;
    border-radius: 60px;
    font-weight: 900;
    font-size: 1rem;
    color: #1f1714;
    cursor: pointer;
    transition: 0.25s ease;
    margin-top: 8px;
}

.settings-group .btn-save-settings:hover {
    transform: scale(1.02);
    background: #e8bc92;
}

/* ============================================================
   داشبورد
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: #2b2420;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #3f332c;
    text-align: center;
    transition: 0.3s;
}

.dashboard-card:hover {
    border-color: #dbaa7a;
    transform: translateY(-2px);
}

.dashboard-card .number {
    font-size: 2rem;
    font-weight: 900;
    color: #dbaa7a;
}

.dashboard-card .label {
    font-size: 0.75rem;
    color: #a68f7d;
    margin-top: 4px;
}

.dashboard-card .icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

.dashboard-card .icon.gold {
    color: #f1c40f;
}
.dashboard-card .icon.silver {
    color: #bdc3c7;
}
.dashboard-card .icon.bronze {
    color: #e67e22;
}
.dashboard-card .icon.total {
    color: #3498db;
}

.dashboard-card.highlight {
    border-color: #dbaa7a33;
    background: rgba(219, 170, 122, 0.05);
}

/* لیست وفاداران */
.loyalty-list {
    max-height: 250px;
    overflow-y: auto;
}

.loyalty-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #2f2621;
}

.loyalty-item:last-child {
    border-bottom: none;
}

.loyalty-item .rank {
    font-weight: 900;
    font-size: 1.1rem;
    min-width: 30px;
    color: #dbaa7a;
}

.loyalty-item .rank.gold {
    color: #f1c40f;
}
.loyalty-item .rank.silver {
    color: #bdc3c7;
}
.loyalty-item .rank.bronze {
    color: #e67e22;
}

.loyalty-item .name {
    font-weight: 700;
    color: #f0e3d8;
    flex: 1;
    margin: 0 12px;
}

.loyalty-item .count {
    font-size: 0.8rem;
    color: #a68f7d;
    background: #1a1717;
    padding: 2px 12px;
    border-radius: 40px;
}

/* ============================================================
   مودال جزئیات
   ============================================================ */
.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 6000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.detail-modal.show {
    display: flex;
}

.detail-modal .modal-content {
    background: #1a1717;
    border-radius: 32px;
    padding: 30px 28px;
    max-width: 450px;
    width: 90%;
    border: 1px solid #dbaa7a33;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.detail-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3f332c;
}

.detail-modal .modal-header h3 {
    color: #dbaa7a;
    font-size: 1.2rem;
}

.detail-modal .close-modal-btn {
    background: none;
    border: none;
    color: #a68f7d;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.detail-modal .close-modal-btn:hover {
    color: #f0e3d8;
    transform: rotate(90deg);
}

.detail-modal .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #2f2621;
}

.detail-modal .detail-row:last-child {
    border-bottom: none;
}

.detail-modal .detail-label {
    color: #7f6e60;
    font-size: 0.85rem;
}

.detail-modal .detail-value {
    color: #f0e3d8;
    font-weight: 500;
    font-size: 0.9rem;
}

.detail-modal .receipt-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    margin-top: 8px;
    border: 1px solid #3f332c;
    cursor: pointer;
}

.detail-modal .receipt-image:hover {
    border-color: #dbaa7a;
}

/* دکمه‌های وضعیت در مودال */
.modal-status-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.modal-status-btn {
    padding: 8px 18px;
    border-radius: 40px;
    border: 2px solid #3f332c;
    background: transparent;
    color: #a68f7d;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: 0.2s;
    flex: 1;
    min-width: 80px;
}

.modal-status-btn:hover {
    transform: scale(1.02);
}

.modal-status-btn.pending {
    border-color: #f39c12;
    color: #f39c12;
}

.modal-status-btn.pending.active {
    background: rgba(243, 156, 18, 0.2);
}

.modal-status-btn.completed {
    border-color: #2ecc71;
    color: #2ecc71;
}

.modal-status-btn.completed.active {
    background: rgba(46, 204, 113, 0.2);
}

.modal-status-btn.cancelled {
    border-color: #e74c3c;
    color: #e74c3c;
}

.modal-status-btn.cancelled.active {
    background: rgba(231, 76, 60, 0.2);
}

.modal-status-btn.waiting {
    border-color: #3498db;
    color: #3498db;
}

.modal-status-btn.waiting.active {
    background: rgba(52, 152, 219, 0.2);
}

.modal-delete-btn {
    width: 100%;
    padding: 10px;
    background: #6d3a3a;
    border: none;
    border-radius: 40px;
    color: #f0d0d0;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    transition: 0.2s;
}

.modal-delete-btn:hover {
    background: #8a4a4a;
}

/* ============================================================
   مودال فیش
   ============================================================ */
.receipt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 7000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.receipt-modal.show {
    display: flex;
}

.receipt-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9);
}

.receipt-modal .close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f0e3d8;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: 0.3s;
}

.receipt-modal .close-modal:hover {
    transform: rotate(90deg);
    color: #dbaa7a;
}

/* ============================================================
   دکمه خروج
   ============================================================ */
.logout-btn {
    background: #6d3a3a;
    border: none;
    color: #f0d0d0;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 700;
    margin-top: 20px;
    width: 100%;
    transition: 0.2s;
}

.logout-btn:hover {
    background: #8a4a4a;
}

/* ============================================================
   نوتیفیکیشن
   ============================================================ */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #dbaa7a;
    color: #1a1717;
    padding: 12px 24px;
    border-radius: 60px;
    font-weight: 700;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 8000;
    display: none;
    animation: slideDown 0.3s ease;
    max-width: 90%;
}

.notification.error {
    background: #8a3a3a;
    color: #f0d0d0;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   اسکرول
   ============================================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #1f1916;
}

::-webkit-scrollbar-thumb {
    background: #dbaa7a;
    border-radius: 20px;
}

/* ============================================================
   ریسپانسیو
   ============================================================ */
@media (max-width: 500px) {
    .admin-container {
        padding: 16px 12px;
        border-radius: 32px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .dashboard-card .number {
        font-size: 1.5rem;
    }
    .reservations-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }
    .stat-card .stat-number {
        font-size: 1.2rem;
    }
    .reservation-item {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-tab-btn {
        font-size: 0.75rem;
        padding: 8px 10px;
    }
    .filter-section {
        gap: 4px;
    }
    .filter-btn {
        font-size: 0.7rem;
        padding: 4px 12px;
    }
    .date-filter-section {
        gap: 4px;
    }
    .date-filter-btn {
        font-size: 0.7rem;
        padding: 4px 12px;
    }
    .settings-group .slide-preview .slide-item {
        width: 70px;
        height: 50px;
    }
    .loyalty-item .name {
        font-size: 0.85rem;
    }
    .modal-status-buttons {
        flex-direction: column;
    }
    .modal-status-btn {
        min-width: auto;
    }
    .detail-modal .modal-content {
        padding: 20px 16px;
    }
}