/* ===== فونت ===== */
@font-face {
    font-family: 'amir';
    src: url('font/BKoodakBold.ttf') format('truetype'),
         url('font/BKoodakBold.eot') format('eot'),
         url('font/BKoodakBold.woff') format('woff');
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'amir', Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    color: #1e293b;
    line-height: 1.6;
}

/* ===== صفحه ورود ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0d9488 100%);
    padding: 20px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.auth-logo {
    font-size: 48px;
    margin-bottom: 8px;
}

.auth-box h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    color: #0f172a;
}

.auth-box .auth-sub {
    color: #64748b;
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.auth-form .form-control {
    margin-bottom: 14px;
}

/* ===== لایه اصلی پنل ===== */
.panel-body {
    background: #f1f5f9;
    min-height: 100vh;
}

.panel-app {
    display: flex;
    min-height: 100vh;
}

/* ===== سایدبار ===== */
.panel-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    font-size: 2rem;
    background: rgba(13, 148, 136, 0.2);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.sidebar-brand strong {
    display: block;
    font-size: 1.1rem;
    color: #fff;
}

.sidebar-brand small {
    color: #94a3b8;
    font-size: 0.75rem;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-form {
    margin: 0;
    padding: 0;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: right;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-logout {
    color: #f87171 !important;
}

.nav-logout:hover {
    background: rgba(248, 113, 113, 0.15) !important;
}

/* ===== محتوای اصلی ===== */
.panel-main {
    flex: 1;
    margin-right: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.panel-topbar {
    background: #fff;
    padding: 20px 32px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar-title h1 {
    margin: 0;
    font-size: 1.4rem;
    color: #0f172a;
}

.topbar-title p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.85rem;
}

.user-badge {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #475569;
}

.panel-content {
    flex: 1;
    padding: 24px 32px;
}

.panel-footer {
    padding: 16px 32px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
}

.panel-footer a {
    color: #0d9488;
    text-decoration: none;
}

/* ===== کارت‌ها ===== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h2 {
    margin: 0;
    font-size: 1rem;
    color: #334155;
}

.card-icon {
    font-size: 1.2rem;
}

.card-body {
    padding: 20px;
}

/* ===== آمار ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    border-radius: 12px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: #0f172a;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
}

/* ===== فرم‌ها ===== */
.panel-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px 20px;
    align-items: start;
    margin-bottom: 16px;
}

.form-label {
    font-weight: bold;
    color: #475569;
    padding-top: 10px;
    font-size: 0.9rem;
}

.form-field {
    min-width: 0;
}

.form-control {
    width: 100%;
    max-width: 480px;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 0.8rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.form-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* ===== دکمه‌ها ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e, #0d9488);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #22c55e;
    color: #fff;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* ===== جدول ===== */
.table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: #f1f5f9;
}

.data-table th {
    padding: 12px 14px;
    text-align: right;
    font-weight: bold;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== بج وضعیت ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* ===== هشدار ===== */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}

/* ===== گزارش کمپین ===== */
.campaign-report {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px dashed #e2e8f0;
}

.campaign-report:last-child {
    border-bottom: none;
}

.campaign-report h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 1.1rem;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #64748b;
}

.report-meta strong {
    color: #0f172a;
}

/* ===== سازگاری با کلاس‌های قدیمی ===== */
.font { font-family: 'amir', Tahoma, sans-serif; }
.green { color: #166534; font-weight: bold; }
.gray { color: #64748b; }
.white { color: #fff; }
.th, .th2 {
    padding: 12px 14px;
    background: #f1f5f9;
    color: #475569;
    font-weight: bold;
    border: 1px solid #e2e8f0;
}
.td, .td2 {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.button-blue, .input-blue {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-family: inherit;
    cursor: pointer;
}
#content {
    width: auto;
    background: transparent;
    box-shadow: none;
}
#content-content { margin: 0; }

/* ===== ریسپانسیو ===== */
@media (max-width: 900px) {
    .panel-sidebar {
        width: 72px;
    }
    .panel-sidebar .sidebar-brand div,
    .panel-sidebar .nav-item span:not(.nav-icon) {
        display: none;
    }
    .sidebar-brand {
        justify-content: center;
        padding: 16px 8px;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .panel-main {
        margin-right: 72px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .panel-content {
        padding: 16px;
    }
    .panel-topbar {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .panel-sidebar {
        position: relative;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
    }
    .nav-form {
        width: auto;
    }
    .nav-item {
        width: auto;
        padding: 8px 12px;
    }
    .panel-main {
        margin-right: 0;
    }
    .panel-app {
        flex-direction: column;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
