/* ============================================
   MODERN FARM ACCOUNT BOOK CSS
   Premium Design 2026 - Nature Inspired
   ============================================ */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Color Palette - Nature & Fresh */
    --primary-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
    --primary-hover: linear-gradient(135deg, #10b981 0%, #059669 100%);

    --secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --danger-light: rgba(239, 68, 68, 0.1);

    --success-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --success-light: rgba(34, 197, 94, 0.1);

    --surface-white: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.9);
    --surface-glass-strong: rgba(255, 255, 255, 0.95);

    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-light: #94a3b8;

    --bg-main: #f1f5f9;
    --border-light: rgba(0, 0, 0, 0.05);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Spacing & Radius */
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

/* ============================================
   FONTS
   ============================================ */
@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;
}

/* ============================================
   BASE
   ============================================ */
/* ============================================
   BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'SiyamRupali', 'SolaimanLipi', 'Poppins', sans-serif;
    font-size: 16px;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-image:
        radial-gradient(at 0% 0%, rgba(5, 150, 105, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0;
}

a {
    text-decoration: none;
    transition: all 0.2s ease;
    color: #059669;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ============================================
   NAVIGATION
   ============================================ */
/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    -webkit-text-fill-color: #059669;
}

/* Navigation Links */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-nav .nav-link {
    color: #475569;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

/* Hover Effect for Desktop */
.navbar-nav .nav-link:hover {
    background: #f0fdf4;
    /* Light green bg */
    color: #059669;
    transform: translateY(-2px);
}

.navbar-nav .nav-link i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.navbar-nav .nav-link:hover i {
    transform: scale(1.1);
}

/* Special Button: Logout & Clear */
.logout-btn {
    background: #fff1f2 !important;
    /* Light red */
    color: #e11d48 !important;
    border: 1px solid #fecdd3;
}

.logout-btn:hover {
    background: #e11d48 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
    border-color: #e11d48;
}

/* Navbar Toggler (Hidden by default) */
.navbar-toggler {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #475569;
    cursor: pointer;
    padding: 0.5rem;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 0;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-toggler {
        display: block;
        /* Show hamburger on mobile */
    }

    .navbar-nav {
        display: none;
        /* Hide menu by default */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        gap: 0.5rem;
        border-bottom: 1px solid #e2e8f0;
    }

    .navbar-nav.active {
        display: flex;
        /* Show when active */
        animation: slideDown 0.2s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Reset link styles for mobile menu */
    .navbar-nav .nav-link {
        width: 100%;
        border-radius: 8px;
        padding: 0.8rem 1rem;
        justify-content: flex-start;
        /* Align left */
    }

    /* Force show text labels in mobile menu */
    .navbar-nav .nav-link span {
        display: inline !important;
    }

    .navbar-nav .nav-link i {
        margin-right: 0.5rem;
        font-size: 1.1rem;
    }
}

/* ============================================
   CONTAINER & HEADER
   ============================================ */
.container {
    max-width: 1280px;
    padding: 0 1.5rem;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin: 3rem 0;
    animation: fadeInDown 0.6s ease-out;
}

.page-header h1 {
    font-size: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CARDS & STATS
   ============================================ */
.total-balance-card {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    animation: pulse 3s infinite;
}

.total-balance-card h2 {
    color: white;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.total-balance-card .amount {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}

.customer-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    min-height: 145px;
    display: flex;
    flex-direction: column;
}

/* Colored accent bar on left */
.stat-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #059669 0%, #047857 100%);
    opacity: 0.6;
    transition: opacity 0.25s;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    line-height: 1.3;
    gap: 0.5rem;
}

/* When stat-label contains a button, use space-between */
.stat-label:has(button),
.stat-label:has(.toggle-adjustment) {
    justify-content: space-between;
}

.stat-label i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Stack items vertically */
    align-items: flex-start;
    /* Align left */
    justify-content: center;
}

/* Previous balance - compact inline style */
.stat-value .last-due {
    font-size: 1.1rem;
    color: #475569;
    font-weight: 700;
    margin-left: 0;
    /* Remove left margin */
    margin-top: 0.25rem;
    /* Add top margin */
    padding: 0.2rem 0.5rem;
    background: #f1f5f9;
    border-radius: 6px;
    white-space: nowrap;
}

.adjustment-notice {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    display: inline-block;
    line-height: 1.3;
}

/* Last activity styling - compact card */
.stat-box .last-transaction {
    font-size: 1.05rem;
    line-height: 1.4;
    display: block;
    color: #475569;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #cbd5e1;
}

.stat-box .last-payment {
    color: #059669;
    background: #f0fdf4;
    border-left-color: #059669;
}

.stat-box .last-due {
    color: #dc2626;
    background: #fef2f2;
    border-left-color: #dc2626;
}

.stat-box .no-activity {
    color: #94a3b8;
    background: #f8fafc;
    border-left-color: #e2e8f0;
    font-style: italic;
}

/* KG Summary box - special styling */
.kg-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #bae6fd;
}

.kg-summary::before {
    background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
}

/* Toggle adjustment button - compact */
.toggle-adjustment {
    background: #f0fdf4;
    border: none;
    color: #059669;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-adjustment:hover {
    background: #dcfce7;
    transform: rotate(90deg);
}

.toggle-adjustment i {
    font-size: 0.8rem;
}

/* ============================================
   CUSTOMER LIST
   ============================================ */
.customer-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.customer-card {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.customer-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.customer-header {
    background: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.customer-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.customer-header p {
    margin: 0.25rem 0 0 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.customer-details {
    padding: 1.5rem;
    flex: 1;
}

.customer-details p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.customer-details i {
    color: #059669;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.balance-box {
    margin-top: 1rem;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
}

.balance-value {
    color: #e11d48;
    font-weight: 800;
    font-size: 1.5rem;
}

.last-activity {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border-light);
}

.last-activity.payment {
    background-color: #f0fdf4;
    color: #15803d;
}

.last-activity.due {
    background-color: #fef2f2;
    color: #b91c1c;
}

.last-activity.no-activity {
    background-color: #f8fafc;
    color: #64748b;
}

.customer-action {
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.view-details-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-white);
    color: #059669;
    border: 2px solid #059669;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    width: 100%;
}

.view-details-button:hover {
    background: #059669;
    color: white;
}

/* ============================================
   FORMS
   ============================================ */
.search-form {
    margin: 0 auto 3rem auto;
    text-align: center;
    max-width: 500px;
    background: var(--surface-white);
    padding: 0.5rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
}

.search-form input[type="text"] {
    flex: 1;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.search-form button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.transaction-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.transaction-card {
    background: var(--surface-white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: none;
    overflow: hidden;
    /* transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease; -- Animation Removed */
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0;
    /* Clear padding from default form */
}

/* Hover Effect: Lift up - Removed */

.card-header {
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle pattern overlay on header */
.card-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.2) 1px, transparent 0);
    background-size: 10px 10px;
    opacity: 0.5;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    /* Compact Header */
    font-weight: 800;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: none;
    /* remove legacy border */
    padding-bottom: 0;
}

.card-header i {
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 1.25rem;
    background: #fff;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- Theme Variants --- */

/* Simple Due (Red/Pink Theme) */
.simple-due-card .card-header {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.simple-due-card .submit-btn {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.3);
}

.simple-due-card .submit-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(225, 29, 72, 0.4);
}

.simple-due-card input:focus,
.simple-due-card textarea:focus {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

/* Product Due (Orange/Amber Theme) */
.product-due-card .card-header {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.product-due-card .submit-btn {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.3);
}

.product-due-card .submit-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.4);
}

.product-due-card input:focus,
.product-due-card textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Payment (Green/Emerald Theme) */
.payment-card .card-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.payment-card .submit-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
}

.payment-card .submit-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.4);
}

.payment-card input:focus,
.payment-card textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Special Element Styling */
.calculated-amount {
    background: #fff7ed;
    color: #ea580c;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 700;
    border: 1px dashed #fdba74;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submit-btn {
    margin-top: auto;
    /* Push to bottom if height varies */
    border-radius: 10px !important;
    /* Overriding default rounded-md */
    padding: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem !important;
}

input[type="number"],
input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: 'SiyamRupali', 'SolaimanLipi', 'Poppins', sans-serif;
    /* Explicitly set Bangla fonts */
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
    font-family: 'SiyamRupali', 'SolaimanLipi', 'Poppins', sans-serif;
    color: #94a3b8;
    opacity: 1;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.date-picker-group {
    display: flex;
    align-items: center;
    /* Center aligned vertically */
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    width: 100%;
}

/* Mobile-friendly Date Input */
.date-picker-group input.date-input {
    margin-bottom: 0;
    flex: 1;
    width: 100%;
    /* Full width on mobile default */
    min-width: 0;
    /* Prevents overflow in flex */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
    min-height: 48px;
    /* Larger touch target for mobile */
    font-size: 1rem;
    /* Prevent zoom on iOS */
    padding: 0.6rem 1rem;
    position: relative;
    color: #334155;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    font-family: 'SiyamRupali', 'SolaimanLipi', 'Poppins', sans-serif;
}

/* Add calendar icon for better UX if supported */
.date-picker-group input.date-input::-webkit-calendar-picker-indicator {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 24 24"><path fill="%23059669" d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/></svg>');
    opacity: 0.6;
    cursor: pointer;
    width: 20px;
    height: 20px;
    padding: 5px;
}

/* ============================================
   TOGGLE BUTTONS FOR TRANSACTION FORMS
   ============================================ */
.transaction-section {
    margin: 1.5rem 0;
}

.toggle-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    /* Reduced gap for mobile */
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    /* Allow wrapping on very small screens */
}

.toggle-btn {
    padding: 0.6rem 1rem;
    border: 1px solid #cbd5e1;
    background: white;
    color: #64748b;
    border-radius: 99px;
    /* Pill shape */
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn i {
    font-size: 1rem;
}

.toggle-btn:hover {
    background: #f1f5f9;
}

.toggle-btn.active {
    background: #0f172a;
    /* Dark active state */
    color: white;
    border-color: #0f172a;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}


@media (max-width: 480px) {
    .toggle-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        /* Smaller text on small mobile */
        flex: 1;
        /* Equal width buttons */
        justify-content: center;
    }

    .toggle-btn i {
        display: none;
        /* Hide icons on very small screens to save space if needed, or keep them */
    }

    .toggle-actions {
        gap: 0.25rem;
    }
}


.date-shortcuts {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
    /* Prevent buttons from squishing */
}

.date-shortcuts button {
    padding: 0.7rem 0.8rem;
    /* Matches new input height */
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.date-shortcuts button:hover {
    background: #e2e8f0;
    color: var(--text-main);
    border-color: #94a3b8;
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    transition: transform 0.1s;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   PREMIUM TABLE DESIGN
   ============================================ */
.section-header {
    margin: 3rem 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: #059669;
    background: #ecfdf5;
    padding: 0.5rem;
    border-radius: 10px;
    font-size: 1.25rem;
}

.table-container {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow-x: auto;
    /* Handle horizontal scroll */
    border: 1px solid #e2e8f0;
    margin-bottom: 3rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}

thead th {
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody td {
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.95rem;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #f8fafc !important;
}

/* --- Row Indicators --- */
.due-row {
    background-color: white;
}

.due-row td:first-child {
    border-left: 4px solid #f43f5e;
}

.payment-row {
    background-color: white;
}

.payment-row td:first-child {
    border-left: 4px solid #10b981;
}

/* Sub Rows (Child Payments) */
.sub-row {
    background-color: #f8fafc;
}

.sub-row td:first-child {
    border-left: 4px solid #94a3b8;
    padding-left: 2rem;
}

.sub-indicator {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-right: 0.5rem;
    display: inline-block;
}

/* --- Cell Specifics --- */
.date-cell {
    display: flex;
    flex-direction: column;
}

.date-cell .date {
    font-weight: 600;
    color: #0f172a;
}

.date-cell .time {
    font-size: 0.85rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.1rem 0.6rem;
    border-radius: 4px;
    width: fit-content;
    margin-top: 0.25rem;
    font-weight: 500;
}

.desc-cell {
    max-width: 300px;
    white-space: normal;
}

.product-info {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    background: #fff7ed;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    border: 1px dashed #fdba74;
}

.product-info strong {
    color: #000000;
    font-weight: 800;
    font-size: 1.1rem;
}

.description-text {
    color: #334155;
    font-style: italic;
}

.amount-cell {
    font-weight: 700;
    font-size: 1rem;
}

.text-success {
    color: #059669;
}

.text-danger {
    color: #dc2626;
}

.text-muted {
    color: #94a3b8;
}

/* Status Badges */
.transaction-type {
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
}

.type-due {
    background: #ffe4e6;
    color: #e11d48;
}

.type-payment {
    background: #d1fae5;
    color: #059669;
}

/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-pay {
    color: #059669;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.btn-pay:hover {
    background: #059669;
    color: white;
    border-color: #059669;
}

.btn-edit {
    color: #3b82f6;
}

.btn-edit:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-delete {
    color: #ef4444;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-pin {
    color: #f59e0b;
}

.btn-pin.active {
    background: #fef3c7;
    color: #d97706;
    border-color: #fcd34d;
}

.btn-pin:hover {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--surface-white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.close:hover {
    color: var(--danger-gradient);
}

/* ============================================
   UTILITIES
   ============================================ */
.me-1 {
    margin-right: 0.25rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-auto {
    margin-left: auto;
}

.text-center {
    text-align: center;
}

.toggle-paid,
.pagination,
.toggle-actions {
    margin: 2rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toggle-paid button,
.toggle-actions button {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.pagination a {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: var(--text-main);
    margin: 0 0.2rem;
}

.pagination a.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .navbar-nav {
        /* display: none; Removed to show icons */
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 1rem;
    }

    .transaction-forms {
        grid-template-columns: 1fr;
    }

    /* Stat boxes responsive */
    .customer-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-box {
        padding: 1.5rem 1.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
        margin-bottom: 0.75rem;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .stat-box .last-transaction {
        font-size: 1rem;
    }

    /* Make table scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .stat-box {
        padding: 1.25rem 1rem;
    }

    .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0.05em;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-box .last-transaction {
        font-size: 0.95rem;
    }

    .toggle-adjustment {
        width: 28px;
        height: 28px;
        padding: 0.3rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header p {
        font-size: 0.85rem;
    }
}

/* ============================================
   DASHBOARD / INDEX PAGE STYLES
   ============================================ */

.dashboard-container {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary-gradient);
}

.dashboard-header .header-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.dashboard-header .header-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 8px 15px rgba(5, 150, 105, 0.2);
    animation: pulseIcon 3s infinite ease-in-out;
}

@keyframes pulseIcon {
    0% {
        transform: scale(1);
        rotate: 0deg;
    }

    50% {
        transform: scale(1.05);
        rotate: 5deg;
    }

    100% {
        transform: scale(1);
        rotate: 0deg;
    }
}

.dashboard-header h1 {
    font-size: 2.25rem;
    font-weight: 900;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}

.dashboard-header p {
    color: #64748b;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.date-badge {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    color: #475569;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e2e8f0;
}

.date-badge i {
    color: #059669;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.balance-card-main .icon-wrapper {
    background: linear-gradient(135deg, #ffe4e6 0%, #fda4af 100%);
    color: #be123c;
}

.customer-stat-card .icon-wrapper {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #1d4ed8;
}

.stat-content h3 {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.stat-content .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}


/* Customer Grid */
.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.customer-card-new {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.customer-card-new:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: #e2e8f0;
}

.card-top-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
}

.accent-red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.accent-green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.customer-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-icon {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: bold;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.customer-info h4 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.customer-id {
    font-size: 0.85rem;
    color: #94a3b8;
    background: #f8fafc;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-weight: 500;
}

.customer-balance {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.customer-balance .label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.customer-balance .amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.last-activity-mini {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.last-activity-mini i {
    color: #94a3b8;
    margin-right: 0.25rem;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.btn-create {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .dashboard-header .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dashboard-header .header-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    .dashboard-header p {
        font-size: 0.95rem;
    }

    .date-badge {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    padding: 1rem;
}

.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.8) 0%, rgba(13, 148, 136, 0.8) 100%);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2.5rem;
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.3);
    transform: rotate(-5deg);
}

.login-header h1 {
    font-size: 1.75rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.login-form .input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.login-form .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s;
}

.login-form input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.3s;
    font-family: inherit;
}

.login-form input:focus {
    border-color: #059669;
    background: white;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    outline: none;
}

.login-form input:focus+.input-icon,
.login-form input:focus~.input-icon {
    color: #059669;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.4);
    margin-top: 1rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.5);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 0.85rem;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #ef4444;
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* Responsive Login Styles */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-form .input-group {
        margin-bottom: 1rem;
    }

    .login-form input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
        font-size: 0.95rem;
    }

    .login-btn {
        padding: 0.875rem;
    }

    .login-footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

.table-container {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 2rem;
    overflow-x: auto;
    /* Enables horizontal scroll on mobile */
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    /* Keeps rows from breaking weirdly */
}

th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

td {
    padding: 1rem 1.5rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    background: #f1f5f9;
    color: #64748b;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-pay {
    background: #ecfdf5;
    color: #059669;
}

.btn-pay:hover {
    background: #059669;
    color: white;
}

.btn-delete {
    background: #fef2f2;
    color: #ef4444;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}

/* ============================================
   BACKUP PAGE STYLES (Card Grid)
   ============================================ */

.backup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.backup-card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.backup-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: #cbd5e1;
}

/* Card Header with Icon and Type */
.backup-header-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.file-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0284c7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.file-badge {
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

/* Backup Info */
.backup-info h3 {
    font-size: 1rem;
    word-break: break-all;
    margin: 0 0 1rem 0;
    color: #1e293b;
    line-height: 1.5;
    font-weight: 600;
}

.backup-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.meta-value {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 500;
}

/* Actions */
.backup-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
}

.btn-download-card {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.btn-download-card:hover {
    background: #0284c7;
    color: white;
    border-color: #0284c7;
}

.btn-delete-card {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.btn-delete-card:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Empty Grid State */
.empty-backup-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    color: #94a3b8;
}

.empty-backup-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

/* ============================================
   MOBILE RESPONSIVENESS - BACKUP PAGE
   ============================================ */

@media (max-width: 768px) {

    /* Backup Grid - Single Column on Mobile */
    .backup-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Backup Cards - Optimized for Mobile */
    .backup-card {
        padding: 1.25rem;
    }

    .backup-header-card {
        margin-bottom: 0.75rem;
    }

    .file-icon {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
    }

    .file-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    /* Backup Info - Compact */
    .backup-info h3 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .backup-meta-grid {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .meta-label {
        font-size: 0.65rem;
    }

    .meta-value {
        font-size: 0.85rem;
    }

    /* Action Buttons - Full Width on Mobile */
    .backup-actions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .btn-action {
        width: 100%;
        padding: 0.85rem;
        font-size: 0.95rem;
    }

    /* Stats Grid - Adjust for Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-card .icon-wrapper {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .stat-content h3 {
        font-size: 0.8rem;
    }

    .stat-content .value {
        font-size: 1.5rem;
    }

    /* Empty State - Compact */
    .empty-backup-state {
        padding: 3rem 1.5rem;
    }

    .empty-backup-state i {
        font-size: 2.5rem;
    }

    .empty-backup-state p {
        font-size: 0.9rem;
    }

    /* Section Title - Mobile Friendly */
    .section-title h2 {
        font-size: 1.25rem !important;
    }
}

/* Extra Small Devices (phones in portrait) */
@media (max-width: 480px) {
    .backup-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .backup-meta-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .meta-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
    }

    .meta-label {
        margin-bottom: 0;
    }

    .file-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .icon-wrapper {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .stat-content .value {
        font-size: 1.35rem;
    }
}

/* ============================================
   PREMIUM SECTION HEADERS
   ============================================ */

.section-header-premium {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 4rem 0 2.5rem;
    position: relative;
    width: 100%;
}

.section-header-premium::before,
.section-header-premium::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #cbd5e1);
}

.section-header-premium::after {
    background: linear-gradient(to left, transparent, #cbd5e1);
}

.section-header-premium .header-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f0fdf4;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    border: 1px solid #dcfce7;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.05);
}


.section-header-premium h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #065f46;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.section-header-premium .icon-box {
    width: 32px;
    height: 32px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    border: none;
}

@media (max-width: 768px) {
    .section-header-premium {
        margin: 2rem 0 1rem;
        gap: 0.75rem;
    }

    .section-header-premium h2 {
        font-size: 1.25rem;
    }

    .section-header-premium .icon-box {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
}

/* ============================================
   MOBILE FAB & POPUP SYSTEM (PREMIUM)
   ============================================ */

/* Desktop State: Grid visible */
@media (min-width: 769px) {
    .transaction-forms {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
        gap: 1.5rem !important;
        margin: 2.5rem 0 !important;
    }

    .transaction-card {
        display: flex !important;
        visibility: visible !important;
        height: auto !important;
        opacity: 1 !important;
        transform: none !important;
        position: static !important;
    }

    .mobile-fab-container,
    .mobile-modal-close {
        display: none !important;
    }

    .mobile-overlay {
        display: none !important;
    }
}

/* Mobile State: FAB Visible, Cards hidden unless active */
@media (max-width: 768px) {
    .transaction-forms {
        display: contents;
        /* Allow children to be positioned individually on mobile */
    }

    .mobile-fab-container {
        position: fixed;
        bottom: 1.5rem;
        right: 1.25rem;
        z-index: 4000;
        display: flex;
        flex-direction: column-reverse;
        /* Expand upwards */
        align-items: flex-end;
        gap: 0.75rem;
    }

    .fab-main {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--primary-gradient);
        color: white;
        border: none;
        box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
        font-size: 1.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .fab-main.active {
        transform: rotate(45deg);
        background: #ef4444;
        /* Turn red when active for clear 'close' signal */
        box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    }

    .fab-menu {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        pointer-events: none;
        opacity: 0;
        transform: translateY(15px) scale(0.9);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        margin-bottom: 0.5rem;
    }

    .fab-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .fab-menu button {
        padding: 0.75rem 1.25rem;
        border-radius: 50px;
        border: none;
        background: white;
        color: #1e293b;
        font-weight: 700;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        white-space: nowrap;
        cursor: pointer;
        width: auto;
    }

    .fab-menu button i {
        color: #059669;
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.7);
        backdrop-filter: blur(6px);
        z-index: 3000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        display: block;
    }

    .mobile-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Popup Form State */
    .transaction-card {
        display: none;
    }

    .transaction-card.mobile-popup-active {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90% !important;
        max-width: 420px !important;
        max-height: 85vh;
        /* Limit height */
        z-index: 5000;
        background: white;
        border-radius: 28px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
        animation: popupIn 0.3s ease-out;
        padding: 0;
        /* Clear padding for inner scroll control */
        overflow: hidden;
        /* Header/Close button stay fixed */
    }

    .transaction-card.mobile-popup-active .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.75rem 1.75rem 1rem;
        border-bottom: 1px solid #f1f5f9;
        flex-shrink: 0;
        position: relative;
        margin-bottom: 0.5rem;
    }

    .transaction-card.mobile-popup-active .card-body {
        padding: 0.5rem 1.75rem 1.75rem;
        overflow-y: auto;
        flex: 1;
    }

    .transaction-card.mobile-popup-active .card-header h3 {
        margin: 0;
        font-size: 1.25rem;
        color: #1e293b;
    }

    .mobile-modal-close {
        display: none;
        /* Hide on desktop by default */
    }

    .transaction-card.mobile-popup-active .mobile-modal-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #f1f5f9;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        color: #64748b;
        font-size: 1.75rem;
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 1rem;
        z-index: 6000;
        /* Highest priority */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transition: background 0.2s;
    }

    .transaction-card.mobile-popup-active .mobile-modal-close:active {
        background: #e2e8f0;
    }

    @keyframes popupIn {
        from {
            opacity: 0;
            transform: translate(-50%, -45%) scale(0.95);
        }

        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }

    /* ============================================
       COMPACT RESPONSIVE TABLE (DENSE CARD VIEW)
       ============================================ */
    .table-container {
        background: transparent;
        box-shadow: none;
        border: none;
        overflow: visible;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100%;
    }

    thead tr {
        display: none;
    }

    tbody tr {
        background: white;
        border-radius: 16px;
        padding: 0.85rem;
        margin-bottom: 0.75rem;
        box-shadow: var(--shadow-sm);
        border: 1px solid #f1f5f9;
        display: flex;
        flex-wrap: wrap;
        gap: 0;
    }

    tbody tr.sub-row {
        margin-top: -0.5rem;
        margin-left: 4%;
        width: 96%;
        background: #fdfdfd;
        border-left: 3px solid #10b981;
        padding: 0.65rem 0.85rem;
    }

    /* Cell layout for high density */
    td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.4rem 0.25rem;
        border: none;
        font-size: 0.85rem;
        width: 50%;
        /* Default to half-width for dense layout */
    }

    /* Make Description and Actions full width */
    td[data-label="বিবরণ"],
    td[data-label="কার্য"] {
        width: 100%;
        border-top: 1px solid #f1f5f9;
        margin-top: 0.25rem;
        padding-top: 0.5rem;
    }

    td[data-label="তারিখ"] {
        width: 60%;
    }

    td[data-label="প্রকার"] {
        width: 40%;
        align-items: flex-end;
    }

    td[data-label="পরিমাণ"],
    td[data-label="পরিশোধিত"],
    td[data-label="বাকি"] {
        width: 33.33%;
        border-top: 1px solid #f8fafc;
        padding-top: 0.5rem;
    }

    /* Adjust labels for density */
    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #94a3b8;
        font-size: 0.65rem;
        text-transform: uppercase;
        margin-bottom: 0.15rem;
    }

    .date-cell {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        line-height: 1.2;
    }

    .date-cell .time {
        font-size: 0.75rem;
        color: #64748b;
    }

    .amount-cell {
        font-weight: 700;
        font-size: 0.95rem;
    }

    .action-buttons {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
        margin-top: 0.25rem;
    }

    .btn-icon {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    /* Compact type badge */
    .transaction-type {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   CUSTOM CONFIRMATION MODAL (PREMIUM)
   ============================================ */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.confirm-card {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.confirm-icon {
    width: 80px;
    height: 80px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
}

.confirm-card h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.confirm-card p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
}

.confirm-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'SiyamRupali', 'SolaimanLipi', 'Poppins', sans-serif;
}

.confirm-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.confirm-btn-cancel:hover {
    background: #e2e8f0;
}

.confirm-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.confirm-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}