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

:root {
    /* PALET WARNA MODEN */
    --bg-body: #f0f2f5;
    --primary-dark: #2c3e50;
    --primary-light: #34495e;
    --accent-orange: #e67e22;
    --accent-blue: #3498db;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    
    /* VARIABEL GLASSMORPHISM */
    --glass-bg: rgba(255, 255, 255, 0.75); /* Putih Lutsinar */
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --blur-amount: 12px;
}

body {
    font-family: 'Outfit', sans-serif;
    /* Latar belakang gradient halus supaya efek kaca nampak */
    background: radial-gradient(circle at 10% 20%, rgb(240, 242, 245) 0%, rgb(228, 232, 238) 90%);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- 1. KOMPONEN UTAMA (NAVBAR & SIDEBAR) --- */

/* Navbar Gradient */
.navbar-custom {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 0.8rem 1rem;
    z-index: 1030;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Sidebar Wrapper */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    transition: all 0.3s ease;
}

#sidebar-wrapper {
    min-width: 260px;
    max-width: 260px;
    /* Gradient menegak untuk sidebar */
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-light));
    color: #fff;
    transition: all 0.3s ease;
    min-height: calc(100vh - 70px);
    border-right: 1px solid rgba(255,255,255,0.05);
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: -260px;
}

#page-content-wrapper {
    width: 100%;
    padding: 25px;
}

/* --- 2. PROJECT LIST (SIDEBAR ITEM) --- */

.project-item {
    border-radius: 10px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid transparent;
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.project-item a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-item.active-project {
    background: rgba(52, 152, 219, 0.2); /* Biru cair lutsinar */
    border: 1px solid rgba(52, 152, 219, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-item.active-project a {
    color: #fff;
    font-weight: 600;
}

/* Action Buttons (Edit/Delete) - Hidden by default */
.project-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.project-item:hover .project-actions {
    opacity: 1;
}

/* --- 3. GLASSMORPHISM CARDS --- */

/* Header Card (Atas) */
.project-header-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

/* Badge Statistik dalam Header */
.stat-badge {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s;
}

.stat-badge:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
}

/* --- 4. JADUAL DATA (TABLE STYLING) --- */

.table-glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    border: var(--glass-border);
    padding: 5px;
    overflow: hidden; /* Rounded corners fix */
}

/* Header Jadual */
table.dataTable thead th {
    background: rgba(241, 243, 245, 0.85) !important; /* Kelabu sangat cair lutsinar */
    color: #5f6368 !important;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0,0,0,0.05) !important;
    white-space: normal !important; /* Wrap Text Header */
    vertical-align: bottom !important;
    padding: 15px 10px !important;
}

/* Body Jadual */
table.dataTable tbody td {
    background: transparent !important;
    padding: 12px 10px !important;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    color: var(--text-main);
}

/* Row Hover Effect */
table.dataTable tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.6) !important;
}

/* Tetapan Column Width */
.col-narrow { width: 70px !important; text-align: center; }
.col-action { width: 50px !important; text-align: center; }

/* --- 5. EDITOR MODE (VISUAL CANGGIH) --- */

/* Butang Toggle Editor */
.btn-editor-active {
    background: linear-gradient(135deg, #ffca28 0%, #ff6f00 100%);
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.3);
    animation: pulseOrange 2s infinite;
}

@keyframes pulseOrange {
    0% { box-shadow: 0 0 0 0 rgba(255, 111, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 111, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 111, 0, 0); }
}

/* Sel yang boleh diedit (Dashed Yellow Line) */
.editor-active .editable-cell {
    border: 2px dashed #ffc107 !important; /* Garisan putus-putus kuning */
    background-color: rgba(255, 249, 196, 0.5) !important; /* Background kuning cair */
    cursor: text;
    border-radius: 4px;
    transition: all 0.2s;
}

.editor-active .editable-cell:hover,
.editor-active .editable-cell:focus {
    background-color: #fff9c4 !important;
    border-color: #ff8f00 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
    outline: none;
}

/* --- 6. FORM & INPUTS (GLASS STYLE) --- */

.form-select-glass, .form-control-glass {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.form-select-glass:focus, .form-control-glass:focus {
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    border-color: var(--accent-blue);
}

/* --- 7. SWEETALERT (POPUP) GLASSMORPHISM --- */

div:where(.swal2-container) div:where(.swal2-popup) {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1) !important;
    padding: 2em;
}

.swal2-title {
    font-family: 'Outfit', sans-serif !important;
    color: var(--text-main) !important;
}

.swal2-html-container {
    color: var(--text-muted) !important;
}

/* Butang SweetAlert */
div:where(.swal2-actions) button {
    border-radius: 50px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- 8. ANIMASI MASUK --- */
.animate-up {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Scrollbar Custom */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.02); }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }