/* ============================================
   Admin Panel Styles - Guru BK
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #5B3FD6;
    --primary-light: #9B7BFF;
    --gradient: linear-gradient(135deg, #5B3FD6, #9B7BFF);
    --bg: #F4F2FA;
    --surface: #FFFFFF;
    --text: #1A1230;
    --text-secondary: #6B6880;
    --text-muted: #9994AC;
    --border: #E8E4F5;
    --sidebar-bg: #1A1230;
    --sidebar-text: #A09CB0;
    --sidebar-active: #9B7BFF;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --sidebar-width: 260px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; }

/* Layout */
.admin-body { background: var(--bg); min-height: 100vh; }

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    color: white;
}

.admin-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 4px;
}

.admin-nav {
    flex: 1;
    padding: 12px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.admin-nav-link:hover {
    background: rgba(155, 123, 255, 0.1);
    color: white;
}

.admin-nav-link.active {
    background: rgba(155, 123, 255, 0.15);
    color: var(--sidebar-active);
    font-weight: 500;
}

.admin-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--sidebar-active);
    border-radius: 0 3px 3px 0;
}

.admin-nav-link svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
}

.nav-badge {
    margin-left: auto;
    background: #FF4757;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    line-height: 1.4;
}

.admin-sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.logout-link {
    color: #FF6B6B !important;
}

.logout-link:hover {
    background: rgba(255, 107, 107, 0.1) !important;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

.admin-page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

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

.admin-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.admin-btn-ghost:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.admin-user {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.admin-content {
    padding: 28px;
    flex: 1;
}

/* Dashboard Stats */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.admin-stat-card:hover {
    box-shadow: 0 8px 25px rgba(91,63,214,0.08);
    transform: translateY(-2px);
}

.admin-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(155, 123, 255, 0.1);
    color: var(--primary-light);
}

.admin-stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.admin-stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Cards & Panels */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.admin-btn svg { width: 16px; height: 16px; }

.admin-btn-primary {
    background: var(--gradient);
    color: white;
}
.admin-btn-primary:hover { box-shadow: 0 4px 15px rgba(91,63,214,0.3); transform: translateY(-1px); }

.admin-btn-success {
    background: #2ED573;
    color: white;
}

.admin-btn-danger {
    background: rgba(255,71,87,0.1);
    color: #FF4757;
    border: 1px solid rgba(255,71,87,0.2);
}
.admin-btn-danger:hover { background: #FF4757; color: white; }

.admin-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.admin-btn-group {
    display: flex;
    gap: 8px;
}

/* Tables */
.admin-table-wrapper {
    overflow-x: auto;
}

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

.admin-table th {
    padding: 12px 16px;
    background: var(--bg);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(155, 123, 255, 0.02);
}

.admin-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Forms */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.admin-form-group {
    margin-bottom: 18px;
}

.admin-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.admin-form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.admin-form-control:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(155,123,255,0.1);
}

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

select.admin-form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%239994AC' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.admin-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.admin-form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Flash Messages */
.admin-flash {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.admin-flash.success {
    background: rgba(46,213,115,0.1);
    border: 1px solid rgba(46,213,115,0.2);
    color: #2ED573;
}

.admin-flash.error {
    background: rgba(255,71,87,0.1);
    border: 1px solid rgba(255,71,87,0.2);
    color: #FF4757;
}

/* Status Badges */
.admin-badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.admin-badge.baru { background: rgba(91,63,214,0.1); color: var(--primary); }
.admin-badge.diproses { background: rgba(255,165,0,0.1); color: #FFA500; }
.admin-badge.selesai { background: rgba(46,213,115,0.1); color: #2ED573; }
.admin-badge.published { background: rgba(46,213,115,0.1); color: #2ED573; }
.admin-badge.draft { background: rgba(255,165,0,0.1); color: #FFA500; }
.admin-badge.tersedia { background: rgba(46,213,115,0.1); color: #2ED573; }
.admin-badge.penuh { background: rgba(255,71,87,0.1); color: #FF4757; }
.admin-badge.aktif { background: rgba(46,213,115,0.1); color: #2ED573; }
.admin-badge.nonaktif { background: rgba(255,71,87,0.1); color: #FF4757; }

/* Empty State */
.admin-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.admin-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Recent Items List */
.admin-recent-list {
    list-style: none;
}

.admin-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.admin-recent-item:last-child { border-bottom: none; }

.admin-recent-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.admin-recent-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F0A1E 0%, #1A1230 50%, #2D1B69 100%);
    padding: 20px;
}

.login-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(155,123,255,0.2);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.login-card h1 {
    color: white;
    font-size: 24px;
    margin-bottom: 8px;
}

.login-card .subtitle {
    color: #A09CB0;
    font-size: 14px;
    margin-bottom: 32px;
}

.login-form .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.login-form label {
    display: block;
    font-size: 13px;
    color: #A09CB0;
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(155,123,255,0.2);
    border-radius: var(--radius);
    color: white;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.login-form input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(155,123,255,0.15);
}

.login-form input::placeholder { color: #6B6880; }

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.login-btn:hover {
    box-shadow: 0 8px 25px rgba(91,63,214,0.4);
    transform: translateY(-2px);
}

.login-error {
    background: rgba(255,71,87,0.1);
    border: 1px solid rgba(255,71,87,0.3);
    color: #FF4757;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.admin-modal-overlay.active { display: flex; }

.admin-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close { display: block; }
    .admin-menu-toggle { display: block; }

    .admin-main {
        margin-left: 0;
    }

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

    .admin-content {
        padding: 16px;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-user { display: none; }
}
