/* @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap'); */

* {
    font-family: 'Vazirmatn','iransans', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f7fa;
    min-height: 100vh;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    transform: scale(1.05);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
}

/* Sidebar */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 270px;
    height: 100vh;
    background: linear-gradient(175deg, #1e3154 0%, #162544 40%, #111d36 100%);
    padding: 0;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(83, 191, 159, 0.3);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(83, 191, 159, 0.5);
}

/* Sidebar Header / Logo */
.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: relative;
    flex-shrink: 0;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 1.5rem;
    left: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(83, 191, 159, 0.4), transparent);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-logo-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #53bf9f 0%, #3a9d82 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    box-shadow: 0 4px 15px rgba(83, 191, 159, 0.35);
    flex-shrink: 0;
    position: relative;
}

.sidebar-logo-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(83, 191, 159, 0.4), transparent);
    z-index: -1;
}

.sidebar-logo-text h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 1.5px;
    line-height: 1.2;
}

.sidebar-logo-text p {
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    margin: 0;
    font-weight: 400;
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

/* Section Titles */
.sidebar-section-title {
    padding: 1.2rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    pointer-events: none;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    margin: 0.75rem 1.5rem;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
}

/* Menu Links */
.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.25rem;
    margin: 0 0.75rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 10px;
    gap: 0;
}

.sidebar-menu a:hover {
    background: rgba(83, 191, 159, 0.08);
    color: rgba(255,255,255,0.95);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(83, 191, 159, 0.15) 0%, rgba(83, 191, 159, 0.05) 100%);
    color: #53bf9f;
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    background: #53bf9f;
    border-radius: 3px 0 0 3px;
    box-shadow: 0 0 8px rgba(83, 191, 159, 0.5);
}

/* Sidebar Icon */
.sidebar-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-left: 0.75rem;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all 0.25s ease;
    background: rgba(255,255,255,0.04);
}

.sidebar-menu a:hover .sidebar-icon {
    background: rgba(83, 191, 159, 0.12);
    color: #53bf9f;
}

.sidebar-menu a.active .sidebar-icon {
    background: rgba(83, 191, 159, 0.2);
    color: #53bf9f;
}

/* Sidebar Text */
.sidebar-text {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Sidebar Badge (notifications) */
.sidebar-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 20px;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: auto;
    margin-left: 0;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 2px 15px rgba(239, 68, 68, 0.6); }
}

/* Logout link */
.sidebar-menu a.sidebar-logout {
    color: rgba(239, 68, 68, 0.7);
}

.sidebar-menu a.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.sidebar-menu a.sidebar-logout:hover .sidebar-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    position: relative;
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    right: 1.5rem;
    left: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(83, 191, 159, 0.3), transparent);
}

.sidebar-footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
}

.sidebar-footer-content i {
    font-size: 0.7rem;
}

/* Main Content */
.main-content {
    margin-right: 270px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top Bar */
.top-bar {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar h2 {
    color: #2d3748;
    font-weight: 700;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-details h5 {
    margin: 0;
    font-size: 0.95rem;
    color: #2d3748;
    font-weight: 600;
}

.user-details p {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.8rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.red {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.3rem;
}

.stat-info p {
    color: #6c757d;
    margin: 0;
    font-size: 0.95rem;
}

/* Content Card */
.content-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.content-card h4 {
    color: #2d3748;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

/* Table Styles */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow-x: auto;
    display: block;
}

.custom-table thead {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
}

.custom-table thead th {
    padding: 1rem;
    color: white;
    font-weight: 600;
    text-align: right;
    font-size: 0.9rem;
}

.custom-table thead th:first-child {
    border-radius: 10px 0 0 0;
}

.custom-table thead th:last-child {
    border-radius: 0 10px 0 0;
}

.custom-table tbody {
    display: table-row-group;
}

.custom-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.custom-table tbody tr:hover {
    background: #f8f9fa;
}

.custom-table tbody td {
    padding: 1rem;
    color: #4a5568;
}

.badge-status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-expired {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Action Buttons */
.action-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.2rem;
    font-size: 0.9rem;
}

.btn-view {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit {
    background: #d1fae5;
    color: #065f46;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #53bf9f;
    box-shadow: 0 0 0 3px rgba(83, 191, 159, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(83, 191, 159, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalShow 0.3s ease;
}

@keyframes modalShow {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.modal-header h3 {
    color: #2d3748;
    font-weight: 700;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #991b1b;
    transform: rotate(90deg);
}

/* Section Visibility */
.section-hidden {
    display: none;
}

.section-active {
    display: block;
}

/* Tab Buttons */
.btn-tab {
    background: white;
    border: 2px solid #e2e8f0;
    color: #6c757d;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tab:hover {
    border-color: #53bf9f;
    color: #53bf9f;
}

.btn-tab.active {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    border-color: transparent;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-md-2, .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
    padding: 0 0.75rem;
}

.col-md-2 { width: 16.666%; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.666%; }
.col-md-12 { width: 100%; }

/* Responsive */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        padding: 5rem 1rem 1rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .custom-table {
        font-size: 0.85rem;
    }
    
    .custom-table thead th,
    .custom-table tbody td {
        padding: 0.7rem 0.5rem;
    }
}

/* Top Bar Actions */
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Notification Bell */
.notification-bell-wrapper {
    position: relative;
}

.notification-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #f5f7fa;
    color: #6c757d;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
}

/* User Menu Wrapper */
.user-menu-wrapper {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.user-info:hover {
    background: #f5f7fa;
}

.user-arrow {
    font-size: 0.75rem;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.user-menu-wrapper:hover .user-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-menu-wrapper:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    width: 100%;
    border: none;
    background: none;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0;
}

.logout-btn {
    color: #e74c3c;
}

.logout-btn:hover {
    background: #fee2e2;
    color: #e74c3c;
}

/* Notifications Page */
.notifications-container {
    max-width: 800px;
    margin: 0 auto;
}

.notification-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.notification-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.notification-card.unread {
    border-right: 4px solid #53bf9f;
    background: linear-gradient(90deg, rgba(83, 191, 159, 0.05) 0%, white 30%);
}

.notification-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.notification-icon.info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.notification-icon.success {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
}

.notification-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.3rem;
}

.notification-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.notification-time {
    font-size: 0.8rem;
    color: #a0aec0;
}

.notification-empty {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.notification-empty i {
    font-size: 4rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.notification-empty p {
    font-size: 1.1rem;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.notifications-header h3 {
    color: #2d3748;
    font-weight: 700;
}

.btn-mark-all {
    padding: 0.5rem 1rem;
    background: #f5f7fa;
    border: none;
    border-radius: 8px;
    color: #6c757d;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-mark-all:hover {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
}

/* Responsive for top bar */
@media (max-width: 576px) {
    .top-bar-actions {
        gap: 0.75rem;
    }
    
    .user-details h5 {
        font-size: 0.85rem;
    }
    
    .user-details p {
        font-size: 0.7rem;
    }
    
    .notification-bell {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Custom Pagination Styles */
.custom-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 15px;
}

.pagination-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: none;
    border-radius: 10px;
    background: white;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-link:hover:not(.disabled):not(.dots) {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(83, 191, 159, 0.3);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(83, 191, 159, 0.4);
}

.page-item.disabled .page-link {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.page-link.dots {
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.page-link i {
    font-size: 0.85rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
}

/* Responsive Pagination */
@media (max-width: 576px) {
    .pagination-list {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-link {
        min-width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
    
    .custom-pagination {
        padding: 1rem;
    }
}

/* ============================================
   MODERN DASHBOARD REDESIGN
   ============================================ */

/* Dashboard Welcome Hero */
.dash-hero {
    position: relative;
    border-radius: 24px;
    padding: 2.5rem 2.5rem;
    margin-bottom: 2.5rem;
    color: white;
    background: linear-gradient(135deg, #1a2847 0%, #233a64 45%, #2d5a8c 100%);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(26, 40, 71, 0.35);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.dash-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(83, 191, 159, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.dash-hero::after {
    content: '';
    position: absolute;
    bottom: -80%;
    right: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(83, 191, 159, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, #53bf9f, #7dd3c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    margin-bottom: 0;
    max-width: 500px;
    line-height: 1.8;
}

.hero-badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    white-space: nowrap;
}

.hero-badge i {
    color: #53bf9f;
    font-size: 1.2rem;
}

.hero-stats-row {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    min-width: 80px;
}

.hero-stat .value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #53bf9f, #a7f3d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1.2;
}

.hero-stat .label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

/* Modern Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card-modern {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: all 0.35s ease;
}

.stat-card-modern:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.stat-card-modern:hover::before {
    opacity: 1;
}

.stat-card-modern:hover .stat-card-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-card-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.35s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-card-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-icon.green {
    background: linear-gradient(135deg, #53bf9f 0%, #1d8a6d 100%);
}

.stat-card-icon.orange {
    background: linear-gradient(135deg, #f6a85b 0%, #f5576c 100%);
}

.stat-card-icon.red {
    background: linear-gradient(135deg, #fa709a 0%, #e3456a 100%);
}

.stat-card-icon.purple {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.stat-card-icon.cyan {
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
}

.stat-card-info {
    flex: 1;
}

.stat-card-info .value {
    font-size: 2.1rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card-info .label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.stat-card-trend {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

/* Dashboard Grid Layout */
.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.dash-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Modern Cards */
.dash-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.3s ease;
}

.dash-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dash-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-card-title i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #53bf9f 0%, #1d8a6d 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(83, 191, 159, 0.3);
}

.dash-card-title.purple i {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.dash-card-title.orange i {
    background: linear-gradient(135deg, #f6a85b 0%, #f5576c 100%);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.dash-card-title.blue i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.dash-card-title.red i {
    background: linear-gradient(135deg, #fa709a 0%, #e3456a 100%);
    box-shadow: 0 4px 12px rgba(227, 69, 106, 0.3);
}

.dash-link {
    font-size: 0.85rem;
    color: #53bf9f;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dash-link:hover {
    color: #1d8a6d;
    transform: translateX(-3px);
}

/* Activity Timeline */
.timeline {
    position: relative;
    padding-right: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, #53bf9f 0%, rgba(83, 191, 159, 0.1) 100%);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-right: 1.25rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -0.44rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #53bf9f;
    box-shadow: 0 0 0 4px rgba(83, 191, 159, 0.2);
}

.timeline-item:nth-child(2n)::before {
    background: #a78bfa;
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
}

.timeline-item .timeline-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.timeline-item .timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.timeline-item .timeline-time {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

/* Module Badge in Timeline */
.module-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* Recommended Knowledge Items */
.recommend-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.recommend-item:hover {
    background: white;
    border-color: #53bf9f;
    box-shadow: 0 4px 15px rgba(83, 191, 159, 0.15);
    transform: translateX(-4px);
}

.recommend-item-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.recommend-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #53bf9f 0%, #1d8a6d 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.recommend-item-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.recommend-item-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.recommend-view-btn {
    flex-shrink: 0;
    background: #ecfdf5;
    color: #059669;
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.recommend-view-btn:hover {
    background: linear-gradient(135deg, #53bf9f 0%, #1d8a6d 100%);
    color: white;
}

/* Pending Knowledge Banner */
.pending-banner {
    position: relative;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    overflow: hidden;
}

.pending-banner::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(251, 146, 60, 0.1);
}

.pending-banner-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.pending-banner-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f6a85b 0%, #f5576c 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.3);
    flex-shrink: 0;
}

.pending-banner-text {
    flex: 1;
    min-width: 200px;
}

.pending-banner-text .title {
    font-weight: 700;
    color: #9a3412;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.pending-banner-text .sub {
    color: #c2410c;
    font-size: 0.88rem;
}

.pending-banner .btn-primary {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #f6a85b 0%, #f5576c 100%);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.35);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
}

.pending-banner .btn-primary:hover {
    box-shadow: 0 12px 30px rgba(245, 87, 108, 0.45);
}

/* Modern Table */
.modern-table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.modern-table thead th {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.82rem;
    text-align: right;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.modern-table tbody td {
    padding: 1rem 1.25rem;
    color: #4a5568;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.modern-table tbody tr {
    transition: all 0.25s ease;
}

.modern-table tbody tr:hover {
    background: #f8fafc;
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* Modern Badge in table */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-modern.green {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-modern.orange {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-modern.red {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-modern.blue {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.badge-modern.purple {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

/* Modern Action Buttons */
.action-btn-modern {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    margin: 0 0.15rem;
}

.action-btn-modern.view {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn-modern.view:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(59, 130, 246, 0.35);
}

.action-btn-modern.edit {
    background: #d1fae5;
    color: #065f46;
}

.action-btn-modern.edit:hover {
    background: #10b981;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(16, 185, 129, 0.35);
}

.action-btn-modern.delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-btn-modern.delete:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(239, 68, 68, 0.35);
}

/* Charts modern */
.chart-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.5);
    margin-bottom: 1.5rem;
}

.chart-card canvas {
    margin-top: 0.5rem;
}

/* Quick Access Cards */
.dash-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.quick-card {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.quick-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #53bf9f, #233a64);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s ease;
    opacity: 0;
    border-radius: 0 0 20px 20px;
}

.quick-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.quick-card:hover::after {
    transform: scaleX(1);
    opacity: 1;
}

.quick-card:hover .quick-card-icon {
    transform: scale(1.1) rotate(-5deg);
}

.quick-card:hover .quick-card-arrow {
    transform: translateX(-5px);
    opacity: 1;
}

.quick-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.quick-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    transition: all 0.35s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.quick-card-icon.green {
    background: linear-gradient(135deg, #53bf9f 0%, #1d8a6d 100%);
}

.quick-card-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.quick-card-icon.orange {
    background: linear-gradient(135deg, #f6a85b 0%, #f5576c 100%);
}

.quick-card-icon.red {
    background: linear-gradient(135deg, #fa709a 0%, #e3456a 100%);
}

.quick-card-icon.purple {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.quick-card-icon.cyan {
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
}

.quick-card-arrow {
    color: #53bf9f;
    font-size: 1rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.quick-card h5 {
    color: #1f2937;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.quick-card p {
    color: #94a3b8;
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 0;
}

/* Info/summary boxes */
.info-box {
    display: flex;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.info-box:hover {
    border-color: #c7d2fe;
    background: #f5f3ff;
}

.info-box-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.info-box-icon.green {
    background: linear-gradient(135deg, #53bf9f 0%, #1d8a6d 100%);
}

.info-box-icon.purple {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.info-box-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.info-box h6 {
    color: #1f2937;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.info-box p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.7;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: #e2e8f0;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Analytics chips */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    transition: all 0.3s ease;
}

.chip i {
    font-size: 0.9rem;
}

.chip.green { color: #059669; background: #ecfdf5; border-color: #a7f3d0; }
.chip.blue { color: #1e40af; background: #dbeafe; border-color: #bfdbfe; }
.chip.orange { color: #c2410c; background: #ffedd5; border-color: #fed7aa; }
.chip.red { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
.chip.purple { color: #6d28d9; background: #ede9fe; border-color: #ddd6fe; }
.chip.cyan { color: #0e7490; background: #cffafe; border-color: #a5f3fc; }

/* Responsive dashboard */
@media (max-width: 992px) {
    .dash-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .dash-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .dash-hero {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .dash-hero {
        padding: 1.75rem;
    }
    
    .hero-stats-row {
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pending-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .recommend-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .recommend-item-title {
        max-width: 100%;
    }
    
    .timeline {
        padding-right: 1rem;
    }
    
    .timeline-item {
        padding-right: 1rem;
    }
}
/* ============================================================
   Knowledge Templates (تمپلیت‌های دانش)
   ============================================================ */

/* --- Page Header --- */
.tpl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: white;
    padding: 1.5rem 1.75rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    border-right: 4px solid #53bf9f;
}

.tpl-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tpl-header-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(83, 191, 159, 0.35);
}

.tpl-header-title {
    margin: 0;
    color: #2d3748;
    font-weight: 700;
    font-size: 1.25rem;
}

.tpl-header-subtitle {
    margin: 0.25rem 0 0;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* --- Cards Grid --- */
.tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tpl-card {
    position: relative;
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tpl-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(35, 58, 100, 0.12);
    border-color: rgba(83, 191, 159, 0.35);
}

.tpl-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tpl-card:hover::before {
    opacity: 1;
}

.tpl-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.tpl-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(83,191,159,0.12) 0%, rgba(35,58,100,0.10) 100%);
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tpl-card-titles {
    min-width: 0;
}

.tpl-card-title {
    margin: 0;
    color: #1e293b;
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Chips (آمار) --- */
.tpl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.tpl-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.tpl-chip i {
    font-size: 0.72rem;
}

.tpl-chip-green {
    background: #d1fae5;
    color: #065f46;
}

.tpl-chip-blue {
    background: #e0e7ff;
    color: #3730a3;
}

.tpl-chip-gray {
    background: #f1f5f9;
    color: #64748b;
}

/* --- Card Footer / Actions --- */
.tpl-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.25rem;
    margin-top: auto;
}

.tpl-card-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.tpl-card-view:hover {
    background: #2563eb;
    color: white;
    transform: translateX(-3px);
}

.tpl-card-actions {
    display: flex;
    gap: 0.45rem;
}

.tpl-icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.tpl-icon-btn.edit {
    background: #d1fae5;
    color: #065f46;
}

.tpl-icon-btn.edit:hover {
    background: #065f46;
    color: white;
    transform: translateY(-2px);
}

.tpl-icon-btn.delete {
    background: #fee2e2;
    color: #991b1b;
}

.tpl-icon-btn.delete:hover {
    background: #991b1b;
    color: white;
    transform: translateY(-2px);
}

/* --- Empty State --- */
.tpl-empty {
    text-align: center;
    padding: 5rem 2rem;
    background: #f8fafc;
    border-radius: 20px;
    border: 2px dashed #e2e8f0;
}
/* ============================================================
   Templates Form (ایجاد / ویرایش تمپلیت)
   ============================================================ */

.tpl-section-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tpl-step-num {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(83, 191, 159, 0.3);
}

.tpl-section-title {
    margin: 0;
    color: #2d3748;
    font-weight: 700;
    font-size: 1.1rem;
    border: none !important;
    padding: 0 !important;
}

.tpl-section-hint {
    margin: 0.3rem 0 0;
    color: #94a3b8;
    font-size: 0.82rem;
}

.tpl-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 2.5rem 0;
}

.tpl-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.tpl-btn-sm {
    padding: 0.55rem 1.2rem !important;
    font-size: 0.85rem !important;
    border-radius: 10px !important;
}

/* --- Field Builder Cards --- */
.tpl-field-card {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tpl-field-card:hover {
    border-color: rgba(83, 191, 159, 0.45);
    box-shadow: 0 5px 20px rgba(35, 58, 100, 0.07);
}

.tpl-field-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.tpl-field-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #53bf9f 0%, #233a64 100%);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
}

.tpl-field-remove {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: #fee2e2;
    color: #991b1b;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.25s ease;
}

.tpl-field-remove:hover {
    background: #991b1b;
    color: white;
}

.tpl-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #2d3748;
    font-weight: 500;
}

.tpl-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #53bf9f;
    cursor: pointer;
}

/* ============================================================
   Template Show (جزئیات تمپلیت)
   ============================================================ */

.tpl-show-hero {
    position: relative;
    background: linear-gradient(135deg, #233a64 0%, #1e3154 60%, #162544 100%);
    border-radius: 18px;
    padding: 2rem 2.25rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.tpl-show-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(83,191,159,0.25) 0%, transparent 70%);
}

.tpl-hero-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.tpl-hero-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tpl-hero-name {
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.tpl-hero-meta {
    margin: 0;
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.tpl-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tpl-hero-chips {
    display: flex;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}

.tpl-hero-chip {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tpl-show-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1.75rem;
    height: 100%;
    margin-bottom: 2rem;
}

.tpl-show-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
    color: #2d3748;
    font-weight: 700;
    font-size: 1.05rem;
}

.tpl-show-card-title i {
    color: #53bf9f;
}

/* --- Info Rows --- */
.tpl-info-list {
    display: grid;
    gap: 0.9rem;
}

.tpl-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.8rem 1rem;
}

.tpl-info-label {
    color: #64748b;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tpl-info-label i {
    color: #53bf9f;
    width: 16px;
    text-align: center;
}

.tpl-info-value {
    font-weight: 700;
    color: #2d3748;
}

/* --- Type Badges in fields table --- */
.tpl-field-card > .tpl-field-remove {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
}

.tpl-field-head {
    padding-left: 3rem;
}

.tpl-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    color: #4338ca;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.tpl-option-tag {
    display: inline-block;
    font-size: 0.74rem;
    background: #f1f5f9;
    color: #475569;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin: 2px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .tpl-header,
    .tpl-show-hero {
        flex-direction: column;
        align-items: stretch;
        text-align: right;
    }

    .tpl-hero-main {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .tpl-grid {
        grid-template-columns: 1fr;
    }

    .tpl-option-row {
        grid-template-columns: 1fr;
    }
}

/* --- Select Options Box --- */
.tpl-options {
    background: white;
    border: 1px dashed #cbd5e0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.tpl-options-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tpl-options-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
    margin: 0;
}

.tpl-option-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    align-items: center;
}

.tpl-option-row .form-control {
    padding: 0.65rem 0.8rem;
    font-size: 0.88rem;
}

/* --- Empty Fields Box --- */
.tpl-empty-fields {
    text-align: center;
    color: #94a3b8;
    padding: 3rem 1.5rem;
    border: 2px dashed #e2e8f0;
    border-radius: 15px;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.tpl-empty-fields:hover {
    border-color: rgba(83, 191, 159, 0.5);
    background: #f8fafc;
}

.tpl-empty-fields i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: #cbd5e0;
}

.tpl-error-text {
    color: #e53e3e;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}


.tpl-empty-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(83,191,159,0.12) 0%, rgba(35,58,100,0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #53bf9f;
}

.tpl-empty h4 {
    color: #475569;
    font-weight: 700;
    margin-bottom: 0.75rem;
    border: none;
    padding: 0;
}

.tpl-empty p {
    color: #94a3b8;
    max-width: 420px;
    margin: 0 auto 2rem;
    line-height: 1.9;
}

.tpl-card-date {
    color: #94a3b8;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.tpl-card-desc {
    color: #64748b;
    line-height: 1.8;
    font-size: 0.88rem;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

/* --- Template page refinements --- */
.tpl-header { box-shadow: 0 8px 24px rgba(35, 58, 100, .07); }
.tpl-grid { gap: 1.25rem; }
.tpl-card { padding: 1.5rem; }

.tpl-chip-purple { background: #f3e8ff; color: #7e22ce; }

.tpl-form-intro {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 65%, #ecfdf5 100%);
}

.tpl-form-intro-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #53bf9f);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .2);
}

.tpl-eyebrow, .tpl-hero-kicker {
    display: block;
    margin-bottom: .35rem;
    color: #0f766e;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.tpl-form-intro h3 { margin: 0; color: #1e3a5f; font-size: 1.08rem; font-weight: 700; }
.tpl-form-intro p { margin: .35rem 0 0; color: #64748b; font-size: .86rem; }

.tpl-form-progress {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-right: auto;
    color: #94a3b8;
    font-size: .78rem;
    white-space: nowrap;
}

.tpl-form-progress .is-active { color: #1d4ed8; font-weight: 700; }
.tpl-form-progress i { color: #cbd5e1; font-size: .65rem; }
.tpl-form-card { border-top: 3px solid #53bf9f; }
.tpl-fields-container:empty { display: none; }

.tpl-form-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .85rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: .86rem;
}

.tpl-hero-kicker { color: #99f6e4; }
.tpl-show-card { box-shadow: 0 8px 24px rgba(35, 58, 100, .06); }
.tpl-show-card-title-spaced { margin-top: 2rem; }

.tpl-description {
    margin: 0;
    color: #64748b;
    font-size: .92rem;
    line-height: 2;
    white-space: pre-line;
}

@media (max-width: 768px) {
    .tpl-form-intro { align-items: flex-start; flex-wrap: wrap; }
    .tpl-form-progress { width: 100%; margin-right: 0; }
    .tpl-hero-chips { flex-wrap: wrap; }
}

