/* ============================================================
   ১. ভেরিয়েবল ও মেইন কালার সেটিংস
   (এখানে কালার পাল্টালে পুরো অ্যাপের কালার পাল্টে যাবে)
   ============================================================ */
:root {
    /* মেইন ব্র্যান্ড কালার (নীল) - হেডার ও বাটনের জন্য */
    --app-primary: #0284c7;       
    --app-primary-dark: #0369a1;
    
    /* হালকা নীল (আইকনের ব্যাকগ্রাউন্ডের জন্য) */
    --app-primary-soft: #e0f2fe;
    
    /* পেজের ব্যাকগ্রাউন্ড কালার (সাদা বা হালকা ধূসর) */
    --app-bg: #f0f9ff;            
    
    /* কার্ড বা বক্সের কালার (সাদা) */
    --card-bg: #ffffff;
    
    /* ফন্ট বা লেখার কালার */
    --text-main: #0f172a;  /* প্রধান লেখা (কালো) */
    --text-muted: #64748b; /* হালকা লেখা (ধূসর) */
    
    /* সাইজ সেটিংস */
    --header-height: 60px;       /* হেডারের উচ্চতা */
    --bottom-nav-height: 70px;   /* নিচের মেনুর উচ্চতা */
    --border-radius: 12px;       /* বক্সের কোণা কতটা গোল হবে */
}

/* বেসিক রিসেট */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }


/* =========================================
   নতুন কাস্টমার কার্ড ডিজাইন (New Card Design)
   ========================================= */

/* মেইন কার্ড কন্টেইনার */
.customer-card {
    display: block; /* ফ্লেক্সবক্সের ঝামেলা এড়াতে ব্লক */
    background: #ffffff;
    border-radius: 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

/* কার্ডের উপরের অংশ (লিংক) */
.card-top-link {
    display: flex; 
    align-items: center; 
    padding: 15px; 
    text-decoration: none; 
    color: inherit;
    width: 100%;
    transition: background 0.2s;
}
.card-top-link:active {
    background: #f8fafc; 
}

/* কাস্টমার ইনফো টেক্সট */
.customer-info {
    flex: 1;
    display: flex; 
    flex-direction: column; 
    gap: 4px;
}

/* কার্ডের ফুটার (বাটন সেকশন) */
.card-action-footer {
    background: #f8fafc;
    padding: 10px 15px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end; /* বাটন ডানপাশে রাখবে */
    gap: 10px;
}

/* অ্যাকশন বাটন ডিজাইন */
.btn-action {
    font-size: 0.75rem; 
    font-weight: 600; 
    padding: 6px 12px; 
    border-radius: 20px; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 5px;
    transition: transform 0.1s;
}
.btn-action:active {
    transform: scale(0.95);
}

/* বাটন কালার */
.btn-pdf { 
    color: #dc2626; 
    background: #fee2e2; 
    border: 1px solid #fecaca; 
}
.btn-excel { 
    color: #166534; 
    background: #dcfce7; 
    border: 1px solid #86efac; 
}

/* অ্যাড বাটন (হেডারের জন্য) */
.btn-add-new {
    background: var(--app-primary); 
    color: white; 
    padding: 8px 15px; 
    border-radius: 25px; 
    text-decoration: none; 
    font-size: 0.85rem; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

/* ============================================================
   ২. বডি এবং স্ক্রল সেটিংস
   ============================================================ */
body {
    margin: 0; padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    
    /* বডির ব্যাকগ্রাউন্ড নীল রাখা হয়েছে যাতে উপরের রাউন্ড অংশে নীল দেখা যায় */
    background: var(--app-primary); 
    
    /* কন্টেন্ট যাতে হেডারের নিচে ঢাকা না পড়ে */
    padding-top: var(--header-height); 
    padding-bottom: 0;
}

a { text-decoration: none; color: inherit; }

/* ============================================================
   ৩. হেডার ডিজাইন (উপরের নীল বার ও লোগো বক্স)
   ============================================================ */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--app-primary); /* নীল কালার */
    color: #ffffff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 15px;
    z-index: 1000;
    box-shadow: none; border: none; /* ফ্ল্যাট ডিজাইন */
}

/* লোগো এবং নামের চারপাশের সাদা বর্ডার বক্স */
.header-brand-box {
    display: flex; align-items: center;
    gap: 8px; /* লোগো আর লেখার মাঝখানের গ্যাপ */
    padding: 5px 12px; /* বক্সের ভেতরের জায়গা */
    
    /* সাদা বর্ডার লাইন (1.5px মোটা) */
    border: 1.5px solid #ffffff; 
    border-radius: 8px; /* বক্সের কোণা হালকা গোল */
    
    text-decoration: none;
    background: transparent; 
}

/* লোগো ছবির সাইজ */
.logo-img {
    width: 24px; height: 24px;
    object-fit: cover;
    border-radius: 4px;
}

/* অ্যাপের নাম */
.header-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #ffffff;
}

/* ডানপাশের আইকন বাটনসমূহ */
.header-actions { display: flex; gap: 8px; }

.header-icon {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.2); /* হালকা ট্রান্সপারেন্ট সাদা */
    color: #ffffff; border: none; cursor: pointer; font-size: 1.1rem;
}

/* ============================================================
   ৪. মেইন কন্টেইনার (সাদা পেপারের মতো অংশ)
   ============================================================ */
.site-main {
    background: var(--app-bg); /* পেজের সাদা রঙ */
    
    /* পেজের উপরের দুই কোণা গোল (30px) - টালি খাতা স্টাইল */
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    
    /* ভেতরের স্পেস */
    padding: 25px 15px calc(var(--bottom-nav-height) + 20px) 15px;
    
    min-height: calc(100vh - var(--header-height));
    margin-top: 10px; /* হেডারের নিচে একটু নীল অংশ দেখানোর জন্য */
    
    position: relative; z-index: 10;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05); /* হালকা শ্যাডো */
}

.container { max-width: 100%; }

/* ============================================================
   ৫. ড্যাশবোর্ড মেনু গ্রিড (আইকন বাটনসমূহ)
   ============================================================ */
.app-menu-grid {
    display: grid;
    /* এক লাইনে ৪টা বাটন থাকবে */
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.app-menu-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; color: var(--text-main);
    font-size: 0.8rem; font-weight: 500;
}

/* আইকনের চারপাশের বক্স */
.app-menu-icon {
    width: 50px; height: 50px;
    border-radius: 15px; /* আইকন বক্সের কোণা গোল */
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background: #ffffff; /* আইকনের ব্যাকগ্রাউন্ড সাদা */
    transition: transform 0.1s;
}

/* ক্লিক করলে একটু ছোট হবে (এনিমেশন) */
.app-menu-item:active .app-menu-icon { transform: scale(0.95); }

/* আইকনের কালার ক্লাস */
.icon-blue { color: var(--app-primary); background: var(--app-primary-soft); }
.icon-green { color: #16a34a; background: #dcfce7; }
.icon-red { color: #dc2626; background: #fee2e2; }

/* ============================================================
   ৬. সামারি কার্ড (বিক্রি ও বাকি হিসাব)
   ============================================================ */
.summary-card-main {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--app-primary-soft);
    margin-bottom: 20px;
}

.summary-box {
    flex: 1; text-align: center;
    display: flex; flex-direction: column; gap: 5px;
}

.summ-amount { font-size: 1.4rem; font-weight: 800; }
.summ-label { font-size: 0.9rem; color: var(--text-muted); }

/* মাঝখানের দাগ */
.summ-divider { width: 1px; height: 40px; background: #e2e8f0; }

.text-green { color: #16a34a; }
.text-red { color: #dc2626; }

/* ============================================================
   ৭. কাস্টমার লিস্ট এবং সার্চ বার ডিজাইন
   ============================================================ */
.search-box { position: relative; width: 100%; margin-bottom: 20px; }

.search-box input {
    width: 100%;
    padding: 14px 15px 14px 45px; /* বামে আইকনের জন্য জায়গা রাখা হয়েছে */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff; outline: none;
    font-size: 1rem; color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.search-icon {
    position: absolute; left: 15px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8; font-size: 1.1rem;
}

/* কাস্টমার বা আইটেম কার্ড */
.customer-item {
    display: flex; align-items: center;
    background: #ffffff;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 12px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}

/* নামের প্রথম অক্ষরের গোল লোগো */
.avatar-circle {
    width: 50px; height: 50px; min-width: 50px;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700;
    margin-right: 15px; text-transform: uppercase;
}

.customer-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.c-name { font-weight: 700; color: var(--text-main); font-size: 1.05rem; }
.c-mobile { font-size: 0.9rem; color: var(--text-muted); }
.customer-action { color: #cbd5e1; font-size: 1rem; }

/* ============================================================
   ৮. বটম নেভিগেশন (নিচের মেনু বার)
   ============================================================ */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: var(--card-bg);
    display: flex; justify-content: space-around; align-items: center;
    
    /* উপরের দুই কোণা গোল */
    border-top-left-radius: 20px; 
    border-top-right-radius: 20px;
    
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    z-index: 999;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; color: var(--text-muted);
    font-size: 0.75rem; gap: 4px;
    text-decoration: none;
}
.nav-item i { font-size: 1.4rem; margin-bottom: 2px; }

/* একটিভ মেনু কালার */
.nav-item.active { color: var(--app-primary); font-weight: 700; }

/* মাঝখানের বড় ফ্লোটিং বাটন */
.nav-item-fab { transform: translateY(-25px); } /* উপরে উঠানো */

.fab-btn {
    width: 58px; height: 58px;
    background: var(--app-primary); /* নীল কালার */
    border-radius: 50%; /* গোল */
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.6rem;
    
    /* বাটনের চারপাশে সাদা বর্ডার (কাটা ইফেক্ট) */
    border: 5px solid var(--app-bg); 
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
}

/* ============================================================
   ৯. ডার্ক মোড (অন্ধকার থিম)
   ============================================================ */
html.dark body { background: var(--app-bg); }

html.dark {
    --app-bg: #0f172a; 
    --card-bg: #1e293b;
    --text-main: #f1f5f9; 
    --text-muted: #94a3b8;
    --app-primary-soft: #1e3a8a;
}

html.dark .header-icon { background: rgba(255,255,255,0.1); }
html.dark .fab-btn { border-color: #1e293b; } /* ডার্ক মোডে বর্ডার কালার ফিক্স */
html.dark .summary-card-main { background: var(--card-bg); border-color: #334155; }
html.dark .customer-item { background: var(--card-bg); border-color: #334155; }

/* ================= DAILY REPORT DESIGN (Tally Style) ================= */

/* ১. উপরের সামারি বার ডিজাইন */
.summary-bars {
    margin-bottom: 25px;
}

.summ-bar-item {
    padding: 12px 15px;
    margin-bottom: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* আইকন ও টেক্সট দুই প্রান্তে রাখার জন্য */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    
    /* উপরের মোটা বর্ডার */
    border-top-width: 6px; 
    border-top-style: solid;
    background: #fff; /* ডিফল্ট সাদা */
}

/* বার কালার স্কিম */
.bar-green {
    background: #ecfdf5;
    border-top-color: #10b981;
}
.bar-red {
    background: #fef2f2;
    border-top-color: #ef4444;
}

/* আইকন ও টেক্সট */
.bar-left {
    display: flex; align-items: center; gap: 15px;
}
.bar-icon { font-size: 1.4rem; }
.bar-green .bar-icon { color: #059669; }
.bar-red .bar-icon { color: #dc2626; }

.bar-text {
    display: flex; flex-direction: column;
}
.bar-amount {
    font-size: 1.25rem; font-weight: 800;
}
.bar-green .bar-amount { color: #047857; }
.bar-red .bar-amount { color: #b91c1c; }

.bar-label { font-size: 0.85rem; color: #64748b; font-weight: 500; }

/* ২. ট্রানজেকশন লিস্ট ডিজাইন */
.transaction-list { margin-top: 10px; }
.t-item {
    display: flex; align-items: center;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.t-icon-box {
    width: 45px; height: 45px; min-width: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px;
    font-size: 1.2rem;
}
.t-info { flex: 1; }
.t-name { font-weight: 700; color: #0f172a; font-size: 1rem; display: block; }
.t-time { font-size: 0.8rem; color: #94a3b8; }

.t-amount-box { text-align: right; }
.t-amount { font-weight: 700; font-size: 1rem; display: block; }
.t-type { font-size: 0.75rem; color: #94a3b8; }


/* =========================================
   ADMIN DASHBOARD COMPLETE STYLES
   ========================================= */

/* --- ১. স্লিম ড্যাশবোর্ড কার্ড (Horizontal) --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* দুই কলাম */
    gap: 10px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    border: 1px solid #f1f5f9;
    display: flex; 
    align-items: center; 
    justify-content: flex-start;
    gap: 12px;
}

.card-icon-box {
    width: 38px; height: 38px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.card-info { text-align: left; }
.card-info h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: #1e293b; line-height: 1.2; }
.card-info p { margin: 0; font-size: 0.7rem; color: #64748b; font-weight: 500; }

/* কার্ড কালার থিম */
.theme-blue { color: #0284c7; background: rgba(2, 132, 199, 0.1); }
.theme-green { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.theme-orange { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.theme-purple { color: #7c3aed; background: rgba(139, 92, 246, 0.1); }
.theme-red { color: #ef4444; background: rgba(239, 68, 68, 0.1); }


/* --- ২. ইউজার লিস্ট (যেটা ভেঙে গিয়েছিল - ফিক্সড) --- */
.recent-user-card {
    background: #fff; 
    border-radius: 12px; 
    padding: 15px; 
    margin-bottom: 12px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
    border: 1px solid #f1f5f9;
    
    /* এই Flex প্রপার্টিগুলোর কারণেই ডিজাইন সুন্দর হবে */
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.user-avatar {
    width: 45px; height: 45px; 
    background: #f1f5f9; 
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center; 
    color: #64748b; 
    font-weight: 700; 
    font-size: 1.2rem;
    border: 1px solid #e2e8f0;
    flex-shrink: 0; /* অবতার যাতে চ্যাপ্টা না হয় */
}

.user-details {
    flex: 1; /* নাম ও নাম্বার মাঝখানের জায়গা নিবে */
    text-align: left; /* বাম পাশে এলাইনমেন্ট */
}
.user-details h5 { 
    margin: 0 0 3px 0; 
    font-size: 1rem; 
    font-weight: 600; 
    color: #1e293b; 
}
.user-details p { 
    margin: 0; 
    font-size: 0.85rem; 
    color: #64748b; 
}

.user-status { 
    font-size: 0.75rem; 
    padding: 6px 12px; 
    border-radius: 20px; 
    background: rgba(2, 132, 199, 0.1); 
    color: #0284c7; 
    font-weight: 600;
    white-space: nowrap;
}


/* --- ৩. এডমিন ফুটার মেনু --- */
body { padding-bottom: 80px; }
.admin-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #ffffff; height: 60px;
    display: flex; justify-content: space-around; align-items: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05); border-top: 1px solid #f1f5f9;
    z-index: 1000;
}
.nav-item { text-decoration: none; color: #94a3b8; text-align: center; font-size: 0.7rem; flex: 1; transition: 0.3s; }
.nav-item .icon { font-size: 1.2rem; margin-bottom: 2px; color: #64748b; }
.nav-item.active { color: #0284c7; font-weight: 700; }
.nav-item.active .icon { color: #0284c7; }
.fab-wrapper { position: relative; top: -20px; }
.fab-button {
    width: 50px; height: 50px; background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.4rem; border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4); margin: 0 auto;
}