/* ==================================================
   ✅ style.css — استایل کامل پنل مدیر کل شیفتار
   ================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1E40AF;
    --primary-dark: #1E3A8A;
    --primary-light: #DBEAFE;
    --bg: #EFF6FF;
    --white: #FFFFFF;
    --text: #0F2A32;
    --text-muted: #5B747B;
    --border: #BFDBFE;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --shadow: 0 4px 12px rgba(30, 64, 175, 0.08);
    --shadow-lg: 0 10px 30px rgba(30, 64, 175, 0.15);
    --radius: 14px;
    --radius-sm: 10px;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================================================
   صفحه ورود
   ================================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
}

.login-container {
    background: var(--white);
    padding: 40px 32px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    background: var(--white);
    color: var(--text);
    transition: all 0.2s;
    direction: rtl;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.form-input::placeholder {
    color: #94A3B8;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-left: 48px;
}

.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.toggle-password:hover {
    background: var(--primary-light);
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.login-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ==================================================
   هدر
   ================================================== */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.btn-logout {
    padding: 8px 16px;
    background: #FEE2E2;
    color: #991B1B;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #FECACA;
}

/* ==================================================
   منوی بالا
   ================================================== */
.main-nav {
    background: var(--primary);
    position: sticky;
    top: 73px;
    z-index: 99;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.nav-item {
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: var(--white);
    border-bottom-color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-icon {
    font-size: 16px;
}

/* ==================================================
   محتوای اصلی
   ================================================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==================================================
   کارت‌های آمار
   ================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    border-right: 4px solid var(--primary);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.12);
}

.stat-blue { border-right-color: #1E40AF; }
.stat-green { border-right-color: #10B981; }
.stat-orange { border-right-color: #F59E0B; }
.stat-purple { border-right-color: #8B5CF6; }

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 14px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==================================================
   دو ستون
   ================================================== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ==================================================
   کارت
   ================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.card-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover {
    text-decoration: underline;
}

.card-body {
    padding: 8px 0;
}

/* ==================================================
   لیست
   ================================================== */
.list {
    list-style: none;
}

.list-item {
    padding: 12px 20px;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.2s;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--bg);
}

.list-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.list-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.list-badge-sm {
    background: #F1F5F9;
    color: var(--text-muted);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.list-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.list-item-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.empty-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==================================================
   جدول
   ================================================== */
.table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--primary);
    color: var(--white);
}

.table th {
    padding: 14px 16px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 13px;
    color: var(--text);
}

.table tbody tr {
    transition: background 0.15s;
}

.table tbody tr:hover {
    background: var(--bg);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================================================
   فرم جستجو
   ================================================== */
.search-bar {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--bg);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

/* ==================================================
   دکمه‌ها
   ================================================== */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.btn-danger:hover {
    background: #FECACA;
}

.btn-success {
    background: #D1FAE5;
    color: #065F46;
}

.btn-success:hover {
    background: #A7F3D0;
}

.btn-warning {
    background: #FEF3C7;
    color: #92400E;
}

.btn-warning:hover {
    background: #FDE68A;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* ==================================================
   Badge
   ================================================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-blue {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-purple {
    background: #EDE9FE;
    color: #5B21B6;
}

/* ==================================================
   Modal
   ================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 42, 50, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--bg);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==================================================
   Responsive
   ================================================== */
@media (max-width: 900px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 12px 16px;
    }

    .logo-text {
        font-size: 14px;
    }

    .user-name {
        display: none;
    }

    .main-nav {
        top: 60px;
    }

    .nav-inner {
        padding: 0 12px;
    }

    .nav-item {
        padding: 12px 14px;
        font-size: 13px;
    }

    .main-content {
        padding: 20px 12px;
    }

    .page-title {
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
        gap: 10px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .table {
        min-width: 700px;
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .search-bar {
        padding: 12px 14px;
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .login-logo {
        font-size: 40px;
    }

    .login-title {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}