/* ==========================================================================
   VARIABLES & BASE CONFIGURATION
   ========================================================================== */
:root {
    --primary: #1e3a8a;
    --primary-light: #eff6ff;
    --secondary-color: #0d9488;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-width: 270px;
    --sidebar-collapsed: 80px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    overflow-x: hidden;
    line-height: 1.5;
    display: flex;
}

/* ==========================================================================
   MODAL LOGIN STYLING
   ========================================================================== */
.modal-login-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(8px);
    z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.login-card {
    background: #ffffff; width: 100%; max-width: 420px; border-radius: var(--radius-lg);
    padding: 2.5rem; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); text-align: center;
}
.login-header { margin-bottom: 2rem; }
.login-header i { font-size: 3rem; color: var(--primary); margin-bottom: 0.5rem; }
.login-header h2 { font-weight: 800; color: var(--text-dark); font-size: 1.5rem; }
.login-header p { font-size: 0.875rem; color: var(--text-muted); }
.form-group { margin-bottom: 1.25rem; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-dark); margin-bottom: 0.4rem; }
.input-box { position: relative; display: flex; align-items: center; }
.input-box i { position: absolute; left: 14px; color: var(--text-muted); }
.input-box input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.6rem; border: 1px solid #cbd5e1;
    border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem; outline: none; transition: var(--transition);
}
.input-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1); }
.btn-login {
    width: 100%; padding: 0.85rem; background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-md); font-weight: 700; font-size: 1rem; cursor: pointer; transition: var(--transition); margin-top: 0.5rem;
}
.btn-login:hover { background: #1e40af; }
.login-error { color: #ef4444; font-size: 0.85rem; margin-top: 1rem; display: none; }

/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%); color: #ffffff;
    z-index: 100; transition: var(--transition); display: flex; flex-direction: column;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.1);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-brand { padding: 1.5rem; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); overflow: hidden; white-space: nowrap; }
.brand-icon { min-width: 44px; height: 44px; background: rgba(255, 255, 255, 0.1); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #38bdf8; }
.brand-name { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.5px; }
.sidebar.collapsed .brand-name { opacity: 0; pointer-events: none; }
.sidebar-menu { padding: 1.5rem 0; list-style: none; overflow-y: auto; flex: 1; }
.sidebar-menu ul { list-style: none; }
.menu-item a { display: flex; align-items: center; gap: 16px; padding: 0.9rem 1.5rem; color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: var(--transition); border-left: 4px solid transparent; white-space: nowrap; }
.menu-item i { font-size: 1.2rem; min-width: 28px; text-align: center; }
.menu-item a:hover { background: rgba(255, 255, 255, 0.05); color: #ffffff; }
.menu-item.active a { background: rgba(255, 255, 255, 0.1); color: #ffffff; border-left-color: #38bdf8; font-weight: 600; }
.sidebar.collapsed .menu-text { opacity: 0; pointer-events: none; }

/* ==========================================================================
   MAIN LAYOUT & TOPBAR
   ========================================================================== */
.main-wrapper { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); min-height: 100vh; display: flex; flex-direction: column; transition: var(--transition); }
.main-wrapper.expanded { margin-left: var(--sidebar-collapsed); width: calc(100% - var(--sidebar-collapsed)); }

.topbar { background-color: var(--bg-card); height: 80px; padding: 0 2.5rem; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-sm); border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 90; }
.topbar-left { display: flex; align-items: center; gap: 1.5rem; }
.toggle-btn { background: #f1f5f9; border: none; font-size: 1.2rem; color: var(--text-dark); cursor: pointer; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.toggle-btn:hover { background-color: #e2e8f0; }
.header-titles h1 { font-size: 1.4rem; font-weight: 700; color: var(--text-dark); line-height: 1.2; }
.header-titles .tagline { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 1.5rem; }

/* USER PROFILE CHIP */
.user-profile-chip { display: flex; align-items: center; gap: 12px; background: #f1f5f9; padding: 6px 14px 6px 8px; border-radius: 30px; border: 1px solid #e2e8f0; }
.user-avatar { width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.user-info { display: flex; flex-direction: column; text-align: left; }
.user-name { font-size: 0.85rem; font-weight: 700; color: var(--text-dark); line-height: 1.1; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }
.btn-logout { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 1.1rem; margin-left: 8px; transition: var(--transition); }
.btn-logout:hover { color: #dc2626; }

/* CONTENT BODY */
.content-body { padding: 2.5rem; flex: 1; }

/* HERO SECTION */
.hero-section { background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%); border-radius: var(--radius-lg); padding: 3rem; color: #ffffff; display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; box-shadow: 0 10px 30px rgba(30, 58, 138, 0.15); position: relative; overflow: hidden; }
.hero-content { max-width: 70%; z-index: 2; }
.hero-content h2 { font-size: 2.2rem; margin-bottom: 1rem; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.hero-content p { font-size: 1.05rem; color: rgba(255,255,255,0.85); margin-bottom: 2rem; line-height: 1.6; }
.btn-cta { display: inline-flex; align-items: center; gap: 10px; padding: 0.9rem 2rem; background-color: #ffffff; color: var(--primary); border-radius: var(--radius-md); font-weight: 700; text-decoration: none; transition: var(--transition); box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
.btn-cta:hover { transform: translateY(-3px); background-color: #f8fafc; }

/* EVENT SECTION */
.event-section { background-color: #ffffff; padding: 2.5rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border: 1px solid #e2e8f0; margin-bottom: 2.5rem; }
.event-section h3 { font-size: 1.25rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--primary); }

.folder-status-box { background-color: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 0.85rem 1.25rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 12px; font-size: 0.875rem; }
.folder-status-box.error { background-color: #fef2f2; border-color: #fecaca; color: #991b1b; }

.canva-month-container { margin-bottom: 2.5rem; width: 100%; display: block; }
.canva-month-heading { font-size: 1.15rem; font-weight: 700; color: #1e3a8a; padding-bottom: 0.6rem; margin-bottom: 1.2rem; border-bottom: 2px solid #e2e8f0; display: flex; align-items: center; gap: 10px; }
.canva-list-wrapper { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.canva-event-row { display: flex; align-items: center; justify-content: space-between; background: #ffffff; border: 1px solid #e2e8f0; border-left: 5px solid #0d9488; border-radius: 10px; padding: 1rem 1.5rem; transition: all 0.25s ease; width: 100%; }
.canva-event-row:hover { transform: translateX(6px); border-left-color: #1e3a8a; }
.canva-event-left { display: flex; align-items: center; gap: 1.5rem; flex: 1; min-width: 0; }
.canva-date-box { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; height: 52px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; flex-shrink: 0; }
.canva-date-num { font-size: 1.35rem; font-weight: 800; color: #0f172a; line-height: 1; }
.canva-date-day { font-size: 0.65rem; font-weight: 700; color: #64748b; text-transform: uppercase; margin-top: 3px; }
.canva-details { display: flex; flex-direction: column; min-width: 0; }
.canva-title { font-size: 1rem; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.canva-meta { display: flex; align-items: center; gap: 12px; font-size: 0.825rem; color: #64748b; flex-wrap: wrap; margin-top: 2px; }

/* BADGE STATUS KEGIATAN */
.badge-status { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.status-done { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-pending { background: #fef9c3; color: #a16207; border: 1px solid #fef08a; }
.status-ongoing { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

.canva-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.canva-btn-action { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: #f1f5f9; color: #334155; border-radius: 30px; font-size: 0.8rem; font-weight: 600; text-decoration: none; border: 1px solid #e2e8f0; transition: all 0.2s ease; cursor: pointer; }
.canva-btn-action:hover { background: #1e3a8a; color: #ffffff; border-color: #1e3a8a; }
.canva-btn-delete { background: #fef2f2; color: #ef4444; border-color: #fecaca; }
.canva-btn-delete:hover { background: #ef4444; color: #ffffff; border-color: #ef4444; }

/* DASHBOARD MENU CARDS */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1.5rem; }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title i { color: var(--primary); font-size: 1.5rem; }
.section-title h3 { font-size: 1.4rem; font-weight: 700; }
.search-box { position: relative; width: 350px; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
#searchMenuInput { width: 100%; padding: 0.8rem 1rem 0.8rem 2.8rem; border: 1px solid #cbd5e1; border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem; outline: none; background-color: #ffffff; transition: var(--transition); }
#searchMenuInput:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.75rem; margin-bottom: 3.5rem; }
.menu-card { background-color: var(--bg-card); border-radius: var(--radius-lg); padding: 2rem 1.75rem; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-md); transition: var(--transition); border: 1px solid #e2e8f0; border-top: 5px solid var(--primary); text-decoration: none; color: inherit; }
.menu-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.card-top { margin-bottom: 1.5rem; }
.card-icon-wrapper { width: 54px; height: 54px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1.25rem; }
.menu-card h4 { font-size: 1.2rem; color: var(--text-dark); margin-bottom: 0.6rem; font-weight: 700; }
.menu-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-action { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; font-weight: 700; padding-top: 1rem; border-top: 1px dashed #f1f5f9; }

.main-footer { background-color: #ffffff; border-top: 1px solid #e2e8f0; padding: 2rem; text-align: center; margin-top: auto; }
.main-footer p { font-size: 0.9rem; color: var(--text-muted); }
.footer-tagline { font-style: italic; font-size: 0.85rem !important; margin-top: 6px; color: #94a3b8; }

.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.4); z-index: 95; backdrop-filter: blur(4px); }

/* ==========================================================================
   RESPONSIVE DESIGN & BREAKPOINTS
   ========================================================================== */
@media (max-width: 992px) {
    .main-wrapper { margin-left: 0 !important; width: 100% !important; }
    .sidebar { left: calc(-1 * var(--sidebar-width)); }
    .sidebar.open { left: 0; width: var(--sidebar-width) !important; }
    .sidebar.open .brand-name,
    .sidebar.open .menu-text { opacity: 1 !important; pointer-events: auto !important; }
    .sidebar-overlay.show { display: block; }
    .hero-content { max-width: 100%; }
}

@media (max-width: 768px) {
    .topbar { height: auto; padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .topbar-left { gap: 0.75rem; }
    .header-titles h1 { font-size: 1.1rem; }
    .header-titles .tagline { display: none; } /* Menyembunyikan tagline panjang di HP */
    .user-info { display: none; } /* Menyembunyikan teks role/nama panjang agar hemat ruang */
    .user-profile-chip { padding: 4px; border: none; background: transparent; }
    .canva-event-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .canva-actions { align-self: flex-end; width: 100%; justify-content: flex-end; }
    .canva-btn-action { width: 100%; justify-content: center; }
}

@media (max-width: 576px) {
    .content-body { padding: 1rem; }
    .hero-section { padding: 1.5rem; margin-bottom: 1.5rem; }
    .hero-content h2 { font-size: 1.4rem; }
    .hero-content p { font-size: 0.9rem; margin-bottom: 1.25rem; }
    .event-section { padding: 1.25rem; }
    .search-box { width: 100%; }
    .menu-grid { grid-template-columns: 1fr; gap: 1rem; }
    .login-card { padding: 1.5rem; }
}