/* =========================================
   1. VARIABLES & RESET (কালার এবং ডিফল্ট সেটিং)
   ========================================= */
:root {
    --mx-bg: #f4f7f6;
    --mx-card-bg: #ffffff;
    --mx-text: #2c3e50;
    --mx-primary: #007bff;
    --mx-danger: #ff4757;
    --mx-success: #2ed573;
    --mx-warning: #ffa502;
    --mx-pink: #ff6b81;
    --mx-dark: #2f3542;
}

/* Strict Box Sizing for Mobile Fixes */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0; 
    padding: 0;
    background: var(--mx-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--mx-text);
    overflow-x: hidden;
}

body.mx-canvas-mode {
    min-height: 100vh !important;
}

.mx-app-wrapper {
    position: relative; 
    width: 100%; 
    min-height: 100vh;
    display: flex; 
    flex-direction: column;
}

.mx-app-wrapper.dark-mode { 
    --mx-bg: #121212; 
    --mx-card-bg: #1e272e; 
    --mx-text: #dcdde1; 
}

.mx-theme-switch { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    z-index: 100; 
}

.mx-theme-switch button { 
    background: rgba(255,255,255,0.2); 
    border: none; 
    color: white; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    font-size: 18px; 
    cursor: pointer; 
    backdrop-filter: blur(5px); 
}

/* =========================================
   2. AUTH SCREEN (লগিন ও রেজিস্ট্রেশন)
   ========================================= */
.mx-auth-screen { 
    width: 100%; 
    min-height: 100vh; 
    overflow-y: auto; 
    display: block;
    background: linear-gradient(135deg, var(--mx-primary), var(--mx-pink), var(--mx-success));
    background-size: 300% 300%; 
    animation: gradientBG 15s ease infinite;
    padding: 30px 15px 80px 15px;
}

.mx-auth-inner { 
    background: var(--mx-card-bg); 
    width: 100%; 
    max-width: 400px; 
    margin: 5vh auto 40px auto; 
    padding: 40px 20px; 
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.mx-logo-area { text-align: center; margin-bottom: 25px; }
.mx-logo-icon { width: 70px; height: 70px; margin: 0 auto 15px; border-radius: 50%; background: linear-gradient(135deg, var(--mx-primary), var(--mx-pink)); color: white; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(0,0,0,0.2); font-size: 30px; }
.mx-logo-area h2 { margin: 0; font-size: 24px; font-weight: 800; color: var(--mx-text); }
.mx-logo-area p { margin: 5px 0 0; color: #7f8fa6; font-size: 14px; }

.mx-auth-tabs { display: flex; width: 100%; background: #f1f2f6; border-radius: 12px; padding: 5px; margin-bottom: 25px; }
.dark-mode .mx-auth-tabs { background: #2f3542; }
.mx-auth-tabs button { flex: 1; padding: 12px; border: none; background: transparent; font-weight: bold; color: #747d8c; cursor: pointer; border-radius: 8px; font-size: 15px; transition: 0.3s; }
.mx-auth-tabs button.active { background: white; color: var(--mx-primary); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.dark-mode .mx-auth-tabs button.active { background: #57606f; color: #fff; }

.mx-form { width: 100%; display: none; flex-direction: column; gap: 16px; }
.mx-form.active-form { display: flex; animation: fadeIn 0.4s ease; }

.input-with-icon { position: relative; width: 100%; }
.input-with-icon i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--mx-primary); z-index: 2; font-size: 18px; }
.input-with-icon input, .input-with-icon select { width: 100%; padding: 14px 14px 14px 45px; border: 2px solid transparent; border-radius: 12px; font-size: 15px; background: #f1f2f6; color: var(--mx-text); transition: 0.3s; outline: none; }
.dark-mode .input-with-icon input, .dark-mode .input-with-icon select { background: #2f3542; border-color: transparent; color: #fff; }
.input-with-icon input:focus { border-color: var(--mx-primary); background: transparent; }

.mx-gradient-btn { background: linear-gradient(90deg, var(--mx-primary), var(--mx-pink)); color: white; border: none; border-radius: 12px; font-weight: bold; cursor: pointer; font-size: 16px; padding: 15px; width: 100%; box-shadow: 0 8px 20px rgba(255, 107, 129, 0.4); transition: 0.3s; text-transform: uppercase; letter-spacing: 1px; }
.mx-gradient-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(255, 107, 129, 0.6); }

/* =========================================
   3. SMART DASHBOARD UI (ড্যাশবোর্ড - হারানো অংশটি)
   ========================================= */
.mx-dashboard-container { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    width: 100%; 
    max-width: 600px; 
    margin: 0 auto; 
    background: var(--mx-bg); 
    box-shadow: 0 0 40px rgba(0,0,0,0.05); 
}

.mx-fixed-top-area { 
    flex-shrink: 0; 
    width: 100%; 
    z-index: 10; 
}

.mx-slider-container { 
    width: 100%; 
    height: 200px; 
    overflow: hidden; 
    position: relative; 
    border-radius: 0 0 30px 30px; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
}

.mx-slide { 
    width: 100%; 
    height: 100%; 
    background-size: cover; 
    background-position: center; 
    position: absolute; 
    top: 0; 
    left: 0; 
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); 
}

.mx-notice-board { 
    background: var(--mx-card-bg); 
    margin: -20px 20px 15px; 
    padding: 12px 15px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); 
    position: relative; 
    z-index: 20; 
    border-left: 5px solid var(--mx-warning); 
    font-size: 14px; 
    font-weight: 500; 
}

.notice-icon { 
    margin-right: 15px; 
    color: var(--mx-warning); 
    font-size: 18px; 
}

.mx-user-card { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--mx-card-bg); 
    padding: 15px 20px; 
    margin: 0 20px 20px; 
    border-radius: 16px; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.05); 
}

.user-details { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.user-avatar { 
    width: 45px; 
    height: 45px; 
    background: linear-gradient(135deg, var(--mx-primary), var(--mx-success)); 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-size: 20px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
}

.user-name { 
    font-size: 16px; 
    color: var(--mx-text); 
}

.user-actions button { 
    background: #f1f2f6; 
    border: none; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    color: var(--mx-dark); 
    cursor: pointer; 
    font-size: 16px; 
    margin-left: 5px; 
    transition: 0.3s; 
}

.dark-mode .user-actions button { 
    background: #2f3542; 
    color: white; 
}

.user-actions button:hover { 
    background: var(--mx-danger); 
    color: white; 
}

.mx-scrollable-menu-area { 
    flex-grow: 1; 
    padding: 0 10px; 
}

.mx-grid-menu { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
    padding: 10px; 
}

@media(max-width: 400px) { 
    .mx-grid-menu { 
        grid-template-columns: repeat(2, 1fr); 
    } 
}

.mx-grid-item { 
    background: var(--mx-card-bg); 
    padding: 20px 10px; 
    border-radius: 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    cursor: pointer; 
    box-shadow: 0 6px 15px rgba(0,0,0,0.04); 
    transition: 0.3s; 
}

.mx-grid-item:active { 
    transform: scale(0.95); 
}

.mx-icon-circle { 
    width: 55px; 
    height: 55px; 
    background: rgba(0, 123, 255, 0.08); 
    border-radius: 16px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 26px; 
    margin-bottom: 12px; 
}

.dark-mode .mx-icon-circle { 
    background: rgba(255, 255, 255, 0.05); 
}

.mx-item-title { 
    font-size: 13px; 
    font-weight: 600; 
    color: var(--mx-text); 
}

/* =========================================
   4. CUSTOM MODALS & ICONS (কাস্টম মডাল ও আইকন)
   ========================================= */
.mx-modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
    z-index: 100000; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(5px); 
}

.mx-modal-box { 
    background: var(--mx-card-bg); 
    width: 90%; 
    max-width: 400px; 
    border-radius: 20px; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.3); 
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    max-height: 90vh;
}

.mx-modal-header { 
    padding: 20px; 
    font-weight: 800; 
    font-size: 18px; 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.mx-modal-body { 
    padding: 30px 20px; 
    text-align: center; 
    font-size: 15px; 
    color: var(--mx-text); 
    overflow-y: auto; 
}

.mx-modal-footer { 
    padding: 15px 20px; 
    display: flex; 
    justify-content: flex-end; 
    gap: 10px; 
    background: rgba(0,0,0,0.02); 
    border-top: 1px solid rgba(0,0,0,0.05); 
}

.mx-modal-close { 
    cursor: pointer; 
    color: var(--mx-danger); 
    background: rgba(255, 71, 87, 0.1); 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
    flex-shrink: 0;
}

/* Icon Grid */
.mx-icon-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    max-height: 200px; 
    overflow-y: auto; 
    padding: 10px; 
    border: 1px solid #eee; 
    background: #fafafa; 
    border-radius: 8px; 
    margin-top: 10px; 
}

.dark-mode .mx-icon-grid { 
    background: #2f3542; 
    border-color: #555; 
}

.mx-icon-option { 
    width: 45px; 
    height: 45px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border: 1px solid #ddd; 
    cursor: pointer; 
    border-radius: 8px; 
    background: #fff; 
    font-size: 18px; 
    transition: 0.2s; 
}

.dark-mode .mx-icon-option { 
    background: #1e272e; 
    border-color: #555; 
}

.mx-icon-option:hover, 
.mx-icon-option.selected { 
    background: var(--mx-primary); 
    color: white; 
    border-color: var(--mx-primary); 
}

/* =========================================
   5. ADMIN PANEL (MOBILE RESPONSIVE BREAKS)
   ========================================= */
.mx-worker-panel { 
    background: #ffffff; 
    padding: 15px; 
    border-radius: 12px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.08); 
    margin: 10px auto 50px auto; 
    max-width: 1000px; 
    width: 95%; 
}

.mx-panel-header { 
    margin-bottom: 20px; 
    border-bottom: 2px solid #f0f0f0; 
    padding-bottom: 15px; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    justify-content: space-between; 
    align-items: center; 
}

.mx-panel-header h2 { margin: 0; font-size: 20px; color: var(--mx-dark); }

.mx-worker-tabs { display: flex; gap: 5px; margin-bottom: 20px; flex-wrap: wrap; border-bottom: 2px solid #eee; }
.w-tab { padding: 10px 12px; background: #f8f9fa; border: 1px solid #ddd; border-bottom: none; cursor: pointer; border-radius: 8px 8px 0 0; font-weight: 600; color: #555; transition: 0.3s; flex: 1 1 auto; text-align: center; font-size: 13px; white-space: nowrap; }
.w-tab.active { background: var(--mx-primary); color: white; border-color: var(--mx-primary); }
.w-section { display: none; width: 100%; }
.w-section.active { display: block; animation: fadeIn 0.3s; }

.mx-card { background: #fff; border: 1px solid #eee; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); width: 100%; }
.mx-card-header { background: #fafafa; padding: 15px; font-weight: bold; border-bottom: 1px solid #eee; border-radius: 8px 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 600px) { .mx-card-header { flex-direction: row; justify-content: space-between; align-items: center; } }
.mx-card-body { padding: 15px; width: 100%; }

.mx-input, .mx-select { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; transition: 0.3s; }
.mx-input:focus { border-color: var(--mx-primary); box-shadow: 0 0 5px rgba(0,123,255,0.2); }
.dark-mode .mx-worker-panel .mx-input { background: #fff; color: #333; }

/* 🌟 ACTION BAR BREAK SYSTEM (মোবাইল ফ্রেন্ডলি ಬ্রেক) 🌟 */
.mx-action-bar { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; align-items: center; }
.mx-action-bar .mx-input { flex: 1 1 180px; min-width: 0; }
.mx-action-bar .mx-btn { flex: 0 0 auto; white-space: nowrap; }

/* 🌟 TABLE SCROLL SYSTEM (টেবিল স্ক্রলিং) 🌟 */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #eee; border-radius: 8px; display: block; background: #fff; }
.mx-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.mx-table th, .mx-table td { padding: 12px 15px; border-bottom: 1px solid #eee; text-align: left; font-size: 13px; vertical-align: middle; }
.mx-table th { background: #f8f9fa; color: #333; font-weight: 700; white-space: nowrap; }

.mx-btn { padding: 10px 15px; border: none; border-radius: 6px; cursor: pointer; color: white; font-size: 13px; font-weight: bold; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: 0.2s; white-space: nowrap; }
.btn-save { background: var(--mx-primary); }
.btn-danger { background: var(--mx-danger); }
.btn-warn { background: var(--mx-warning); color: #fff; }
.btn-success { background: var(--mx-success); }
.mx-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.mx-status-badge { font-size: 11px; padding: 5px 10px; border-radius: 20px; text-transform: uppercase; font-weight: bold; white-space: nowrap;}
.status-active { background: rgba(46, 213, 115, 0.2); color: #2ed573; }
.status-pending { background: rgba(255, 165, 2, 0.2); color: #ffa502; }
.status-locked { background: rgba(255, 71, 87, 0.2); color: #ff4757; }

.mx-role-checkboxes { display: flex; flex-wrap: wrap; gap: 15px; }
.mx-role-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }