/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    background: #2563eb;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    background: white;
    color: #2563eb;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.header-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.header-btn i {
    font-size: 0.875rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 2rem 0;
    position: sticky;
    top: 73px;
    height: calc(100vh - 73px);
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.nav-item.active {
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Billing Content */
.billing-content {
    flex: 1;
    padding: 2rem;
    background: #f8fafc;
}

.billing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-info h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.header-info p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.new-invoice-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.new-invoice-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Tabs */
.tabs-container {
    margin-bottom: 2rem;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
}

.tab:hover {
    color: #2563eb;
    background: #f8fafc;
}

.tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #f8fafc;
}

/* Template Selector Section */
.template-selector-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.template-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.template-dropdown-container {
    display: flex;
    flex-direction: column;
}

.dropdown-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.template-dropdown {
    width: 100%;
    padding: 1.25rem 3.5rem 1.25rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    background: white;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.template-dropdown:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 8px 25px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.template-dropdown:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.dropdown-arrow {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748b;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.template-dropdown:focus + .dropdown-arrow {
    color: #2563eb;
    transform: translateY(-50%) rotate(180deg);
}

.template-preview-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.5rem;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.template-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-preview-card:hover {
    border-color: #2563eb;
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.15);
    transform: translateY(-5px);
}

.template-preview-card:hover::before {
    opacity: 1;
}

/* Template Preview Styles */
.template-preview {
    font-size: 0.5rem;
    line-height: 1.2;
    color: #374151;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

/* Modern Template Preview */
.modern-preview {
    font-family: 'Poppins', sans-serif;
}

.modern-preview .preview-swoosh {
    background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 100%);
    height: 4px;
}

.modern-preview .preview-header {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modern-preview .preview-brand {
    font-weight: 700;
    font-size: 0.7rem;
}

.modern-preview .preview-title {
    font-weight: 600;
    font-size: 0.6rem;
    opacity: 0.9;
}

.modern-preview .preview-content {
    padding: 0.4rem 0.6rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #E5E7EB;
}

.modern-preview .preview-company p,
.modern-preview .preview-customer p {
    margin: 0;
    font-size: 0.45rem;
    color: #6B7280;
    text-align: left;
}

.modern-preview .preview-customer p:last-child {
    text-align: right;
}

.modern-preview .preview-table {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #E5E7EB;
}

.modern-preview .preview-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.2rem;
    padding: 0.15rem 0;
    font-size: 0.45rem;
}

.modern-preview .preview-row.header {
    font-weight: 600;
    background: #F9FAFB;
    padding: 0.2rem 0.3rem;
    border-radius: 2px;
    margin-bottom: 0.15rem;
    color: #1F2937;
}

.modern-preview .preview-total {
    padding: 0.4rem 0.6rem;
    background: #F9FAFB;
}

.modern-preview .total-row {
    text-align: right;
    font-weight: 500;
    font-size: 0.45rem;
    color: #1F2937;
    margin: 0.1rem 0;
}

.modern-preview .total-final {
    font-weight: 700;
    border-top: 1px solid #E5E7EB;
    padding-top: 0.15rem;
    margin-top: 0.15rem;
}

/* Minimal Template Preview */
.minimal-preview {
    font-family: 'Inter', sans-serif;
}

.minimal-preview .preview-header {
    background: #F8FAFC;
    color: #111827;
    border-bottom: 2px solid #E5E7EB;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.minimal-preview .preview-brand,
.minimal-preview .preview-title {
    color: #111827;
    font-weight: 600;
}

.minimal-preview .preview-brand {
    font-size: 0.7rem;
}

.minimal-preview .preview-title {
    font-size: 0.6rem;
}

.minimal-preview .preview-content {
    padding: 0.4rem 0.6rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #E5E7EB;
}

.minimal-preview .preview-company p,
.minimal-preview .preview-customer p {
    margin: 0;
    font-size: 0.45rem;
    color: #6B7280;
    text-align: left;
}

.minimal-preview .preview-customer p:last-child {
    text-align: right;
}

.minimal-preview .preview-table {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #E5E7EB;
}

.minimal-preview .preview-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.2rem;
    padding: 0.15rem 0;
    font-size: 0.45rem;
}

.minimal-preview .preview-row.header {
    font-weight: 600;
    background: #F9FAFB;
    padding: 0.2rem 0.3rem;
    border-radius: 2px;
    margin-bottom: 0.15rem;
    color: #111827;
}

.minimal-preview .preview-total {
    padding: 0.4rem 0.6rem;
    background: #F9FAFB;
}

.minimal-preview .total-row {
    text-align: right;
    font-weight: 500;
    font-size: 0.45rem;
    color: #111827;
    margin: 0.1rem 0;
}

.minimal-preview .total-final {
    font-weight: 700;
    border-top: 1px solid #E5E7EB;
    padding-top: 0.15rem;
    margin-top: 0.15rem;
}

/* Luxury Template Preview */
.luxury-preview {
    font-family: 'Lato', sans-serif;
}

.luxury-preview .preview-header {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #fdfdfd;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.luxury-preview .preview-brand,
.luxury-preview .preview-title {
    color: #fdfdfd;
    font-family: 'Cormorant Garamond', serif;
}

.luxury-preview .preview-brand {
    font-size: 0.7rem;
    font-weight: 700;
}

.luxury-preview .preview-title {
    font-size: 0.6rem;
    font-weight: 600;
}

.luxury-preview .preview-content {
    padding: 0.5rem 0.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.luxury-preview .preview-company h4,
.luxury-preview .preview-customer h4 {
    font-weight: 600;
    font-size: 0.6rem;
    margin: 0 0 0.2rem 0;
    color: #1a1a1a;
}

.luxury-preview .preview-company p,
.luxury-preview .preview-customer p {
    margin: 0 0 0.1rem 0;
    font-size: 0.5rem;
    color: #6c757d;
}

.luxury-preview .preview-table {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.luxury-preview .preview-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.3rem;
    padding: 0.2rem 0;
    font-size: 0.5rem;
}

.luxury-preview .preview-row.header {
    font-weight: 600;
    background: #f8f9fa;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.2rem;
}

.luxury-preview .preview-total {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
}

.luxury-preview .total-row {
    text-align: right;
    font-weight: 600;
    font-size: 0.6rem;
    color: #1a1a1a;
}

/* Creative Template Preview */
.creative-preview {
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.creative-preview::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -15px;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #E0FBFC 0%, rgba(255,255,255,0) 70%);
    opacity: 0.5;
    z-index: 0;
}

.creative-preview .preview-header {
    background: linear-gradient(135deg, #3D5A80, #98C1D9);
    color: white;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.creative-preview .preview-brand,
.creative-preview .preview-title {
    color: white;
    font-family: 'Playfair Display', serif;
}

.creative-preview .preview-brand {
    font-size: 0.7rem;
    font-weight: 700;
}

.creative-preview .preview-title {
    font-size: 0.6rem;
    font-weight: 600;
}

.creative-preview .preview-content {
    padding: 0.5rem 0.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border-bottom: 1px solid #E5E7EB;
    position: relative;
    z-index: 1;
}

.creative-preview .preview-company h4,
.creative-preview .preview-customer h4 {
    font-weight: 600;
    font-size: 0.6rem;
    margin: 0 0 0.2rem 0;
    color: #293241;
}

.creative-preview .preview-company p,
.creative-preview .preview-customer p {
    margin: 0 0 0.1rem 0;
    font-size: 0.5rem;
    color: #6c757d;
}

.creative-preview .preview-table {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #E5E7EB;
    position: relative;
    z-index: 1;
}

.creative-preview .preview-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.3rem;
    padding: 0.2rem 0;
    font-size: 0.5rem;
}

.creative-preview .preview-row.header {
    font-weight: 600;
    background: #F9FAFB;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.2rem;
}

.creative-preview .preview-total {
    padding: 0.5rem 0.75rem;
    background: #F9FAFB;
    position: relative;
    z-index: 1;
}

.creative-preview .total-row {
    text-align: right;
    font-weight: 600;
    font-size: 0.6rem;
    color: #293241;
}

/* Geometric Template Preview */
.geometric-preview {
    font-family: 'Inter', sans-serif;
}

.geometric-preview .preview-accent-bar {
    height: 4px;
    background-color: #E53935;
    margin-bottom: 0.3rem;
}

.geometric-preview .preview-header {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.geometric-preview .preview-brand,
.geometric-preview .preview-title {
    color: white;
    font-family: 'Inter', sans-serif;
}

.geometric-preview .preview-brand {
    font-size: 0.7rem;
    font-weight: 700;
}

.geometric-preview .preview-title {
    font-size: 0.6rem;
    font-weight: 600;
}

.geometric-preview .preview-content {
    padding: 0.5rem 0.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border-bottom: 1px solid #EAEAEA;
}

.geometric-preview .preview-company h4,
.geometric-preview .preview-customer h4 {
    font-weight: 600;
    font-size: 0.6rem;
    margin: 0 0 0.2rem 0;
    color: #111111;
}

.geometric-preview .preview-company p,
.geometric-preview .preview-customer p {
    margin: 0 0 0.1rem 0;
    font-size: 0.5rem;
    color: #777777;
}

.geometric-preview .preview-table {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #EAEAEA;
}

.geometric-preview .preview-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.3rem;
    padding: 0.2rem 0;
    font-size: 0.5rem;
}

.geometric-preview .preview-row.header {
    font-weight: 600;
    background: #F9FAFB;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.2rem;
}

.geometric-preview .preview-total {
    padding: 0.5rem 0.75rem;
    background: #F9FAFB;
}

.geometric-preview .total-row {
    text-align: right;
    font-weight: 600;
    font-size: 0.6rem;
    color: #111111;
}

/* Vibrant Template Preview */
.vibrant-preview {
    font-family: 'Inter', sans-serif;
}

.vibrant-preview .preview-header {
    background: linear-gradient(45deg, #3B82F6, #1D4ED8, #2563EB, #1E40AF);
    background-size: 300% 300%;
    animation: gradientShift 6s ease-in-out infinite;
    color: white;
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.vibrant-preview .preview-brand,
.vibrant-preview .preview-title {
    color: white;
    font-family: 'Poppins', sans-serif;
}

.vibrant-preview .preview-brand {
    font-size: 0.7rem;
    font-weight: 800;
}

.vibrant-preview .preview-title {
    font-size: 0.6rem;
    font-weight: 600;
}

.vibrant-preview .preview-content {
    padding: 0.5rem 0.75rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.vibrant-preview .preview-company h4,
.vibrant-preview .preview-customer h4 {
    font-weight: 600;
    font-size: 0.6rem;
    margin: 0 0 0.2rem 0;
    color: #1f2937;
}

.vibrant-preview .preview-company p,
.vibrant-preview .preview-customer p {
    margin: 0 0 0.1rem 0;
    font-size: 0.5rem;
    color: #6b7280;
}

.vibrant-preview .preview-table {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.vibrant-preview .preview-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.3rem;
    padding: 0.2rem 0;
    font-size: 0.5rem;
}

.vibrant-preview .preview-row.header {
    font-weight: 600;
    background: #F9FAFB;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.2rem;
}

.vibrant-preview .preview-total {
    padding: 0.5rem 0.75rem;
    background: #F9FAFB;
}

.vibrant-preview .total-row {
    text-align: right;
    font-weight: 600;
    font-size: 0.6rem;
    color: #1f2937;
}

.preview-placeholder {
    text-align: center;
    color: #64748b;
    max-width: 280px;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
}

.placeholder-icon i {
    font-size: 2rem;
    color: #94a3b8;
}

.preview-placeholder h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.75rem 0;
}

.preview-placeholder p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    color: #64748b;
}

.template-preview-content {
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.template-icon-large {
    font-size: 3.5rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.template-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.template-info p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.template-features {
    margin-bottom: 2rem;
}

.template-features h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
}

.template-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.template-features li {
    font-size: 0.9rem;
    color: #64748b;
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
    transition: color 0.3s ease;
}

.template-features li:hover {
    color: #2563eb;
}

.template-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 600;
    font-size: 1rem;
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
}

/* Product Dropdown Wrapper */
.product-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.product-name-input {
    flex: 1;
    padding-right: 2.5rem;
    cursor: pointer;
}

.dropdown-arrow-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.dropdown-arrow-btn:hover {
    color: #2563eb;
}

.dropdown-arrow-btn i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.product-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.product-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item.product-item {
    color: #1e293b;
    font-weight: 400;
}

.dropdown-item.product-item:hover {
    background: #f1f5f9;
}

.dropdown-item.add-product-item {
    color: #2563eb;
    font-weight: 500;
}

.dropdown-item.add-product-item:hover {
    background: #eff6ff;
}

.dropdown-item i {
    font-size: 0.875rem;
}

.dropdown-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 0.25rem 0;
}

/* Customer Dropdown Wrapper */
.customer-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.customer-name-input {
    flex: 1;
    padding-right: 2.5rem;
    cursor: pointer;
}

.customer-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.customer-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.customer-item {
    color: #1e293b;
    font-weight: 400;
}

.customer-item:hover {
    background: #f1f5f9;
}


/* Product Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.product-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.product-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.product-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.3s ease;
}

.product-modal-close:hover {
    color: #1e293b;
}

.product-modal-body {
    padding: 2rem;
}

.add-product-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

/* .existing-products-section {
    Styles for existing products section
} */

.products-list {
    max-height: 400px;
    overflow-y: auto;
}

.product-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.product-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.product-price {
    font-size: 1rem;
    font-weight: 600;
    color: #2563eb;
}

.product-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.product-detail {
    display: flex;
    flex-direction: column;
}

.product-detail-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.product-detail-value {
    font-size: 0.875rem;
    color: #374151;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.no-products {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.no-products i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-products p {
    margin: 0;
    font-size: 0.875rem;
}

/* Invoice Form Section */
.invoice-form-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input[type="email"]:focus,
.form-input[type="tel"]:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
}

.date-input-wrapper {
    position: relative;
}

.date-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

/* Items Table */
.items-table-container {
    margin-bottom: 1rem;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.items-table th {
    background: #f8fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    border-bottom: 1px solid #e2e8f0;
}

.items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.items-table .form-input {
    margin: 0;
    width: 100%;
}

.amount-display {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.remove-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.add-item-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.add-item-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Invoice Summary */
.invoice-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    max-width: 300px;
    margin-left: auto;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.summary-value {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 600;
}

.summary-row.total-row {
    border-top: 2px solid #2563eb;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.summary-row.total-row .summary-label,
.summary-row.total-row .summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: #2563eb;
}

.summary-row.amount-words {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.summary-row.amount-words .summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-row.amount-words .summary-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    font-style: italic;
}

.total-row {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.total-row .summary-label,
.total-row .summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #374151;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Mobile Warning Modal */
.mobile-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-warning-modal.active {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 1;
}

.mobile-warning-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: scale(0.8) translateY(30px) rotate(-2deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-warning-modal.active .mobile-warning-content {
    transform: scale(1) translateY(0) rotate(0deg);
    opacity: 1;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
    transform: scale(0.5);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.mobile-warning-modal.active .warning-icon {
    transform: scale(1);
    opacity: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.warning-title {
    color: #1e40af;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}

.mobile-warning-modal.active .warning-title {
    transform: translateY(0);
    opacity: 1;
}

.warning-message {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s;
}

.mobile-warning-modal.active .warning-message {
    transform: translateY(0);
    opacity: 1;
}

.warning-tips {
    margin-bottom: 2rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s;
}

.mobile-warning-modal.active .warning-tips {
    transform: translateY(0);
    opacity: 1;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    text-align: left;
}

.tip-item:last-child {
    margin-bottom: 0;
}

.tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tip-item span:last-child {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
}

.warning-ok-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s;
}

.mobile-warning-modal.active .warning-ok-btn {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.warning-ok-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateY(-2px) scale(1.05); }
    50% { transform: translateY(-2px) scale(1.08); }
}

.warning-ok-btn:active {
    transform: translateY(0);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #e94560 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #00bfff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .invoice-summary {
        max-width: 100%;
        margin-left: 0;
    }
    
    .template-selector {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 1rem 0;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .nav-item {
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .billing-content {
        padding: 1rem;
    }
    
    .billing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .top-header {
        padding: 1rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .header-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .items-table {
        font-size: 0.75rem;
    }
    
    .items-table th,
    .items-table td {
        padding: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .billing-content {
        padding: 0.75rem;
    }
    
    .invoice-form-section {
        padding: 1rem;
    }
    
    .items-table {
        font-size: 0.7rem;
    }
    
    .items-table th,
    .items-table td {
        padding: 0.25rem;
    }
    
    .mobile-warning-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .warning-title {
        font-size: 1.3rem;
    }
    
    .warning-message {
        font-size: 0.9rem;
    }
    
    .tip-item {
        padding: 0.5rem;
    }
    
    .warning-ok-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}
