:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #4895ef;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gray-dark: #495057;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    direction: rtl;
}

/* صفحات المصادقة */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 80%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 50%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 70%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.6s ease;
}

.register-page .auth-container {
    max-width: 700px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    padding: 40px;
    backdrop-filter: blur(10px);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
}

.logo i {
    font-size: 28px;
}

.auth-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 700;
}

.auth-header p {
    color: var(--gray);
    font-size: 16px;
}

/* النماذج */
.auth-form {
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--gray);
    transition: var(--transition);
}

.form-input {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
    background: var(--light);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-input:focus + .input-underline {
    transform: scaleX(1);
}

.form-input:focus ~ .input-icon {
    color: var(--primary);
}

.input-underline {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: right;
}

/* الأزرار */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-auth {
    margin-top: 10px;
}

.btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    display: block;
}

/* خيارات النموذج */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password:hover {
    text-decoration: underline;
}

.form-agreement {
    margin: 20px 0;
    font-size: 14px;
}

/* زر الاختيار */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-light);
    border-radius: 4px;
    margin-left: 8px;
    position: relative;
    transition: var(--transition);
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    right: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.form-agreement a {
    color: var(--primary);
    text-decoration: none;
}

.form-agreement a:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

.auth-footer p {
    color: var(--gray);
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-link:hover {
    text-decoration: underline;
}

/* لوحة التحكم */
.dashboard-page {
    background: #f5f7fb;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* الشريط الجانبي */
.sidebar {
    width: 280px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid var(--gray-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

.user-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--dark);
}

.user-info p {
    font-size: 14px;
    color: var(--gray);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    border-right: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item a:before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: var(--transition);
}

.nav-item a:hover:before {
    right: 100%;
}

.nav-item a i {
    margin-left: 10px;
    font-size: 18px;
    width: 24px;
    text-align: center;
    transition: var(--transition);
}

.nav-item a span {
    transition: var(--transition);
}

.nav-item a:hover {
    background: var(--gray-light);
    border-right-color: var(--primary);
}

.nav-item a:hover i {
    transform: scale(1.1);
    color: var(--primary);
}

.nav-item.active a {
    background: rgba(67, 97, 238, 0.1);
    border-right-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.nav-item.active a i {
    color: var(--primary);
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    padding: 30px;
    margin-right: 280px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header h1 {
    font-size: 28px;
    color: var(--dark);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-notification {
    position: relative;
    background: white;
    border: 1px solid var(--gray-light);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
}

.btn-notification:hover {
    background: var(--gray-light);
    color: var(--dark);
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: var(--transition);
}

.user-menu:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.user-avatar-small {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* قسم الإحصائيات */
.stats-section {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    animation: fadeIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: var(--transition);
}

.stat-card:hover:before {
    transform: translateX(100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.total {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.stat-icon.cash {
    background: linear-gradient(135deg, var(--success), var(--info));
}

.stat-icon.product {
    background: linear-gradient(135deg, var(--warning), var(--danger));
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
}

.stat-info p {
    color: var(--gray);
    font-size: 16px;
}

/* قسم المفكرات الحديثة */
.recent-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    animation: fadeInUp 0.6s ease 0.4s both;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 22px;
    color: var(--dark);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-all:hover {
    text-decoration: underline;
    gap: 8px;
}

.view-all i {
    transition: var(--transition);
}

.view-all:hover i {
    transform: translateX(-5px);
}

.notebooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.notebook-card {
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
    animation: fadeIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

.notebook-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.notebook-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.notebook-header h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 5px;
}

.notebook-type {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    flex-shrink: 0;
}

.notebook-type.cash {
    background: var(--success);
}

.notebook-type.product {
    background: var(--warning);
}

.notebook-body {
    margin-bottom: 15px;
}

.notebook-date {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 5px;
}

.notebook-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.notebook-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
    background: transparent;
}

.btn-action:hover {
    background: var(--gray-light);
    transform: scale(1.1);
}

.btn-action.view:hover {
    color: var(--info);
}

.btn-action.edit:hover {
    color: var(--warning);
}

.btn-action.delete:hover {
    color: var(--danger);
}

/* التجاوب */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-right: 250px;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: 51vh;
    }
    
    .sidebar-nav ul {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .nav-item {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .nav-item a {
        border-right: none;
        border-bottom: 3px solid transparent;
        padding: 10px 15px;
        flex-direction: column;
        text-align: center;
        font-size: 12px;
    }
    
    .nav-item a i {
        margin-left: 0;
        margin-bottom: 5px;
    }
    
    .nav-item.active a {
        border-right-color: transparent;
        border-bottom-color: var(--primary);
    }
    
    .main-content {
        margin-right: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .notebooks-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .auth-container {
        max-width: 100%;
    }
    
    .auth-card {
        padding: 25px 15px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
}
/* تنسيقات صفحة الإعدادات */
.settings-container {
    padding: 20px 0;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section .section-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.settings-section .section-header h2 {
    font-size: 22px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section .section-header h2 i {
    color: var(--primary);
}

.settings-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--gray-light);
}

.settings-form {
    max-width: 100%;
}

.settings-form .form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
    text-align: left;
}

/* خيارات الإعدادات */
.settings-options {
    margin-bottom: 25px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-light);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h4 {
    margin-bottom: 5px;
    color: var(--dark);
    font-size: 16px;
}

.setting-info p {
    color: var(--gray);
    font-size: 14px;
    margin: 0;
}

/* زر التبديل */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* الإجراءات المتقدمة */
.advanced-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-dark);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #e68900;
}

/* معلومات الحساب */
.account-info {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--dark);
}

.info-value {
    color: var(--gray);
}

.status-active {
    color: var(--success) !important;
    font-weight: 500;
}

/* النص المساعد */
.text-muted {
    color: var(--gray);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* التجاوب */
@media (max-width: 768px) {
    .settings-card {
        padding: 20px 15px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .advanced-actions {
        flex-direction: column;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
/* تنسيقات صفحة الأرشيف */
.archive-container {
    padding: 20px 0;
}

.archive-stats {
    margin-bottom: 30px;
}

.archive-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.archive-table-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.archive-table-section .section-header h2 {
    font-size: 24px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.archive-table-section .section-header h2 i {
    color: var(--primary);
}

.archive-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

/* تنسيق الجدول */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.archive-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.archive-table th,
.archive-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--gray-light);
}

.archive-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.archive-table tbody tr {
    transition: var(--transition);
}

.archive-table tbody tr:hover {
    background: #f8f9fa;
}

.archive-table tbody tr:last-child td {
    border-bottom: none;
}

/* تنسيق عنوان المفكرة */
.notebook-title strong {
    display: block;
    margin-bottom: 5px;
    color: var(--dark);
}

.notebook-title small {
    color: var(--gray);
    font-size: 12px;
    display: block;
}

/* تنسيق المبلغ */
.amount {
    font-weight: 600;
    color: var(--primary);
    font-family: 'Tajawal', sans-serif;
}

/* تنسيق الحالة */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-completed {
    background: #e3f2fd;
    color: #1565c0;
}

.status-cancelled {
    background: #ffebee;
    color: #c62828;
}

/* أزرار الإجراءات */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-buttons .btn-action {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
    background: transparent;
    font-size: 14px;
}

.action-buttons .btn-action:hover {
    background: var(--gray-light);
    transform: scale(1.1);
}

.action-buttons .btn-action.view:hover {
    color: var(--info);
}

.action-buttons .btn-action.edit:hover {
    color: var(--warning);
}

.action-buttons .btn-action.download:hover {
    color: var(--success);
}

.action-buttons .btn-action.delete:hover {
    color: var(--danger);
}

/* ترقيم الصفحات */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid var(--gray-light);
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    order: 2;
}

.pagination-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
}

.pagination-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    color: white;
}

.pagination-btn.prev {
    order: 1;
}

.pagination-btn.next {
    order: 3;
}

.pagination-btn:disabled {
    background: var(--gray-light);
    color: var(--gray);
    cursor: not-allowed;
    transform: none;
}

.pagination-btn:disabled:hover {
    background: var(--gray-light);
    transform: none;
}

.pagination-number {
    padding: 10px 15px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    border: 1px solid var(--gray-light);
    font-weight: 500;
    min-width: 45px;
    text-align: center;
    display: inline-block;
}

.pagination-number:hover,
.pagination-number.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-info {
    text-align: center;
    padding: 15px;
    border-top: 1px solid var(--gray-light);
    color: var(--gray);
    font-size: 14px;
    order: 4;
    width: 100%;
}

/* حالة عدم وجود بيانات */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 24px;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 25px;
    font-size: 16px;
}

/* التجاوب */
@media (max-width: 1024px) {
    .archive-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .archive-table-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .archive-stats .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .archive-table th,
    .archive-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .action-buttons .btn-action {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-numbers {
        order: 1;
    }
    
    .pagination-btn.prev {
        order: 2;
    }
    
    .pagination-btn.next {
        order: 3;
    }
    
    .pagination-info {
        order: 4;
    }
}
/* تحسينات إضافية للترقيم */
.pagination-btn.disabled {
    background: var(--gray-light);
    color: var(--gray);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-btn.disabled:hover {
    background: var(--gray-light);
    transform: none;
}
/* تنسيقات الأرشيف للمكتملة فقط */
.filter-info {
    margin-bottom: 20px;
}

.filter-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: var(--border-radius-sm);
    color: #2e7d32;
    font-size: 14px;
}

.filter-badge i {
    font-size: 16px;
}

.show-all-link {
    color: var(--primary);
    text-decoration: none;
    margin-right: auto;
    font-weight: 500;
}

.show-all-link:hover {
    text-decoration: underline;
}

.export-actions {
    display: flex;
    gap: 10px;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #00b4d8;
}

/* أيقونات جديدة */
.stat-icon.total {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
}

/* أزرار الإجراءات الجديدة */
.action-buttons .btn-action.restore:hover {
    color: #ff9800;
}

/* حالة عدم وجود بيانات */
.empty-state-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* تحسين تنسيق الجدول */
.archive-table td {
    vertical-align: middle;
}

.notebook-title {
    max-width: 250px;
}

.notebook-title strong {
    display: block;
    margin-bottom: 5px;
    color: var(--dark);
}

.notebook-title small {
    color: var(--gray);
    font-size: 12px;
    display: block;
    line-height: 1.4;
}
/* تنسيقات إضافية للمفكرات النشطة */
.stat-icon.total {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}


/* أزرار الإجراءات الجديدة */
.action-buttons .btn-action.complete:hover {
    color: #4caf50;
}

/* تحسينات التصميم */
.empty-state-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.filter-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: var(--border-radius-sm);
    color: #1565c0;
    font-size: 14px;
}

.show-all-link {
    color: var(--primary);
    text-decoration: none;
    margin-right: auto;
    font-weight: 500;
}

.show-all-link:hover {
    text-decoration: underline;
}
/* تحسينات للهواتف لصفحة المصادقة */
@media (max-width: 768px) {
    .auth-page {
        min-height: 100vh;
        height: auto;
        overflow-y: auto; /* تمكين التمرير العمودي */
        padding: 10px;
        align-items: flex-start; /* محاذاة المحتوى من الأعلى */
    }

    .auth-container {
        max-width: 100%;
        margin: 10px auto;
        animation: none; /* إزالة الحركة إذا كانت تسبب مشاكل */
    }

    .auth-card {
        padding: 20px 15px;
        margin: 10px 0;
        max-height: none; /* إزالة أي حد أقصى للارتفاع */
        overflow: visible; /* التأكد من أن المحتوى لا يتم قطعه */
    }

    .auth-form {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .btn-auth {
        margin-top: 10px;
        margin-bottom: 10px;
        order: 100; /* وضع الزر في نهاية النموذج */
    }

    .auth-footer {
        order: 101; /* وضع التذييل بعد الزر */
    }
}

/* تحسينات إضافية للشاشات الصغيرة جدًا */
@media (max-width: 480px) {
    .auth-card {
        padding: 15px 12px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 15px;
    }

    .auth-page {
        padding: 5px;
    }
}
