/* =============================================
   Admin Panel Stylesheet
   ============================================= */

/* ---------- Login ---------- */
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--white);
    font-size: 1.75rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--neutral-500);
    font-size: 0.875rem;
}

/* ---------- Admin Layout ---------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--neutral-900);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--neutral-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar-header .brand-text {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-header .brand-sub {
    font-size: 0.688rem;
    color: var(--neutral-400);
    font-weight: 400;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-label {
    padding: 0.75rem 1.5rem 0.375rem;
    font-size: 0.688rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--neutral-500);
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--neutral-400);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover {
    color: var(--white);
    background: var(--neutral-800);
}

.sidebar-link.active {
    color: var(--white);
    background: var(--primary);
    border-right: 3px solid var(--primary-light);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.938rem;
}

.sidebar-link .badge {
    margin-left: auto;
    background: #ef4444;
    color: var(--white);
    font-size: 0.688rem;
    padding: 0.125rem 0.5rem;
    border-radius: 50px;
    font-weight: 700;
}

/* ---------- Admin Main ---------- */
.admin-main {
    margin-left: 260px;
    flex: 1;
    background: var(--neutral-50);
    min-height: 100vh;
}

.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.topbar-user .user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-100);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
}

.admin-content {
    padding: 2rem;
}

/* ---------- Dashboard Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card .stat-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.125rem;
}

.stat-card .stat-info p {
    font-size: 0.813rem;
    color: var(--neutral-500);
    font-weight: 500;
}

/* ---------- Admin Table ---------- */
.admin-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
}

.admin-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card-header h3 {
    font-size: 1.05rem;
}

.admin-card-body {
    padding: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--neutral-500);
    font-weight: 600;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.admin-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-700);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: var(--neutral-50);
}

.admin-table .table-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-400);
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--neutral-200);
    background: var(--white);
    color: var(--neutral-600);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.813rem;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}

.btn-icon.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.btn-icon.success:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: #ecfdf5;
}

/* ---------- Admin Form ---------- */
.admin-form .form-group {
    margin-bottom: 1.5rem;
}

.admin-form .form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--neutral-700);
}

.admin-form .form-hint {
    font-size: 0.75rem;
    color: var(--neutral-400);
    margin-top: 0.375rem;
}

.admin-form textarea.form-control {
    min-height: 150px;
}

.form-image-preview {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--neutral-300);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-400);
    font-size: 2rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.form-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Status Badges ---------- */
.badge-active {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #ecfdf5;
    color: var(--secondary);
}

.badge-inactive {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--neutral-100);
    color: var(--neutral-500);
}

.badge-unread {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fffbeb;
    color: var(--accent);
}

/* ---------- Responsive Admin ---------- */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-content {
        padding: 1rem;
    }
}
