/* ========== ADMIN DASHBOARD STYLES ========== */
:root {
    --admin-bg: #f1f5f9;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

.admin-body {
    background: var(--admin-bg);
    font-family: 'Inter', sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.sidebar-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    color: var(--text-main);
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background: linear-gradient(135deg, #1e3a8a 0%, #06b6d4 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.nav-item.logout {
    margin-top: auto;
    background: #fee2e2;
    color: #ef4444;
}

.nav-item.logout:hover {
    background: #ef4444;
    color: white;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.header-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--admin-bg);
    outline: none;
    transition: border-color 0.2s;
}

.header-search input:focus {
    border-color: var(--secondary);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-info {
    text-align: right;
}

.profile-name {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.profile-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Views */
.admin-view {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.admin-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: var(--text-main);
}

.view-header p {
    color: var(--text-muted);
    margin-top: 5px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.bg-blue { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.bg-cyan { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.bg-green { background: linear-gradient(135deg, #10b981, #34d399); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.recent-activity, .quick-actions {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.recent-activity h2, .quick-actions h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.activity-list {
    list-style: none;
    padding: 0;
}

.activity-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.activity-list li:last-child { border-bottom: none; }
.activity-list li span { color: var(--text-muted); font-size: 0.85rem; }

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--admin-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--admin-bg);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.admin-table td {
    color: var(--text-main);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-published { background: #dcfce7; color: #166534; }
.status-draft { background: #f1f5f9; color: #475569; }

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-edit { background: #e0f2fe; color: #0369a1; }
.btn-edit:hover { background: #0369a1; color: white; }
.btn-delete { background: #fee2e2; color: #b91c1c; }
.btn-delete:hover { background: #b91c1c; color: white; }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #06b6d4 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
    background: var(--admin-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted);
}

.admin-form { padding: 1.5rem; }

.form-group { margin-bottom: 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.admin-form label {
    display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--text-main);
}

.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px;
    font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}

.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
    border-color: var(--secondary);
}

.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px; padding-top: 1rem;
}

/* Overlay for mobile */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 999; display: none;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.active { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .close-sidebar { display: block; }
    .admin-main { margin-left: 0; }
    .menu-toggle { display: block; }
    .header-search { display: none; }
    .profile-info { display: none; }
    .view-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .form-row { grid-template-columns: 1fr; }
}