/* Notifchi Unified — Main Styles */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 260px;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}

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

body.notifchi-panel {
    font-family: Vazirmatn, Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.7;
    direction: rtl;
    text-align: right;
}
html[dir="rtl"] body,
body.notifchi-auth {
    direction: rtl;
    text-align: right;
    font-family: Vazirmatn, Tahoma, sans-serif;
}

/* Layout */
.panel-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 100;
    transition: transform .3s;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #1e293b;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 700; color: #fff; }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all .15s;
    font-size: 13.5px;
}
.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-item.active { background: var(--primary); color: #fff; border-radius: 0; }
.nav-icon { font-size: 16px; width: 22px; text-align: center; }

.sidebar-footer { border-top: 1px solid #1e293b; padding: 8px 0; }

.main-content {
    margin-right: var(--sidebar-w);
    flex: 1;
    min-width: 0;
}

.topbar {
    background: var(--card);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.page-title { font-size: 18px; font-weight: 700; }
.user-info { color: var(--text-muted); font-size: 13px; }

.content-area { padding: 24px 28px; }

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-card.warning { border-top: 3px solid var(--warning); }
.stat-card.info { border-top: 3px solid var(--info); }
.stat-card.success { border-top: 3px solid var(--success); }
.stat-card.highlight { border-top: 3px solid var(--primary); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.table th {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    background: #f8fafc;
}
.table tr:hover td { background: #f8fafc; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    background: #f1f5f9;
    color: var(--text);
}
.btn:hover { background: #e2e8f0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color .15s;
    background: #fff;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-check label { font-weight: 400; display: flex; align-items: center; gap: 8px; }
.form-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 12px; }
.mb-3 { margin-bottom: 20px; }

/* Plans */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.plan-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: box-shadow .2s;
}
.plan-card:hover { box-shadow: var(--shadow-md); }
.plan-card.plan-test { border-color: var(--info); }
.plan-price { font-size: 24px; font-weight: 700; color: var(--primary); margin: 12px 0 4px; }
.plan-duration { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.plan-features { list-style: none; text-align: right; margin: 12px 0; }
.plan-features li { padding: 4px 0; font-size: 13px; }
.plan-features li::before { content: "✓ "; color: var(--success); }

/* Auth */
body.notifchi-auth {
    font-family: Vazirmatn, Tahoma, sans-serif;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header .logo-icon { font-size: 36px; }
.auth-header h1 { font-size: 22px; margin: 8px 0 4px; }
.auth-header p { color: var(--text-muted); font-size: 13px; }
.auth-footer { text-align: center; margin-top: 20px; }
.auth-footer a { color: var(--primary); text-decoration: none; font-size: 13px; }

/* Pagination */
.pagination ul { display: flex; gap: 4px; list-style: none; justify-content: center; padding: 16px 0; }
.pagination a {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}
.pagination .active a { background: var(--primary); color: #fff; }

/* Search */
.search-form { display: flex; gap: 8px; }
.search-form input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
}

.filter-tabs { display: flex; gap: 6px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 9999;
    animation: slideIn .3s ease;
    max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-content { margin-right: 0; }
    .grid-2 { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
