@import url('https://fonts.googleapis.com/css2?family=Anek+Bangla:wght@400;500;600;700;800&display=swap');

:root {
    --blue-900: #0B2E59;
    --blue-800: #123B72;
    --blue-700: #1B4F8C;
    --blue-600: #2563A8;
    --blue-500: #2F7DD1;
    --blue-100: #E8F1FC;
    --blue-50:  #F4F8FE;

    --text-dark: #16233A;
    --text-muted: #5B6B85;
    --border-color: #DCE6F5;

    --success: #1F9D55;
    --success-bg: #E7F9EE;
    --danger: #E03131;
    --danger-bg: #FDECEC;

    --sidebar-width: 270px;
    --radius: 14px;
    --shadow: 0 6px 20px rgba(18, 59, 114, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Anek Bangla', sans-serif;
    font-size: 17px;
    background: var(--blue-50);
    color: var(--text-dark);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== LAYOUT ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--blue-900), var(--blue-800));
    color: #fff;
    padding: 26px 18px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 26px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .3px;
}

.sidebar .brand .dot {
    width: 12px; height: 12px;
    background: var(--blue-500);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(47,125,209,0.25);
}

.nav-section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,0.5);
    margin: 22px 10px 10px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 16.5px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 4px;
    transition: background .15s ease, color .15s ease;
}

.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }

.nav-link.active {
    background: var(--blue-500);
    color: #fff;
    box-shadow: 0 4px 14px rgba(47,125,209,0.45);
}

.nav-link .icon { font-size: 19px; width: 22px; text-align: center; }

/* ক্যাটেগরি ড্রপডাউন লিস্ট (সাইডবার) */
.category-tree { margin-left: 8px; margin-top: 2px; }
.category-tree .cat-item {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 15.5px;
    color: rgba(255,255,255,0.75);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.category-tree .cat-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.category-tree .cat-count {
    background: rgba(255,255,255,0.12);
    padding: 1px 9px;
    border-radius: 20px;
    font-size: 12.5px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 34px 60px;
    width: calc(100% - var(--sidebar-width));
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.topbar h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--blue-900);
}

.topbar .subtitle { color: var(--text-muted); font-size: 15px; margin-top: 2px; }

/* ===== CARDS ===== */
.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* ===== DASHBOARD STAT CARDS ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: var(--blue-500);
}

.stat-card .label {
    font-size: 14.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 30px;
    font-weight: 800;
    color: var(--blue-900);
}

.stat-card .icon-badge {
    position: absolute;
    right: 18px; top: 20px;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--blue-100);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: var(--blue-600);
}

/* ===== FORM ELEMENTS ===== */
label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

input[type=text], input[type=tel], input[type=number], input[type=search],
textarea, select {
    width: 100%;
    font-family: 'Anek Bangla', sans-serif;
    font-size: 16.5px;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-dark);
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(47,125,209,0.15);
}

textarea { resize: vertical; min-height: 140px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform .1s ease, box-shadow .15s ease;
}

.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 4px 14px rgba(37,99,168,0.35); }
.btn-primary:hover { background: var(--blue-700); }
.btn-outline { background: #fff; border: 1.5px solid var(--blue-500); color: var(--blue-600); }
.btn-outline:hover { background: var(--blue-100); }

/* ===== TABLE ===== */
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
}
tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
}
tbody tr:hover { background: var(--blue-50); }

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
}
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-due { background: var(--danger-bg); color: var(--danger); }

/* ===== MESSAGE COMPOSER ===== */
.composer-meta {
    display: flex;
    gap: 22px;
    margin-top: 10px;
    font-size: 15px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.composer-meta b { color: var(--blue-700); font-size: 16px; }