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

/* ============================================
   ANDROID-STYLE LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
}

.loading-spinner-sm {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(79, 70, 229, 0.15);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

.loading-text-android {
    color: white;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ============================================
   SKELETON LOADING SCREENS
   ============================================ */
.skeleton {
    background: #e2e8f0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
    100% { left: 100%; }
}

.skeleton-card {
    height: 140px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ============================================
   TOUCH-FRIENDLY / NATIVE ANDROID FEEL
   ============================================ */

/* Ripple effect for all clickable elements */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Native-feeling tap feedback */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.touch-target:active {
    transform: scale(0.96) !important;
    opacity: 0.85;
    transition: transform 0.1s, opacity 0.1s !important;
}

/* Smooth native scrolling */
.native-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Better card tap feel */
.card-tap {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-tap:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Pull-to-refresh indicator */
.pull-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: top 0.3s ease;
}

.pull-indicator.visible {
    top: 10px;
}

.pull-indicator .loading-spinner-sm {
    border-top-color: var(--primary-color);
}

/* Inline loading spinner for buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinLoader 0.7s linear infinite;
}

/* Page transition animation */
.page-enter {
    animation: pageSlideIn 0.3s ease-out;
}

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

/* Better select dropdowns for Android */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px !important;
}

/* Better input focus for mobile */
input, select, textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
}

@media (min-width: 769px) {
    input, select, textarea {
        font-size: 14px !important;
    }
}

/* Safe area padding for notch devices */
body {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* ============================================
   IMPROVED ADMIN PANEL MOBILE DESIGN
   ============================================ */
@media (max-width: 768px) {
    /* Bigger touch targets for admin */
    .admin-table td {
        padding: 10px 6px !important;
    }
    
    .admin-table .btn-small,
    .admin-table .btn-edit,
    .admin-table .btn-delete {
        padding: 6px !important;
        font-size: 11px !important;
        min-height: 32px;
        min-width: 32px;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Better stat cards on mobile */
    .stat-card {
        min-height: 140px !important;
        padding: 20px 16px !important;
        border-radius: 16px !important;
    }
    
    .stat-number {
        font-size: 30px !important;
    }
    
    /* Tab buttons bigger touch area */
    .admin-tabs .tab-btn {
        padding: 14px 16px !important;
        font-size: 13px !important;
        min-height: 46px;
    }
    
    /* Better modal on mobile */
    .modal-content {
        border-radius: 16px 16px 0 0 !important;
        margin: auto auto 0 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
    }
    
    /* Filter bar inputs bigger */
    .filter-bar input,
    .filter-bar select {
        padding: 12px 14px !important;
        font-size: 15px !important;
        min-height: 44px;
        border-radius: 10px !important;
    }
    
    .filter-bar button {
        min-height: 44px;
        padding: 12px 20px !important;
        border-radius: 10px !important;
    }
    
    /* Better tab header */
    .tab-header h2 {
        font-size: 20px !important;
    }
    
    /* Pagination buttons bigger */
    .btn-pagination {
        min-height: 44px;
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }
}

/* Global Styles */

:root {
    /* Primary Colors - Premium Indigo/Violet Theme */
    --primary-color: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #6366f1;
    
    /* Secondary Colors - Emerald */
    --secondary-color: #10b981;
    --secondary-dark: #047857;
    
    /* Accent Colors - Amber */
    --accent-color: #f59e0b;
    --accent-dark: #b45309;
    
    /* Status Colors */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #cbd5e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Soft hover transitions */
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page - Mobile First */
.login-page {
    background: #ffffff;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    position: relative;
    border: 2px solid #e0dded;
}

.login-container {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 60px 40px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.login-content {
    flex: 1;
}

.login-welcome {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 56px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.login-subtitle {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #6b7280;
    margin: 0 0 48px 0;
    line-height: 1.6;
}

.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 32px;
}

.form-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #d1d5db;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #111827;
    background: transparent;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-bottom-color: #1e293b;
}

.form-input::placeholder {
    color: transparent;
}

.btn-login {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    letter-spacing: 0.3px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.25);
}

.btn-login:active {
    transform: translateY(0);
}

.error-message {
    color: #dc2626;
    font-size: 13px;
    margin: 12px 0;
    min-height: 18px;
}

.register-link {
    margin-top: 32px;
    text-align: left;
}

.register-link a {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.register-link a:hover {
    color: #374151;
}

.link-highlight {
    text-decoration: underline;
    color: #2563eb;
}

.link-highlight:hover {
    color: #1d4ed8;
}

/* Login Footer */
.login-footer {
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid #f3f4f6;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.download-link:hover {
    color: #374151;
}

.footer-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 16px;
}

.info-indicator {
    position: relative;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.info-indicator:hover {
    color: #6b7280;
}

.info-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 10px 14px;
    background: #1f2937;
    color: #ffffff;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.info-indicator:hover .info-tooltip {
    display: block;
}

.settings-btn {
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.settings-btn:hover {
    color: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 40px 24px 32px;
        max-width: 100%;
    }
    
    .login-welcome {
        font-size: 44px;
    }
    
    .login-subtitle {
        font-size: 14px;
        margin-bottom: 36px;
    }
    
    .form-group {
        margin-bottom: 28px;
    }
    
    .form-input {
        font-size: 14px;
    }
    
    .btn-login {
        padding: 14px 28px;
        font-size: 15px;
    }
}

@media (min-width: 1024px) {
    .login-container {
        padding: 80px 60px 60px;
        max-width: 580px;
    }
    
    .login-welcome {
        font-size: 64px;
    }
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.error-message {
    color: var(--danger-color);
    margin-top: 15px;
    font-size: 14px;
    font-weight: 600;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.party-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.party-selector select {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.party-selector select:hover {
    background: white;
    transform: translateY(-1px);
}

.header-center {
    display: flex;
    gap: 10px;
}

.info-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rate {
    background: var(--success-color);
}

.limit {
    background: var(--info-color);
}

.capping {
    background: var(--danger-color);
}

.date {
    background: var(--danger-color);
}

.time {
    background: var(--success-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info #username {
    display: none;
}

.points {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-logout {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Party Quick Selection Panel */
.party-quick-panel {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.party-quick-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.party-quick-header h3 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 700;
}

.btn-close-panel {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-panel:hover {
    background: #dc2626;
    transform: rotate(90deg);
}

.party-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.party-card {
    border-radius: 12px;
    padding: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.party-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.party-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.party-card-header {
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
}

.party-card-header h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.party-card-info {
    font-size: 12px;
    margin-bottom: 5px;
    opacity: 0.95;
}

.party-card-info strong {
    font-weight: 700;
}

.party-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.btn-party-action {
    padding: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-party-action:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: scale(1.05);
}

/* Party Card Colors */
.party-card.faridabad {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.party-card.nagpur {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.party-card.gaziabaad {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.party-card.gali {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.party-card.deshawer {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.party-card.default {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* Left Panel - Table */
.left-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-container {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    /* Removed sticky positioning to fix overlap with border-spacing */
    z-index: 10;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

table tbody tr:hover {
    background: #f8fafc;
}

table input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: #f8fafc;
}

table input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-add-row {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-add-row:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Center Panel */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instructions {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.instructions h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.instructions ol {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.instructions li {
    position: relative;
    padding: 12px 16px 12px 42px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 500;
}

.instructions li::before {
    content: counter(item);
    counter-increment: item;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

.totals {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 1px solid var(--border-color);
}

.total-item {
    margin-bottom: 15px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.total-item h3 {
    font-size: 20px;
    color: #333;
}

.total-item h3 span {
    color: var(--primary-color);
    font-weight: 700;
}

/* Right Panel */
.right-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.transaction-header {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--secondary-dark) 100%);
    color: white;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.transaction-header h2 {
    font-size: 18px;
}

.copy-txn {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.btn-copy {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s;
}

.btn-copy:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.copy-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.copy-options label {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.narration {
    padding: 15px;
    border-bottom: 1px solid #eee;
    flex-grow: 1;
}

.narration h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
}

.narration-content {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    min-height: 100px;
}

.right-total {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    padding: 15px;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(239, 68, 68, 0.3);
}

.grand-total-display {
    font-size: 18px;
    font-weight: 600;
}

/* Bottom Panel */
.bottom-panel {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(37, 99, 235, 0.3);
}

.btn-action {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-save {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--success-color) 0%, var(--secondary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-clear {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: white;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.modal-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.modal-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.modal-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-input-group input,
.modal-input-group select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.modal-input-group input:focus,
.modal-input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: white;
}

.modal-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.modal-table th {
    background: var(--bg-primary);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.modal-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-table input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.modal-table input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-modal-save {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--success-color) 0%, var(--secondary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-modal-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-modal-close {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--text-secondary) 0%, #475569 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.checkbox-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.random-inputs-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}

.random-inputs-container::-webkit-scrollbar {
    width: 6px;
}

.random-inputs-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.random-inputs-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.random-inputs-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.modal-total {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    border: 2px solid var(--border-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .right-panel {
        grid-column: 1 / -1;
    }
}

/* Drawer & Hamburger Menu Base Styles */
.hamburger-btn {
    display: none;
}

.drawer-header {
    display: none;
}

.menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .right-panel,
    .center-panel {
        grid-column: auto;
    }
    
    .bottom-panel {
        flex-wrap: wrap;
    }
    
    .bottom-panel button {
        flex: 1;
        min-width: 120px;
    }

    /* Hamburger & Sliding Navigation Menu Styles for Mobile */
    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1200;
    }

    .hamburger-btn span {
        width: 100%;
        height: 2.5px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hamburger-btn.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1050;
        display: none;
    }

    .menu-overlay.active {
        display: block;
    }

    .admin-tabs {
        position: fixed;
        top: 0;
        left: -300px; /* hidden by default */
        width: 280px;
        height: 100vh;
        background: #0f172a;
        display: flex;
        flex-direction: column;
        padding: 24px;
        z-index: 1100;
        box-shadow: none;
        border-bottom: none;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 12px;
        align-items: stretch;
        justify-content: flex-start;
    }

    .admin-tabs.open {
        left: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    }

    .admin-tabs .tab-btn {
        width: 100%;
        text-align: left;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.7);
        padding: 12px 16px;
        border-radius: 12px;
    }

    .admin-tabs .tab-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .admin-tabs .tab-btn.active {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        border-color: transparent;
        color: white;
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }

    .drawer-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 16px;
    }
}

/* Admin Panel Styles */
.admin-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-container {
    width: 100%;
    margin: 10px auto;
    padding: 0 15px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.tab-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    background: white;
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    padding: 28px 24px;
    border-radius: 20px;
    color: white !important;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    min-height: 140px;
}

.stat-icon {
    font-size: 48px;
    opacity: 0.9;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Individual premium gradient themes for the stats cards */
.stats-grid .stat-card:nth-child(1) {
    background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.2);
}

.stats-grid .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.2);
}

.stats-grid .stat-card:nth-child(3) {
    background: linear-gradient(135deg, #059669 0%, #065f46 100%);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.2);
}

.stats-grid .stat-card:nth-child(4) {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.2);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.stat-card h3 {
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.85) !important;
}

.stat-number {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
    color: white !important;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    table-layout: fixed;
}

.admin-table thead {
    background: #f8fafc;
}

.admin-container .table-container {
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    border-radius: 8px;
}

/* On mobile, make sure the table doesn't break the page */
@media (max-width: 768px) {
    .admin-container .table-container {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
    text-align: left;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table th {
    font-weight: 700;
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table tbody tr {
    background: #ffffff;
    transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
    background: #f1f5f9;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-user {
    background: #dbeafe;
    color: #1e40af;
}

.badge-active, .badge-success {
    background: #10b981;
    color: #ffffff;
}

.badge-inactive, .badge-danger {
    background: #ef4444;
    color: #ffffff;
}

.badge-warning {
    background: #f59e0b;
    color: #ffffff;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    margin-top: 15px;
    border: 1px solid #f1f5f9;
}

.btn-pagination {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.btn-pagination:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-pagination:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-info {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 14px;
}

.pagination-info small {
    font-weight: 500;
    color: #94a3b8;
}

.badge-completed {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.btn-secondary {
    padding: 8px 16px;
    background: var(--text-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--text-primary);
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-right: 5px;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--info-color);
    color: white !important;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-size: 20px;
    color: #ffffff;
    margin: 0;
}

.close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger-color);
}

.form-group {
    padding: 15px 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    padding: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

/* Party Quick Panel Cards */
.party-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.party-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.party-card-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.party-card-header h4 {
    color: white;
    font-size: 18px;
    margin: 0;
    text-transform: uppercase;
}

.party-card-info {
    color: white;
    font-size: 13px;
    margin-bottom: 8px;
}

.party-card-info strong {
    font-weight: 700;
}

.party-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-party-action {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-party-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Party Card Colors */
.party-color-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.party-color-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.party-color-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.party-color-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.party-color-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.party-color-indigo {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

/* User Landing Page Styles */
.user-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    padding: 24px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.2);
    border-radius: 0;
}

.user-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.user-info h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.user-header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-stats {
    display: flex;
    gap: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.games-container {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.games-header {
    margin-bottom: 30px;
}

.games-header h1 {
    font-size: 28px;
    margin: 0 0 5px 0;
    color: var(--text-dark);
}

.games-header p {
    color: var(--text-light);
    margin: 0;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.game-card {
    border-radius: 16px;
    padding: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.game-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.game-status {
    position: absolute;
    top: 15px;
    right: 15px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.open {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.status-badge.closed {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.game-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-label {
    font-weight: 600;
    opacity: 0.9;
}

.info-value {
    font-weight: 700;
}

.result-value {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 8px;
}

.loading-text,
.error-text,
.no-games-text {
    text-align: center;
    padding: 50px 20px;
    font-size: 18px;
    color: var(--text-light);
}

.error-text {
    color: var(--danger-color);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 15px));
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.35);
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    box-sizing: border-box;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 700;
    transition: all 0.3s;
    padding: 6px 16px;
    border-radius: 12px;
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Comprehensive Mobile Responsiveness Rules
   ========================================================================== */

@media (max-width: 900px) {
    /* Main Dashboard content grid */
    .main-content {
        grid-template-columns: 1fr !important;
        gap: 15px;
        padding: 10px;
    }
    
    .left-panel, .center-panel, .right-panel {
        grid-column: auto !important;
    }
    
    /* Dashboard headers styling */
    .dashboard-header {
        position: relative;
        flex-direction: column;
        align-items: stretch;
        padding: 55px 16px 16px 16px;
        border-radius: 0 0 20px 20px;
        gap: 16px;
        background: linear-gradient(135deg, #1e1b4b 0%, #311042 100%);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }
    
    .dashboard-header #dashboardTitle {
        position: absolute;
        top: 14px;
        left: 16px;
        font-size: 24px !important;
        margin: 0;
        font-weight: 800;
        letter-spacing: -0.5px;
        background: linear-gradient(to right, #ffffff, #c7d2fe);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    .dashboard-header .user-info {
        position: absolute;
        top: 14px;
        right: 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .dashboard-header .user-info #username {
        font-weight: 700;
        font-size: 14px;
        color: rgba(255, 255, 255, 0.9);
        text-transform: capitalize;
    }
    
    .dashboard-header .header-left {
        width: 100%;
        display: flex;
        flex-direction: column;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .party-selector {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: rgba(255, 255, 255, 0.08);
        padding: 8px 12px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .party-selector label {
        font-weight: 700;
        color: rgba(255, 255, 255, 0.9);
        font-size: 14px;
        margin: 0;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .party-selector select {
        flex-grow: 1;
        max-width: 70%;
        background: white;
        color: var(--text-primary);
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 700;
        border: none;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        text-align: center;
    }
    
    .dashboard-header .header-right {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 12px;
    }
    
    /* Elegant Badges on Mobile */
    .dashboard-header .info-badge {
        flex: 1;
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
        font-weight: 700;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        margin: 0;
        color: white;
    }
    
    .dashboard-header .info-badge.date {
        background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dashboard-header .info-badge.time {
        background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dashboard-header .info-badge.points {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 768px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Admin/Agent Panels layout */
    .admin-container {
        margin: 10px auto;
        padding: 0 10px;
    }
    
    .admin-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
    }
    
    .admin-header .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
        width: auto;
    }
    
    .admin-header .header-right {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        width: auto;
    }

    .admin-header h1 {
        display: none !important;
    }

    .btn-logout {
        padding: 6px 10px !important;
        font-size: 12px;
    }
    
    /* Tab Headers */
    .tab-content {
        padding: 10px !important;
    }
    
    .tab-header {
        margin-bottom: 12px;
        padding: 12px !important;
    }
    
    .tab-header h2 {
        font-size: 18px;
    }

    /* Filter bars stacking */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .filter-bar input,
    .filter-bar select,
    .filter-bar button {
        width: 100% !important;
        margin-right: 0 !important;
    }

    /* Compact tables for mobile */
    .table-container,
    .table-scroll {
        width: 100%;
        overflow-x: auto;
        border: none;
        border-radius: 4px;
        padding: 5px;
    }
    
    .admin-container table,
    .admin-container .admin-table {
        min-width: 100%;
        font-size: 11px;
    }
    
    .admin-table td .badge {
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 4px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }

    .admin-table th, .data-table th {
        padding: 6px 2px;
        white-space: nowrap;
        font-size: 8px;
    }

    .admin-table td, .data-table td {
        padding: 6px 2px;
        white-space: normal;
        word-break: break-word;
        font-size: 10px;
    }

    .admin-table td button {
        padding: 4px;
        box-sizing: border-box;
    }

    /* Bottom Panel wrap in dashboard */
    .bottom-panel {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        padding-bottom: 15px;
    }
    
    .bottom-panel button {
        flex: 1 1 calc(50% - 8px);
        font-size: 12px;
        padding: 8px 5px;
    }
    
    .bottom-panel .btn-save {
        flex: 1 1 100%;
        order: -1;
        font-size: 14px;
        padding: 10px;
    }
    
    /* Pagination for mobile */
    .pagination-controls {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        padding: 12px 10px;
    }
    
    .pagination-controls .pagination-info {
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .pagination-controls .btn-pagination {
        flex: 1;
        margin: 0 5px;
        padding: 8px;
        font-size: 12px;
    }

    /* Modal container fixes */
    .modal-container,
    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
    }
}

@media (max-width: 600px) {
    /* User Profile & Landing Pages */
    .user-header {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 24px 20px 20px 20px;
        text-align: center;
    }
    
    .user-header-left {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .user-header-right {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-top: 16px;
    }
    
    .user-stats {
        justify-content: center;
        width: auto;
        gap: 12px;
    }
    
    .user-avatar {
        width: 65px;
        height: 65px;
        font-size: 30px;
    }

    /* Games container bottom padding to clear bottom navigation bar */
    .games-container {
        padding: 15px 10px 105px 10px !important;
    }

    /* Reports Container */
    .reports-container {
        padding: 10px;
        padding-bottom: 105px;
    }
    
    .reports-header {
        padding: 15px;
        margin: -10px -10px 15px -10px !important;
        border-radius: 0 0 12px 12px;
    }
    
    .reports-container .tab-btn {
        padding: 10px 5px !important;
        font-size: 12px !important;
    }
    
    .transaction-header {
        padding: 12px 10px !important;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .transaction-info {
        flex-wrap: wrap;
        gap: 10px !important;
    }
    
    .transaction-info div {
        flex: 1 1 calc(50% - 10px);
    }
    
    /* Master Result Layouts */
    .master-container {
        padding: 10px;
        padding-bottom: 90px;
    }
    
    .master-header {
        padding: 15px 12px;
        margin: -10px -10px 15px -10px;
    }

    .filter-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 12px;
    }
    
    .filter-card select,
    .filter-card input {
        width: 100%;
    }
    
    .result-row-card {
        padding: 15px;
        gap: 12px;
    }
    
    .row-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .row-totals {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
    
    /* Edit Profile block styling */
    .games-container[style*="max-width: 600px"] {
        margin: 15px auto !important;
        width: 95% !important;
        padding: 15px !important;
    }

    /* Modal Form / Row fixes */
    .modal-body {
        padding: 15px !important;
    }
    .modal-header {
        padding: 15px !important;
    }
    .modal-row {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
        gap: 8px !important;
    }
    .form-group {
        padding: 8px 12px !important;
    }
    .form-actions {
        padding: 12px !important;
    }
    
    /* Fanter Jantri mobile search inputs */
    .filter-bar-jantari {
        padding: 10px !important;
        margin: 10px !important;
        gap: 8px !important;
    }
    .filter-bar-jantari select, 
    .filter-bar-jantari input {
        width: 100% !important;
        flex-basis: 100% !important;
        flex-grow: 1 !important;
    }
    .filter-bar-jantari .btn-primary {
        width: 100% !important;
        margin-top: 5px !important;
    }
}

@media (max-width: 576px) {
    /* 2 column stats grid for smaller screens */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }
    .stat-card {
        padding: 14px 12px !important;
        min-height: 100px !important;
        gap: 10px !important;
    }
    .stat-icon {
        font-size: 32px !important;
    }
    .stat-number {
        font-size: 22px !important;
    }
    
    /* 1 Column Games Grid */
    .games-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Login & Register Boxes */
    .login-box,
    .register-container {
        padding: 20px 15px !important;
        border-radius: 8px !important;
        width: 95% !important;
        margin: 20px auto !important;
    }
    
    .login-box h1,
    .register-container h1 {
        font-size: 24px !important;
        margin-bottom: 12px !important;
    }
}

@media (max-width: 480px) {
    /* Navigation bar icon scaling */
    .nav-item {
        padding: 5px 6px !important;
        font-size: 11px !important;
    }
    .nav-icon {
        font-size: 18px !important;
    }
}

/* Blinking animations for live games */
@keyframes statusBlink {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

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

.status-badge.live {
    background: #ef4444 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6) !important;
    font-weight: 700 !important;
    border: none !important;
}

.blinking {
    animation: statusBlink 1.5s infinite ease-in-out !important;
}

.blinking-text {
    animation: textBlink 1.5s infinite ease-in-out !important;
    font-weight: 700 !important;
}

.info-value.text-green {
    color: #4ade80 !important; /* bright green */
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.4) !important;
    font-weight: 700 !important;
}

.info-value.text-red {
    color: #fca5a5 !important; /* light red */
    font-weight: 700 !important;
}

/* Header Actions Layout */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.btn-add-money {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-add-money:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: auto;
    }
    
    .btn-logout, .btn-add-money {
        width: auto;
        text-align: center;
        justify-content: center;
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 6px;
    }
    
    .row-totals {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
}
    /* Edit Profile block styling */
    .games-container[style*="max-width: 600px"] {
        margin: 15px auto !important;
        width: 95% !important;
        padding: 15px !important;
    }

    /* Modal Form / Row fixes */
    .modal-body {
        padding: 15px !important;
    }
    .modal-header {
        padding: 15px !important;
    }
    .modal-row {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
        gap: 8px !important;
    }
    .form-group {
        padding: 8px 12px !important;
    }
    .form-actions {
        padding: 12px !important;
    }
    
    /* Fanter Jantri mobile search inputs */
    .filter-bar-jantari {
        padding: 10px !important;
        margin: 10px !important;
        gap: 8px !important;
    }
    .filter-bar-jantari select, 
    .filter-bar-jantari input {
        width: 100% !important;
        flex-basis: 100% !important;
        flex-grow: 1 !important;
    }
    .filter-bar-jantari .btn-primary {
        width: 100% !important;
        margin-top: 5px !important;
    }
}

@media (max-width: 576px) {
    /* 2 column stats grid for smaller screens */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }
    .stat-card {
        padding: 14px 12px !important;
        min-height: 100px !important;
        gap: 10px !important;
    }
    .stat-icon {
        font-size: 32px !important;
    }
    .stat-number {
        font-size: 22px !important;
    }
    
    /* 1 Column Games Grid */
    .games-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Login & Register Boxes */
    .login-box,
    .register-container {
        padding: 20px 15px !important;
        border-radius: 8px !important;
        width: 95% !important;
        margin: 20px auto !important;
    }
    
    .login-box h1,
    .register-container h1 {
        font-size: 24px !important;
        margin-bottom: 12px !important;
    }
}

@media (max-width: 480px) {
    /* Navigation bar icon scaling */
    .nav-item {
        padding: 5px 6px !important;
        font-size: 11px !important;
    }
    .nav-icon {
        font-size: 18px !important;
    }
}

/* Blinking animations for live games */
@keyframes statusBlink {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

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

.status-badge.live {
    background: #ef4444 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6) !important;
    font-weight: 700 !important;
    border: none !important;
}

.blinking {
    animation: statusBlink 1.5s infinite ease-in-out !important;
}

.blinking-text {
    animation: textBlink 1.5s infinite ease-in-out !important;
    font-weight: 700 !important;
}

.info-value.text-green {
    color: #4ade80 !important; /* bright green */
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.4) !important;
    font-weight: 700 !important;
}

.info-value.text-red {
    color: #fca5a5 !important; /* light red */
    font-weight: 700 !important;
}

/* Header Actions Layout */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.btn-add-money {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-add-money:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: auto;
    }
    
    .btn-logout, .btn-add-money {
        width: auto;
        text-align: center;
        justify-content: center;
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 6px;
    }
}

/* ============================================
   DASHBOARD DATA ENTRY - MOBILE IMPROVEMENTS
   ============================================ */
@media (max-width: 768px) {
    /* Bigger inputs for data entry operators */
    .number-input, .amount-input {
        padding: 12px 10px !important;
        font-size: 16px !important;
        min-height: 44px;
        border-radius: 8px !important;
    }
    
    /* Table headers bigger */
    table thead th {
        padding: 10px 8px !important;
        font-size: 13px !important;
    }
    
    /* Table cells bigger */
    table td {
        padding: 8px 6px !important;
    }
    
    /* Save/Clear buttons */
    
    /* Save/Clear buttons */
    .btn-save, .btn-clear {
        padding: 14px 16px !important;
        font-size: 15px !important;
        min-height: 48px;
        border-radius: 10px !important;
    }
    
    /* Action buttons bigger */
    .btn-action {
        padding: 12px 8px !important;
        font-size: 13px !important;
        min-height: 44px;
        border-radius: 8px !important;
    }
    
    /* Grand total display */
    .total-item h3 {
        font-size: 18px !important;
    }
    
    /* Party selector dropdown */
    .party-selector select {
        min-height: 44px;
        padding: 10px 16px !important;
        font-size: 15px !important;
    }
    
    /* Bottom nav bigger touch area */
    .bottom-nav {
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 15px)) !important;
    }
    
    .nav-item {
        padding: 8px 12px !important;
        min-width: 60px;
    }
    
    .nav-icon {
        font-size: 22px !important;
    }
    
    /* Modal improvements for mobile */
    .modal-overlay .modal-container {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 92vh !important;
        margin: auto auto 0 auto !important;
    }
    
    .modal-header h3 {
        font-size: 20px !important;
    }
    
    .modal-body {
        padding: 20px 16px !important;
    }
    
    .modal-input-group input,
    .modal-input-group select {
        padding: 14px 12px !important;
        font-size: 16px !important;
        min-height: 44px;
    }
    
    .btn-modal-save, .btn-modal-close {
        padding: 14px 20px !important;
        font-size: 15px !important;
        min-height: 48px;
        border-radius: 10px !important;
        flex: 1;
    }
    
    .modal-footer {
        flex-wrap: wrap;
    }
    
    /* Checkbox group bigger */
    .checkbox-group label {
        padding: 10px 14px !important;
        font-size: 15px !important;
        min-height: 44px;
        background: #f8fafc;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }
    
    /* Modal table inputs */
    .modal-table input,
    .modal-table select {
        padding: 12px 10px !important;
        font-size: 16px !important;
        min-height: 44px;
    }
}

/* ============================================
   MASTER/REPORTS/PROFILE - MOBILE FIXES
   ============================================ */
@media (max-width: 600px) {
    /* Master page filters */
    .filter-card {
        padding: 14px !important;
        gap: 10px !important;
    }
    
    .filter-card select,
    .filter-card input {
        width: 100% !important;
        padding: 12px 14px !important;
        font-size: 15px !important;
        min-height: 44px;
        border-radius: 10px !important;
    }
    
    /* Reports page */
    .reports-container {
        padding: 10px !important;
    }
    
    .filter-bar {
        padding: 12px !important;
        border-radius: 12px !important;
    }
    
    .filter-bar select,
    .filter-bar input {
        width: 100% !important;
        padding: 12px 14px !important;
        font-size: 15px !important;
        min-height: 44px;
    }
    
    .filter-bar button {
        width: 100% !important;
        min-height: 44px;
        padding: 12px 20px !important;
        border-radius: 10px !important;
    }
    
    /* Profile page */
    .games-container[style*="max-width: 600px"] {
        margin: 10px auto !important;
        padding: 20px 15px !important;
        border-radius: 12px !important;
    }
    
    .games-container form input {
        padding: 14px 12px !important;
        font-size: 16px !important;
        min-height: 44px;
    }
    
    .games-container form button[type="submit"] {
        width: 100%;
        padding: 14px !important;
        font-size: 16px !important;
        min-height: 48px;
        border-radius: 10px !important;
    }
    
    /* Result row cards */
    .result-row-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }
    
    .game-title {
        font-size: 16px !important;
    }
    
    .number-pill {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    /* Add money page */
    .add-money-container {
        padding: 15px !important;
    }
    
    .add-money-container input,
    .add-money-container select {
        padding: 14px 12px !important;
        font-size: 16px !important;
        min-height: 44px;
    }
    
    /* Statement page */
    .statement-container {
        padding: 10px !important;
    }
    
    /* Game results page */
    .game-results-container {
        padding: 10px !important;
    }
    
    /* Jantari page */
    .jantari-container {
        padding: 10px !important;
    }
    
    /* Agent panel */
    .agent-container {
        padding: 10px !important;
    }
}

/* ============================================
   GLOBAL MOBILE BOTTOM PADDING (clear nav)
   ============================================ */
@media (max-width: 768px) {
    /* Pages with bottom nav need bottom padding */
    body:has(.bottom-nav) .main-content,
    body:has(.bottom-nav) .admin-container,
    body:has(.bottom-nav) .games-container {
        padding-bottom: 120px !important;
    }
    
    /* Swipe hint for tables */
    .table-container::after {
        content: '← Swipe →';
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 11px;
        color: #94a3b8;
        font-weight: 600;
    }
    
    /* Better scroll indicators */
    .table-container {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }
}

/* ============================================
   PROFESSIONAL DESIGN OVERHAUL
   ============================================ */

/* Global improvements */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #f0f2f5 !important;
}

/* Better admin container */
.admin-container {
    background: #f0f2f5;
    padding: 12px;
    max-width: 100%;
    overflow-x: hidden;
}

/* Improved stat cards */
.stat-card {
    position: relative;
    padding: 22px 20px;
    border-radius: 16px;
    color: white !important;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    min-height: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-icon {
    font-size: 40px;
    opacity: 0.9;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card h3 {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9) !important;
}

.stat-number {
    font-size: 32px !important;
    font-weight: 800 !important;
    letter-spacing: -1px;
    line-height: 1.1;
}

/* ============================================
   ADMIN TABLE - CARD LAYOUT ON MOBILE
   (No horizontal scrolling)
   ============================================ */
@media (max-width: 768px) {
    /* Hide table header on mobile */
    .admin-table thead {
        display: none;
    }
    
    /* Each row becomes a card */
    .admin-table tbody tr {
        display: block;
        background: white;
        margin-bottom: 12px;
        border-radius: 12px;
        padding: 45px 16px 16px 16px; /* 52px top padding for absolute buttons to prevent overlap with first row */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        position: relative;
    }
    
    .admin-table tbody tr:hover {
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Each cell becomes a row in the card */
    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f8fafc;
        font-size: 14px;
        white-space: normal;
        overflow: visible;
    }
    
    .admin-table tr.loading-row {
        background: transparent !important;
        box-shadow: none !important;
        padding: 40px 0 !important;
    }
    
    .admin-table tr.loading-row td {
        display: block !important;
        text-align: center !important;
        border: none !important;
        position: static !important;
        width: 100% !important;
    }
    
    .admin-table td:first-child {
        padding-right: 0; 
    }
    
    .admin-table td:last-child {
        border-bottom: none;
        padding: 0;
        position: absolute;
        top: 10px;
        right: 15px;
        width: auto;
        justify-content: flex-end;
        gap: 6px;
    }
    
    /* Add labels before each cell */
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748b;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Hide label for Actions since they are absolute */
    .admin-table td:last-child::before {
        display: none;
    }
    
    /* Actions buttons in card layout */
    .admin-table td:last-child button {
        margin: 0 3px;
        width: 32px !important;
        height: 32px !important;
        padding: 6px !important;
        min-height: auto !important;
        color: white !important;
        border-radius: 8px !important;
    }
    
    .admin-table td:last-child button svg {
        width: 16px !important;
        height: 16px !important;
        stroke: white !important;
        stroke-width: 2px !important;
    }
    
    /* Table container - no horizontal scroll */
    .admin-container .table-container {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
    
    .admin-table {
        overflow: visible !important;
    }
    
    /* Tab header improvements */
    .tab-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    
    /* Admin tabs - keep sidebar drawer styles */
    .admin-tabs {
        background: #0f172a !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    }
    
    /* Pagination buttons */
    .btn-pagination {
        padding: 10px 14px !important;
        font-size: 13px !important;
        min-height: 40px;
        border-radius: 8px !important;
    }
    
    /* Filter bars */
    .filter-bar,
    .filter-bar-report,
    .filter-bar-jantari {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 14px !important;
    }
    
    .filter-bar select,
    .filter-bar input,
    .filter-bar-report select,
    .filter-bar-report input,
    .filter-bar-jantari select,
    .filter-bar-jantari input {
        width: 100% !important;
        min-height: 44px;
        padding: 12px 14px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
    }
    
    .filter-bar button,
    .filter-bar-report button,
    .filter-bar-jantari button {
        width: 100% !important;
        min-height: 44px;
        padding: 12px 20px !important;
        border-radius: 10px !important;
        font-size: 15px !important;
    }
    
    /* Modal improvements */
    .modal-overlay .modal-container {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 90vh !important;
        margin: auto auto 0 auto !important;
    }
    
    .modal-header {
        padding: 18px 20px !important;
        border-radius: 20px 20px 0 0 !important;
    }
    
    .modal-header h3 {
        font-size: 20px !important;
        font-weight: 800 !important;
    }
    
    .modal-body {
        padding: 20px 18px !important;
    }
    
    .modal-input-group label {
        font-size: 13px !important;
        font-weight: 700 !important;
        margin-bottom: 6px !important;
        color: #475569 !important;
    }
    
    .modal-input-group input,
    .modal-input-group select {
        padding: 14px 12px !important;
        font-size: 16px !important;
        min-height: 48px;
        border-radius: 10px !important;
        border: 1.5px solid #e2e8f0 !important;
    }
    
    .modal-input-group input:focus,
    .modal-input-group select:focus {
        border-color: #4f46e5 !important;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
    }
    
    .btn-modal-save, .btn-modal-close {
        padding: 14px 20px !important;
        font-size: 15px !important;
        min-height: 48px;
        border-radius: 10px !important;
        flex: 1;
        font-weight: 700 !important;
    }
    
    .modal-footer {
        flex-wrap: wrap;
        gap: 10px !important;
        padding: 16px 18px !important;
    }
    
    /* Checkbox group bigger */
    .checkbox-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .checkbox-group label {
        padding: 10px 16px !important;
        font-size: 15px !important;
        min-height: 44px;
        background: #f8fafc;
        border-radius: 10px;
        border: 1.5px solid #e2e8f0;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .checkbox-group label:has(input:checked) {
        background: #eef2ff;
        border-color: #4f46e5;
        color: #4f46e5;
        font-weight: 700;
    }
    
    /* Modal table inputs */
    .modal-table input,
    .modal-table select {
        padding: 12px 10px !important;
        font-size: 16px !important;
        min-height: 44px;
        border-radius: 8px !important;
        width: 100% !important;
    }
    
    .modal-table td {
        padding: 6px 4px !important;
    }
    
    /* Modal total box */
    .modal-total {
        padding: 16px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        margin: 16px 0 !important;
    }
    
    /* Instructions box in modal */
    .modal-body > div[style*="background: #f9f9f9"],
    .modal-body > div[style*="background:#f9f9f9"] {
        padding: 16px !important;
        border-radius: 12px !important;
        font-size: 13px !important;
    }
    
    /* SweetAlert improvements */
    .swal2-popup {
        border-radius: 16px !important;
        padding: 24px !important;
    }
    
    .swal2-title {
        font-size: 20px !important;
        font-weight: 800 !important;
    }
    
    .swal2-confirm, .swal2-cancel {
        padding: 12px 24px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
        min-height: 44px;
    }
}
    }
}
    .checkbox-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .checkbox-group label {
        padding: 10px 16px !important;
        font-size: 15px !important;
        min-height: 44px;
        background: #f8fafc;
        border-radius: 10px;
        border: 1.5px solid #e2e8f0;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .checkbox-group label:has(input:checked) {
        background: #eef2ff;
        border-color: #4f46e5;
        color: #4f46e5;
        font-weight: 700;
    }
    
    /* Modal table inputs */
    .modal-table input,
    .modal-table select {
        padding: 12px 10px !important;
        font-size: 16px !important;
        min-height: 44px;
        border-radius: 8px !important;
        width: 100% !important;
    }
    
    .modal-table td {
        padding: 6px 4px !important;
    }
    
    /* Modal total box */
    .modal-total {
        padding: 16px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        margin: 16px 0 !important;
    }
    
    /* Instructions box in modal */
    .modal-body > div[style*="background: #f9f9f9"],
    .modal-body > div[style*="background:#f9f9f9"] {
        padding: 16px !important;
        border-radius: 12px !important;
        font-size: 13px !important;
    }
    
    /* SweetAlert improvements */
    .swal2-popup {
        border-radius: 16px !important;
        padding: 24px !important;
    }
    
    .swal2-title {
        font-size: 20px !important;
        font-weight: 800 !important;
    }
    
    .swal2-confirm, .swal2-cancel {
        padding: 12px 24px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
        min-height: 44px;
    }
}

/* ========================================================
   ADMIN REDESIGN NEW SYSTEM (VIOLET/PURPLE THEME)
   ======================================================== */

.admin-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.admin-header-gradient {
    background: linear-gradient(135deg, #6a1b9a 0%, #8e24aa 40%, #ab47bc 100%) !important;
    box-shadow: 0 4px 20px rgba(106, 27, 154, 0.25) !important;
}

/* Modals */
.admin-modal .modal-content {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border: none !important;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal .modal-header {
    background: linear-gradient(135deg, #6a1b9a 0%, #8e24aa 100%) !important;
    color: white !important;
    padding: 18px 24px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none !important;
}

.admin-modal .modal-header h2 {
    color: white !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    letter-spacing: -0.5px;
}

.admin-modal .modal-header .close {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.admin-modal .modal-header .close:hover {
    color: white !important;
}

.admin-modal .modal-body {
    padding: 24px !important;
}

/* Forms */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-label {
    display: block;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.admin-input, 
.admin-select, 
.admin-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: all 0.2s ease;
}

.admin-input:focus, 
.admin-select:focus, 
.admin-textarea:focus {
    border-color: #8e24aa;
    background: white;
    box-shadow: 0 0 0 3px rgba(142, 36, 170, 0.12);
}

.admin-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.admin-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-btn-primary {
    background: linear-gradient(135deg, #6a1b9a 0%, #8e24aa 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.2);
}

.admin-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(106, 27, 154, 0.3);
}

.admin-btn-primary:active {
    transform: translateY(0);
}

.admin-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.admin-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.admin-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.admin-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.admin-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.admin-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

/* Filter Bars */
.admin-filter-bar {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-filter-bar select,
.admin-filter-bar input {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    background: #f8fafc;
    min-height: 44px;
    transition: all 0.2s;
}

.admin-filter-bar select:focus,
.admin-filter-bar input:focus {
    border-color: #8e24aa;
    background: white;
    box-shadow: 0 0 0 3px rgba(142, 36, 170, 0.12);
}

/* Scoped admin table enhancements */
.admin-table-wrapper {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 20px;
}

.admin-table-wrapper .table-container {
    border-radius: 0;
    box-shadow: none;
}

.admin-table-wrapper .admin-table {
    box-shadow: none;
}

.admin-table-wrapper .admin-table thead {
    background: #f8fafc;
}

.admin-table-wrapper .admin-table th {
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 14px;
}
