/* =============================================
   ADMIN PANEL - Desa Lalosingi
   ============================================= */

/* ===== LOCAL FONTS (offline-safe) ===== */
@font-face { font-family: 'Poppins'; src: url('../../assets/fonts/poppins-300.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../../assets/fonts/poppins-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../../assets/fonts/poppins-500.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../../assets/fonts/poppins-600.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../../assets/fonts/poppins-700.ttf') format('truetype'); font-weight: 700; font-display: swap; }
/* ===== GOOGLE FONTS FALLBACK (online) ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

:root {
    --primary: #1a6b3c;
    --primary-light: #2d9b5a;
    --primary-dark: #0f4023;
    --gold: #c9a227;
    --sidebar-bg: #0f2218;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --white: #ffffff;
    --body-bg: #f0f5f1;
    --card-bg: #ffffff;
    --text-dark: #1a2e1e;
    --text-medium: #4a6b54;
    --text-light: #7a9b84;
    --border: #d8eade;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(26,107,60,0.08);
    --shadow-md: 0 6px 24px rgba(26,107,60,0.12);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--body-bg);
    color: var(--text-dark);
    min-height: 100vh;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f2218 0%, #1a6b3c 60%, #2d9b5a 100%);
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    top: -200px;
    right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    bottom: -150px;
    left: -150px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #c9a227, #f0c84b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #0f2218;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(201,162,39,0.4);
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 32px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: #f8faf9;
    transition: all 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(26,107,60,0.1);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 120px; }

.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #1a6b3c, #2d9b5a);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,107,60,0.3); }

.login-back {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-light);
}
.login-back a { color: var(--primary); font-weight: 600; }

/* ===== ADMIN LAYOUT ===== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

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

.sidebar-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #c9a227, #f0c84b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #0f2218;
    flex-shrink: 0;
}

.sidebar-brand-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: white;
}
.sidebar-brand-text small {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.sidebar-section {
    padding: 20px 16px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

.sidebar-nav { padding: 0 12px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(26,107,60,0.4);
}

.sidebar-link-icon { font-size: 17px; width: 22px; text-align: center; }

.sidebar-bottom {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

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

/* TOPBAR */
.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-admin {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-medium);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.topbar-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.btn-view { background: #e8f4ea; color: var(--primary); }
.btn-view:hover { background: #d1eada; }
.btn-logout { background: #fee2e2; color: var(--danger); }
.btn-logout:hover { background: #fecaca; }

/* PAGE CONTENT */
.page-content { padding: 28px; flex: 1; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafcfb;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
}

.card-body { padding: 24px; }

/* ===== STAT CARDS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon-green { background: rgba(26,107,60,0.1); }
.stat-icon-gold { background: rgba(201,162,39,0.12); }
.stat-icon-blue { background: rgba(59,130,246,0.1); }
.stat-icon-purple { background: rgba(139,92,246,0.1); }

.stat-card-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 3px;
}

.stat-card-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

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

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

table thead tr {
    background: #f0f5f1;
    border-bottom: 2px solid var(--border);
}

table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    white-space: nowrap;
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
    vertical-align: middle;
}

table tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: #f8faf9; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}
.badge-green { background: var(--success-light); color: var(--success); }
.badge-gold { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 4px 12px rgba(26,107,60,0.3); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-warning { background: var(--warning-light); color: var(--warning); }
.btn-warning:hover { background: #fde68a; }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }

/* ===== FORM UPLOAD ===== */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 28px;
    text-align: center;
    background: #f8faf9;
    cursor: pointer;
    transition: all 0.2s;
}
.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(26,107,60,0.03);
}
.file-upload-area input { display: none; }
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--text-medium); }
.upload-text strong { color: var(--primary); }
.upload-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.img-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 12px;
    display: none;
}

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 16px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; }
}
