/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* CSS Custom Properties (Design Tokens) */
:root {
    /* ─── Professional Color Palette ─────────────────────────────────────────
       Family: Slate-Indigo  |  Saturation: Controlled (25-55%)
       All text-on-bg combos meet WCAG AA (≥4.5:1 for normal text)
    ─────────────────────────────────────────────────────────────────────── */

    /* Primary — Deep Indigo Slate (hsl 228°) */
    --primary: hsl(228, 48%, 38%);
    /* #3048 — rich, calm indigo */
    --primary-hover: hsl(228, 52%, 30%);
    /* darker on hover */
    --primary-light: hsl(228, 50%, 95%);
    /* very pale tint for bg fills */
    --primary-medium: hsl(228, 42%, 88%);
    /* subtle border / divider */

    /* Secondary — Charcoal Slate */
    --secondary: hsl(220, 18%, 20%);
    /* near-black, readable on white */

    /* Accent — Muted Teal (pairs well with indigo) */
    --accent: hsl(175, 42%, 40%);
    /* calm teal */
    --accent-hover: hsl(175, 48%, 32%);

    /* Semantic — desaturated for professionalism */
    --success: hsl(152, 40%, 38%);
    /* forest green */
    --danger: hsl(4, 52%, 46%);
    /* brick red */
    --warning: hsl(38, 55%, 46%);
    /* amber ochre */
    --info: hsl(210, 48%, 42%);
    /* steel blue */

    /* Neutral Colors */
    --bg-body: hsl(220, 18%, 96%);
    /* cool off-white */
    --bg-card: hsl(0, 0%, 100%);
    --bg-dark: hsl(222, 20%, 14%);
    /* deep navy-slate */
    --text-primary: hsl(222, 20%, 14%);
    /* same dark for text */
    --text-muted: hsl(220, 10%, 48%);
    /* medium grey */
    --text-light: hsl(220, 20%, 94%);
    --border-color: hsl(220, 14%, 89%);
    --border-color-dark: hsl(220, 14%, 22%);

    /* Layout & Spacing */
    --header-height: 80px;
    --sidebar-width: 260px;

    /* Visual Effects */
    --border-radius-sm: 6px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);

    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Core Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

.gap-4 {
    gap: 32px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 48px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 48px;
}

.py-2 {
    padding-top: 16px;
    padding-bottom: 16px;
}

.py-4 {
    padding-top: 32px;
    padding-bottom: 32px;
}

.py-6 {
    padding-top: 64px;
    padding-bottom: 64px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-card);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(48, 70, 140, 0.22);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--bg-card);
}

.btn-secondary:hover {
    background-color: hsl(35, 30%, 12%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--bg-dark);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--bg-card);
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: hsl(350, 70%, 40%);
}

.btn-sm {
    padding: 6px 18px;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
}

.btn-xs {
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    border-radius: var(--border-radius-sm) !important;
}

/* Glassmorphism Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.85;
}

.logo .logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(48, 70, 140, 0.28);
}

.logo span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary);
    padding: 8px 4px;
    border-radius: 0;
    position: relative;
    font-size: 0.93rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background-color: transparent;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--secondary);
    border-radius: 3px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - var(--header-height));
        background: var(--bg-card);
        flex-direction: column;
        padding: 40px 24px;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        align-items: flex-start;
        gap: 20px;
    }

    .nav-menu.active {
        right: 0;
    }
}

/* Base Body Padding for Fixed Nav */
.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - 300px);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Product Card */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-img-wrapper {
    position: relative;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    background-color: #f5f5f5;
    overflow: hidden;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.08);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-cat {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7rem;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.product-price {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Footer styling */
.footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 60px 0 20px;
    margin-top: 60px;
    border-top: 3px solid var(--primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-title {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.footer-socials {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.social-icon {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border-color-dark);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Dashboard Page Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-body);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 99;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color-dark);
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
}

.sidebar-brand span {
    color: var(--primary);
}

.sidebar-menu {
    list-style: none;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-item.active a,
.sidebar-item a:hover {
    background-color: var(--primary);
    color: white;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color-dark);
}

/* Dashboard Main Pane */
.dashboard-main {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-navbar {
    position: sticky;
    top: 0;
    z-index: 98;
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.dashboard-container {
    padding: 32px;
    flex-grow: 1;
}

@media (max-width: 992px) {
    .sidebar {
        left: -100%;
    }

    .sidebar.active {
        left: 0;
    }

    .dashboard-main {
        margin-left: 0;
    }
}

/* Dashboard KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-details h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.kpi-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.kpi-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.kpi-success {
    background-color: hsl(152, 40%, 93%);
    color: var(--success);
}

.kpi-danger {
    background-color: hsl(4, 52%, 94%);
    color: var(--danger);
}

.kpi-info {
    background-color: hsl(210, 48%, 93%);
    color: var(--info);
}

/* Table styles */
.table-wrapper {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-bottom: 32px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th,
.table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.table th {
    background-color: var(--bg-body);
    font-weight: 600;
    color: var(--secondary);
    font-family: 'Outfit', sans-serif;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Badge tags */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: hsl(152, 40%, 90%);
    color: var(--success);
}

.badge-danger {
    background-color: hsl(4, 52%, 90%);
    color: var(--danger);
}

.badge-warning {
    background-color: hsl(38, 55%, 90%);
    color: var(--warning);
}

.badge-info {
    background-color: hsl(210, 48%, 90%);
    color: var(--info);
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: var(--bg-card);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(48, 70, 140, 0.12);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Alerts */
.django-alert {
    padding: 16px 24px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: hsl(152, 40%, 94%);
    color: var(--success);
    border-left-color: var(--success);
}

.alert-error,
.alert-danger {
    background-color: hsl(4, 52%, 95%);
    color: var(--danger);
    border-left-color: var(--danger);
}

.alert-warning {
    background-color: hsl(38, 55%, 94%);
    color: var(--warning);
    border-left-color: var(--warning);
}

.alert-info {
    background-color: hsl(210, 48%, 94%);
    color: var(--info);
    border-left-color: var(--info);
}

/* Charts Card container */
.chart-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.chart-card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Color Utility Classes for Dynamic Theme Elements */
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-green {
    color: #27ae60 !important;
}

.text-emerald {
    color: #2ecc71 !important;
}

.text-alizarin {
    color: #e74c3c !important;
}

/* Border Left Utility Classes */
.border-left-success {
    border-left: 4px solid var(--success) !important;
}

.border-left-danger {
    border-left: 4px solid var(--danger) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning) !important;
}

/* Background Soft Fills */
.bg-success-soft {
    background-color: rgba(46, 204, 113, 0.1) !important;
}

.bg-danger-soft {
    background-color: rgba(231, 76, 60, 0.1) !important;
}

.bg-warning-soft {
    background-color: #fff3cd !important;
}

.bg-danger-soft-alt {
    background-color: #f8d7da !important;
}

/* Notification UI helper classes */
.notification-item {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    background: transparent;
}

.notification-item.unread {
    background: rgba(186, 139, 87, 0.05) !important;
}

.notification-text {
    font-weight: normal;
    margin-bottom: 4px;
    color: var(--text-color);
}

.notification-item.unread .notification-text {
    font-weight: bold !important;
}

/* Global Dashboard Print Styles */
@media print {

    .sidebar,
    .dashboard-navbar,
    .no-print,
    header,
    footer,
    .btn-glass,
    .btn,
    form,
    button,
    .dashboard-navbar button {
        display: none !important;
    }

    .dashboard-main,
    .dashboard-layout {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt !important;
    }

    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: white !important;
        margin-bottom: 16px !important;
        padding: 16px !important;
    }

    .table-wrapper {
        border: none !important;
        box-shadow: none !important;
        overflow-x: visible !important;
    }

    .table {
        width: 100% !important;
        border: 1px solid #ddd !important;
    }

    .table th,
    .table td {
        padding: 8px 10px !important;
        border-bottom: 1px solid #ddd !important;
        font-size: 10pt !important;
    }
}


/* ──────────────────────────────────────────────────────────────────────────
   Mobile & Responsive Dashboard Fixes
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {

    /* Navbar adjustments */
    .dashboard-navbar {
        padding: 0 16px !important;
    }

    .navbar-title {
        font-size: 1rem !important;
    }

    @media (max-width: 576px) {
        .navbar-title {
            display: none !important;
        }
    }

    .user-meta {
        display: none !important;
    }

    .logout-text {
        display: none !important;
    }

    .logout-btn {
        margin-left: 6px !important;
        padding: 6px 10px !important;
    }

    .dashboard-user {
        gap: 6px !important;
    }

    .dashboard-user a.btn {
        margin-left: 4px !important;
        padding: 6px 8px !important;
        font-size: 0.8rem !important;
    }

    /* Layout padding */
    .dashboard-container {
        padding: 16px 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Header action stacking */
    .mb-3.d-flex.justify-between.align-center.flex-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    .mb-3.d-flex.justify-between.align-center.flex-wrap>div:last-child {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .mb-3.d-flex.justify-between.align-center.flex-wrap>div:last-child a,
    .mb-3.d-flex.justify-between.align-center.flex-wrap>div:last-child button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* Tabs scrollable */
    .tabs-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        padding-bottom: 6px !important;
    }

    .tabs-nav .tab-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }

    /* Tables responsiveness */
    .table-wrapper,
    .tx-panel {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .table,
    .tx-table {
        width: 100% !important;
        min-width: 650px !important;
    }

    /* Billing Builder table */
    .builder-table {
        min-width: 750px !important;
    }

    /* Panel card flex layouts stacking */
    .panel-card div[style*="display: flex"],
    .panel-card div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .panel-card .form-group-custom {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Finance Header Stacking */
    .finance-header {
        padding: 20px 16px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .finance-header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .finance-header-actions a,
    .finance-header-actions button {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Filter bars stacking */
    .filter-bar {
        padding: 14px 16px !important;
    }

    .filter-bar form {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .filter-bar .form-control {
        width: 100% !important;
    }

    .filter-bar a.btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Flex item stacking */
    .d-flex.flex-wrap>div[style*="flex"],
    .d-flex.flex-wrap>div[style*="flex:"] {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

/* Card with responsive padding */
.card-padded {
    padding: 40px;
}

@media (max-width: 576px) {
    .card-padded {
        padding: 20px !important;
    }
}

/* Row-to-Card stacked table responsiveness on mobile */
@media (max-width: 768px) {
    .table-responsive-stack {
        min-width: auto !important;
        width: 100% !important;
    }

    .table-responsive-stack,
    .table-responsive-stack thead,
    .table-responsive-stack tbody,
    .table-responsive-stack th,
    .table-responsive-stack td,
    .table-responsive-stack tr {
        display: block !important;
    }

    .table-responsive-stack thead {
        display: none !important;
    }

    .table-responsive-stack tr {
        border: 1px solid var(--border-color) !important;
        border-bottom: 2px solid var(--border-color) !important;
        padding: 6px 0 !important;
        background-color: var(--bg-card) !important;
        margin-bottom: 12px !important;
        border-radius: var(--border-radius-sm) !important;
        box-shadow: var(--shadow-sm) !important;
    }

    .table-responsive-stack td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 12px !important;
        border-bottom: 1px dashed var(--border-color) !important;
        text-align: right !important;
        font-size: 0.95rem !important;
    }

    .table-responsive-stack td:last-child {
        border-bottom: none !important;
    }

    .table-responsive-stack td::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
        text-align: left !important;
        padding-right: 10px !important;
    }

    /* Custom tweaks for specific columns in mobile stacked card layout */
    .table-responsive-stack td[data-label="ছবি"]::before,
    .table-responsive-stack td[data-label="অ্যাকশন"]::before,
    .table-responsive-stack td[data-label="ছবি"]::before,
    .table-responsive-stack td[data-label="অ্যাকশন"]::before {
        display: none !important;
    }

    .table-responsive-stack td[data-label="ছবি"],
    .table-responsive-stack td[data-label="অ্যাকশন"] {
        justify-content: center !important;
        text-align: center !important;
        border-bottom: none !important;
    }

    .table-responsive-stack td[data-label="ছবি"] img,
    .table-responsive-stack td[data-label="ছবি"] div {
        width: 80px !important;
        height: 80px !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 480px) {
    .pagination-first-last {
        display: none !important;
    }
}