/* assets/css/style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== نوار ناوبری ==================== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand a {
    color: white;
    font-size: 24px;
    font-weight: 900;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand a i {
    font-size: 28px;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-menu ul li a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu ul li a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-menu ul li a.active {
    background: rgba(255,255,255,0.25);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.user-name i {
    margin-left: 5px;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-toggle {
    display: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

/* ==================== محتوای اصلی ==================== */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    width: 100%;
}

/* ==================== فوتر ==================== */
.footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 14px;
}

.footer-version {
    color: #999;
}

/* ==================== کارت‌ها ==================== */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header h3 {
    font-size: 18px;
    color: #333;
}

.card-header i {
    font-size: 24px;
    color: #667eea;
}

/* ==================== آمار داشبورد ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-icon.red { background: #ffebee; color: #d32f2f; }
.stat-icon.orange { background: #fff3e0; color: #f57c00; }
.stat-icon.purple { background: #f3e5f5; color: #7b1fa2; }

.stat-info h4 {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.stat-info .number {
    font-size: 28px;
    font-weight: 900;
    color: #333;
}

/* ==================== جدول ==================== */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table thead {
    background: #f8f9fa;
}

table th {
    padding: 15px 12px;
    text-align: right;
    font-weight: 700;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

table tbody tr:hover {
    background: #f8f9fa;
}

/* وضعیت‌ها */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-expiring {
    background: #fff3e0;
    color: #e65100;
}

.status-expired {
    background: #ffebee;
    color: #c62828;
}

.status-locked {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* ==================== دکمه‌ها ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #43a047;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-info {
    background: #2196f3;
    color: white;
}

.btn-info:hover {
    background: #1976d2;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ==================== فرم‌ها ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group label .required {
    color: #f44336;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-control.error {
    border-color: #f44336;
}

.form-control.success {
    border-color: #4caf50;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== صفحه لاگین ==================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 50px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .logo i {
    font-size: 60px;
    color: #667eea;
}

.login-box .logo h1 {
    font-size: 24px;
    margin-top: 10px;
    color: #333;
}

.login-box .logo p {
    color: #888;
    font-size: 14px;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-control {
    padding: 14px 18px;
    font-size: 15px;
}

.login-box .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
}

.login-box .error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* ==================== پاسخگو (Responsive) ==================== */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        background: white;
        width: 300px;
        height: calc(100vh - 70px);
        padding: 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-menu ul li a {
        color: #333;
        padding: 12px 15px;
        border-radius: 10px;
    }
    
    .nav-menu ul li a:hover {
        background: #f0f0f0;
        color: #333;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-user {
        gap: 10px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .logout-btn span {
        display: none;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .stat-info .number {
        font-size: 22px;
    }
    
    .login-box {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .card {
        padding: 15px;
    }
    
    .table-container {
        padding: 10px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th, table td {
        padding: 8px;
    }
}