/* ============================================
   ADMIN PANEL - BASE & VARIABLES
   ============================================ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root {
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --primary: #f97316;
    --primary-dark: #ea580c;
    --blue: #3b82f6;
    --green: #10b981;
    --purple: #8b5cf6;
    --red: #ef4444;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 0.75rem;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body {
    font-family: 'Noto Sans Devanagari', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}
.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), #fb923c);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.sidebar-brand h2 { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.sidebar-brand p { font-size: 0.7rem; opacity: 0.5; }
.sidebar-close-btn {
    display: none;
    background: none; border: none; color: #fff; font-size: 1.25rem;
    margin-left: auto; cursor: pointer; padding: 4px;
}
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(249,115,22,0.3);
}
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}
.user-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}
.user-info strong { display: block; font-size: 0.8rem; }
.user-info small { font-size: 0.65rem; opacity: 0.5; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition);
}
.topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}
.menu-toggle {
    display: none;
    background: none; border: none;
    font-size: 1.25rem; color: var(--text);
    cursor: pointer; padding: 6px;
}
.topbar-title h1 { font-size: 1.25rem; font-weight: 700; }
.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
}
.btn-icon {
    position: relative;
    background: var(--bg); border: 1px solid var(--border);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted);
    transition: all var(--transition);
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }
.badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--red);
    color: #fff; font-size: 0.6rem; font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ============================================
   PAGES
   ============================================ */
.page { display: none; }
.page.active { display: block; }
.page-content { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* ============================================
   STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid transparent;
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-blue { border-left-color: var(--blue); }
.stat-green { border-left-color: var(--green); }
.stat-orange { border-left-color: var(--primary); }
.stat-purple { border-left-color: var(--purple); }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}
.stat-blue .stat-icon { background: #dbeafe; color: var(--blue); }
.stat-green .stat-icon { background: #d1fae5; color: var(--green); }
.stat-orange .stat-icon { background: #ffedd5; color: var(--primary); }
.stat-purple .stat-icon { background: #ede9fe; color: var(--purple); }
.stat-info h3 { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-info p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   CARDS & GRID
   ============================================ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.card-header h3 i { color: var(--primary); }
.card-body { padding: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.link-btn {
    font-size: 0.8rem; color: var(--primary);
    text-decoration: none; font-weight: 600;
    transition: color var(--transition);
}
.link-btn:hover { color: var(--primary-dark); }

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.quick-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 0.75rem 1.25rem;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.quick-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff7ed;
}
.quick-btn i { font-size: 1.1rem; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(249,115,22,0.25);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(249,115,22,0.35); transform: translateY(-1px); }
.btn-secondary {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; border-radius: 8px; }
.btn-edit { background: #dbeafe; color: var(--blue); }
.btn-edit:hover { background: #bfdbfe; }
.btn-delete { background: #fee2e2; color: var(--red); }
.btn-delete:hover { background: #fecaca; }

/* ============================================
   TOOLBAR & SEARCH
   ============================================ */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.search-box {
    position: relative;
    flex: 1; max-width: 400px;
}
.search-box i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--card);
    transition: all var(--transition);
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

/* ============================================
   FORMS
   ============================================ */
.form-container { margin-bottom: 1.25rem; }
.form-container.hidden { display: none; }
.form-card { border: 2px solid var(--primary); border-radius: var(--radius); }
.form-card .card-header { background: linear-gradient(135deg, #fff7ed, #fef3c7); }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
}
.form-group label i { color: var(--primary); font-size: 0.75rem; }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    transition: all var(--transition);
    color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.form-group textarea { resize: vertical; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Upload Area */
.upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    background: #fafbfc;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: #fff7ed;
}
.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-placeholder { color: var(--text-muted); }
.upload-placeholder i { font-size: 2rem; color: var(--primary); opacity: 0.5; margin-bottom: 8px; display: block; }
.upload-placeholder p { font-size: 0.85rem; font-weight: 500; }
.upload-placeholder small { font-size: 0.7rem; opacity: 0.6; }
.upload-preview {
    max-height: 200px;
    max-width: 100%;
    border-radius: 8px;
    object-fit: contain;
}
.upload-preview.hidden { display: none; }

/* ============================================
   TABLE
   ============================================ */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .actions-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}
.priority-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}
.priority-सामान्य { background: #e0f2fe; color: #0369a1; }
.priority-महत्त्वाचे { background: #fef9c3; color: #a16207; }
.priority-तातडीचे { background: #fee2e2; color: #dc2626; }
.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f0fdf4;
    color: #15803d;
}

/* ============================================
   GALLERY GRID
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.gallery-item {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gallery-item-img {
    width: 100%; height: 200px;
    object-fit: cover;
    display: block;
}
.gallery-item-body { padding: 1rem; }
.gallery-item-body h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.gallery-item-body .gallery-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.gallery-item-body .gallery-meta span { font-size: 0.72rem; color: var(--text-muted); }
.gallery-item-body p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.gallery-item-actions { display: flex; gap: 6px; }

/* ============================================
   PROGRAMS LIST
   ============================================ */
.programs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}
.program-item {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.program-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.program-item-img {
    width: 100%; height: 180px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #fef3c7, #ffedd5);
}
.program-item-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.program-item-body h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.program-meta {
    display: flex; flex-wrap: wrap; gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.program-meta span { display: flex; align-items: center; gap: 4px; }
.program-meta i { color: var(--primary); }
.program-item-body p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.program-status {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 12px;
    border-radius: 20px; 
    font-size: 0.72rem; font-weight: 700;
}
.status-आगामी { background: #dbeafe; color: #1d4ed8; }
.status-चालू { background: #d1fae5; color: #059669; }
.status-पूर्ण { background: #e0e7ff; color: #4338ca; }
.status-रद्द { background: #fee2e2; color: #dc2626; }
.program-item-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}
.program-item-footer .actions-cell { display: flex; gap: 6px; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.empty-state.full { grid-column: 1 / -1; }
.empty-state i { font-size: 2.5rem; opacity: 0.25; margin-bottom: 0.75rem; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ============================================
   RECENT ACTIVITY
   ============================================ */
.recent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }
.recent-item-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; flex-shrink: 0;
}
.recent-item-icon.blue { background: #dbeafe; color: var(--blue); }
.recent-item-icon.green { background: #d1fae5; color: var(--green); }
.recent-item-icon.orange { background: #ffedd5; color: var(--primary); }
.recent-item-info h4 { font-size: 0.82rem; font-weight: 600; }
.recent-item-info p { font-size: 0.72rem; color: var(--text-muted); }

/* ============================================
   DELETE MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
.modal-box {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-icon {
    width: 60px; height: 60px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem; color: var(--red);
}
.modal-box h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.modal-box p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem; right: 1rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    background: var(--card);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 280px;
    animation: slideInRight 0.4s cubic-bezier(0.34,1.56,0.64,1);
    border-left: 4px solid var(--green);
    font-size: 0.85rem; font-weight: 500;
}
.toast.error { border-left-color: var(--red); }
.toast.error i { color: var(--red); }
.toast i { color: var(--green); font-size: 1.1rem; }
.toast.fade-out { animation: slideOutRight 0.3s ease forwards; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { to { transform: translateX(120%); opacity: 0; } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close-btn { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .programs-list { grid-template-columns: 1fr; }
    .topbar-date { display: none; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: 1rem; }
    .page-toolbar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: none; }
}
