/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    direction: rtl;
}

/* Utility Classes */
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

/* Layout */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col-md-1, .col-md-2, .col-md-3, .col-md-4,
.col-md-5, .col-md-6, .col-md-7, .col-md-8,
.col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    padding: 0.75rem;
}

.col-md-1 { flex: 0 0 8.33333%; max-width: 8.33333%; }
.col-md-2 { flex: 0 0 16.66667%; max-width: 16.66667%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.33333%; max-width: 33.33333%; }
.col-md-5 { flex: 0 0 41.66667%; max-width: 41.66667%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-7 { flex: 0 0 58.33333%; max-width: 58.33333%; }
.col-md-8 { flex: 0 0 66.66667%; max-width: 66.66667%; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; }
.col-md-10 { flex: 0 0 83.33333%; max-width: 83.33333%; }
.col-md-11 { flex: 0 0 91.66667%; max-width: 91.66667%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }

/* Sidebar */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #1a1a2e 100%);
    color: white;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .logo i {
    font-size: 1.8rem;
    color: #4a6ee0;
}

.sidebar-header .logo span {
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-user {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4a6ee0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.user-info h4 {
    margin-bottom: 5px;
    font-size: 1rem;
}

.user-info p {
    font-size: 0.85rem;
    opacity: 0.8;
}

.sidebar-nav ul {
    list-style: none;
    padding: 20px 0;
}

.sidebar-nav li {
    margin: 5px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-right: 25px;
}

.sidebar-nav li.active a {
    background: rgba(74, 110, 224, 0.2);
    color: white;
    border-right: 3px solid #4a6ee0;
}

.sidebar-nav i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-right: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-title h1 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.header-title p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e1e5e9;
    background: white;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.btn-icon:hover {
    background: #f8f9fa;
    color: #4a6ee0;
}

.btn-icon .badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content {
    flex: 1;
    padding: 30px;
    background: #f8f9fa;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: none;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    background: white;
    border-radius: 10px 10px 0 0;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.card-body {
    padding: 25px;
}

.stat-card {
    border: none;
    overflow: hidden;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-body {
    display: flex;
    align-items: center;
    padding: 25px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-left: 20px;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.stat-info p {
    color: #7f8c8d;
    margin: 0;
}

.stat-primary .stat-icon {
    background: rgba(74, 110, 224, 0.1);
    color: #4a6ee0;
}

.stat-success .stat-icon {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-warning .stat-icon {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.stat-info .stat-icon {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #4a6ee0;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 110, 224, 0.25);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 110, 224, 0.25);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #4a6ee0 0%, #6a11cb 100%);
    border-color: #4a6ee0;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a5ed0 0%, #5a01bb 100%);
    border-color: #3a5ed0;
}

.btn-success {
    color: #fff;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba889 100%);
    border-color: #218838;
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    border-color: #5a6268;
}

.btn-info {
    color: #fff;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border-color: #17a2b8;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    border-color: #138496;
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #dc3545;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    border-color: #c82333;
}

.btn-outline-primary {
    color: #4a6ee0;
    background-color: transparent;
    background-image: none;
    border-color: #4a6ee0;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #4a6ee0;
    border-color: #4a6ee0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    color: #fff;
    background-color: #4a6ee0;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

.badge-info {
    color: #fff;
    background-color: #17a2b8;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-draft {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-deployed {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,.02);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Alerts */
.alert {
    position: relative;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Timeline */
.timeline {
    position: relative;
    padding-right: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e1e5e9;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    right: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a6ee0;
    border: 3px solid white;
    z-index: 1;
}

.timeline-content {
    margin-right: 30px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timeline-header strong {
    color: #2c3e50;
}

.timeline-header .text-muted {
    font-size: 0.85rem;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(to right, #4a6ee0, #6a11cb);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header .logo {
    margin-bottom: 20px;
}

.login-header .logo img {
    max-width: 80px;
    height: auto;
}

.login-header .logo i {
    font-size: 3rem;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.login-box {
    padding: 30px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox input {
    margin-left: 5px;
}

/* Version Preview */
.version-preview {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px dashed #dee2e6;
}

/* Footer */
.main-footer {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #e1e5e9;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .col-md-1, .col-md-2, .col-md-3, .col-md-4,
    .col-md-5, .col-md-6, .col-md-7, .col-md-8,
    .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 992px) {
    .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4,
    .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8,
    .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
        padding: 0.75rem;
    }
    
    .col-lg-1 { flex: 0 0 8.33333%; max-width: 8.33333%; }
    .col-lg-2 { flex: 0 0 16.66667%; max-width: 16.66667%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.33333%; max-width: 33.33333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}