/* Prevent overflow */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

.card-title i {
    margin-right: 8px;
    color: #667eea;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Sidebar Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    /* Desktop: Show by default */
    transform: translateX(0);
    transition: transform 0.3s ease;
}

/* Desktop: Ensure sidebar is always visible */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .mobile-menu-btn {
        display: none !important;
    }
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    background: rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 600;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.9;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.15);
    border-left-color: #ffd700;
    transform: translateX(5px);
}

.sidebar-menu a:hover::before,
.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #ffd700;
}

.sidebar-menu i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 25px;
    background: #f8f9fa;
    min-height: 100vh;
    width: calc(100% - 250px);
}

/* Simple Layout for Santri */
.simple-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.card-header {
    border-bottom: 2px solid #f1f3f4;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
}

.card-title i {
    margin-right: 10px;
    color: #667eea;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f3f4;
}

.table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    transform: scale(1.01);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Scanner Styles */
.scanner-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.scanner-box {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.scanner-title {
    color: white;
    font-size: 28px;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#reader {
    width: 100% !important;
    max-width: 400px;
    margin: 20px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.scan-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 500;
}

.scan-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #c3e6cb;
}

.scan-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.scan-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 2px solid #ffeaa7;
}

/* Login Styles */
.login-container {
    max-width: 400px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 28px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.login-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-subtitle {
    color: #6c757d;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #495057;
}

.close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s ease;
}

.close:hover {
    color: #dc3545;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.w-100 { width: 100%; }
.hidden { display: none; }

/* Flexbox utilities */
.d-flex { 
    display: flex; 
    align-items: center;
}

.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* Text utilities */
.text-center { text-align: center; }

/* Padding utilities */
.p-20 { padding: 20px; }

/* Mobile Navigation Bar */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 10px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    padding: 8px 6px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 50px;
    font-size: 12px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-2px);
}

.mobile-nav-item i {
    font-size: 16px;
    margin-bottom: 2px;
}

.mobile-nav-item span {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
}

/* Mobile Logout Button */
.mobile-logout-btn {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
}

.mobile-logout-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .mobile-logout-btn {
        display: block;
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide sidebar completely on mobile */
    .sidebar {
        display: none !important;
    }
    
    /* Hide mobile menu button */
    .mobile-menu-btn {
        display: none !important;
    }
    
    /* Show mobile navigation */
    .mobile-nav {
        display: block;
    }
    
    /* Adjust main content for mobile nav */
    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-bottom: 80px; /* Space for mobile nav */
    }
    
    .admin-layout .main-content {
        margin-left: 0;
        padding-bottom: 80px;
    }
    
    /* Simple layout adjustments */
    .simple-layout {
        padding-bottom: 80px;
    }
    
    .container {
        padding-bottom: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .report-grid {
        grid-template-columns: 1fr;
    }
    
    .week-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .week-selector .form-control {
        max-width: 100%;
    }
    
    .d-flex {
        flex-direction: column;
    }
    
    .gap-10 > * {
        margin-bottom: 10px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
    }
    
    .scanner-box {
        padding: 20px;
    }
    
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .card-header h3 {
        font-size: 16px;
    }
    
    /* Mobile modal adjustments */
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    /* Mobile button adjustments */
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Mobile Responsive - Enhanced */
@media (max-width: 768px) {
    /* Hide sidebar completely on mobile */
    .sidebar {
        display: none !important;
    }
    
    /* Hide mobile menu button */
    .mobile-menu-btn {
        display: none !important;
    }
    
    /* Show mobile navigation */
    .mobile-nav {
        display: block;
    }
    
    /* Adjust main content for mobile nav */
    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-bottom: 80px; /* Space for mobile nav */
        width: 100%;
    }
    
    .admin-layout .main-content {
        margin-left: 0;
        padding: 15px;
        padding-bottom: 80px;
    }
    
    /* Simple layout adjustments */
    .simple-layout {
        padding-bottom: 80px;
    }
    
    .simple-layout .container {
        padding: 15px;
        padding-bottom: 20px;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
        padding: 15px;
    }
    
    .card-header {
        padding: 15px;
        margin: -15px -15px 15px -15px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 15px;
        text-align: center;
    }
    
    .stat-number {
        font-size: 24px;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .stat-label {
        font-size: 12px;
        color: #666;
    }
    
    /* Form adjustments */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 8px;
    }
    
    /* Button adjustments */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
        border-radius: 8px;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    /* Table responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0 0 12px 12px;
        width: 100%;
        max-width: 100%;
    }
    
    .table {
        min-width: 100%;
        font-size: 14px;
        margin: 0;
        width: 100%;
        table-layout: auto;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
        white-space: nowrap;
        vertical-align: middle;
        min-width: 80px;
    }
    
    .table th {
        background: #f8f9fa;
        font-weight: 600;
        border-bottom: 2px solid #dee2e6;
        font-size: 12px;
    }
    
    .table tbody tr:hover {
        background: rgba(102, 126, 234, 0.05);
    }
    
    /* Force table to fit container */
    .card .table-responsive {
        margin: 0;
        padding: 0;
    }
    
    /* Responsive table adjustments */
    @media (max-width: 768px) {
        .table-responsive {
            margin: -15px;
            padding: 15px;
            border-radius: 0;
        }
        
        .table {
            font-size: 11px;
            min-width: 600px; /* Force horizontal scroll */
        }
        
        .table th,
        .table td {
            padding: 6px 4px;
            min-width: 60px;
            font-size: 11px;
        }
        
        .table th {
            font-size: 10px;
            font-weight: 700;
        }
        
        /* Make specific columns narrower on mobile */
        .table th:first-child,
        .table td:first-child {
            min-width: 70px; /* Date/NIS column */
        }
        
        .table th:last-child,
        .table td:last-child {
            min-width: 80px; /* Action column */
        }
    }
    
    /* Modal adjustments */
    .modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    /* QR Code adjustments */
    .qr-display {
        padding: 15px;
    }
    
    /* Login page mobile */
    .login-container {
        margin: 20px;
        padding: 25px;
    }
    
    /* Report grid mobile */
    .report-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Week selector mobile */
    .week-selector {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .week-selector .form-control {
        max-width: 100%;
    }
    
    .week-selector .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* Filter forms mobile */
    .d-flex {
        flex-direction: column;
    }
    
    .gap-10 > * {
        margin-bottom: 10px;
    }
    
    /* Hide desktop elements */
    .desktop-only {
        display: none !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .main-content {
        padding: 60px 10px 15px 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .modal-content {
        margin: 10px;
    }
}

/* Prevent zoom on input focus (iOS Safari) */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    input[type="number"],
    input[type="email"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    input[type="color"] {
        font-size: 16px !important;
    }
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left-color: #28a745;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left-color: #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #cce7ff 0%, #b3d7ff 100%);
    color: #004085;
    border-left-color: #007bff;
}

/* QR Code Display */
.qr-display {
    text-align: center;
    padding: 20px;
}

.qr-display canvas {
    border: 3px solid #667eea;
    border-radius: 12px;
    margin: 15px 0;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Report Form */
.report-form {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .report-form {
        padding: 15px;
    }
}

/* Report Grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile Responsive - Enhanced */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 0 10px;
        max-width: 100%;
    }
    
    /* Report grid mobile */
    .report-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .report-grid .form-group {
        margin-bottom: 15px;
    }
    
    .report-grid .d-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    .report-grid .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* Form adjustments */
    .form-control {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Button adjustments */
    .btn {
        padding: 10px 15px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
        width: 100%;
        box-sizing: border-box;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-title {
        font-size: 16px;
    }
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.prayer-schedule {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.prayer-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.prayer-time:last-child {
    border-bottom: none;
}

.prayer-time:hover {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

.prayer-name {
    font-weight: 500;
    color: #495057;
}

.prayer-time-range {
    color: #6c757d;
    font-size: 14px;
}

.current-prayer {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border-left: 4px solid #28a745;
    padding-left: 15px;
    border-radius: 8px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Hover Effects */
.card:hover .card-title i {
    transform: scale(1.2);
    color: #764ba2;
}

.btn:hover {
    transform: translateY(-2px);
}

.sidebar-menu a:hover i {
    transform: scale(1.1);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Force no overflow for all elements */
.container, .card, .table-responsive, .form-control, .btn {
    max-width: 100%;
    box-sizing: border-box;
}

/* Specific mobile fixes */
@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }
    
    .card {
        margin: 0 0 15px 0;
        padding: 10px;
    }
    
    .card-header {
        padding: 10px;
        margin: -10px -10px 10px -10px;
    }
    
    .report-grid {
        padding: 10px;
        gap: 10px;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 16px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .table {
        font-size: 10px;
        min-width: 500px;
    }
    
    .table th,
    .table td {
        padding: 4px 2px;
        min-width: 50px;
        font-size: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-number {
        font-size: 20px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding-top: 60px;
        padding-bottom: 70px;
    }
    
    .simple-layout {
        padding-bottom: 70px;
    }
}
/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-hadir {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-masbuq {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-alfa {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-sakit {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-izin {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-pulang {
    background-color: #fce4ec;
    color: #880e4f;
    border: 1px solid #f8bbd9;
}

/* Info box */
.info-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-box h3 {
    margin-bottom: 15px;
    color: #495057;
}

.info-box p {
    margin-bottom: 8px;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}
/* Small button styles */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
}

.btn-sm i {
    margin-right: 4px;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: 1px solid #ffc107;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert i {
    margin-right: 8px;
}