/**
 * Voucher & Bill System - Stylesheet
 * @version 3.0
 */

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

* {
    font-family: 'Noto Sans Bengali', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f3f4f6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main content wrapper should grow to fill space */
#loginScreen,
#dashboardScreen,
#historyScreen,
#createVoucherScreen,
#settingsScreen,
#manageUsersScreen,
#inventoryScreen,
#changePasswordScreen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Make main content grow to push footer down */
#dashboardScreen>main,
#historyScreen>main,
#createVoucherScreen>main,
#settingsScreen>main,
#manageUsersScreen>main,
#inventoryScreen>main,
#changePasswordScreen>main {
    flex: 1;
}

/* Sticky header styling */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
}


/* =====================================================
   SIDEBAR MENU STYLES
   ===================================================== */
.sidebar {
    background-color: #111827;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1f2937;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.sidebar-item {
    color: #e5e7eb;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background-color: #1f2937;
    color: #60a5fa;
    transform: translateX(2px);
}

.sidebar-item.active {
    background-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    border-left: 4px solid #1e3a8a;
}

/* Submenu Styles */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-submenu.expanded {
    max-height: 500px;
}

.sidebar-submenu-item {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    font-size: 0.875rem;
    color: #d1d5db;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.sidebar-submenu-item:hover {
    background-color: #374151;
    color: #f3f4f6;
    padding-left: 3rem;
}

.sidebar-submenu-item.active {
    background-color: #1e40af;
    color: #f3f4f6;
    border-left: 3px solid #60a5fa;
    padding-left: 2.5rem;
}

/* Icon rotation for submenu toggle */
.rotate-180 {
    transform: rotate(180deg);
}

/* Minimized sidebar state */
.sidebar.minimized {
    width: 80px;
}

.sidebar.minimized .sidebar-item span,
.sidebar.minimized .mb-6 > p,
.sidebar.minimized .sidebar-submenu {
    display: none;
}

.sidebar.minimized .sidebar-item {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.sidebar.minimized .sidebar-item svg {
    margin: 0;
    width: 1.5rem;
    height: 1.5rem;
}

#dashboardScreen.sidebar-minimized main {
    padding-left: 6.25rem;
}

#minimizeIcon {
    transform: scaleX(-1);
}

#minimizeIcon.expanded {
    transform: scaleX(-1) rotate(180deg);
}

/* Responsive sidebar for smaller screens */
@media (max-width: 1024px) {
    .sidebar {
        margin-left: 0;
    }

    #dashboardScreen main {
        padding-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 16rem;
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    main {
        padding-left: 0 !important;
        padding-top: 5rem;
    }

    .app-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* =====================================================
   DASHBOARD LAYOUT ADJUSTMENT FOR SIDEBAR
   ===================================================== */
#dashboardScreen main {
    padding-left: 16rem;
    padding-top: 4rem;
}

#dashboardScreen .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

#dashboardScreen main > div {
    max-width: none;
}


/* =====================================================
   A4 PAGE STYLES
   ===================================================== */
.a4-page {
    width: 210mm;
    min-height: 297mm;
    padding: 3mm 10mm 10mm 10mm;
    margin: 0 auto;
    background: white;
    box-sizing: border-box;
    position: relative;
}

/* Auto-scaling classes */
.a4-page.scale-95 .voucher-content {
    font-size: 0.95em;
}

.a4-page.scale-90 .voucher-content {
    font-size: 0.90em;
}

.a4-page.scale-85 .voucher-content {
    font-size: 0.85em;
}

.a4-page.scale-80 .voucher-content {
    font-size: 0.80em;
}

.a4-page.scale-75 .voucher-content {
    font-size: 0.75em;
}

.a4-page.scale-70 .voucher-content {
    font-size: 0.70em;
}

.a4-page.scale-95 .voucher-table th,
.a4-page.scale-95 .voucher-table td {
    padding: 5px 6px;
}

.a4-page.scale-90 .voucher-table th,
.a4-page.scale-90 .voucher-table td {
    padding: 4px 5px;
}

.a4-page.scale-85 .voucher-table th,
.a4-page.scale-85 .voucher-table td {
    padding: 3px 4px;
}

.a4-page.scale-80 .voucher-table th,
.a4-page.scale-80 .voucher-table td {
    padding: 3px 4px;
}

.a4-page.scale-75 .voucher-table th,
.a4-page.scale-75 .voucher-table td {
    padding: 2px 3px;
}

.a4-page.scale-70 .voucher-table th,
.a4-page.scale-70 .voucher-table td {
    padding: 2px 3px;
}

.a4-page.scale-85 .signature-space,
.a4-page.scale-80 .signature-space,
.a4-page.scale-75 .signature-space,
.a4-page.scale-70 .signature-space {
    min-height: 20px;
}

/* =====================================================
   WATERMARK STYLES
   ===================================================== */
.watermark {
    position: absolute;
    opacity: var(--watermark-opacity, 0.08);
    pointer-events: none;
    z-index: 0;
    max-width: var(--watermark-size, 40%);
    max-height: var(--watermark-size, 40%);
    object-fit: contain;
    top: var(--watermark-vertical, 50%);
    transform: translate(var(--watermark-translate-x, -50%), -50%);
}

.watermark.h-pos-left {
    left: 15%;
    --watermark-translate-x: 0%;
}

.watermark.h-pos-center {
    left: 50%;
    --watermark-translate-x: -50%;
}

.watermark.h-pos-right {
    right: 15%;
    left: auto;
    --watermark-translate-x: 0%;
}

/* =====================================================
   SEAL STYLES
   ===================================================== */
.seal {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    object-fit: contain;
    transform: translate(-50%, -50%);
}

.paid-seal {
    width: var(--paid-seal-size, 80px);
    height: var(--paid-seal-size, 80px);
    opacity: var(--paid-seal-opacity, 0.7);
    left: var(--paid-seal-horizontal, 75%);
    top: var(--paid-seal-vertical, 60%);
}

.due-seal {
    width: var(--due-seal-size, 80px);
    height: var(--due-seal-size, 80px);
    opacity: var(--due-seal-opacity, 0.7);
    left: var(--due-seal-horizontal, 75%);
    top: var(--due-seal-vertical, 60%);
}

/* =====================================================
   SIGNATURE STYLES
   ===================================================== */
.signature-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px;
}

.signature-block {
    text-align: center;
    min-width: 140px;
}

.signature-space {
    min-height: 25px;
}

.signature-line {
    border-top: 1px solid #9ca3af;
    padding-top: 8px;
    min-width: 140px;
}

.signature-container {
    position: relative;
    min-height: 30px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 5px;
}

.signature-image {
    height: var(--signature-size, 60px);
    object-fit: contain;
}

/* =====================================================
   HEADER LOGO STYLES
   ===================================================== */
.header-logo {
    height: var(--header-logo-size, 40px);
    max-width: 120px;
    object-fit: contain;
}

.header-logo-wrapper {
    position: absolute;
    top: var(--header-logo-vertical, 0%);
}

.header-logo-wrapper.logo-left {
    left: 0;
    right: auto;
}

.header-logo-wrapper.logo-center {
    left: 50%;
    transform: translateX(-50%);
}

.header-logo-wrapper.logo-right {
    left: auto;
    right: 0;
}

/* =====================================================
   VOUCHER HEADER
   ===================================================== */
.voucher-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 0;
    min-height: 35px;
    font-family: 'Georgia', 'Garamond', serif;
}

#printCompanyName {
    font-family: 'Georgia', 'Garamond', serif;
    letter-spacing: 0.5px;
}

.company-info-section {
    width: 100%;
    padding: 0 70px;
}

.contact-info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 3px;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #4b5563;
}

.contact-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.contact-text {
    white-space: nowrap;
}

.contact-item:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 10px;
    background-color: #9ca3af;
    margin-left: 12px;
}

.voucher-content {
    position: relative;
    z-index: 1;
}

/* =====================================================
   VOUCHER TYPE BADGE
   ===================================================== */
.voucher-type-badge {
    display: inline-block;
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: white;
    background: linear-gradient(135deg, #1e3a8a 0%, #0c1e4d 100%);
    padding: 0.4rem 2rem;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.4);
    margin: 0 auto;
}


/* =====================================================
   TABLE STYLES
   ===================================================== */
.voucher-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.voucher-table th,
.voucher-table td {
    border: 1px solid #d1d5db;
    padding: 6px 8px;
}

.voucher-table th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.voucher-table td {
    color: #1f2937;
}

.voucher-table td.text-center {
    text-align: center;
}

.voucher-table td.text-right {
    text-align: right;
}

.amount-cell {
    text-align: right;
    white-space: nowrap;
}

/* Form table */
.form-table {
    width: 100%;
    border-collapse: collapse;
}

.form-table th {
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.form-table td {
    padding: 0.5rem;
}

/* =====================================================
   FORM STYLES
   ===================================================== */
.input-field {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    outline: none;
}

.input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field::placeholder {
    color: #9ca3af;
}

.input-field.text-right {
    text-align: right;
}

.input-field[readonly] {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Password toggle button */
.password-toggle-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 0.75rem;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #374151;
}

.password-toggle-btn:focus {
    outline: none;
}

.password-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.password-toggle-btn .eye-icon,
.password-toggle-btn .eye-off-icon {
    transition: opacity 0.2s ease;
}

/* =====================================================
   BUTTON STYLES
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 0.25rem;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-success {
    background-color: #16a34a;
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    padding: 0.25rem 1rem;
    font-size: 0.75rem;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* =====================================================
   DASHBOARD STYLES
   ===================================================== */
.dashboard-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Card hover colors based on border color */
.dashboard-card.border-blue-500:hover {
    background-color: #dbeafe;
}

.dashboard-card.border-green-500:hover {
    background-color: #dcfce7;
}

.dashboard-card.border-purple-500:hover {
    background-color: #f3e8ff;
}

.dashboard-card.border-yellow-500:hover {
    background-color: #fef3c7;
}

.dashboard-card.border-orange-500:hover {
    background-color: #fed7aa;
}

.dashboard-card.border-teal-500:hover {
    background-color: #ccfbf1;
}

.dashboard-card.border-pink-500:hover {
    background-color: #fbcfe8;
}

.dashboard-card.border-amber-500:hover {
    background-color: #fffbeb;
}

/* =====================================================
   LOGO PREVIEW
   ===================================================== */
.logo-preview-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px dashed #d1d5db;
}

.logo-preview-box img {
    max-height: 60px;
    max-width: 150px;
    object-fit: contain;
}

/* Site Settings button improvements */
button[data-route="site-settings"], .site-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.1rem 0.2rem;
    background: transparent;
    border: none;
    color: inherit;
}

.site-settings-btn svg,
.site-settings-btn .fi {
    width: 18px;
    height: 18px;
    color: #374151;
    opacity: 0.9;
    font-size: 18px;
}

.site-settings-btn span {
    line-height: 1;
}

.site-icon-img {
    height: 18px;
    width: 18px;
    object-fit: contain;
    border-radius: 4px;
    display: inline-block;
}

/* =====================================================
   SYNC STATUS
   ===================================================== */
#syncStatus {
    transition: all 0.3s ease;
}

#syncDot {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* =====================================================
   TOAST NOTIFICATION
   ===================================================== */
.toast-notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        background: white;
    }

    .no-print,
    #syncStatus {
        display: none !important;
    }

    .a4-page {
        width: 210mm;
        height: auto;
        padding: 2mm 8mm 8mm 8mm;
        margin: 0 0 10mm 0;
        box-shadow: none;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .watermark {
        opacity: var(--watermark-opacity, 0.08) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .seal {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .header-logo {
        height: var(--header-logo-size, 40px) !important;
        max-width: 120px !important;
    }

    .signature-image {
        height: var(--signature-size, 60px) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .voucher-table {
        page-break-inside: auto;
    }

    .voucher-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .voucher-table thead {
        display: table-header-group;
    }

    /* Make sure table header repeats with border */
    .voucher-table thead tr {
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .voucher-table th {
        background-color: #f3f4f6 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .voucher-type-badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Repeating header for multi-page print */
    .print-page-header {
        display: block !important;
        position: running(header);
    }

    @supports not (position: running(header)) {

        /* Fallback for browsers that don't support running headers */
        .voucher-header {
            display: block;
        }
    }

    /* Prevent page breaks in certain sections */
    .client-section,
    .voucher-summary,
    .signature-row {
        page-break-inside: avoid;
    }

    /* Allow page break before signature if needed */
    .signature-row {
        page-break-before: auto;
    }

    /* Ensure footer stays at bottom of last page */
    .voucher-footer {
        page-break-inside: avoid;
    }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

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

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

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

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.space-x-1>*+* {
    margin-left: 0.25rem;
}

.space-x-2>*+* {
    margin-left: 0.5rem;
}

.space-x-3>*+* {
    margin-left: 0.75rem;
}

.space-x-4>*+* {
    margin-left: 1rem;
}

.space-x-6>*+* {
    margin-left: 1.5rem;
}

.space-y-3>*+* {
    margin-top: 0.75rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.space-y-8>*+* {
    margin-top: 2rem;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .md\:col-span-2 {
        grid-column: span 2 / span 2;
    }
}

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

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

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

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.italic {
    font-style: italic;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.text-gray-300 {
    color: #d1d5db;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-800 {
    color: #1f2937;
}

.text-white {
    color: white;
}

.text-blue-600 {
    color: #2563eb;
}

.text-blue-700 {
    color: #1d4ed8;
}

.text-green-600 {
    color: #16a34a;
}

.text-red-600 {
    color: #dc2626;
}

.text-purple-600 {
    color: #9333ea;
}

.text-indigo-600 {
    color: #4f46e5;
}

.text-yellow-600 {
    color: #ca8a04;
}

.text-cyan-600 {
    color: #0891b2;
}

.bg-white {
    background-color: white;
}

.bg-gray-50 {
    background-color: #f9fafb;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-gray-800 {
    background-color: #1f2937;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.bg-blue-100 {
    background-color: #dbeafe;
}

.bg-blue-600 {
    background-color: #2563eb;
}

.bg-green-50 {
    background-color: #f0fdf4;
}

.bg-green-100 {
    background-color: #dcfce7;
}

.bg-green-500 {
    background-color: #22c55e;
}

.bg-green-600 {
    background-color: #16a34a;
}

.bg-purple-50 {
    background-color: #faf5ff;
}

.bg-purple-100 {
    background-color: #f3e8ff;
}

.bg-purple-600 {
    background-color: #9333ea;
}

.bg-red-50 {
    background-color: #fef2f2;
}

.bg-red-100 {
    background-color: #fee2e2;
}

.bg-red-600 {
    background-color: #dc2626;
}

.bg-indigo-50 {
    background-color: #eef2ff;
}

.bg-indigo-100 {
    background-color: #e0e7ff;
}

.bg-yellow-50 {
    background-color: #fefce8;
}

.bg-yellow-100 {
    background-color: #fef9c3;
}

.bg-cyan-100 {
    background-color: #cffafe;
}

.bg-emerald-100 {
    background-color: #d1fae5;
}

.bg-black {
    background-color: #000;
}

.bg-opacity-50 {
    --tw-bg-opacity: 0.5;
}

.border {
    border: 1px solid #e5e7eb;
}

.border-t {
    border-top: 1px solid #e5e7eb;
}

.border-b {
    border-bottom: 1px solid #e5e7eb;
}

.border-b-2 {
    border-bottom: 2px solid #1f2937;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.border-gray-800 {
    border-color: #1f2937;
}

.border-l-4 {
    border-left: 4px solid;
}

.border-blue-200 {
    border-color: #bfdbfe;
}

.border-blue-500 {
    border-color: #3b82f6;
}

.border-green-500 {
    border-color: #22c55e;
}

.border-purple-500 {
    border-color: #a855f7;
}

.border-yellow-200 {
    border-color: #fef08a;
}

.border-yellow-500 {
    border-color: #eab308;
}

.border-cyan-500 {
    border-color: #06b6d4;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.pt-2 {
    padding-top: 0.5rem;
}

.pt-4 {
    padding-top: 1rem;
}

.pt-20 {
    padding-top: 5rem;
}

.pb-1 {
    padding-bottom: 0.25rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pl-3 {
    padding-left: 0.75rem;
}

.pl-10 {
    padding-left: 2.5rem;
}

.m-0 {
    margin: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.-mx-2 {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.my-8 {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.mx-4 {
    margin-left: 1rem;
    margin-right: 1rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.w-3 {
    width: 0.75rem;
}

.w-4 {
    width: 1rem;
}

.w-5 {
    width: 1.25rem;
}

.w-6 {
    width: 1.5rem;
}

.w-7 {
    width: 1.75rem;
}

.w-8 {
    width: 2rem;
}

.w-10 {
    width: 2.5rem;
}

.w-12 {
    width: 3rem;
}

.w-14 {
    width: 3.5rem;
}

.w-16 {
    width: 4rem;
}

.w-20 {
    width: 5rem;
}

.w-24 {
    width: 6rem;
}

.w-28 {
    width: 7rem;
}

.w-32 {
    width: 8rem;
}

.w-72 {
    width: 18rem;
}

.w-full {
    width: 100%;
}

.h-3 {
    height: 0.75rem;
}

.h-4 {
    height: 1rem;
}

.h-5 {
    height: 1.25rem;
}

.h-6 {
    height: 1.5rem;
}

.h-7 {
    height: 1.75rem;
}

.h-8 {
    height: 2rem;
}

.h-10 {
    height: 2.5rem;
}

.h-12 {
    height: 3rem;
}

.h-14 {
    height: 3.5rem;
}

.h-16 {
    height: 4rem;
}

.min-h-screen {
    min-height: 100vh;
}

.min-w-\[200px\] {
    min-width: 200px;
}

.max-w-xs {
    max-width: 20rem;
}

.max-w-sm {
    max-width: 24rem;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.max-w-5xl {
    max-width: 64rem;
}

.max-w-6xl {
    max-width: 72rem;
}

.max-w-7xl {
    max-width: 80rem;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.inset-y-0 {
    top: 0;
    bottom: 0;
}

.top-0 {
    top: 0;
}

.left-0 {
    left: 0;
}

.right-0 {
    right: 0;
}

.bottom-4 {
    bottom: 1rem;
}

.right-4 {
    right: 1rem;
}

.z-0 {
    z-index: 0;
}

.z-1 {
    z-index: 1;
}

.z-10 {
    z-index: 10;
}

.z-50 {
    z-index: 50;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-x-auto {
    overflow-x: auto;
}

.object-contain {
    object-fit: contain;
}

.cursor-pointer {
    cursor: pointer;
}

/* =====================================================
   COMPREHENSIVE CURSOR POINTER RULES
   ===================================================== */
/* Ensure all interactive elements show pointer cursor */
a,
button,
[role="button"],
[onclick],
label[for],
input[type="radio"],
input[type="submit"],
input[type="button"],
input[type="reset"],
select {
    cursor: pointer;
}

/* SVG icons within clickable elements */
button svg,
a svg,
[onclick] svg,
[role="button"] svg {
    cursor: pointer;
}

/* Table sortable/clickable headers */
.product-table th[onclick],
.product-table th.sortable,
th[onclick],
th.sortable {
    cursor: pointer;
}

/* Disabled states should show not-allowed cursor */
button:disabled,
input:disabled,
select:disabled,
a[disabled],
[disabled],
button[disabled],
.btn:disabled,
.btn[disabled] {
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Ensure readonly inputs don't show pointer */
input[readonly],
textarea[readonly] {
    cursor: not-allowed;
}

.pointer-events-none {
    pointer-events: none;
}

.transition {
    transition: all 0.2s ease;
}

.divide-y>*+* {
    border-top: 1px solid #e5e7eb;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.list-decimal {
    list-style-type: decimal;
}

.list-inside {
    list-style-position: inside;
}

/* Hover states */
.hover\:bg-gray-50:hover {
    background-color: #f9fafb;
}

.hover\:bg-blue-700:hover {
    background-color: #1d4ed8;
}

.hover\:bg-green-700:hover {
    background-color: #15803d;
}

.hover\:bg-purple-700:hover {
    background-color: #7e22ce;
}

.hover\:text-gray-300:hover {
    color: #d1d5db;
}

.hover\:text-gray-800:hover {
    color: #1f2937;
}

.hover\:text-blue-700:hover {
    color: #1d4ed8;
}

.hover\:text-red-700:hover {
    color: #b91c1c;
}

.hover\:text-red-800:hover {
    color: #991b1b;
}

.hover\:text-green-800:hover {
    color: #166534;
}

/* Focus states */
.focus\:ring-blue-500:focus {
    --tw-ring-color: #3b82f6;
}

.focus\:ring-green-500:focus {
    --tw-ring-color: #22c55e;
}

.focus\:ring-red-500:focus {
    --tw-ring-color: #ef4444;
}

.focus\:ring-purple-500:focus {
    --tw-ring-color: #a855f7;
}

.focus\:ring-indigo-500:focus {
    --tw-ring-color: #6366f1;
}

/* File input */
input[type="file"] {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Checkbox */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

/* Select */
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Range input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
}

/* Status badge */
.status-paid {
    background-color: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-due {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-partial {
    background-color: #fef9c3;
    color: #854d0e;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-returned {
    background-color: #fed7aa;
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* =====================================================
   AUTOCOMPLETE SUGGESTIONS
   ===================================================== */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #eff6ff;
}

.suggestion-item .suggestion-name {
    font-weight: 500;
    color: #1f2937;
}

.suggestion-item .suggestion-details {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.suggestion-item .suggestion-highlight {
    background-color: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}

/* =====================================================
   FOOTER STYLES
   ===================================================== */
#appFooter {
    margin-top: auto;
    position: relative;
    z-index: 10;
}

#appFooter a {
    text-decoration: none;
    font-weight: 500;
}

#appFooter a:hover {
    text-decoration: underline;
}

/* Hide footer during print */
@media print {
    #appFooter {
        display: none !important;
    }
}

/* =====================================================
   INVENTORY MODULE STYLES
   ===================================================== */

/* Stock Status Badges */
.stock-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
}

.stock-ok {
    background-color: #d1fae5;
    color: #065f46;
}

.stock-low {
    background-color: #fef3c7;
    color: #92400e;
}

.stock-out {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Product Table Enhancements */
.product-table th {
    user-select: none;
    transition: background-color 0.2s;
}

.product-table th.sorted-asc::after {
    content: ' ▲';
    font-size: 0.75rem;
    opacity: 0.6;
}

.product-table th.sorted-desc::after {
    content: ' ▼';
    font-size: 0.75rem;
    opacity: 0.6;
}

.product-table tbody tr {
    transition: background-color 0.15s;
}

.product-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Product Modal */
#productModal {
    backdrop-filter: blur(4px);
}

#inventoryScreen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#inventoryScreen>main {
    flex: 1;
}

/* =====================================================
   PRODUCT AUTOCOMPLETE IN VOUCHER
   ===================================================== */

/* Product Suggestions Dropdown */
.product-suggestions {
    max-height: 300px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.product-suggestions .suggestion-item {
    transition: background-color 0.15s;
}

.product-suggestions .suggestion-item:hover {
    background-color: #f3f4f6;
}

/* Stock Info Display */
.product-stock-info {
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: #f9fafb;
}

.product-stock-info svg {
    flex-shrink: 0;
}

/* Search Highlight */
.product-suggestions strong.bg-yellow-200 {
    background-color: #fef08a;
    font-weight: 600;
    padding: 0 2px;
}

/* Stock Warning Border for Quantity Input */
.border-red-500 {
    border-color: #ef4444 !important;
}

.border-2 {
    border-width: 2px !important;
}

/* =====================================================
   VOUCHER PRODUCT FORM IMPROVEMENTS
   ===================================================== */

/* Larger product description input for better search experience */
.product-description {
    min-height: 2.75rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
    font-weight: 500;
    line-height: 1.4;
}

/* Larger quantity, price, amount inputs for better UX */
.product-qty,
.product-rate,
.product-amount,
.product-warranty {
    min-height: 2.75rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
}

/* Product autocomplete dropdown - ensure full visibility */
.product-suggestions {
    position: absolute;
    z-index: 9999 !important;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    margin-top: 0.25rem;
    max-height: 32rem;
    overflow-y: auto;
}

/* Stock info styling */
.product-stock-info {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Ensure table cells allow dropdown overflow */
.form-table td {
    overflow: visible !important;
}

.form-table td.relative {
    position: relative;
    overflow: visible !important;
}

/* Description column - wider for product search */
.form-table th:nth-child(2),
.form-table td:nth-child(2) {
    min-width: 320px;
    width: 40%;
}

/* Quantity column */
.form-table th:nth-child(3),
.form-table td:nth-child(3) {
    width: 100px;
}

/* Unit Price column */
.form-table th:nth-child(4),
.form-table td:nth-child(4) {
    width: 130px;
}

/* Amount column */
.form-table th:nth-child(5),
.form-table td:nth-child(5) {
    width: 130px;
}

/* Ensure product table container allows overflow for dropdown */
#createVoucherScreen .bg-white.rounded-lg.shadow-sm,
#createVoucherScreen .products-section {
    overflow: visible !important;
}

/* Better spacing for product table body */
#productTableBody tr {
    position: relative;
}

/* Improve suggestion item styling */
.suggestion-item {
    transition: background-color 0.15s ease;
}

.suggestion-item:hover {
    background-color: #f3f4f6 !important;
}

/* User Requested Styles */
.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    min-height: 400px;
}

.table-responsive {
    overflow: visible;
}

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
    }
}

.suggestion-box {
    position: absolute;
    z-index: 1000;
    background: white;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   LOADING ANIMATION
   ===================================================== */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f4f6;
    border-top: 5px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}