
/* =========================================================
   LEGAL MANAGEMENT SYSTEM - DASHBOARD CSS
   Header, Menu & Login Form excluded
   ========================================================= */

:root {
    --primary: #263f67;
    --primary-dark: #192d4b;
    --primary-light: #eaf0f8;
    --background: #f4f7fb;
    --surface: #ffffff;
    --text: #243247;
    --muted: #718096;
    --border: #e3e9f1;
    --success: #168653;
    --danger: #d94242;
    --shadow: 0 5px 20px rgba(32, 52, 83, 0.07);
    --radius: 12px;
}

/* =========================
   MAIN CONTENT
   ========================= */

.main-content {
    flex: 1;
    min-width: 0;
    padding: 26px 28px;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    box-sizing: border-box;
}

.main-content *,
.main-content *::before,
.main-content *::after {
    box-sizing: border-box;
}

/* =========================
   PAGE TITLE
   ========================= */

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.page-title-row h1 {
    margin: 0 0 5px;
    color: var(--primary-dark);
    font-size: 27px;
    font-weight: 750;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.page-title-row p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.dashboard-date {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--primary);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(32, 52, 83, 0.03);
}
/* =========================================
   GUEST PICTURE BOX
   ========================================= */

.guest-picture-container {
    width: 100%;
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    box-sizing: border-box;
    background: #f4f6fa;
}

.guest-picture-box {
    width: 100%;
    max-width: 1000px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e1e7f0;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(40, 57, 87, 0.10);
}

.guest-picture {
    display: block;
    width: 100%;
    max-width: 420px;
    max-height: 420px;
    height: auto;
    object-fit: contain;
}
/* =========================
   DASHBOARD SECTIONS
   ========================= */

.dashboard-section {
    margin-bottom: 28px;
    min-width: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 0 17px;
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.4;
}

.section-title-bar {
    display: inline-block;
    width: 5px;
    height: 23px;
    flex-shrink: 0;
    border-radius: 5px;
    background: var(--primary);
}

/* =========================
   CASE SUMMARY CARDS
   ========================= */

.case-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.summary-card {
    position: relative;
    min-width: 0;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
}

.summary-card.total-box::before {
    background: #3b527c;
}

.summary-card.running-box::before {
    background: #168653;
}

.summary-card.dismiss-box::before {
    background: #d94242;
}

.summary-card:hover,
.finance-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(32, 52, 83, 0.11);
}

.summary-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.summary-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

.summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border-radius: 11px;
    background: var(--primary-light);
    font-size: 21px;
}

.total-box .summary-icon {
    background: #eaf0f8;
}

.running-box .summary-icon {
    background: #e7f7ee;
}

.dismiss-box .summary-icon {
    background: #fff0f0;
}

.summary-number {
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: clamp(27px, 3vw, 35px);
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.running-box .summary-number {
    color: var(--success);
}

.dismiss-box .summary-number {
    color: var(--danger);
}

.summary-caption {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* =========================
   FINANCIAL SUMMARY
   ========================= */

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.finance-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.finance-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 19px;
    color: #536176;
    font-size: 13px;
    font-weight: 700;
}

.finance-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 11px;
    background: var(--primary-light);
    font-size: 21px;
}

.expense-card .finance-icon {
    background: #fff0e8;
}

.receipt-card .finance-icon {
    background: #eaf0ff;
}

.recovery-card .finance-icon {
    background: #e6f7ee;
}

.finance-amount {
    margin-bottom: 9px;
    color: var(--primary-dark);
    font-size: clamp(19px, 2vw, 27px);
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.expense-card .finance-amount {
    color: #c65b22;
}

.receipt-card .finance-amount {
    color: #3b527c;
}

.recovery-card .finance-amount {
    color: var(--success);
}

.finance-caption {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* =========================
   FINANCIAL CHART
   ========================= */

.finance-chart-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.chart-heading {
    margin-bottom: 22px;
}

.chart-heading h2 {
    margin: 0 0 5px;
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 750;
}

.chart-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.finance-chart-container {
    position: relative;
    width: 100%;
    height: 330px;
    min-width: 0;
}

/* =========================
   FOOTER
   ========================= */

.dashboard-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 30px;
    padding: 18px 10px 8px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.dashboard-footer span {
    color: #a0aabc;
}

/* =========================
   TABLE / GENERAL CONTENT
   Optional dashboard tables
   ========================= */

.main-content table {
    width: 100%;
    border-collapse: collapse;
}

.main-content img,
.main-content canvas {
    max-width: 100%;
}

/* =========================
   RESPONSIVE: TABLET
   ========================= */

@media (max-width: 1100px) {
    .main-content {
        padding: 22px 20px;
    }

    .case-summary-grid,
    .finance-summary-grid {
        gap: 15px;
    }

    .summary-card,
    .finance-card {
        padding: 18px;
    }

    .finance-amount {
        font-size: 22px;
    }
}

/* =========================
   RESPONSIVE: SMALL TABLET
   ========================= */

@media (max-width: 768px) {
    .main-content {
        padding: 20px 16px;
    }

    .page-title-row {
        align-items: flex-start;
        margin-bottom: 23px;
    }

    .page-title-row h1 {
        font-size: 24px;
    }
    
     .guest-picture-container {
        min-height: calc(100vh - 60px);
        padding: 15px;
    }

    .guest-picture-box {
        min-height: 260px;
        padding: 18px;
        border-radius: 12px;
    }

    .guest-picture {
        max-width: 100%;
        max-height: 320px;
    }

    .case-summary-grid,
    .finance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .summary-card,
    .finance-card {
        padding: 18px;
    }

    .finance-chart-card {
        padding: 19px;
    }

    .finance-chart-container {
        height: 290px;
    }
}

/* =========================
   RESPONSIVE: MOBILE
   ========================= */

@media (max-width: 480px) {
    .main-content {
        padding: 16px 12px;
    }

    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-title-row h1 {
        font-size: 22px;
    }

    .dashboard-date {
        padding: 8px 12px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .case-summary-grid,
    .finance-summary-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
    }

    .summary-card,
    .finance-card {
        padding: 19px;
    }

    .summary-number {
        font-size: 30px;
    }

    .finance-amount {
        font-size: 24px;
    }

    .finance-chart-card {
        padding: 16px 12px;
    }

    .chart-heading h2 {
        font-size: 16px;
    }

    .finance-chart-container {
        height: 260px;
    }

    .dashboard-footer {
        margin-top: 22px;
    }
}

/* =========================================================
   FIX: SCROLLBAR STARTS BELOW HEADER
   Add this at the END of dashboard.css
   ========================================================= */

:root {
    /* আপনার Header-এর প্রকৃত উচ্চতা অনুযায়ী পরিবর্তন করুন */
    --header-height: 80px;
}

/* Browser-এর default spacing বন্ধ */
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

/* Header সবসময় উপরে থাকবে */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
}

/* Header-এর নিচ থেকে Dashboard layout শুরু */
.page-layout {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;

    display: flex;
    align-items: stretch;

    width: 100%;
    height: auto;
    min-height: 0;

    overflow: hidden;
}

/* Sidebar-এর স্ক্রলবার Header-এর নিচে থাকবে */
.page-layout > .sidebar {
    flex: 0 0 250px;
    height: 100%;
    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

/* Main Dashboard-এর নিজস্ব scrollbar */
.page-layout > .main-content {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 100%;
    min-height: 0;

    overflow-x: auto;
    overflow-y: auto;

    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;

    padding: 26px 28px;
}

/* Dashboard content যেন নিচে কেটে না যায় */
.main-content > .dashboard-footer {
    margin-bottom: 8px;
}

/* সুন্দর ও ব্যবহারযোগ্য scrollbar */
.page-layout > .main-content::-webkit-scrollbar,
.page-layout > .sidebar::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.page-layout > .main-content::-webkit-scrollbar-track,
.page-layout > .sidebar::-webkit-scrollbar-track {
    background: #edf1f6;
}

.page-layout > .main-content::-webkit-scrollbar-thumb,
.page-layout > .sidebar::-webkit-scrollbar-thumb {
    background: #aab6c7;
    border: 2px solid #edf1f6;
    border-radius: 10px;
}

.page-layout > .main-content::-webkit-scrollbar-thumb:hover,
.page-layout > .sidebar::-webkit-scrollbar-thumb:hover {
    background: #71839d;
}

/* Tablet ও Mobile */
@media (max-width: 768px) {
    .page-layout > .main-content {
        padding: 20px 16px;
    }

    .page-layout > .sidebar {
        height: 100%;
        max-height: 100%;
    }
}