/* ============================================
   Dashboard Admin Styles
   ============================================ */

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: #f1f5f9;
}

/* SIDEBAR */
.admin-sidebar {
    background: #0f172a;
    color: white;
    padding: 2rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    font-size: 1.35rem;
    background: linear-gradient(135deg, #60a5fa 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-user {
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    color: #cbd5e1;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: #1e293b;
    color: white;
}

.sidebar-nav a.active {
    background: #1e293b;
    color: white;
    border-left-color: #3b82f6;
}

.sidebar-nav .badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

/* MAIN CONTENT */
.admin-main {
    padding: 2rem;
    overflow-x: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    font-size: 2rem;
    color: #0f172a;
}

/* DASHBOARD STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-info .value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon.success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* CARD */
.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1.25rem;
    color: #0f172a;
}

.card-body {
    padding: 1.5rem;
}

/* TABLE */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: #f8fafc;
}

.admin-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

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

.admin-table .thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.action-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-right: 0.25rem;
    transition: all 0.2s;
}

.btn-view { background: #dbeafe; color: #1e40af; }
.btn-edit { background: #fef3c7; color: #92400e; }
.btn-delete { background: #fee2e2; color: #991b1b; }
.btn-view:hover { background: #bfdbfe; }
.btn-edit:hover { background: #fde68a; }
.btn-delete:hover { background: #fecaca; }

/* ADMIN FORM */
.admin-form {
    max-width: 900px;
}

.admin-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f172a;
    font-size: 0.95rem;
}

.admin-form .help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #64748b;
}

.admin-form input[type="file"] {
    padding: 0.5rem;
    background: #f8fafc;
}

.preview-image {
    max-width: 400px;
    max-height: 300px;
    margin-top: 1rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

/* LOGIN */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 2rem;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.login-box .subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 2rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        position: relative;
        height: auto;
    }
    
    .admin-main {
        padding: 1rem;
    }
    
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-read {
    background: #d1fae5;
    color: #065f46;
}

.status-unread {
    background: #fee2e2;
    color: #991b1b;
}

/* Message detail */
.message-detail {
    max-width: 800px;
}

.message-detail .meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.message-detail .meta-item strong {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.message-detail .content {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    line-height: 1.8;
    white-space: pre-wrap;
}