@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Precise Color Palette based on reference */
    --primary: #3b82f6; /* Blue for total */
    --success: #22c55e; /* Green for baik */
    --warning: #f59e0b; /* Orange for rusak ringan */
    --danger: #ef4444;  /* Red for rusak berat */
    
    /* Backgrounds */
    --bg-app: #f0f4f8; /* Soft blue-gray for the body */
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    
    /* Text */
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Borders & Shadows */
    --border-light: #e2e8f0;
    
    /* Rounded corners as seen in the image */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Soft shadows */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.06);
}

/* =========================================
   BASE TYPOGRAPHY
   ========================================= */
body, html {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    background-color: var(--bg-app) !important;
    color: var(--text-main) !important;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.navbar-bg {
    display: none !important;
}

/* =========================================
   SPEED UP STISLA LAYOUT TRANSITIONS
   ========================================= */
.main-sidebar, .main-content, .main-navbar {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* =========================================
   NAVBAR
   ========================================= */
.main-navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--border-light) !important;
    box-shadow: none !important;
    height: 70px !important;
    display: flex;
    align-items: center;
}

.main-navbar .nav-link {
    color: var(--text-muted) !important;
}

.main-navbar .nav-link:hover {
    color: var(--primary) !important;
}

.main-navbar .nav-link-user {
    color: var(--text-main) !important;
    font-weight: 600 !important;
}

.main-navbar .nav-link-user img {
    border: none !important;
    width: 32px;
    height: 32px;
}

/* =========================================
   SIDEBAR
   ========================================= */
.main-sidebar {
    background-color: var(--bg-sidebar) !important;
    border-right: none !important;
    box-shadow: 2px 0 20px rgba(0,0,0,0.02) !important;
}

.main-sidebar .sidebar-brand {
    background-color: var(--bg-sidebar) !important;
    border-bottom: none !important;
    height: 120px !important;
    line-height: 120px !important;
}

.main-sidebar .sidebar-brand-sm {
    background-color: var(--bg-sidebar) !important;
    border-bottom: none !important;
    height: 80px !important;
    line-height: 80px !important;
}

.main-sidebar .sidebar-brand img {
    max-height: 85px;
    width: auto !important;
    max-width: 200px;
    object-fit: contain;
}

.main-sidebar .sidebar-brand-sm img {
    max-height: 40px;
    width: auto !important;
    max-width: 45px;
    object-fit: contain;
}

.main-sidebar .sidebar-menu {
    padding: 0 10px;
}

.main-sidebar .sidebar-menu li.menu-header {
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 15px 15px 5px 15px !important;
    text-transform: uppercase;
}

/* Hide menu headers when sidebar is collapsed */
body.sidebar-mini .main-sidebar .sidebar-menu li.menu-header {
    display: none !important;
}

.main-sidebar .sidebar-menu li a {
    color: #475569 !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin: 4px 0;
    padding: 12px 15px !important;
    transition: all 0.2s ease;
}

.main-sidebar .sidebar-menu li a i {
    color: #64748b !important;
    font-size: 16px;
    width: 28px;
    text-align: center;
}

.main-sidebar .sidebar-menu li a:hover {
    background-color: #f8fafc !important;
    color: var(--text-main) !important;
}

/* Active State matches reference (soft pill, blue text) */
.main-sidebar .sidebar-menu li.active a {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}

.main-sidebar .sidebar-menu li.active a i {
    color: #0284c7 !important;
}

/* Sidebar Logout Button Outline Style */
.main-sidebar .hide-sidebar-mini .btn-danger {
    background-color: transparent !important;
    border: 1px solid #fca5a5 !important;
    color: var(--danger) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.main-sidebar .hide-sidebar-mini .btn-danger:hover {
    background-color: #fee2e2 !important;
}

/* =========================================
   MAIN CONTENT & CARDS
   ========================================= */
.main-content {
    background-color: var(--bg-app) !important;
    padding-top: 100px !important;
}

.section-header {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 15px 0 !important;
    margin-bottom: 15px !important;
}

.section-header h1 {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
}

.card {
    background-color: var(--bg-card) !important;
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-card) !important;
    margin-bottom: 25px !important;
    transition: box-shadow 0.2s ease !important;
}

.card:hover {
    box-shadow: var(--shadow-hover) !important;
}

.card .card-header {
    border-bottom: 1px solid var(--border-light) !important;
    padding: 20px 25px !important;
    background-color: transparent !important;
}

.card .card-header h4 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
}

.card .card-body {
    padding: 25px !important;
}

/* Fix nested cards (to remove double padding/shadow inside tables) */
.card .card {
    box-shadow: none !important;
    border: 1px solid var(--border-light) !important;
    margin-bottom: 0 !important;
}

/* =========================================
   DASHBOARD STATISTIC CARDS
   ========================================= */
.card.card-statistic-1 {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 20px 24px !important;
    border: none !important;
    background: #fff !important;
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--radius-lg) !important;
}

/* Rounded rect icon wrapper */
.card.card-statistic-1 .card-icon {
    width: 52px !important;
    height: 52px !important;
    border-radius: 14px !important; /* Soft rounded rectangle */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 18px !important;
    flex-shrink: 0;
    box-shadow: none !important;
}

.card.card-statistic-1 .card-icon i {
    font-size: 24px !important;
}

/* Precise pastel colors for icons */
.card.card-statistic-1 .card-icon.bg-primary { background: #e0f2fe !important; color: #0284c7 !important; }
.card.card-statistic-1 .card-icon.bg-success { background: #dcfce7 !important; color: #16a34a !important; }
.card.card-statistic-1 .card-icon.bg-warning { background: #fef3c7 !important; color: #d97706 !important; }
.card.card-statistic-1 .card-icon.bg-danger { background: #fee2e2 !important; color: #dc2626 !important; }

.card.card-statistic-1 .card-icon.bg-primary i { color: #0284c7 !important; }
.card.card-statistic-1 .card-icon.bg-success i { color: #16a34a !important; }
.card.card-statistic-1 .card-icon.bg-warning i { color: #d97706 !important; }
.card.card-statistic-1 .card-icon.bg-danger i { color: #dc2626 !important; }

/* FIX ALIGNMENT FOR STATISTIC CARDS */
.card.card-statistic-1 .card-wrap {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.card.card-statistic-1 .card-header {
    border-bottom: none !important; /* Fix for the weird line */
    padding: 0 !important;
    min-height: auto !important;
}

.card.card-statistic-1 .card-header h4 {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    line-height: 1 !important;
}

.card.card-statistic-1 .card-body {
    padding: 0 !important;
    font-size: 26px !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    line-height: 1.2 !important;
}

/* =========================================
   LIST ITEMS (Outlined cards as in reference)
   ========================================= */
.media {
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-md) !important;
    padding: 15px !important;
    margin-bottom: 12px !important;
    background-color: #fff;
    align-items: center !important;
    transition: all 0.2s ease;
}

.media:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.media:last-child {
    margin-bottom: 0 !important;
}

.media .media-title {
    font-weight: 700 !important;
    color: var(--text-main) !important;
    font-size: 14px !important;
}

.media p {
    color: var(--text-muted) !important;
    font-size: 13px !important;
    margin-bottom: 0;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    border-radius: var(--radius-sm) !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: none !important;
}

.btn-primary { background: var(--primary) !important; color: #fff !important; }
.btn-primary:hover { background: #2563eb !important; }

.btn-success { background: var(--success) !important; color: #fff !important; }
.btn-warning { background: var(--warning) !important; color: #fff !important; }
.btn-danger { background: var(--danger) !important; color: #fff !important; }

.btn-block.btn-primary {
    background-color: #3b82f6 !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px !important;
}

.btn-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
}

/* Button Group Spacing Fix */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.btn-action-square {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    border: none !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}
.btn-action-square i {
    font-size: 13px !important;
}
.btn-action-square:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
}

/* Luxurious Soft Tints */
.btn-action-square.action-detail {
    background: #e0f2fe !important;
    color: #0284c7 !important;
}
.btn-action-square.action-detail:hover {
    background: #bae6fd !important;
}

.btn-action-square.action-edit {
    background: #dcfce7 !important;
    color: #16a34a !important;
}
.btn-action-square.action-edit:hover {
    background: #bbf7d0 !important;
}

.btn-action-square.action-print {
    background: #f3e8ff !important;
    color: #9333ea !important;
}
.btn-action-square.action-print:hover {
    background: #e9d5ff !important;
}

.btn-action-square.action-delete {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}
.btn-action-square.action-delete:hover {
    background: #fecaca !important;
}

/* Luxurious Top Action Buttons */
.btn-lux {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
    height: 38px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    cursor: pointer;
}
.btn-lux:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
}
.btn-lux i {
    font-size: 14px !important;
    margin-right: 6px !important;
}

/* Color Variants */
.btn-lux-blue {
    background: #e0f2fe !important;
    color: #0284c7 !important;
}
.btn-lux-blue:hover { background: #bae6fd !important; }

.btn-lux-green {
    background: #dcfce7 !important;
    color: #16a34a !important;
}
.btn-lux-green:hover { background: #bbf7d0 !important; }

.btn-lux-purple {
    background: #f3e8ff !important;
    color: #9333ea !important;
}
.btn-lux-purple:hover { background: #e9d5ff !important; }

.btn-lux-primary {
    background: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important;
}
.btn-lux-primary:hover {
    background: #2563eb !important;
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4) !important;
}

/* =========================================
   Modern DataTables Pagination & Info
   ========================================= */
.dataTables_wrapper .pagination {
    margin-top: 10px;
    gap: 4px;
    justify-content: flex-end;
}
.dataTables_wrapper .page-item .page-link {
    border: none !important;
    color: #64748b !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}
.dataTables_wrapper .page-item:not(.active) .page-link:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
.dataTables_wrapper .page-item.active .page-link {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.1) !important;
}
.dataTables_wrapper .page-item.disabled .page-link {
    color: #cbd5e1 !important;
    background: transparent !important;
}
.dataTables_info {
    color: #94a3b8 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    padding-top: 15px !important;
}
.btn-group > form {
    display: inline-flex;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================
   TABLES
   ========================================= */
.table-responsive {
    border-radius: var(--radius-md) !important;
}

.table {
    margin-bottom: 1rem !important; /* Ensure space before pagination */
}

.table thead th {
    background-color: #ffffff !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    border-bottom: 2px solid var(--border-light) !important;
    padding: 16px !important;
}

.table td {
    padding: 16px !important;
    border-top: 1px solid var(--border-light) !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text-main) !important;
}

.table tbody tr:hover {
    background-color: #f8fafc !important;
}

/* =========================================
   FORMS & BADGES
   ========================================= */
.form-control, .ts-control {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-light) !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    background-color: #fff !important;
    color: var(--text-main) !important;
    box-shadow: none !important;
}

.form-control:focus, .ts-control.focus {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.badge {
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-weight: 600 !important;
}

/* =========================================
   SWEETALERT MODERN STYLES
   ========================================= */
.swal2-popup {
    border-radius: 24px !important;
    padding: 2em !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

.swal2-title {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
}

.swal2-content, .swal2-html-container {
    font-size: 16px !important;
    color: var(--text-muted) !important;
    margin-top: 15px !important;
}

.swal2-icon {
    border-width: 4px !important;
    margin-top: 15px !important;
    margin-bottom: 25px !important;
}

.swal2-actions {
    margin-top: 30px !important;
    gap: 15px !important;
}

.swal2-styled {
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important;
}

.swal2-styled:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1) !important;
}

.swal2-cancel {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.swal2-cancel:hover {
    background-color: #e2e8f0 !important;
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .main-content { padding-top: 80px !important; }
    .section-header h1 { font-size: 20px !important; }
    .card { margin-bottom: 15px !important; }
    .card .card-header { padding: 15px !important; }
    .card .card-body { padding: 15px !important; }
    .card.card-statistic-1 { padding: 15px !important; flex-direction: column !important; align-items: flex-start !important; }
    .card.card-statistic-1 .card-icon { margin-bottom: 10px !important; }
    .btn { padding: 8px 12px !important; font-size: 13px !important; }
}