/* =====================================================
   Portal Berita DP3AP2KB - Admin CSS
   ===================================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #f1f5f9;
    color: #334155;
    min-height: 100vh;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 50%, #0ea5e9 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.login-page::before {
    width: 500px;
    height: 500px;
    top: -250px;
    right: -150px;
}

.login-page::after {
    width: 400px;
    height: 400px;
    bottom: -200px;
    left: -100px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 14px;
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.3);
    margin-bottom: 14px;
}

.login-logo h1 {
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 13px;
    color: #64748b;
}

.login-form h2 {
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 6px;
    text-align: center;
}

.login-form .subtitle {
    color: #64748b;
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f8fafc;
    transition: all 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: #1d4ed8;
    background: white;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
}

.input-group .form-control {
    padding-left: 42px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.35);
}

.btn-secondary {
    background: #e2e8f0;
    color: #334155;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #10b981; color: white; }
.btn-warning { background: #f59e0b; color: white; }
.btn-info { background: #06b6d4; color: white; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ========== ADMIN LAYOUT ========== */
.admin-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 20;
}

.admin-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-brand h1 {
    font-size: 15px;
    color: white;
    line-height: 1.2;
}

.admin-brand p {
    font-size: 11px;
    color: #94a3b8;
}

.admin-menu {
    flex: 1;
    padding: 16px 0;
    list-style: none;
}

.admin-menu-label {
    padding: 16px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 700;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.admin-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.admin-menu a.active {
    background: linear-gradient(90deg, rgba(29, 78, 216, 0.12) 0%, transparent 100%);
    color: white;
    border-left-color: #1d4ed8;
}

.admin-menu a i {
    width: 20px;
    text-align: center;
    color: #94a3b8;
}

.admin-menu a.active i,
.admin-menu a:hover i {
    color: #60a5fa;
}

.admin-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-user-info {
    flex: 1;
    min-width: 0;
}

.admin-user-info h4 {
    font-size: 14px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-info p {
    font-size: 11px;
    color: #94a3b8;
}

.admin-user a {
    color: #94a3b8;
    transition: color 0.3s;
}

.admin-user a:hover { color: #ef4444; }

/* Main content */
.admin-main {
    background: #f1f5f9;
    min-height: 100vh;
    overflow-x: auto;
}

.admin-header {
    background: white;
    padding: 16px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.admin-header h2 {
    font-size: 20px;
    color: #0f172a;
    font-weight: 700;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-header-link {
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
}

.admin-header-link:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.admin-body {
    padding: 28px;
}

/* ========== STATS CARD ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stats-card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 16px;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.stats-info h3 {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 4px;
}

.stats-info .num {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.stats-info .sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ========== CARD ========== */
.card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* ========== TABLE ========== */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: #f8fafc;
}

.table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

.table img.thumb {
    width: 60px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
}

.action-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ========== BADGE ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-publish { background: #d1fae5; color: #065f46; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-arsip { background: #e2e8f0; color: #475569; }
.badge-admin { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); color: white; }
.badge-editor { background: #dbeafe; color: #1e40af; }

/* ========== ALERT ========== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid;
}

.alert-success { background: #f0fdf4; color: #15803d; border-color: #10b981; }
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #ef4444; }
.alert-warning { background: #fffbeb; color: #a16207; border-color: #f59e0b; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #3b82f6; }

/* ========== FORM GRID ========== */
.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.form-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.req { color: #ef4444; }

/* Preview gambar */
.image-preview {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 16/10;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 10px;
    border: 2px dashed #cbd5e1;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== PAGINATION ========== */
.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    font-size: 13px;
    color: #64748b;
}

.pagination {
    display: flex;
    gap: 4px;
}

.pagination a,
.pagination span {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    background: white;
    border: 1px solid #e2e8f0;
}

.pagination a:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.pagination .active {
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
    color: white;
    border-color: transparent;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 50px;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.empty-state h3 {
    font-size: 18px;
    color: #334155;
    margin-bottom: 6px;
}

/* ========== OVERLAY ========== */
.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
}

.admin-overlay.show {
    display: block;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-wrap {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        transition: left 0.3s;
    }

    .admin-sidebar.show {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-body {
        padding: 18px;
    }

    .admin-header {
        padding: 14px 18px;
    }

    .admin-header h2 {
        font-size: 17px;
    }

    .card-body {
        padding: 18px;
    }

    .stats-card {
        padding: 16px;
    }

    .login-box {
        padding: 28px 20px;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #64748b; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
