      * {
        font-family: 'Roboto', system-ui, -apple-system, sans-serif;
      }
      
      #invoicePreview * {
        font-size: 13px !important;
      }
      
      #invoicePreview h1, #invoicePreview h2, #invoicePreview h3, #invoicePreview h4, #invoicePreview h5, #invoicePreview h6 {
        font-weight: bold;
        font-size: 13px !important;
      }
      
      #invoicePreview .company-name {
        font-size: 16px !important;
      }
      
      #invoicePreview .invoice-title {
        font-size: 16px !important;
      }
      
      #invoicePreview .invoice-title {
        font-size: 16px !important;
      }
      
      body {
        background: #f8fafc;
        min-height: 100vh;
        font-family: 'Inter', 'Roboto', system-ui, sans-serif;
      }
      
      body.loaded {
        opacity: 1;
      }
      
      .editable {
        cursor: text;
        transition: all 0.2s ease;
        border-radius: 4px;
        padding: 2px 4px;
        margin: -2px -4px;
      }
      
      .editable:hover {
        background-color: rgba(37, 99, 235, 0.05);
      }
      
      .editable:focus {
        outline: 2px solid #2563eb;
        background-color: white;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        color: #111827 !important;
      }
      
      .table-header-white {
        color: #111827 !important;
        background: white !important;
      }
      
      .items-heading {
        color: white !important;
      }
      
      .items-heading i {
        color: white !important;
      }
      
      .table-header-white:focus {
        color: #111827 !important;
        background-color: #f9fafb !important;
        outline: 2px solid #2563eb !important;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
      }
      
      .table-header-white:hover {
        color: #111827 !important;
        background-color: #f9fafb !important;
      }
      
      .invoice-preview {
        background: white;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
      }
      
      .sidebar {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-right: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        border-radius: 0 16px 16px 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      }
      
      .glass-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      }
      
      .glass-card:hover {
        background: rgba(255, 255, 255, 0.95);
        border-color: rgba(37, 99, 235, 0.2);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
      }
      
      .btn {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        font-weight: 500;
        border-radius: 12px;
        backdrop-filter: blur(10px);
      }
      
      .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }
      
      .btn:active {
        transform: translateY(0);
      }
      
      .template-option {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        position: relative;
      }
      
      .template-option:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
      }
      
      .template-option.active {
        border-color: #2563eb !important;
        background: rgba(37, 99, 235, 0.08) !important;
        box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
        transform: translateY(-2px);
      }
      
      .template-option.active::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        border-radius: 14px;
        z-index: -1;
        opacity: 0.1;
      }
    
      
      .currency-symbol {
        min-width: auto;
        text-align: left;
        padding-right: 0;
      }
      

      
      .items-table {
        border-collapse: separate;
        border-spacing: 0;
        width: 100%;
        table-layout: fixed;
        max-width: 100%;
      }
      
      /* Prevent table overflow */
      .items-table th,
      .items-table td {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 0;
      }
      
      /* PDF table optimization */
      .items-table {
        white-space: nowrap;
      }
      
      .items-table th,
      .items-table td {
        white-space: nowrap;
        overflow: visible;
        padding: 8px 12px;
      }
      
      .items-table th:first-child,
      .items-table td:first-child {
        white-space: normal;
        word-wrap: break-word;
        padding: 8px 12px;
      }
      
      /* Dynamic column widths based on visible columns */
      .items-table th:first-child,
      .items-table td:first-child {
        width: 50%;
        min-width: 0;
      }
      
      .items-table th:nth-child(2),
      .items-table td:nth-child(2) {
        width: 15%;
        min-width: 110px;
        padding: 8px 8px 8px 12px;
      }
      
      .items-table th:nth-child(3),
      .items-table td:nth-child(3) {
        width: 20%;
        min-width: 110px;
        padding: 8px 8px 8px 12px;
      }
      
      .items-table th:nth-last-child(2),
      .items-table td:nth-last-child(2) {
        width: 20%;
        min-width: 110px;
      }
      
      .items-table th:last-child,
      .items-table td:last-child {
        width: 5%;
        min-width: 0;
      }
      
      /* Adjust widths when optional columns are visible */
      .items-table th.tax-column,
      .items-table td.tax-column,
      .items-table th.discount-column,
      .items-table td.discount-column,
      .items-table th.shipping-column,
      .items-table td.shipping-column {
        width: 12%;
        min-width: 110px;
        padding: 8px 12px;
      }
      
      /* Ensure input fields in optional columns are properly sized */
      .tax-column input,
      .discount-column input,
      .shipping-column input,
      .items-table td:nth-child(2) input,
      .items-table td:nth-child(3) input,
      .items-table td:nth-last-child(2) input {
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        box-sizing: border-box !important;
        text-align: left !important;
        font-size: 12px !important;
      }
      
      /* When optional columns are shown, adjust main columns */
      body[data-tax-mode="per_item_fixed"] .items-table th:first-child,
      body[data-tax-mode="per_item_percentage"] .items-table th:first-child,
      body[data-discount-mode="per_item_fixed"] .items-table th:first-child,
      body[data-discount-mode="per_item_percentage"] .items-table th:first-child,
      body[data-shipping-mode="per_item_fixed"] .items-table th:first-child,
      body[data-shipping-mode="per_item_percentage"] .items-table th:first-child,
      body[data-tax-mode="per_item_fixed"] .items-table td:first-child,
      body[data-tax-mode="per_item_percentage"] .items-table td:first-child,
      body[data-discount-mode="per_item_fixed"] .items-table td:first-child,
      body[data-discount-mode="per_item_percentage"] .items-table td:first-child,
      body[data-shipping-mode="per_item_fixed"] .items-table td:first-child,
      body[data-shipping-mode="per_item_percentage"] .items-table td:first-child {
        width: 35%;
      }
      
      /* PDF specific table optimizations */
      @media print {
        .items-table {
          font-size: 10px !important;
          table-layout: fixed !important;
        }
        
        .items-table th,
        .items-table td {
          padding: 4px 2px !important;
          font-size: 10px !important;
          line-height: 1.2 !important;
        }
        
        .items-table th:first-child,
        .items-table td:first-child {
          width: 40% !important;
        }
        
        .items-table .tax-column,
        .items-table .discount-column,
        .items-table .shipping-column {
          width: 10% !important;
          min-width: 0 !important;
        }
        
        .items-table input {
          font-size: 9px !important;
          padding: 1px !important;
        }
      }
      
      .items-table thead tr {
        background: white !important;
      }
      
      .items-table th {
        background: white !important;
        font-weight: 600;
        color: #111827;
        border-bottom: 2px solid #e5e7eb;
      }
      
      .item-row-even {
        background-color: #f9fafb !important;
      }
      
      .item-row-odd {
        background-color: #ffffff !important;
      }
      
      .summary-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        overflow: hidden;
        word-wrap: break-word;
        min-height: 24px;
        padding: 2px 0;
      }
      
      .summary-value {
        flex-shrink: 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
        text-align: right;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
      }
      
      .summary-label {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-right: 8px;
        text-align: left;
      }
      
      /* Ensure input fields in summary don't cause overflow */
      .summary-value input {
        max-width: 60px !important;
        min-width: 40px !important;
        font-size: 11px !important;
        padding: 1px 2px !important;
        text-align: right !important;
      }
      
      /* Better spacing for summary elements */
      .summary-value > * {
        flex-shrink: 0;
      }
      
      /* Hide input fields and calculation symbols in print view */
      @media print {
        .hide-in-pdf {
          display: none !important;
          visibility: hidden !important;
        }
        
        /* Ensure summary section is properly formatted in print */
        .summary-value {
          max-width: none !important;
          justify-content: flex-end !important;
        }
        
        .summary-row {
          padding: 1px 0 !important;
        }
      }
      
      .mobile-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
      }
      
      .mobile-menu.open {
        transform: translateX(0);
      }
      
      .fade-in {
        animation: fadeIn 0.3s ease-in-out;
      }
      
      @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
      }
      
      .slide-up {
        animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
      }
      
      @keyframes slideUp {
        from { 
          opacity: 0; 
          transform: translateY(20px) scale(0.95); 
        }
        to { 
          opacity: 1; 
          transform: translateY(0) scale(1); 
        }
      }
      
      /* Enhanced loading states */
      .loading {
        position: relative;
        overflow: hidden;
      }
      
      .loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        animation: shimmer 1.5s infinite;
      }
      
      @keyframes shimmer {
        0% { left: -100%; }
        100% { left: 100%; }
      }
      
      @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
      }
      
      .animate-spin {
        animation: spin 1s linear infinite;
      }
      
      .signature-pad {
        border: 2px dashed #d1d5db;
        border-radius: 8px;
      }
      
      .toast {
        position: fixed;
        top: 20px;
        right: 20px;
        background: white;
        border-left: 4px solid #10b981;
        padding: 16px 20px;
        border-radius: 8px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        transform: translateX(400px);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      }
      
      .toast.show {
        transform: translateX(0);
        opacity: 1;
      }
      
      .toast.error {
        border-left-color: #ef4444;
      }
      
      .toast.warning {
        border-left-color: #f59e0b;
      }
      
      /* Invoice Header Linking */
      .invoice-header-container {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        width: 100%;
        gap: 1rem;
      }
      
      .invoice-header-container.items-start {
        align-items: flex-start !important;
      }
      
      .company-section {
        flex: 1;
        min-width: 0;
      }
      
      .invoice-section {
        flex-shrink: 0;
        text-align: right;
      }
      
      @media (max-width: 640px) {
        .invoice-header-container {
          flex-direction: column;
          gap: 1.5rem;
        }
        
        .invoice-section {
          text-align: left;
        }
        
        .invoice-preview {
          padding: 1rem !important;
          margin: 0.5rem !important;
          border-radius: 8px !important;
        }
        
        .flex.flex-col.md\:flex-row {
          flex-direction: column !important;
          gap: 1rem !important;
        }
        
        .flex.flex-col.lg\:flex-row {
          flex-direction: column !important;
          gap: 1rem !important;
        }
        
        .w-full.lg\:w-80 {
          width: 100% !important;
          max-width: 100% !important;
        }
        
        .items-table {
          font-size: 11px !important;
        }
        
        .items-table th,
        .items-table td {
          padding: 4px 2px !important;
          font-size: 11px !important;
        }
        
        .items-table input {
          font-size: 10px !important;
          padding: 2px !important;
          width: 60px !important;
          min-width: 60px !important;
          max-width: 60px !important;
        }
        
        .summary-row {
          font-size: 11px !important;
        }
        
        .border.border-gray-200.rounded-lg {
          margin: 0.5rem 0 !important;
        }
      }

      /* Mobile overlay */
      .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
      }
      
      .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
      }
      
      /* Enhanced Mobile Sidebar */
      @media (max-width: 768px) {
        .sidebar {
          position: fixed;
          left: -100%;
          top: 0;
          height: 100vh;
          height: 100dvh;
          z-index: 200;
          transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
          width: 320px;
          max-width: 85vw;
          background: rgba(255, 255, 255, 0.98);
          backdrop-filter: blur(20px);
          border-right: none;
          box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
          padding: 1.5rem;
          overflow-y: auto;
        }
        
        .sidebar.open {
          left: 0 !important;
          transform: translateX(0) !important;
        }
        
        .sidebar-toggle-btn {
          display: none !important;
        }
        
        .main-content {
          padding: 0.5rem !important;
        }
        
        .flex-1 {
          padding: 0.5rem !important;
        }
        
        .max-w-full {
          padding: 0 !important;
        }
        
        .pdf-container {
          padding: 0.5rem !important;
          max-width: 100% !important;
        }
      }
      
      /* Desktop sidebar toggle */
      @media (min-width: 769px) {
        .sidebar.hidden {
          transform: translateX(-100%);
        }
        
        .main-content.sidebar-hidden {
          margin-left: 0;
        }
        
        .main-content {
          transition: margin-left 0.3s ease;
        }
      }
      
      /* Prevent clicks on main content when sidebar is open */
      body.sidebar-open .main-content {
        pointer-events: none;
      }
        
      body.sidebar-open .sidebar {
        pointer-events: auto;
      }
      
      body.sidebar-open .mobile-overlay {
        opacity: 1;
        visibility: visible;
      }
      
      /* Ensure mobile menu button is always visible */
      .mobile-menu-btn {
        position: relative;
        z-index: 250;
      }
      
      /* Fix header on mobile */
      .header {
        position: relative;
        z-index: 100;
      }
      
      /* Improve touch targets */
      .glass-card button,
      .template-option,
      .mobile-btn {
        min-height: 48px;
        padding: 12px 16px;
      }
      
      /* Better dropdown positioning on mobile */
      @media (max-width: 768px) {
        .dropdown {
          position: absolute !important;
          top: 100% !important;
          left: 0 !important;
          right: auto !important;
          width: 100% !important;
          min-width: 200px !important;
          max-height: 60vh !important;
          overflow-y: auto !important;
          z-index: 9999 !important;
        }
        
        /* Mobile editable improvements */
        .editable {
          min-height: 32px !important;
          padding: 4px 6px !important;
          font-size: 12px !important;
        }
        
        .editable:focus {
          font-size: 14px !important;
          padding: 6px 8px !important;
        }
        
        /* Mobile input improvements */
        input[type="date"] {
          font-size: 12px !important;
          padding: 4px !important;
          min-width: 100px !important;
          width: 100px !important;
        }
        
        /* Mobile button improvements */
        #addItemBtn {
          font-size: 12px !important;
          padding: 8px 12px !important;
        }
      }
      
      .overlay {
        display: none;
      }
      
      .glass-card {
        min-height: 48px;
      }
      
      button {
        min-height: 48px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
      }
      
      .btn-primary, .btn-secondary {
        min-height: 48px !important;
        padding: 0.875rem 1.25rem !important;
      }
      
      .control-btn {
        min-height: 44px !important;
        padding: 0.75rem 1rem !important;
      }
      
      .template-option {
        min-height: 80px;
        touch-action: manipulation;
      }
      
      input[type="color"] {
        width: 48px;
        height: 48px;
        border-radius: 12px;
      }
      
      .template-option,
      .glass-card button,
      button {
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
      }
      
      button:focus-visible,
      .template-option:focus-visible,
      input:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
      }
      
      /* Tablet Optimizations */
      @media (min-width: 769px) and (max-width: 1024px) {
        .sidebar {
          width: 300px;
          background: rgba(255, 255, 255, 0.96);
        }
      }
      
      /* Desktop Enhancements */
      @media (min-width: 1025px) {
        .sidebar {
          width: 340px;
          background: rgba(255, 255, 255, 0.95);
        }
        
        .sidebar:hover {
          background: rgba(255, 255, 255, 0.98);
          box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        }
      }
      
      /* Hide Add Item Button in PDF/Print */
      .pdf-hide {
        display: none !important;
      }
      
      .print-hide {
        display: none !important;
      }
      
      /* Logo Position Buttons */
      .logo-position-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        background: white;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 12px;
        font-weight: 500;
        color: #6b7280;
      }
      
      .logo-position-btn:hover {
        border-color: #2563eb;
        background: #f8fafc;
      }
      
      .logo-position-btn.active {
        border-color: #2563eb;
        background: #eff6ff;
        color: #2563eb;
      }
      
      .logo-position-btn .w-3 {
        transition: background-color 0.2s ease;
      }
      
      .logo-position-btn.active .w-3 {
        background-color: #2563eb;
      }
      
      /* Logo Size Buttons */
      .logo-size-btn {
        border-color: #e5e7eb;
        background: white;
        color: #6b7280;
        transition: all 0.2s ease;
        min-width: 50px;
        white-space: nowrap;
        font-size: 11px;
        padding: 4px 8px;
      }
      
      .logo-size-btn:hover {
        border-color: #2563eb;
        background: #f8fafc;
      }
      
      .logo-size-btn.active {
        border-color: #2563eb;
        background: #2563eb;
        color: white;
      }
      
      /* Logo Draggable */
      .logo-draggable {
        cursor: move;
        user-select: none;
      }
      
      .logo-draggable:hover {
        opacity: 0.8;
      }
      
      /* Fix signature section positioning */
      #signatureSection {
        position: relative;
        z-index: 10;
        margin-top: 0.5rem;
      }
      
      #signatureSection .glass-card {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
      }
      
      /* Ensure proper stacking order */
      .sidebar .space-y-2 > * {
        position: relative;
      }
      
      .sidebar .space-y-2 > button {
        z-index: 20;
      }
      
      .sidebar .space-y-2 > div {
        z-index: 10;
      }
      
      @media print {
        @page {
          margin: 0.5in;
          size: A4;
        }
        
        html, body {
          height: auto !important;
          overflow: visible !important;
        }
        
        /* Ensure date inputs have proper width in print */
        input[type="date"] {
          min-width: 110px !important;
          width: 110px !important;
          text-align: right !important;
        }
        
        * {
          -webkit-print-color-adjust: exact !important;
          print-color-adjust: exact !important;
        }
        
        body {
          background: white !important;
          margin: 0 !important;
          padding: 0 !important;
          font-family: 'Roboto', system-ui, sans-serif !important;
          height: auto !important;
          min-height: auto !important;
        }
        
        .header, .sidebar, .mobile-controls, .mobile-menu-btn, .no-print, .overlay, .pdf-hide, .print-hide, button, .remove-item, i.ri-arrow-left-s-line, i.ri-arrow-right-s-line, .ri-arrow-left-s-line, .ri-arrow-right-s-line {
          display: none !important;
          visibility: hidden !important;
          opacity: 0 !important;
          height: 0 !important;
          width: 0 !important;
          margin: 0 !important;
          padding: 0 !important;
        }
        
        .main-content {
          display: block !important;
          flex-direction: column !important;
          margin: 0 !important;
          padding: 0 !important;
          height: auto !important;
        }
        
        .flex-1 {
          padding: 0 !important;
          flex: none !important;
          height: auto !important;
          min-height: auto !important;
        }
        
        .max-w-6xl, .max-w-full {
          max-width: none !important;
          margin: 0 !important;
          padding: 0 !important;
        }
        
        .px-8 {
          padding-left: 0 !important;
          padding-right: 0 !important;
        }
        
        .invoice-preview {
          box-shadow: none !important;
          border: none !important;
          margin: 0 !important;
          padding: 20px !important;
          border-radius: 0 !important;
          min-height: auto !important;
          height: auto !important;
          width: 100% !important;
          max-width: 100% !important;
          background: white !important;
          font-size: 11px !important;
          line-height: 1.3 !important;
          page-break-inside: auto !important;
          overflow: visible !important;
          position: static !important;
          transform: none !important;
        }
        
        .invoice-preview * {
          font-size: 11px !important;
          line-height: 1.3 !important;
        }
        
        .invoice-preview .company-name {
          font-size: 14px !important;
        }
        
        .invoice-preview .invoice-title {
          font-size: 20px !important;
        }
        
        .flex.flex-col.md\:flex-row {
          display: flex !important;
          flex-direction: row !important;
          justify-content: space-between !important;
          align-items: flex-start !important;
        }
        
        .flex-1 {
          flex: 1 !important;
          text-align: left !important;
        }
        
        .text-right {
          text-align: right !important;
          flex: none !important;
          min-width: 200px !important;
        }
        
        .flex.flex-col.lg\:flex-row {
          display: flex !important;
          flex-direction: row !important;
          gap: 1.5rem !important;
        }
        
        .w-full.lg\:w-80 {
          width: 280px !important;
          max-width: 280px !important;
          flex-shrink: 0 !important;
          min-width: 280px !important;
        }
        
        .overflow-x-auto {
          overflow: visible !important;
        }
        
        .items-table {
          border-collapse: collapse !important;
          width: 100% !important;
          table-layout: fixed !important;
          margin-bottom: 0 !important;
        }
        
        .items-table th:first-child,
        .items-table td:first-child {
          width: 40% !important;
          min-width: 0 !important;
        }
        
        .items-table th:nth-child(2),
        .items-table td:nth-child(2) {
          width: 10% !important;
          min-width: 0 !important;
        }
        
        .items-table th:nth-child(3),
        .items-table td:nth-child(3) {
          width: 15% !important;
          min-width: 0 !important;
        }
        
        .items-table th:nth-last-child(2),
        .items-table td:nth-last-child(2) {
          width: 20% !important;
          min-width: 0 !important;
        }
        
        .items-table th:last-child,
        .items-table td:last-child {
          display: none !important;
        }
        
        .items-table th,
        .items-table td {
          border: 1px solid #e5e7eb !important;
          padding: 4px 6px !important;
          font-size: 10px !important;
          word-wrap: break-word !important;
          overflow-wrap: break-word !important;
          vertical-align: top !important;
          text-overflow: ellipsis !important;
          overflow: hidden !important;
        }
        
        .remove-item {
          display: none !important;
        }
        
        .items-table thead tr {
          background: #111827 !important;
        }
        
        .items-table th {
          background: #111827 !important;
          color: white !important;
          font-weight: 600 !important;
          font-size: 10px !important;
        }
        
        .item-row-even {
          background-color: #f9fafb !important;
        }
        
        .item-row-odd {
          background-color: #ffffff !important;
        }
        
        /* PDF specific layout fixes */
        .border-b-2.border-gray-900 {
          margin-bottom: 15px !important;
          padding-bottom: 10px !important;
        }
        
        .mb-6 {
          margin-bottom: 15px !important;
        }
        
        .mb-8 {
          margin-bottom: 20px !important;
        }
        
        .p-4, .p-3 {
          padding: 8px !important;
        }
        
        .space-y-1 > * + * {
          margin-top: 3px !important;
        }
        
        .space-y-2 > * + * {
          margin-top: 6px !important;
        }
        
        /* Signature area */
        #signatureArea {
          margin-top: 20px !important;
          page-break-inside: avoid !important;
        }
        
        /* Summary section adjustments */
        .summary-row {
          padding: 3px 0 !important;
        }
        
        /* Hide add item button and other controls */
        #addItemBtn,
        .pdf-hide,
        .print-hide,
        .no-print,
        .hide-in-pdf,
        button,
        .remove-item,
        [class*="arrow"],
        i[class*="arrow"] {
          display: none !important;
          visibility: hidden !important;
          width: 0 !important;
          height: 0 !important;
          margin: 0 !important;
          padding: 0 !important;
        }
        
        /* Ensure summary values are properly aligned in print */
        .summary-row {
          display: flex !important;
          justify-content: space-between !important;
          align-items: center !important;
          padding: 2px 0 !important;
        }
        
        .summary-value {
          text-align: right !important;
          white-space: nowrap !important;
        }
        
        .summary-label {
          text-align: left !important;
          flex: 1 !important;
        }
        
        /* Hide inactive summary rows in PDF */
        #discountRow[style*="display: none"],
        #shippingRow[style*="display: none"],
        #taxRow[style*="display: none"],
        .summary-row[style*="display: none"] {
          display: none !important;
          visibility: hidden !important;
          height: 0 !important;
          margin: 0 !important;
          padding: 0 !important;
          overflow: hidden !important;
        }
        
        /* Force hide when modes are none */
        body[data-discount-mode="none"] #discountRow,
        body[data-shipping-mode="none"] #shippingRow,
        body[data-tax-mode="none"] #taxRow {
          display: none !important;
        }
        
        /* Prevent table overflow */
        .border.border-gray-200.rounded-lg {
          border: 1px solid #e5e7eb !important;
          border-radius: 0 !important;
          overflow: visible !important;
          margin-bottom: 10px !important;
        }
        
        /* Compact spacing for many items */
        .items-table tbody tr {
          height: auto !important;
          min-height: 20px !important;
        }
        
        .items-table tbody td {
          padding: 3px 4px !important;
          vertical-align: top !important;
          line-height: 1.1 !important;
        }
        
        /* Responsive font sizing based on content */
        .items-table tbody tr:nth-child(n+8) td {
          font-size: 9px !important;
          padding: 2px 3px !important;
        }
        
        .items-table tbody tr:nth-child(n+12) td {
          font-size: 8px !important;
          padding: 1px 2px !important;
        }
      }
      .header {
        background: rgb(255, 255, 255);
        color: #374151;
        padding: 1rem 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 0;
        z-index: 100;
        border-bottom: 1px solid #dadada;
      }
      
      .header-content {
        max-width: auto;
        margin: 0 auto;
        padding: 0 5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      
      .logo-section {
        display: flex;
        align-items: center !important;
        gap: 0.75rem;
      }
      
      .sidebar-toggle-btn {
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        color: #374151;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 18px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
      }
      
      .sidebar-toggle-btn:hover {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
      }
      
      .sidebar-toggle-btn:active {
        transform: translateY(0);
      }
      
      .sidebar-toggle-btn.active {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
      }
      
      .logo {
        background: #2563eb;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: left !important;
        justify-content: left !important;
        font-weight: 700;
        font-size: 1.25rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }
      
      .app-title {
        font-size: 1.5rem;
        font-weight: 600;
        letter-spacing: -0.025em;
      }
      
      .header-actions {
        display: flex;
        gap: 0.75rem;
        align-items: center;
      }
      
      .mobile-menu-btn {
        display: none;
        background: #2563eb;
        border: none;
        color: white;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 18px;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
      }
      
      .mobile-menu-btn:hover {
        background: #1e40af;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
      }
      
      .mobile-menu-btn:active {
        transform: translateY(0);
      }
      
      .btn-primary {
        background: #2563eb;
        color: white;
        border: none;
        padding: 0.75rem 1.25rem;
        border-radius: 8px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.2s ease;
        font-size: 14px;
        min-height: 44px;
        box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
      }
      
      .btn-primary:hover {
        background: #1e40af;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
      }
      
      .btn-primary:active {
        transform: translateY(0);
      }
      
      .btn-secondary {
        background: white;
        color: #374151;
        border: 1px solid #e5e7eb;
        padding: 0.75rem 1.25rem;
        border-radius: 8px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.2s ease;
        font-size: 14px;
        min-height: 44px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
      }
      
      .btn-secondary:hover {
        background: #f8fafc;
        border-color: #2563eb;
        color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }
      
      .btn-secondary:active {
        transform: translateY(0);
      }
      
      .control-panel {
        background: rgba(237, 237, 237, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        padding: 0.8rem;
        display: flex;
        gap: 0.8rem;
        align-items: center;
        border: 1px solid rgba(226, 232, 240, 0.8);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
      }
      
      .control-btn {
        background: white;
        border: 1px solid #e5e7eb;
        color: #374151;
        padding: 0.625rem 1rem;
        border-radius: 8px;
        font-size: 0.875rem;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
        font-weight: 500;
        min-height: 40px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
      }
      
      .control-btn:hover {
        background: #f8fafc;
        border-color: #2563eb;
        color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
      }
      
      .control-btn:active {
        transform: translateY(0);
      }
      
      .dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 0.75rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        min-width: 280px;
        max-height: 400px;
        overflow-y: auto;
        z-index: 9999;
        display: none;
        margin-top: 0.5rem;
      }
      
      .dropdown.show {
        display: block;
        animation: slideDown 0.2s ease;
      }
      
      @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
      }
      
      .dropdown-item {
        padding: 0.75rem 1rem;
        border-radius: 6px;
        cursor: pointer;
        color: #374151;
        font-size: 0.9rem;
        font-weight: 500;
        transition: all 0.2s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
      }
      
      .dropdown-item:hover {
        background: #f3f4f6;
        color: #2563eb;
        transform: translateX(2px);
      }
      
      .currency-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
      }
      
      .currency-flag {
        font-size: 1.25rem;
      }
      
      .currency-info {
        display: flex;
        flex-direction: column;
      }
      
      .currency-name {
        font-weight: 500;
      }
      
      .currency-code {
        font-size: 0.75rem;
        color: #6b7280;
      }
      
      .mobile-controls {
        display: none;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        overflow: visible;
      }
      
      .mobile-btn-row {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        justify-content: center;
      }
      
      .mobile-btn-row:last-child {
        margin-bottom: 0;
      }
      
      .mobile-btn {
        flex: 1;
        background: white;
        color: #2563eb;
        border: 1px solid #e5e7eb;
        padding: 0.875rem 1rem;
        border-radius: 8px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        transition: all 0.2s ease;
        font-size: 0.875rem;
        min-height: 48px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
      }
      
      .mobile-btn:hover {
        background: #f8fafc;
        border-color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
      }
      
      .mobile-btn:active {
        transform: translateY(0);
      }
      
      .mobile-btn.primary {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
      }
      
      .mobile-btn.primary:hover {
        background: #1e40af;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
      }
      
      .mobile-btn.primary:active {
        transform: translateY(0);
      }
      
      @media (min-width: 769px) {
        .control-panel {
          display: flex !important;
        }
        
        .mobile-controls {
          display: none !important;
        }
        
        .mobile-menu-btn {
          display: none !important;
        }
      }
      
      @media (max-width: 768px) {
        .mobile-menu-btn {
          display: flex !important;
        }
        
        .header-actions > .btn-primary,
        .header-actions > .btn-secondary,
        .control-panel {
          display: none !important;
        }
        
        .mobile-controls {
          display: block !important;
        }
        
        .app-title {
          font-size: 1.25rem;
        }
        
        .sidebar {
          z-index: 200;
        }
        
        .header-content {
          padding: 0 1rem;
        }
        
        .logo-section {
          flex: 1;
        }
        
        .sidebar-toggle-btn {
          display: none !important;
        }
        
        /* Mobile invoice preview improvements */
        .invoice-preview {
          font-size: 12px !important;
          line-height: 1.4 !important;
        }
        
        .invoice-preview * {
          font-size: 12px !important;
        }
        
        .invoice-preview .company-name {
          font-size: 14px !important;
        }
        
        .invoice-preview .invoice-title {
          font-size: 14px !important;
        }
        
        /* Mobile table improvements */
        .overflow-x-auto {
          overflow-x: scroll !important;
          -webkit-overflow-scrolling: touch !important;
        }
        
        .items-table {
          min-width: 600px !important;
        }
        
        /* Mobile summary section */
        .border.border-gray-200.rounded-lg {
          width: 100% !important;
          margin: 1rem 0 !important;
        }
        
        /* Mobile summary row improvements */
        .summary-row {
          font-size: 11px !important;
          padding: 4px 0 !important;
        }
        
        .summary-value {
          max-width: 100px !important;
          font-size: 11px !important;
        }
        
        .summary-label {
          font-size: 11px !important;
          margin-right: 4px !important;
        }
        
        /* Hide calculation elements on mobile for cleaner view */
        .hide-in-pdf {
          display: none !important;
        }
        
        /* Mobile dropdown fix */
        .mobile-controls .dropdown {
          position: absolute !important;
          top: 100% !important;
          left: 0 !important;
          right: 0 !important;
          width: 100% !important;
          max-width: none !important;
          z-index: 99999 !important;
          margin-top: 0.5rem !important;
        }
        
        .mobile-btn-row .relative {
          position: relative !important;
          overflow: visible !important;
        }
      }
      
      /* Invoice Preview Container Fixes */
      .invoice-preview {
        max-width: 100%;
        width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
      }
      
      /* PDF Container Optimization */
      .pdf-container {
        max-width: 800px;
        width: 100%;
        min-height: auto;
        padding: 2rem;
        box-sizing: border-box;
        font-family: 'Inter', system-ui, sans-serif;
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: white;
        margin: 0 auto;
        overflow-x: auto;
      }
      
      /* PDF generation temporary styles */
      .pdf-generating {
        width: 210mm !important;
        max-width: 210mm !important;
        padding: 15mm !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        background: #ffffff !important;
        border-radius: 0 !important;
        box-shadow: none !important;
      }
      
      .pdf-generating .items-table {
        table-layout: fixed !important;
        width: 100% !important;
        font-size: 11px !important;
      }
      
      .page-break {
        page-break-before: always;
      }
      
      .no-break {
        page-break-inside: avoid;
      }
      
      /* Main content layout fixes */
      .main-content {
        overflow-x: hidden;
        width: 100%;
      }
      
      .flex-1 {
        min-width: 0;
        overflow-x: hidden;
        width: 100%;
      }
      
      /* Responsive table container */
      .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      
      /* Ensure inputs don't cause overflow */
      .items-table input {
        max-width: 100%;
        box-sizing: border-box;
      }
      
      /* Invoice container responsive fixes */
      #invoice-container {
        max-width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
      }
      
      @media print {
        .pdf-container {
          max-width: none !important;
          width: 100% !important;
          margin: 0 !important;
          padding: 0 !important;
          overflow: visible !important;
          height: auto !important;
          min-height: auto !important;
        }
        
        #invoice-container {
          max-width: none !important;
          overflow: visible !important;
          height: auto !important;
          margin: 0 !important;
          padding: 0 !important;
        }
        
        .invoice-preview {
          max-width: none;
          overflow: visible;
        }
        
        #invoice-container {
          max-width: none;
          overflow: visible;
        }
      }
      
      /* Professional Footer Styles */
      footer {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
      }
      
      footer a {
        position: relative;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
      }
      
      footer a:hover {
        background: rgba(37, 99, 235, 0.1);
        transform: translateY(-1px);
      }
      
      footer a::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        width: 0;
        height: 2px;
        background: #2563eb;
        transition: all 0.3s ease;
        transform: translateX(-50%);
      }
      
      footer a:hover::after {
        width: 80%;
      }
      
      /* Mobile Footer Styles */
      @media (max-width: 768px) {
        footer {
          padding: 1rem 0;
        }
        
        footer .max-w-6xl {
          padding: 0 1rem;
        }
        
        footer a {
          padding: 0.75rem 0.5rem;
          font-size: 0.875rem;
          text-align: center;
          min-height: 44px;
          display: flex;
          align-items: center;
          justify-content: center;
        }
        
        footer .flex-wrap {
          gap: 0.5rem;
          justify-content: center;
        }
        
        footer .text-center p {
          font-size: 0.875rem;
          line-height: 1.5;
        }
      }
      
      /* Tablet Footer Styles */
      @media (min-width: 769px) and (max-width: 1024px) {
        footer a {
          padding: 0.625rem 1rem;
          font-size: 0.9rem;
        }
        
        footer .flex-wrap {
          gap: 1.5rem;
        }
      }
      
      /* Desktop Footer Enhancements */
      @media (min-width: 1025px) {
        footer {
          background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%);
        }
        
        footer a {
          padding: 0.75rem 1.25rem;
          font-weight: 500;
        }
        
        footer .flex-wrap {
          gap: 2rem;
        }
      }
      
      /* Print Styles for Footer */
      @media print {
        footer {
          display: none !important;
        }
      }