﻿/* Dashboard responsive CSS
   Colors are kept same as your existing dashboard.css. */

.dashboard-shell,
.dashboard-shell * {
    box-sizing: border-box;
}

.dashboard-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    padding: 26px 34px 38px;
    background: #f9f9f7;
    overflow-x: hidden;
}

    .dashboard-shell img,
    .dashboard-shell svg,
    .dashboard-shell canvas {
        max-width: 100%;
    }

.dashboard-main-grid,
.dashboard-card-grid,
.dashboard-bottom-grid,
.filter-card,
.matrix-grid,
.action-plan-grid,
.refund-grid,
.amount-row {
    min-width: 0;
}

.ledger-status-card,
.active-matrix-card,
.info-card,
.action-plan-card,
.refund-card-wrapper,
.refund-card,
.matrix-item,
.plan-item,
.filter-item {
    min-width: 0;
}

/* TOP BAR */
.dashboard-topbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 12px;
}

.search-box {
    width: 100%;
    max-width: 280px;
    height: 40px;
    background: #f4f4f2;
    border: 1px solid #e0c0b2;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    transition: all 0.2s;
}

    .search-box:focus-within {
        border-color: #9e3d00;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(158, 61, 0, 0.1);
    }

.search-icon {
    color: #8c7166;
    font-size: 14px;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    color: #1a1c1b;
    font-family: 'Work Sans', sans-serif;
}

    .search-box input::placeholder {
        color: #8c7166;
        opacity: 0.7;
    }

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.top-action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #4c5e71;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .top-action-btn:hover {
        background: #eeeeec;
        color: #9e3d00;
    }

    .top-action-btn.icon-btn {
        background: transparent;
        box-shadow: none;
    }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a1c1b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-left: 4px;
    font-family: 'Work Sans', sans-serif;
    flex-shrink: 0;
}

/* HEADING */
.dashboard-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 24px;
    flex-wrap: wrap;
}

    .dashboard-heading-row > div:first-child {
        min-width: 0;
        flex: 1 1 420px;
    }

    .dashboard-heading-row h1 {
        margin: 0;
        font-size: 40px;
        line-height: 1.2;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: #1a1c1b;
        font-family: 'Manrope', sans-serif;
        overflow-wrap: anywhere;
    }

        .dashboard-heading-row h1 span {
            color: #9e3d00;
            font-style: italic;
        }

    .dashboard-heading-row p {
        max-width: 600px;
        margin: 8px 0 0;
        font-size: 16px;
        line-height: 1.6;
        font-weight: 400;
        color: #594238;
        font-family: 'Work Sans', sans-serif;
    }

.heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
    flex: 0 1 auto;
}

.year-btn,
.company-btn {
    height: 40px;
    border-radius: 10px;
    border: none;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    letter-spacing: 0.02em;
}

.year-btn {
    background: #ffffff;
    color: #1a1c1b;
    border: 1px solid #e0c0b2;
}

    .year-btn:hover {
        background: #f4f4f2;
    }

.company-btn {
    background: #9e3d00;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(158, 61, 0, 0.25);
    display: flex;
    align-items: center;
}

    .company-btn:hover {
        background: #7d2f00;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(158, 61, 0, 0.3);
    }

/* FILTER */
.filter-card {
    background: #ffffff;
    border: 1px solid #e0c0b2;
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(76, 94, 113, 0.05);
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #8c7166;
    text-transform: uppercase;
    font-family: 'Work Sans', sans-serif;
    position: relative;
}

.filter-item select,
.filter-item input {
    width: 100%;
    min-width: 0;
    height: 44px;
    border: 1px solid #e0c0b2;
    outline: none;
    border-radius: 10px;
    background: #f4f4f2;
    color: #1a1c1b;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Work Sans', sans-serif;
    transition: all 0.2s;
}

    .filter-item select:focus,
    .filter-item input:focus {
        border-color: #9e3d00;
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(158, 61, 0, 0.08);
    }

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e0c0b2;
}

.search-btn,
.reset-btn {
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Work Sans', sans-serif;
    white-space: nowrap;
}

.search-btn {
    background: #9e3d00;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(158, 61, 0, 0.25);
}

    .search-btn:hover {
        background: #7d2f00;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(158, 61, 0, 0.3);
    }

.reset-btn {
    background: #f4f4f2;
    color: #594238;
    border: 1px solid #e0c0b2;
}

    .reset-btn:hover {
        background: #eeeeec;
        color: #9e3d00;
    }

#taxTypeFilter {
    border-color: #9e3d00 !important;
    background: linear-gradient(135deg, #fff8f5 0%, #ffffff 100%) !important;
    font-weight: 600;
    color: #9e3d00;
}

.filter-item:nth-child(5) label::after {
    content: 'NEW';
    position: absolute;
    right: 0;
    top: -2px;
    background: #fed652;
    color: #725c00;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* MAIN TOP GRID */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.ledger-status-card {
    min-height: 260px;
    border-radius: 20px;
    background: linear-gradient(135deg, #9e3d00 0%, #7d2f00 100%);
    color: #ffffff;
    padding: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(158, 61, 0, 0.3);
}

    .ledger-status-card::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -20%;
        width: 250px;
        height: 250px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 50%;
    }

    .ledger-status-card p {
        margin: 0 0 12px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.08em;
        color: rgba(255, 255, 255, 0.85);
        text-transform: uppercase;
        font-family: 'Work Sans', sans-serif;
    }

    .ledger-status-card h2 {
        margin: 0;
        font-size: 52px;
        line-height: 1;
        font-weight: 700;
        font-family: 'Manrope', sans-serif;
    }

    .ledger-status-card > span {
        display: block;
        margin-top: 4px;
        font-size: 13px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.9);
        text-transform: uppercase;
        font-family: 'Work Sans', sans-serif;
    }

.ledger-count-row {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 48px;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}

    .ledger-count-row h3 {
        margin: 0;
        font-size: 32px;
        line-height: 1;
        font-weight: 700;
        font-family: 'Manrope', sans-serif;
    }

    .ledger-count-row small {
        display: block;
        margin-top: 6px;
        font-size: 11px;
        line-height: 1.3;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.85);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-family: 'Work Sans', sans-serif;
    }

.ledger-status-card a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Work Sans', sans-serif;
    transition: opacity 0.2s;
    position: relative;
    z-index: 1;
}

    .ledger-status-card a:hover {
        opacity: 0.9;
    }

/* ACTIVE MATRIX CARD */
.active-matrix-card {
    background: #ffffff;
    border: 1px solid #e0c0b2;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(76, 94, 113, 0.08);
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 12px;
}

    .card-title-row h5 {
        margin: 0;
        font-size: 13px;
        font-weight: 600;
        color: #594238;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-family: 'Work Sans', sans-serif;
    }

    .card-title-row p {
        margin: 4px 0 0;
        font-size: 14px;
        font-weight: 500;
        color: #8c7166;
        font-family: 'Work Sans', sans-serif;
    }

.live-pill {
    background: #fed652;
    color: #725c00;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.03em;
    font-family: 'Work Sans', sans-serif;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.matrix-item {
    min-height: 100px;
    background: #f9f9f7;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid;
    transition: all 0.2s;
}

    .matrix-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(76, 94, 113, 0.1);
        background: #ffffff;
    }

    .matrix-item.active-border {
        border-left-color: #9e3d00;
    }

    .matrix-item:nth-child(2) {
        border-left-color: #fed652;
    }

    .matrix-item:nth-child(3) {
        border-left-color: #c64f00;
    }

    .matrix-item:nth-child(4) {
        border-left-color: #4c5e71;
    }

    .matrix-item h4 {
        margin: 0 0 8px;
        font-size: 28px;
        line-height: 1;
        font-weight: 700;
        color: #1a1c1b;
        font-family: 'Manrope', sans-serif;
    }

    .matrix-item p {
        margin: 0;
        font-size: 11px;
        line-height: 1.4;
        font-weight: 600;
        color: #594238;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        font-family: 'Work Sans', sans-serif;
    }

/* FOUR CARDS */
.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.info-card {
    background: #ffffff;
    border: 1px solid #e0c0b2;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(76, 94, 113, 0.06);
    transition: all 0.2s;
}

    .info-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(76, 94, 113, 0.12);
    }

.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.mini-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.orange-badge {
    background: rgba(158, 61, 0, 0.1);
    color: #9e3d00;
}

.yellow-badge {
    background: rgba(254, 214, 82, 0.25);
    color: #725c00;
}

.red-badge {
    background: rgba(186, 26, 26, 0.1);
    color: #ba1a1a;
}

.blue-badge {
    background: rgba(76, 94, 113, 0.1);
    color: #4c5e71;
}

.info-card-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1c1b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-family: 'Work Sans', sans-serif;
}

.amount-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

    .amount-row label {
        display: block;
        margin-bottom: 6px;
        font-size: 11px;
        font-weight: 600;
        color: #8c7166;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        font-family: 'Work Sans', sans-serif;
    }

    .amount-row h4 {
        margin: 0;
        font-size: 22px;
        line-height: 1;
        font-weight: 700;
        color: #1a1c1b;
        font-family: 'Manrope', sans-serif;
        overflow-wrap: anywhere;
    }

.mini-list,
.audit-list {
    margin-top: 16px;
}

    .mini-list div,
    .audit-list div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 10px 0;
        border-top: 1px solid #eeeeec;
        font-size: 13px;
        color: #594238;
        font-weight: 500;
        font-family: 'Work Sans', sans-serif;
    }

        .mini-list div:last-child,
        .audit-list div:last-child {
            border-top: none;
        }

    .mini-list b,
    .audit-list b {
        font-weight: 600;
        color: #1a1c1b;
        font-family: 'Manrope', sans-serif;
        white-space: nowrap;
    }

.alert-box {
    margin-top: 16px;
    background: rgba(186, 26, 26, 0.05);
    border-left: 3px solid #ba1a1a;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    color: #ba1a1a;
    font-family: 'Work Sans', sans-serif;
}

    .alert-box b {
        display: block;
        margin-bottom: 2px;
        font-weight: 700;
    }

.critical-box {
    margin-top: 16px;
    background: rgba(254, 214, 82, 0.15);
    border: 1px solid rgba(254, 214, 82, 0.4);
    padding: 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    color: #725c00;
    font-family: 'Work Sans', sans-serif;
}

/* BOTTOM GRID */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 24px;
}

.action-plan-card {
    background: #ffffff;
    border: 1px solid #e0c0b2;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(76, 94, 113, 0.06);
}

    .action-plan-card .card-title-row {
        margin-bottom: 24px;
    }

    .action-plan-card h5 {
        font-size: 18px;
        font-weight: 700;
        color: #1a1c1b;
        font-family: 'Manrope', sans-serif;
    }

.deadline-text {
    color: #9e3d00;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #fed652;
    padding-bottom: 2px;
    font-family: 'Work Sans', sans-serif;
}

.action-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.plan-item {
    background: #f9f9f7;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

    .plan-item:hover {
        background: #f4f4f2;
        transform: translateY(-2px);
    }

    .plan-item label {
        display: block;
        margin-bottom: 12px;
        font-size: 12px;
        font-weight: 600;
        color: #594238;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        font-family: 'Work Sans', sans-serif;
    }

    .plan-item h4 {
        margin: 0 0 6px;
        font-size: 32px;
        line-height: 1;
        font-weight: 700;
        color: #1a1c1b;
        font-family: 'Manrope', sans-serif;
    }

    .plan-item p {
        margin: 0;
        font-size: 13px;
        color: #8c7166;
        font-weight: 500;
        font-family: 'Work Sans', sans-serif;
    }

/* REFUND CARD */
.refund-card-wrapper {
    position: relative;
}

.refund-card {
    min-height: 200px;
    padding: 28px;
    background: linear-gradient(135deg, #1e2523 0%, #2f3130 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(30, 37, 35, 0.4);
}

    .refund-card::before {
        content: '₹';
        position: absolute;
        right: 20px;
        bottom: -30px;
        font-size: 140px;
        font-weight: 900;
        color: rgba(255, 255, 255, 0.03);
        font-family: 'Manrope', sans-serif;
        pointer-events: none;
    }

    .refund-card::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 200px;
        height: 200px;
        background: radial-gradient(circle, rgba(254, 214, 82, 0.05) 0%, transparent 70%);
        pointer-events: none;
    }

    .refund-card h5 {
        color: #ffffff;
        margin: 0 0 24px;
        font-size: 18px;
        font-weight: 700;
        font-family: 'Manrope', sans-serif;
        position: relative;
        z-index: 1;
    }

.refund-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    position: relative;
    z-index: 1;
}

    .refund-grid label {
        display: block;
        margin-bottom: 8px;
        font-size: 11px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.6);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-family: 'Work Sans', sans-serif;
    }

    .refund-grid h4 {
        margin: 0;
        font-size: 24px;
        line-height: 1;
        font-weight: 700;
        color: #ffffff;
        font-family: 'Manrope', sans-serif;
        overflow-wrap: anywhere;
    }

    .refund-grid .danger-text {
        color: #ff6b55;
    }

    .refund-grid .sanctioned-text {
        color: #fed652;
    }

/* PLUS BUTTON */
.refund-add-btn {
    position: absolute;
    top: -18px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #9e3d00;
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(158, 61, 0, 0.4);
    z-index: 10;
    cursor: pointer;
    transition: all 0.2s;
}

    .refund-add-btn:hover {
        background: #7d2f00;
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 8px 20px rgba(158, 61, 0, 0.5);
    }

/* RESPONSIVE DESKTOP */
@media (min-width: 1400px) {
    .dashboard-shell {
        padding: 32px 40px 40px;
    }

    .dashboard-heading-row h1 {
        font-size: 44px;
    }
}

/* SMALL DESKTOP / LARGE TABLET */
@media (max-width: 1399px) {
    .dashboard-shell {
        padding: 24px 28px 32px;
    }

    .dashboard-heading-row h1 {
        font-size: 36px;
    }

    .filter-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* TABLET LANDSCAPE */
@media (max-width: 1199px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .matrix-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* TABLET PORTRAIT */
@media (max-width: 991px) {
    .dashboard-shell {
        padding: 20px 20px 28px;
    }

    .dashboard-heading-row {
        flex-direction: column;
        gap: 16px;
    }

        .dashboard-heading-row > div:first-child,
        .heading-actions {
            width: 100%;
            flex: 1 1 auto;
        }

        .dashboard-heading-row h1 {
            font-size: 32px;
        }

        .dashboard-heading-row p {
            font-size: 15px;
        }

    .search-box {
        max-width: 100%;
    }

    .filter-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        padding: 20px;
    }

    .dashboard-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .action-plan-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

/* MOBILE */
@media (max-width: 767px) {
    .dashboard-shell {
        padding: 16px 16px 24px;
    }

    .dashboard-topbar {
        height: auto;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
        order: 1;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-end;
        order: 2;
    }

    .dashboard-heading-row h1 {
        font-size: 28px;
    }

    .heading-actions {
        justify-content: stretch;
    }

    .year-btn,
    .company-btn {
        flex: 1 1 0;
        min-width: 0;
        font-size: 12px;
        padding: 0 14px;
        justify-content: center;
    }

    .filter-card {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 20px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .search-btn,
    .reset-btn {
        width: 100%;
    }

    .dashboard-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .matrix-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .action-plan-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .refund-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .ledger-count-row {
        gap: 24px 32px;
    }

    .card-title-row {
        flex-wrap: wrap;
    }
}

/* SMALL MOBILE */
@media (max-width: 575px) {
    .dashboard-shell {
        padding: 12px 12px 20px;
    }

    .dashboard-heading-row h1 {
        font-size: 26px;
    }

    .dashboard-heading-row p {
        font-size: 14px;
    }

    .search-box {
        height: 40px;
    }

        .search-box input {
            font-size: 13px;
        }

    .top-action-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .heading-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .year-btn,
    .company-btn {
        width: 100%;
        height: 38px;
        font-size: 11px;
        padding: 0 12px;
    }

    .filter-card {
        padding: 16px;
    }

    .filter-item select,
    .filter-item input {
        height: 40px;
        font-size: 13px;
    }

    .ledger-status-card {
        min-height: auto;
        padding: 24px;
    }

        .ledger-status-card h2 {
            font-size: 40px;
        }

    .ledger-count-row h3 {
        font-size: 28px;
    }

    .active-matrix-card,
    .action-plan-card,
    .refund-card {
        padding: 20px;
    }

    .matrix-grid {
        grid-template-columns: 1fr;
    }

    .matrix-item {
        padding: 16px;
    }

        .matrix-item h4 {
            font-size: 24px;
        }

        .matrix-item p {
            font-size: 10px;
        }

    .info-card {
        padding: 20px;
    }

    .amount-row {
        grid-template-columns: 1fr;
    }

        .amount-row h4,
        .refund-grid h4,
        .plan-item h4 {
            font-size: 20px;
        }

    .refund-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .refund-add-btn {
        top: -16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* EXTRA SMALL MOBILE */
@media (max-width: 420px) {
    .dashboard-shell {
        padding: 10px 10px 18px;
    }

    .dashboard-heading-row h1 {
        font-size: 24px;
    }

    .ledger-status-card,
    .active-matrix-card,
    .info-card,
    .action-plan-card,
    .refund-card,
    .filter-card {
        border-radius: 14px;
    }

    .ledger-count-row {
        flex-direction: column;
        gap: 18px;
    }
}


/* =========================================================
   Samsung Galaxy S8 / Small Mobile Container Fix
   Viewport width is usually around 360px.
   This fixes container squeezing/overflow inside sidebar layout.
   No colors changed.
   ========================================================= */

@media (max-width: 390px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .dashboard-shell {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 10px 10px 18px !important;
        overflow-x: hidden !important;
    }

    .dashboard-topbar,
    .dashboard-heading-row,
    .filter-card,
    .dashboard-main-grid,
    .dashboard-card-grid,
    .dashboard-bottom-grid,
    .ledger-status-card,
    .active-matrix-card,
    .info-card,
    .action-plan-card,
    .refund-card-wrapper,
    .refund-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .dashboard-main-grid,
    .dashboard-card-grid,
    .dashboard-bottom-grid,
    .filter-card,
    .matrix-grid,
    .action-plan-grid,
    .refund-grid,
    .amount-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .dashboard-topbar {
        align-items: stretch;
        gap: 10px;
        margin-bottom: 18px;
    }

    .search-box {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 12px;
        padding-right: 12px;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .dashboard-heading-row {
        gap: 14px;
        margin-bottom: 22px;
    }

        .dashboard-heading-row > div:first-child {
            width: 100%;
            flex-basis: auto;
        }

        .dashboard-heading-row h1 {
            font-size: 23px;
            line-height: 1.18;
            overflow-wrap: anywhere;
        }

        .dashboard-heading-row p {
            font-size: 13px;
            line-height: 1.45;
            max-width: 100%;
        }

    .heading-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin-top: 0;
    }

    .year-btn,
    .company-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .filter-card {
        padding: 14px !important;
        gap: 12px;
        margin-bottom: 22px;
    }

    .filter-actions {
        gap: 10px;
        padding-top: 14px;
    }

    .ledger-status-card {
        min-height: auto;
        padding: 20px !important;
    }

        .ledger-status-card h2 {
            font-size: 34px;
        }

    .ledger-count-row {
        flex-direction: column;
        gap: 16px;
        margin-top: 22px;
    }

    .ledger-status-card a {
        margin-top: 22px;
    }

    .active-matrix-card,
    .info-card,
    .action-plan-card,
    .refund-card {
        padding: 18px !important;
    }

    .card-title-row {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 18px;
    }

    .matrix-item,
    .plan-item {
        padding: 14px;
    }

    .mini-list div,
    .audit-list div {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .refund-card::before {
        font-size: 90px;
        right: 10px;
        bottom: -18px;
    }

    .refund-add-btn {
        top: -14px;
        right: 14px;
    }
}

/* Sidebar-layout safety for mobile.
   This prevents double spacing if the parent layout keeps sidebar margin on small screens. */
@media (max-width: 991.98px) {
    .dashboard-shell {
        margin-left: 0 !important;
    }

    .main-content .dashboard-shell,
    .content .dashboard-shell,
    .page-content .dashboard-shell,
    .layout-content .dashboard-shell,
    main .dashboard-shell {
        width: 100% !important;
        max-width: 100% !important;
    }
}

