/* ==========================================
   MBS DIGITAL - MAIN STYLESHEET
   No Tailwind, Pure CSS Custom
   ========================================== */

/* ========== RESET & VARIABLES ========== */
:root {
    /* Primary Colors - Green Theme */
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;
    --primary-900: #064e3b;
    
    /* Secondary Colors */
    --secondary-50: #eff6ff;
    --secondary-100: #dbeafe;
    --secondary-200: #bfdbfe;
    --secondary-300: #93c5fd;
    --secondary-400: #60a5fa;
    --secondary-500: #3b82f6;
    --secondary-600: #2563eb;
    --secondary-700: #1d4ed8;
    --secondary-800: #1e40af;
    --secondary-900: #1e3a8a;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   LAYOUT & SIDEBAR
   ========================================== */

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-900) 0%, var(--primary-800) 100%);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

#sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}

#sidebar.collapsed .sidebar-header h3,
#sidebar.collapsed .sidebar-header p,
#sidebar.collapsed .menu-label,
#sidebar.collapsed .nav-text {
    display: none;
}

#sidebar.collapsed .sidebar-header {
    text-align: center;
    padding: 15px;
}

#sidebar.collapsed .sidebar-menu li a {
    justify-content: center;
    padding: 12px;
}

#sidebar.collapsed .sidebar-menu li a i {
    margin: 0;
    font-size: 1.25rem;
}

/* Sidebar Header - TEKS PUTIH */
.sidebar-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white !important;
}

.sidebar-header h3 i {
    color: #fcd34d;
}

.sidebar-header p {
    font-size: 0.7rem;
    margin-top: 4px;
    color: #d1fae5 !important;
    opacity: 1;
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.sidebar-menu li {
    margin: 4px 12px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar-menu li a i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(4px);
}

.sidebar-menu li a.active {
    background: var(--primary-600);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.menu-label {
    padding: 20px 20px 8px 20px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a7f3d0 !important;
    font-weight: 700;
    opacity: 0.9;
}

/* Content Area */
#content {
    flex-grow: 1;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    transition: all 0.3s;
}

.main-content {
    flex-grow: 1;
    padding: 24px;
}

@media (min-width: 768px) {
    .main-content { padding: 32px; }
}

@media (min-width: 1024px) {
    .main-content { padding: 40px; }
}

/* ==========================================
   NAVIGASI TAB (NAV KAITAN)
   ========================================== */

.nav-kaitan {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-item {
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85em;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid var(--primary-200);
    color: var(--primary-700);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-item:hover {
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
    border-color: var(--primary-300);
}

.tab-item.active {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.tab-item i {
    margin-right: 8px;
}

/* Flash Message */
.flash-message {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 50;
    background: #ecfdf5;
    border-left: 4px solid #059669;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

.flash-error {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #991b1b;
}

.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 16px 24px;
    font-size: 0.75rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
}

.app-footer strong {
    color: #059669;
}

/* Mobile Responsive Sidebar */
@media screen and (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 1001;
        box-shadow: none;
    }
    
    #sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(6, 78, 59, 0.6);
        backdrop-filter: blur(3px);
        z-index: 1000;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .flash-message {
        top: 70px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(5, 150, 105, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-600);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility tambahan */
.mx-2 { margin-left: 8px; margin-right: 8px; }
.text-red-400 { color: #f87171; }

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--gray-800);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* ========== LINKS ========== */
a {
    text-decoration: none;
    color: inherit;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-600);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 18px 24px;
    font-size: 1.1rem;
}

/* ========== CARDS ========== */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ========== TABLES ========== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.table tr:hover {
    background: var(--gray-50);
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-success {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* ========== ALERTS ========== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: var(--primary-50);
    border-left: 4px solid var(--success);
    color: var(--primary-800);
}

.alert-danger {
    background: #fef2f2;
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-left: 4px solid var(--info);
    color: #1e40af;
}

/* ========== GRID SYSTEM ========== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ========== FLEX UTILITIES ========== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* ========== SPACING UTILITIES ========== */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }

/* ========== TEXT UTILITIES ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: 0.7rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.text-primary { color: var(--primary-600); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-gray { color: var(--gray-500); }
.text-white { color: white; }

/* ========== BACKGROUND UTILITIES ========== */
.bg-white { background: white; }
.bg-gray-50 { background: var(--gray-50); }
.bg-gray-100 { background: var(--gray-100); }
.bg-primary-50 { background: var(--primary-50); }
.bg-primary-100 { background: var(--primary-100); }

/* ========== BORDER UTILITIES ========== */
.border { border: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.border-l { border-left: 1px solid var(--gray-200); }
.border-r { border-right: 1px solid var(--gray-200); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* ========== SHADOW UTILITIES ========== */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-in-right { animation: slideInRight 0.3s ease-out; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ========== RESPONSIVE UTILITIES ========== */
.hidden { display: none; }

@media (min-width: 640px) {
    .sm\:block { display: block; }
    .sm\:hidden { display: none; }
}

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
}

@media (min-width: 1024px) {
    .lg\:block { display: block; }
    .lg\:hidden { display: none; }
}

/* ========== CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ========== PROFIL HEADER - TEKS PUTIH ========== */
.profil-header .profil-name,
.profil-header h3,
[style*="background: #064e3b"] h3,
[style*="background: #064e3b"] .profil-name {
    color: white !important;
}

.badge-role {
    background: #1e293b !important;
    color: white !important;
}

.badge-digital {
    background: #059669 !important;
    color: white !important;
}

.badge-manual {
    background: #d97706 !important;
    color: white !important;
}
/* ==========================================
   STATISTICS CONTAINER & CARDS
   ========================================== */

.stats-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
    flex: 1;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card .icon {
    font-size: 28px;
}

.stat-card .info {
    display: flex;
    flex-direction: column;
}

.stat-card .label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .count {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.2;
}

.stat-detail {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
    display: block;
}

/* Warna border untuk setiap stat card */
.stat-card:nth-child(1) { border-left-color: #f59e0b; }
.stat-card:nth-child(2) { border-left-color: #3b82f6; }
.stat-card:nth-child(3) { border-left-color: #10b981; }
.stat-card:nth-child(4) { border-left-color: #ef4444; }
.stat-card:nth-child(5) { border-left-color: #8b5cf6; }

/* ==========================================
   BADGE MODE KERJA (Digital/Manual)
   ========================================== */

.badge-mode {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7em;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.mode-digital {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.mode-manual {
    background: #fed7aa;
    color: #9b2c1d;
    border: 1px solid #fdba74;
}

.mode-disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

/* Hover effect untuk badge mode yang bisa diklik */
.badge-mode:not(.mode-disabled) {
    cursor: pointer;
}

.badge-mode:not(.mode-disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   BADGE ROLE (Admin, Ustadz, Penguji, dll)
   ========================================== */

.badge-role {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: bold;
    color: white;
    min-width: 80px;
    display: inline-block;
    text-align: center;
    text-transform: uppercase;
}

.role-admin { background: #1e293b; }
.role-penguji { background: #8b5cf6; }
.role-ustadz { background: #10b981; }
.role-bendahara { background: #f59e0b; }

/* ==========================================
   BUTTON VARIANTS LENGKAP
   ========================================== */

.btn-primary {
    background: var(--primary-600);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-300);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Disabled button state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   FILTER FORM
   ========================================== */

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-actions {
    flex: 0 0 auto;
}

/* ==========================================
   ACTION BUTTONS (Edit, Delete, Mark)
   ========================================== */

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-mark {
    background: #d1fae5;
    color: #065f46;
}

.btn-mark:hover {
    background: #a7f3d0;
}

.btn-delete {
    background: #fee2e2;
    color: #ef4444;
}

.btn-delete:hover {
    background: #fecaca;
}

.toggle-mode-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.btn-edit {
    background: #fef3c7;
    color: #d97706;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit:hover {
    background: #fde68a;
    transform: translateY(-1px);
}

.btn-disabled {
    background: #f1f5f9;
    color: #94a3b8;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    cursor: not-allowed;
}

/* ==========================================
   MESSAGE PREVIEW (WA)
   ========================================== */

.message-preview {
    cursor: pointer;
    color: #3b82f6;
    transition: all 0.2s ease;
    max-width: 300px;
    word-break: break-word;
}

.message-preview:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ==========================================
   UNREAD ROW (Pesan Belum Diproses)
   ========================================== */

.unread-row {
    background: #fefce8;
    position: relative;
}

.unread-row:hover {
    background: #fef9c3;
}

.badge-new {
    background: #ef4444;
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    display: inline-block;
}

/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 8px;
}

/* ==========================================
   INFO BOX
   ========================================== */

.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 15px;
    font-size: 0.85em;
    color: #1e40af;
}

.info-box.warning {
    background: #fff8e1;
    border-color: #ffe082;
    color: #8d6e63;
}

.info-box.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

/* ==========================================
   PREVIEW BOX (Broadcast)
   ========================================== */

.preview-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    min-height: 120px;
    white-space: pre-line;
    font-size: 14px;
    line-height: 1.6;
}

.preview-box b {
    color: #065f46;
}

.preview-box i {
    color: #d97706;
}

/* ==========================================
   PAGINATION WRAPPER
   ========================================== */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination-wrapper .pagination {
    margin: 0;
}

/* ==========================================
   MODAL
   ========================================== */

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

.modal-title {
    margin-top: 0;
    color: #064e3b;
    font-weight: 800;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.modal-subtitle {
    margin-bottom: 10px;
    font-weight: 700;
    color: #064e3b;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #f59e0b;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

.close {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #94a3b8;
    transition: 0.2s;
}

.close:hover {
    color: #ef4444;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================
   CARD BODY PADDING VARIANTS
   ========================================== */

.card-body.p-0 {
    padding: 0;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: #fafbfc;
}

/* ==========================================
   RESPONSIVE TABLES
   ========================================== */

.table-responsive {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .badge-mode,
    .badge-role {
        font-size: 0.65em;
        padding: 3px 8px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .stats-container {
        gap: 10px;
    }
    
    .stat-card {
        padding: 8px 12px;
        min-width: 120px;
    }
    
    .stat-card .icon {
        font-size: 20px;
    }
    
    .stat-card .count {
        font-size: 20px;
    }
    
    .modal-content {
        margin: 15% auto;
        padding: 20px;
        width: 95%;
    }
}

/* ==========================================
   LOADING STATE
   ========================================== */

.btn-loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ==========================================
   FORM CHECKBOX & RADIO
   ========================================== */

.form-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

.form-radio {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

/* ==========================================
   TEXT COLORS UTILITIES
   ========================================== */

.text-primary { color: var(--primary-600); }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }
.text-info { color: #3b82f6; }
.text-muted { color: #64748b; }
.text-gray { color: #6b7280; }
.text-white { color: white; }

/* ==========================================
   BACKGROUND UTILITIES
   ========================================== */

.bg-gray-50 { background: #f9fafb; }
.bg-gray-100 { background: #f3f4f6; }
.bg-primary-50 { background: #ecfdf5; }
.bg-primary-100 { background: #d1fae5; }

/* ==========================================
   FLEXBOX GAP UTILITIES
   ========================================== */

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* ==========================================
   WIDTH UTILITIES
   ========================================== */

.w-full { width: 100%; }
.w-auto { width: auto; }
.w-50 { width: 50%; }

/* ==========================================
   HEIGHT UTILITIES
   ========================================== */

.h-full { height: 100%; }
.h-auto { height: auto; }

/* ==========================================
   CURSOR UTILITIES
   ========================================== */

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-wait { cursor: wait; }
/* ========== PRINT STYLES ========== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 20px;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    .nav-kaitan, .btn, .sidebar-overlay, #sidebar, header, .app-footer {
        display: none !important;
    }
    
    #content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
}
