/* 
   Modern SaaS Style - Innovation based on GAWE Reference 
   Primary Green: #184b2c (Deep Green)
   Vibrant Green: #2ecc71
*/

:root {
    --primary-yuuu: #00441B;    /* Deep Forest Green Base */
    --accent-yuuu: #FBD304;     /* Vibrant Gold */
    --dark-yuuu: #0d0d0d;       /* Rich Black */
    --bg-yuuu: #f8f9fa;
    --radius-yuuu: 16px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme Variations - Smoother Palette */
body.theme-green {
    --primary-yuuu: #1a4d2e;
    --primary-soft: #4f6f52;
    --gradient-yuuu: linear-gradient(135deg, #1a4d2e 0%, #4f6f52 100%);
}

body.theme-purple {
    --primary-yuuu: #4a2c5a;
    --primary-soft: #8a6a9d;
    --gradient-yuuu: linear-gradient(135deg, #4a2c5a 0%, #8a6a9d 100%);
}

body.theme-maroon {
    --primary-yuuu: #5c1020;
    --primary-soft: #a64452;
    --gradient-yuuu: linear-gradient(135deg, #5c1020 0%, #a64452 100%);
}

body {
    background-color: var(--bg-yuuu) !important;
    font-family: 'Outfit', 'Nunito', sans-serif !important;
    color: #444;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--dark-yuuu) !important;
    background-image: none !important;
    box-shadow: 4px 0 15px rgba(0,0,0,0.2);
}

.sidebar .nav-item .nav-link {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
}

.sidebar .nav-item.active .nav-link {
    color: var(--accent-yuuu) !important;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin: 0 10px;
}

.sidebar-brand {
    padding: 1.5rem 1rem !important;
    height: auto !important;
    background: rgba(0,0,0,0.2);
}

.sidebar-brand .brand-logo-img {
    max-width: 80px;
}

.sidebar-brand-text {
    font-weight: 800 !important;
    letter-spacing: 1px;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Sidebar Submenu (Collapse) Styling */
.collapse-inner {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0 12px;
    transition: var(--transition-smooth);
}

.collapse-item {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 400 !important;
    padding: 0.6rem 1.2rem !important;
    transition: var(--transition-smooth);
    border-radius: 8px !important;
    margin: 2px 0;
}

.collapse-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--accent-yuuu) !important;
    padding-left: 1.5rem !important;
}

.collapse-item.active {
    color: var(--accent-yuuu) !important;
    background: rgba(251, 211, 4, 0.1) !important;
    font-weight: 600 !important;
}

.collapse-header {
    color: rgba(255, 255, 255, 0.3) !important;
    text-transform: uppercase;
    font-weight: 700 !important;
    font-size: 0.6rem !important;
    letter-spacing: 1.5px;
    padding: 0.75rem 1.2rem 0.25rem !important;
}

/* Banner Styling */
.yuuu-banner {
    background: var(--gradient-yuuu) !important;
    border-radius: 20px !important;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

/* Card Styling */
.card {
    border: none !important;
    border-radius: var(--radius-yuuu) !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03) !important;
    transition: var(--transition-smooth) !important;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.07) !important;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    background: #fff !important;
    border-bottom: 1px solid #eee !important;
    padding: 1rem 1.25rem !important;
}

/* Button Styling */
.btn {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 0.5rem 1.25rem !important;
}

.btn-primary {
    background-color: var(--primary-yuuu) !important;
    border-color: var(--primary-yuuu) !important;
}

.btn-success {
    background-color: #27ae60 !important;
    border-color: #27ae60 !important;
}

/* Dashboard Metrics */
.text-primary { color: var(--primary-yuuu) !important; }
.border-left-primary { border-left: 0.25rem solid var(--primary-yuuu) !important; }
.border-left-success { border-left: 0.25rem solid #27ae60 !important; }

/* Table Styling */
.table thead th {
    background-color: #f8f9fc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border: none;
    color: #666;
}

.table tbody td {
    vertical-align: middle !important;
    border-top: 1px solid #f1f1f1;
}

/* Karyawan Profile Circles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-gawe);
    overflow: hidden;
}

/* Attendance Mock Scanner */
.attendance-scanner {
    position: relative;
    border: 3px solid var(--success-gawe);
    border-radius: 20px;
    overflow: hidden;
}

.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    border: 2px dashed rgba(46, 204, 113, 0.5);
    border-radius: 15px;
    pointer-events: none;
}

.icon-circle {
    height: 3rem;
    width: 3rem;
    border-radius: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle i {
    font-size: 1.25rem;
}

.bg-success-light { background-color: #e8f5e9 !important; }
.bg-primary-light { background-color: #e3f2fd !important; }
.bg-info-light { background-color: #e0f7fa !important; }
.bg-warning-light { background-color: #fffde7 !important; }

/* Inovasi: Logo Glow & Brand Accent */
.sidebar-brand-icon i {
    filter: drop-shadow(0 0 5px rgba(251, 211, 4, 0.5));
}

.text-yuuu-green { color: var(--primary-yuuu) !important; }
.text-yuuu-gold { color: var(--accent-yuuu) !important; }
.bg-yuuu-dark { background-color: var(--dark-yuuu) !important; }

@keyframes scanAnim {
    0% { top: 0; opacity: 1; }
    50% { top: 100%; opacity: 0.5; }
    100% { top: 0; opacity: 1; }
}

.bg-light-soft {
    background-color: #fafbfc;
}

/* Liquid Drip Header Effect */
.yuuu-banner {
    background: var(--dark-yuuu) !important;
    border-radius: var(--radius-yuuu);
    position: relative;
    overflow: hidden;
}

.yuuu-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: var(--primary-yuuu);
    box-shadow: 0 5px 15px rgba(0,68,27,0.3);
}

.card-header.bg-yuuu-header {
    background-color: var(--primary-yuuu) !important;
    color: white !important;
}

/* =============================================
   MOBILE RESPONSIVE OVERHAUL
   Target: HP (< 768px) & Tablet (768-992px)
   ============================================= */

/* ---- Topbar ---- */
@media (max-width: 768px) {
    /* Topbar lebih kompak */
    .topbar {
        padding: 0.25rem 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Nama user disembunyikan, hanya ikon */
    .topbar .mr-2.d-none.d-lg-inline {
        display: none !important;
    }

    /* Avatar lebih kecil */
    .img-profile {
        width: 32px !important;
        height: 32px !important;
    }
}

/* ---- Sidebar ---- */
@media (max-width: 768px) {
    /* Sidebar lebih sempit saat tidak aktif */
    #wrapper.toggled #sidebar-wrapper {
        width: 0;
    }

    /* Sidebar toggled state */
    .sidebar {
        min-height: 100vh;
    }

    /* Brand area lebih kecil di mobile */
    .sidebar-brand {
        padding: 0.75rem 0.5rem !important;
    }

    .sidebar-brand .brand-logo-img {
        max-width: 50px !important;
    }

    .sidebar-brand-text {
        font-size: 0.75rem !important;
    }

    /* Nav link lebih rapat di mobile */
    .sidebar .nav-item .nav-link {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem;
    }

    /* Heading kategori lebih kecil */
    .sidebar-heading {
        font-size: 0.6rem !important;
        padding: 0.5rem 1rem 0.25rem !important;
    }

    /* Collapse item lebih ringkas */
    .collapse-item {
        padding: 0.45rem 1rem !important;
        font-size: 0.8rem !important;
    }
}

/* ---- Layout & Container ---- */
@media (max-width: 768px) {
    /* Container tidak terlalu lebar */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Heading halaman lebih kecil */
    .h3, h3 {
        font-size: 1.15rem !important;
    }

    /* Card hover effect dimatikan di mobile (ganggu scroll) */
    .card:hover {
        transform: none !important;
        box-shadow: 0 5px 20px rgba(0,0,0,0.03) !important;
    }

    /* Card padding lebih kecil */
    .card-body {
        padding: 0.85rem !important;
    }

    .card-header {
        padding: 0.75rem 1rem !important;
    }
}

/* ---- Tabel Responsif Mobile ---- */
@media (max-width: 768px) {
    /* Semua tabel bisa di-scroll horizontal */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Ukuran font tabel lebih kecil */
    .table th,
    .table td {
        font-size: 0.78rem !important;
        padding: 0.4rem 0.5rem !important;
        white-space: nowrap;
    }

    /* DataTable controls responsif */
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        float: none !important;
        text-align: left !important;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 200px;
    }
}

/* ---- Tombol & Form ---- */
@media (max-width: 768px) {
    /* Tombol utama penuh di mobile */
    .btn-mobile-block {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }

    /* Grup tombol */
    .btn-group .btn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.8rem !important;
    }

    /* Modal lebih lebar */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    /* Form label lebih kecil */
    .form-control {
        font-size: 0.875rem !important;
    }

    label {
        font-size: 0.85rem !important;
    }
}

/* ---- Dashboard Cards (Metric Cards) ---- */
@media (max-width: 576px) {
    /* Statistik card teks lebih kecil */
    .card .h5 {
        font-size: 1.1rem !important;
    }

    .card .text-xs {
        font-size: 0.65rem !important;
    }

    /* Icon circle lebih kecil */
    .icon-circle {
        height: 2.5rem !important;
        width: 2.5rem !important;
    }

    .icon-circle i {
        font-size: 1rem !important;
    }

    /* Margin bawah lebih kecil */
    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
}

/* ---- Alert & Badge responsif ---- */
@media (max-width: 768px) {
    .alert {
        font-size: 0.82rem !important;
        padding: 0.6rem 0.9rem !important;
    }

    .badge {
        font-size: 0.65rem !important;
    }
}

/* ---- Footer ---- */
@media (max-width: 768px) {
    .sticky-footer {
        padding: 0.75rem 0 !important;
        font-size: 0.75rem !important;
    }
}

/* ---- Scroll to top button ---- */
@media (max-width: 768px) {
    .scroll-to-top {
        right: 1rem !important;
        bottom: 1rem !important;
    }
}

/* ---- Fix: Overflow tersembunyi (konten tidak terpotong) ---- */
@media (max-width: 768px) {
    #content-wrapper {
        overflow-x: hidden !important;
    }

    body {
        overflow-x: hidden !important;
    }

    /* Pastikan kolom tabel tidak membuat halaman melebar */
    .table {
        display: block;
        width: 100%;
    }
}

/* ---- Input Penjualan Mobile ---- */
@media (max-width: 768px) {
    /* Tabel input penjualan */
    .table-input-penjualan td,
    .table-input-penjualan th {
        min-width: 80px !important;
    }

    .table-input-penjualan input[type="number"] {
        min-width: 65px !important;
        max-width: 90px !important;
    }
}
