<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Triarkabara | <%= title %></title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --bg-color: #f3f4f6;
            --sidebar-bg: #111827;
            --sidebar-text: #d1d5db;
            --sidebar-hover: #1f2937;
            --primary: #3b82f6;
            --primary-hover: #2563eb;
            --text-main: #1f2937;
            --card-bg: #ffffff;
            --border: #e5e7eb;
            --danger: #ef4444;
            --danger-hover: #dc2626;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-main); display: flex; min-height: 100vh; }
        
        /* Sidebar */
        .sidebar { width: 260px; background-color: var(--sidebar-bg); color: #fff; display: flex; flex-direction: column; }
        .sidebar-header { padding: 24px; font-size: 20px; font-weight: 700; border-bottom: 1px solid #374151; letter-spacing: 1px; }
        .sidebar-nav { flex: 1; padding: 20px 0; }
        .sidebar-nav a { display: block; padding: 12px 24px; color: var(--sidebar-text); text-decoration: none; font-weight: 500; transition: 0.2s; }
        .sidebar-nav a:hover, .sidebar-nav a.active { background-color: var(--sidebar-hover); color: #fff; border-left: 4px solid var(--primary); padding-left: 20px; }
        .sidebar-footer { padding: 20px 24px; border-top: 1px solid #374151; }
        .sidebar-footer a { color: #f87171; text-decoration: none; font-weight: 500; }
        .sidebar-footer a:hover { color: #ef4444; }

        /* Main Content */
        .main-content { flex: 1; display: flex; flex-direction: column; }
        .topbar { background: var(--card-bg); padding: 20px 32px; border-bottom: 1px solid var(--border); font-size: 18px; font-weight: 600; }
        .content { padding: 32px; overflow-y: auto; flex: 1; }
        
        /* Card */
        .card { background: var(--card-bg); border-radius: 12px; padding: 24px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
        .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
        .card-title { font-size: 18px; font-weight: 600; }
        
        /* Form Elements */
        .form-group { margin-bottom: 16px; }
        .form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; }
        .form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 14px; transition: 0.2s; }
        .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
        textarea.form-control { min-height: 120px; resize: vertical; }
        
        /* Buttons */
        .btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; font-size: 14px; font-weight: 500; border-radius: 8px; cursor: pointer; border: none; text-decoration: none; transition: 0.2s; }
        .btn-primary { background-color: var(--primary); color: white; }
        .btn-primary:hover { background-color: var(--primary-hover); }
        .btn-danger { background-color: var(--danger); color: white; }
        .btn-danger:hover { background-color: var(--danger-hover); }
        
        /* Tables */
        table { width: 100%; border-collapse: collapse; }
        th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
        th { background-color: #f9fafb; font-weight: 600; color: #4b5563; text-transform: uppercase; font-size: 12px; letter-spacing: 0.05em; }
        tr:hover td { background-color: #f9fafb; }
        
        /* Image Preview */
        .img-preview { max-width: 100px; max-height: 100px; border-radius: 6px; object-fit: cover; }
        
        /* Alerts */
        .alert { padding: 16px; border-radius: 8px; margin-bottom: 24px; font-weight: 500; }
        .alert-success { background-color: #d1fae5; color: #065f46; }
        .alert-error { background-color: #fee2e2; color: #991b1b; }
    </style>
</head>
<body>
    <aside class="sidebar">
        <div class="sidebar-header">TRIARKABARA</div>
        <nav class="sidebar-nav">
            <a href="/admin" class="<%= active === 'dashboard' ? 'active' : '' %>">Dashboard</a>
            <a href="/admin/about" class="<%= active === 'about' ? 'active' : '' %>">Tentang Kami</a>
            <a href="/admin/projects" class="<%= active === 'projects' ? 'active' : '' %>">Proyek</a>
            <a href="/admin/ppg" class="<%= active === 'ppg' ? 'active' : '' %>">PPG Installation</a>
            <a href="/admin/clients" class="<%= active === 'clients' ? 'active' : '' %>">Client / Partner</a>
            <a href="/admin/users" class="<%= active === 'users' ? 'active' : '' %>">Kelola Admin</a>
        </nav>
        <div class="sidebar-footer">
            <a href="/admin/logout">Logout</a>
        </div>
    </aside>
    <main class="main-content">
        <header class="topbar"><%= title %></header>
        <section class="content">
            <%- body %>
        </section>
    </main>
</body>
</html>
