@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700;800&display=swap');

@font-face {
    font-family: 'SiyamRupali';
    src: local('Siyam Rupali'), local('SiyamRupali'),
        url('https://cdn.jsdelivr.net/gh/ronniesong0211/bangla-fonts@main/Siyam%20Rupali.woff2') format('woff2'),
        url('https://cdn.jsdelivr.net/gh/ronniesong0211/bangla-fonts@main/Siyam%20Rupali.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SolaimanLipi';
    src: local('Solaiman Lipi'), local('SolaimanLipi'),
        url('https://cdn.jsdelivr.net/gh/ronniesong0211/bangla-fonts@main/SolaimanLipi_20-04-07.woff2') format('woff2'),
        url('https://cdn.jsdelivr.net/gh/ronniesong0211/bangla-fonts@main/SolaimanLipi_20-04-07.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #2563EB;
    /* Royal Blue */
    --primary-light: #DBEAFE;
    /* Light Blue-100 */
    --secondary: #3B82F6;
    /* Sky Blue */
    --accent: #1D4ED8;
    /* Navy Blue */
    --danger: #EF4444;

    /* Workspace Color Identity */
    --ws-dokan: #2563EB;
    /* Blue */
    --ws-farm: #10B981;
    /* Emerald Green */
    --ws-sonali: #F59E0B;
    /* Amber/Gold */
    --ws-loan: #8B5CF6;
    /* Violet */

    --dark: #1E3A8A;
    /* Deep Blue Dark */
    --text-main: #1F2937;
    --text-light: #4B5563;

    --bg-body: #F0F7FF;
    /* Very Light Blue BG */
    --surface: #ffffff;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;

    --shadow-sm: 0 1px 3px rgba(37, 99, 235, 0.1);
    --shadow-md: 0 6px 15px rgba(37, 99, 235, 0.12);
    --shadow-lg: 0 15px 30px rgba(30, 58, 138, 0.15);
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

body {
    font-family: 'SiyamRupali', 'SolaimanLipi', 'Noto Sans Bengali', system-ui, sans-serif;
    background: linear-gradient(to bottom, #eef2ff, var(--bg-body));
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
}

/* ================= HEADER ================= */
.app-header {
    background: var(--surface);
    padding: 24px 32px;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand h1 i {
    color: var(--primary);
}

.brand p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ================= CONTAINER ================= */
.container {
    max-width: 100%;
    padding: 0 40px 60px;
}

/* ================= WORKSPACE LINKS ================= */
.workspace-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.workspace-link {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 35px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.workspace-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 5px;
    width: 100%;
    background: currentColor;
    opacity: 0.8;
}

.workspace-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.workspace-link:hover {
    transform: translateY(-12px) scale(1.05);
}

.workspace-link:hover::after {
    opacity: 0.05;
}

.workspace-link i {
    font-size: 3.2rem;
    margin-bottom: 5px;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.workspace-link:hover i {
    transform: scale(1.2) translateY(-5px);
    filter: drop-shadow(0 8px 12px currentColor);
}

.workspace-link span {
    display: block;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.8px;
    z-index: 1;
    transition: all 0.3s ease;
}

/* Specific Multi-Color Themes */
.workspace-link.dokan {
    color: var(--ws-dokan);
}

.workspace-link.dokan:hover {
    background: #EFF6FF;
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.3);
    border-color: rgba(37, 99, 235, 0.4);
}

.workspace-link.farm {
    color: var(--ws-farm);
}

.workspace-link.farm:hover {
    background: #ECFDF5;
    box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.4);
}

.workspace-link.sonali {
    color: var(--ws-sonali);
}

.workspace-link.sonali:hover {
    background: #FFFBEB;
    box-shadow: 0 20px 40px -10px rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.4);
}

.workspace-link.loan {
    color: var(--ws-loan);
}

.workspace-link.loan:hover {
    background: #F5F3FF;
    box-shadow: 0 20px 40px -10px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.4);
}

/* ================= SECTION TITLE ================= */
.section-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 24px;
    padding: 12px 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 6px solid var(--primary);
}

/* ================= NO DATA STATE ================= */
.no-data {
    text-align: center;
    background: var(--surface);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 2px dashed #E5E7EB;
    margin: 20px 0;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-data i {
    background: var(--primary-light);
    width: 100px;
    height: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 24px;
    font-size: 3.5rem !important;
    color: var(--primary) !important;
    opacity: 1 !important;
    box-shadow: inset 0 2px 4px rgba(37, 99, 235, 0.1);
}

.no-data h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
}

.no-data p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto;
}


/* ================= VISIBILITY UTILITIES ================= */
/* We use !important to ensure these utility classes always override component-level display rules */
.desktop-only {
    display: none !important;
}

.mobile-only {
    display: block !important;
}

@media (min-width: 1024px) {
    .desktop-only {
        display: block !important;
    }


    .mobile-only {
        display: none !important;
    }


    .custom-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        background: var(--surface);
        border-radius: var(--radius-md);
        overflow: hidden;
        box-shadow: var(--shadow-md);
    }

    .custom-table th {
        background: var(--primary-light);
        padding: 18px 22px;
        text-align: left;
        font-weight: 800;
        font-size: 1rem;
        color: var(--dark);
        border-bottom: 2px solid rgba(37, 99, 235, 0.1);
    }

    .custom-table td {
        padding: 18px 22px;
        border-bottom: 1px solid #F3F4F6;
        font-size: 0.95rem;
    }

    /* NORMAL ROW HOVER ONLY */
    .custom-table tr:not(.summary-row):hover td {
        background: #F9FAFB;
    }

    .text-right {
        text-align: right;
    }

    /* SUMMARY ROW – FIXED */
    .summary-row td {
        background: linear-gradient(135deg, var(--dark), var(--primary));
        color: #ffffff;
        font-weight: 800;
    }

    .custom-table tr.summary-row:hover td {
        background: linear-gradient(135deg, var(--dark), var(--primary));
        color: #ffffff;
    }
}

/* ================= MOBILE CARD ================= */
.customer-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.customer-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.customer-card-left {
    display: flex;
    gap: 14px;
    align-items: center;
}

.customer-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    border: 2px solid white;
}

.customer-info h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark);
}

.meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-badge {
    padding: 6px 12px;
    font-size: 0.95rem;
    border-radius: 8px;
    font-weight: 700;
}

.meta-badge.dokan {
    background: #EEF2FF;
    color: var(--primary);
}

.meta-badge.sonali {
    background: #E0F2FE;
    color: var(--accent);
}

.customer-card-right {
    text-align: right;
}

.total-badge {
    font-size: 1.15rem;
    font-weight: 900;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

/* ================= BANK DETAILS ================= */
.bank-details-card {
    margin-top: 40px;
    border-left: 6px solid var(--secondary);
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.bank-details-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    color: var(--dark);
}

.bank-details-header i {
    color: var(--primary);
    font-size: 1.8rem;
}

.bank-details-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

.saved-accounts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.account-item {
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.account-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    background: white;
}

.account-item h4 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    flex: 1;
}

.account-details {
    font-size: 1rem;
    font-weight: 500;
    white-space: pre-wrap;
    color: var(--text-main);
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    word-break: break-word;
    margin-bottom: 16px;
}

.btn-group-sm {
    display: flex;
    gap: 12px;
}

.btn-action {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    color: white;
}

.btn-action.view {
    background: var(--primary);
}

.btn-action.edit {
    background: var(--secondary);
}

.btn-action:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.delete-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(15deg) scale(1.1);
}

/* ================= MODALS ================= */
.details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 138, 0.4);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.details-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content-custom {
    background: var(--surface);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.details-modal.active .modal-content-custom {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-body);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body-content {
    margin-top: 24px;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--dark);
    font-weight: 600;
    white-space: pre-wrap;
    background: var(--bg-body);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

/* ================= FORMS ================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--primary-light);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.bank-details-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    filter: brightness(1.1);
}

.btn-dark {
    background: var(--dark);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-dark:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.summary-card {
    background: var(--dark) !important;
    border: none;
    margin-top: 10px;
}

.summary-card .customer-avatar {
    background: white !important;
    color: var(--dark) !important;
}

.summary-card .meta-badge {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-card .total-badge {
    background: white !important;
    color: var(--dark) !important;
    border: none !important;
}

/* ================= CONFIRM MODAL ================= */
.confirm-modal .modal-content-custom {
    max-width: 450px;
    text-align: center;
    padding: 40px 30px;
}

.confirm-icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: 20px;
    display: inline-block;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 15px;
}

.confirm-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-confirm {
    padding: 12px 25px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    flex: 1;
}

.btn-cancel {
    background: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--primary-light);
}

.btn-cancel:hover {
    background: #e5eaf5;
}

.btn-danger-confirm {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger-confirm:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(239, 68, 68, 0.3);
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {

    .container {
        padding: 0 16px 40px;
    }

    .workspace-links {
        gap: 12px;
    }

    .workspace-link {
        padding: 16px 8px;
    }

    .workspace-link i {
        font-size: 1.8rem;
    }

    .workspace-link span {
        font-size: 0.8rem;
    }

    .customer-card {
        flex-direction: column;
    }

    .customer-card-right {
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid #E5E7EB;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .form-actions button {
        width: 100% !important;
        justify-content: center !important;
        padding: 16px !important;
        font-size: 1.1rem !important;
    }
}