:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #f43f5e;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --sidebar-text: #475569;
    --sidebar-active-bg: #eef2ff;
    --sidebar-active-text: #4f46e5;
    --content-bg: #f1f5f9;
    --header-bg: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
}

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

body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Decoration */
body::before {
    content: '';
    position: fixed;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.15) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}

.sidebar-header {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
    background: linear-gradient(to right, var(--text-main), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    flex: 1;
    padding: 0 16px;
    list-style: none;
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.nav-menu::-webkit-scrollbar {
    width: 6px;
}
.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}
.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--sidebar-text);
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: #f8fafc;
    color: var(--text-main);
}

.nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.1);
    border-left: 4px solid var(--primary);
}

.nav-link svg {
    margin-right: 12px;
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.nav-link:hover svg {
    transform: translateX(2px);
}

/* Main Content Area */
.main-wrapper {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

header {
    height: 80px;
    background-color: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background: #e2e8f0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

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

.content-area {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard Cards & Layout */
.welcome-banner {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(55, 48, 163, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    color: white;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.8s ease-out forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    filter: blur(20px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 32px;
    border-radius: 24px;
    border: var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.8s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.8);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

/* Iframe Section */
.iframe-container {
    width: 100%;
    height: calc(100vh - 200px);
    border-radius: 24px;
    overflow: hidden;
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* CRUD Elements */
.table-container {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

th {
    background-color: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: #334155;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.btn-warning {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.btn-warning:hover {
    background-color: #fef3c7;
}

.btn-danger {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background-color: #fee2e2;
}

/* Forms */
.form-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

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

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
}

input[type="text"], textarea, select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-draft { background: #f1f5f9; color: #475569; }
.badge-terverifikasi { background: #ecfdf5; color: #059669; }
.badge-publik { background: #eff6ff; color: #2563eb; }

/* Responsive Toggle (Hidden by default, used for JS) */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-main);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    header {
        padding: 0 20px;
    }
    .content-area {
        padding: 20px;
    }
}


/* Sub menu styles */
.has-submenu {
    position: relative;
}

.submenu-toggle {
    cursor: pointer;
}

.submenu-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.submenu-icon.rotate {
    transform: rotate(180deg);
}

.sub-menu {
    display: none;
    list-style: none;
    padding-left: 32px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.sub-menu.show {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.sub-link {
    display: block;
    padding: 8px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.sub-link:hover {
    opacity: 1;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.sub-link.active {
    opacity: 1;
    color: var(--primary);
    font-weight: 600;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

