/**
 * Bengali Business Inventory & Accounting Management Web Application
 * Master Stylesheet (assets/css/style.css)
 */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --secondary-color: #0284c7;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --info-color: #06b6d4;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-header: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;

    --sidebar-width: 260px;
    --header-height: 64px;
    --font-base: 'Hind Siliguri', sans-serif;
    --sidebar-font-size: 14px;
    --transition: all 0.25s ease-in-out;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-main: #0b1120;
    --bg-card: #1e293b;
    --bg-sidebar: #090d16;
    --bg-header: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --border-color: #334155;
    --primary-light: #064e3b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: var(--transition);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-badge {
    background: #059669;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 10px;
    font-size: var(--sidebar-font-size);
}

.menu-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 10px 12px 4px;
    font-weight: 600;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 3px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.nav-link-custom:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-link-custom.active {
    color: #ffffff;
    background: linear-gradient(135deg, #059669, #047857);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

/* Top Navbar / Header */
.top-navbar {
    height: var(--header-height);
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.marquee-container {
    flex: 1;
    max-width: 600px;
    overflow: hidden;
    margin: 0 20px;
    background: var(--primary-light);
    border-radius: 20px;
    padding: 4px 16px;
    color: var(--primary-hover);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
}

.marquee-text {
    display: inline-block;
    animation: marquee-anim 25s linear infinite;
}

@keyframes marquee-anim {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Money Visibility Toggle */
.money-mask {
    letter-spacing: 2px;
    font-family: monospace;
}

/* Custom Cards */
.card-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.card-custom:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--primary-color);
}

.stat-card.stat-purple { border-left-color: #8b5cf6; }
.stat-card.stat-blue { border-left-color: #0284c7; }
.stat-card.stat-green { border-left-color: #10b981; }
.stat-card.stat-red { border-left-color: #ef4444; }
.stat-card.stat-orange { border-left-color: #f59e0b; }

.stat-title {
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.15;
    width: 48px;
    height: 48px;
}

/* Section Containers & Modals */
.content-body {
    padding: 24px;
    flex: 1;
}

/* Section 34: All dialogs width: 95%; border-radius: 8px; */
.modal-dialog {
    max-width: 800px;
    width: 95% !important;
    margin: 1.75rem auto;
}

.modal-dialog-sm {
    max-width: 480px;
}

.modal-content {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
    background: linear-gradient(135deg, #059669, #0284c7);
    color: #ffffff;
    border-bottom: none;
    padding: 14px 20px;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-title {
    font-weight: 600;
    font-size: 17px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
}

/* Tables */
.table-custom {
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table-custom th {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13.5px;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-custom td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background-color: rgba(5, 150, 105, 0.03);
}

/* Progress bar */
.progress-custom {
    height: 10px;
    border-radius: 6px;
    background-color: var(--border-color);
    overflow: hidden;
}

/* Printable Bill / Invoice Styles */
@media print {
    body * {
        visibility: hidden;
    }
    #printableReceipt, #printableReceipt * {
        visibility: visible;
    }
    #printableReceipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
        background: #ffffff !important;
        color: #000000 !important;
    }
    .no-print {
        display: none !important;
    }
}

.receipt-box {
    border: 1px dashed #94a3b8;
    background: #fafafa;
    border-radius: 8px;
    padding: 24px;
    color: #1e293b;
    font-size: 14px;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

/* Calculator Widget */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-btn {
    height: 48px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-primary);
}

.calc-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.calc-display {
    grid-column: span 4;
    height: 60px;
    font-size: 26px;
    text-align: right;
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: monospace;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
}

/* Action buttons */
.btn-action-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-action-icon:hover {
    transform: translateY(-1px);
}

/* ================= Mobile & Screenshot Matching Styles (Screenshots 1000882034, 1000882035, 1000882036) ================= */

/* Header Top Navbar Layout */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-date-pill {
    position: relative;
    display: inline-block;
}

.header-hidden-date-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* Dua / Islamic Blessing Ticker */
.dua-marquee-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}

/* 4 Main Stat Cards (2x2 Grid) */
.dash-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.dash-card {
    border-radius: 16px;
    padding: 14px 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 112px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    border: 1px solid transparent;
}

.dash-card-pink {
    background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
    border-color: #fecdd3;
}

.dash-card-green {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.dash-card-amber {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}

.dash-card-blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
}

.dash-card-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    margin: 4px 0 2px 0;
}

.dash-card-sub {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
}

.dash-card-icon {
    font-size: 20px;
    line-height: 1;
}

.text-amber {
    color: #d97706 !important;
}

/* Purchase & Sale Section Containers */
.purchase-section-box, .sale-section-box {
    border-radius: 18px;
    overflow: hidden;
}

.purchase-box-header {
    background-color: #dc2626;
    color: #ffffff;
}

.purchase-box-search {
    background-color: #dc2626;
}

.purchase-search-input {
    background-color: #b91c1c !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    font-size: 14px;
    padding: 8px 16px;
}

.purchase-search-input::placeholder {
    color: rgba(255,255,255,0.75) !important;
}

.purchase-search-input:focus {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2) !important;
}

.sale-box-header {
    background-color: #059669;
    color: #ffffff;
}

.sale-box-search {
    background-color: #059669;
}

.sale-search-input {
    background-color: #047857 !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    font-size: 14px;
    padding: 8px 16px;
}

.sale-search-input::placeholder {
    color: rgba(255,255,255,0.75) !important;
}

.sale-search-input:focus {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2) !important;
}

/* Item Cards in Dashboard */
.dash-item-card {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-item-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Modals matching Screenshots 1000882035 & 1000882036 */
.modal-content-custom {
    border-radius: 20px !important;
    border: none !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-cancel-custom {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    border-radius: 10px;
}

.btn-cancel-custom:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.btn-purchase-add {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    font-weight: 700;
    border-radius: 10px;
}

.btn-purchase-add:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.btn-sale-add {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    font-weight: 700;
    border-radius: 10px;
}

.btn-sale-add:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}
