@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Logical-1.0.3.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-color: #facc15;
    --primary-dark: #ca8a04;
    --accent-color: #2563eb;
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'YekanBakh', 'Tahoma', sans-serif; }

html, body {
    background: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    width: 100%;
    direction: rtl;
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: calc(100vh - 40px);
    background: var(--sidebar-bg);
    padding: 30px 20px;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.04);
    border-radius: 30px;
    border: 1px solid rgba(0,0,0,0.02);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 18px;
    margin-bottom: 8px;
    font-weight: 700;
    transition: all 0.3s;
}

.nav-link.active, .nav-link:hover {
    background: var(--primary-color);
    color: #000;
}

/* Main Content */
.main-content {
    margin-right: 320px;
    padding: 40px;
    min-height: 100vh;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card {
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

/* Grid System */
.grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}
.grid-form-right {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .grid-form-right { grid-template-columns: 1fr !important; }
}

/* Forms */
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 10px; font-weight: 800; font-size: 0.85rem; }
input, select, textarea {
    width: 100%; padding: 15px; border: 2px solid var(--border-color); border-radius: 15px; font-size: 1rem;
}
input:focus { border-color: var(--primary-color); background: #fffbeb; outline: none; }

.btn {
    padding: 15px 30px; border-radius: 15px; border: none; font-weight: 900; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary { background: var(--accent-color); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

/* Responsive */
.mobile-header { 
    display: none; 
    background: #fff; 
    padding: 15px 20px; 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 900; 
}
.hamburger { font-size: 1.8rem; cursor: pointer; }

@media (max-width: 1024px) {
    .sidebar { right: -320px !important; left: auto !important; height: calc(100vh - 30px) !important; top: 15px !important; }
    .sidebar.open { right: 15px !important; }
    .main-content { margin-right: 0 !important; margin-left: 0 !important; padding: 15px !important; width: 100% !important; }
    .mobile-header { display: flex !important; justify-content: space-between; align-items: center; }
    .grid-container { grid-template-columns: 1fr !important; gap: 20px !important; }
    
    .page-header { 
        flex-direction: column !important; 
        align-items: stretch !important; 
        gap: 15px !important; 
        margin-bottom: 25px !important; 
    }
    .page-header h1 { font-size: 1.5rem !important; text-align: center !important; }
    .page-header div { 
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }
    .page-header div .btn { width: 100% !important; justify-content: center !important; }
}

/* Modal */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); animation: fadeIn 0.3s ease; }
.modal-content { background: #fff; margin: 5% auto; padding: 40px; border-radius: 30px; width: 95%; max-width: 650px; position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15); border: 1px solid var(--border-color); }
.close-modal { position: absolute; right: 25px; top: 25px; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); transition: all 0.2s; }
.close-modal:hover { color: var(--danger); transform: rotate(90deg); }

.code-box {
    background: #f1f5f9;
    border: 2px dashed var(--accent-color);
    padding: 18px;
    border-radius: 18px;
    font-family: 'monospace';
    font-size: 0.85rem;
    word-break: break-all;
    color: #0f172a;
    margin: 20px 0;
    direction: ltr;
    text-align: left;
    line-height: 1.4;
}
.guide-step { margin-bottom: 25px; }
.guide-step h4 { font-weight: 900; color: var(--text-main); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.guide-step p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }
.guide-step a { color: var(--accent-color); text-decoration: none; font-weight: 800; border-bottom: 2px solid #bfdbfe; }

.sidebar-overlay { display: none; position: fixed; top: 0; right: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.2); z-index: 950; }
.sidebar-overlay.active { display: block; }
.table-responsive { width: 100%; overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px; text-align: right; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
th { color: var(--text-muted); font-weight: 800; }

.badge { padding: 6px 12px; border-radius: 10px; font-weight: 800; font-size: 0.75rem; }
.badge-pending { background: #fef9c3; color: #a16207; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fef2f2; color: #b91c1c; }