/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile app-like viewport */
html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
    text-decoration: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.navbar-brand:hover .brand-icon {
    transform: rotate(5deg) scale(1.1);
}

.brand-text {
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

/* Mobile Navigation */
.mobile-menu {
    display: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.page-subtitle {
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

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

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

.btn-success:hover {
    background: #047857;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.table th {
    background: #f9fafb;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

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

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

/* Flexbox */
.flex {
    display: flex;
}

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

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

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

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

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

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

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

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

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

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

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

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

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

/* Text */
.text-center {
    text-align: center;
}

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

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

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

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

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

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

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

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

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

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

.text-gray-900 {
    color: #111827;
}

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

.text-green-600 {
    color: #059669;
}

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

/* Links */
.link {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s;
}

.link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Mobile-First Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Navigation - Show by default */
.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-direction: row;
}

.navbar-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
    padding: 0.5rem 0;
}

.navbar-nav a:hover {
    color: #2563eb;
}

/* Mobile Navigation - Hide by default */
.mobile-menu-btn {
    display: none;
}

.mobile-menu {
    display: none;
}

/* Fix mobile navigation */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }
    
    .navbar .container {
        padding: 0 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
        padding: 0.25rem 0.5rem;
    }
    
    .brand-icon {
        width: 28px;
        height: 28px;
    }
    
    .navbar-nav {
        display: none !important;
    }
    
    /* Mobile-friendly filters */
    .collapse .card-body .row > div {
        margin-bottom: 1rem;
    }
    
    .collapse .card-body .btn-group {
        flex-direction: column;
    }
    
    .collapse .card-body .btn-group .btn {
        margin-bottom: 0.5rem;
        border-radius: 0.375rem !important;
    }
    
    .collapse .card-body .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile pagination */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table td, .table th {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    /* Mobile badge improvements */
    .badge {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        color: #666;
    }
    
    .mobile-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 1rem;
        z-index: 1000;
        border-top: 1px solid #e5e7eb;
    }
    
    .mobile-menu.show {
        display: block;
    }
    
    .mobile-menu a {
        display: block;
        padding: 0.75rem 1rem;
        color: #666;
        text-decoration: none;
        border-bottom: 1px solid #f3f4f6;
        font-weight: 500;
    }
    
    .mobile-menu a:hover {
        background: #f9fafb;
        color: #2563eb;
    }
    
    .mobile-menu a:last-child {
        border-bottom: none;
    }
    
    .mobile-menu button {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        background: none;
        border: none;
        color: #666;
        font-weight: 500;
        cursor: pointer;
    }
    
    .mobile-menu button:hover {
        background: #f9fafb;
        color: #2563eb;
    }
}

/* Mobile layout fixes */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .page-subtitle {
        font-size: 0.875rem;
    }
    
    /* Fix grid layouts for mobile */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Fix dashboard cards */
    .grid.grid-cols-1.grid-cols-2.grid-cols-3.grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Fix dashboard stats cards */
    .grid.grid-cols-1.grid-cols-2.grid-cols-3.grid-cols-4 > .card {
        margin-bottom: 1rem;
    }
    
    /* Fix dashboard quick actions */
    .grid.grid-cols-1.grid-cols-2 > .card {
        margin-bottom: 1rem;
    }
    
    .grid.grid-cols-1.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Fix dashboard grid layout */
    .grid.grid-cols-1.grid-cols-2.grid-cols-3.grid-cols-4.gap-6 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .grid.grid-cols-1.grid-cols-2.gap-8 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Fix table responsiveness */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
        position: relative;
        z-index: 1;
    }
    
    .table {
        min-width: 600px;
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .actions {
        position: relative;
        display: inline-block;
    }
    
    .actions-burger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: #f3f4f6;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.875rem;
        color: #6b7280;
        transition: all 0.2s ease;
    }
    
    .actions-burger:hover {
        background: #e5e7eb;
        color: #374151;
    }
    
    .actions-burger:active {
        transform: scale(0.95);
    }
    
    .actions-menu {
        position: fixed;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 0.5rem 0;
        min-width: 120px;
        z-index: 9999;
        display: none;
    }
    
    .actions-menu.show {
        display: block;
        pointer-events: auto;
    }
    
    .actions-menu a,
    .actions-menu button {
        display: block;
        width: 100%;
        padding: 0.5rem 0.75rem;
        text-align: left;
        text-decoration: none;
        font-size: 0.875rem;
        color: #374151;
        border: none;
        background: none;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }
    
    .actions-menu a:hover,
    .actions-menu button:hover {
        background: #f9fafb;
    }
    
    .actions-menu .link {
        color: #2563eb;
    }
    
    .actions-menu .edit {
        color: #7c3aed;
    }
    
    .actions-menu .delete {
        color: #dc2626;
    }
    
    .actions-menu .pdf {
        color: #059669;
    }
    
    .actions-menu a:last-child,
    .actions-menu button:last-child {
        border-bottom: none;
    }
    
    /* Fix forms for mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
        width: 100%;
    }
    
    /* Fix buttons for mobile */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        width: 100%;
        margin-bottom: 0.5rem;
        display: block;
        text-align: center;
    }
    
    .flex.space-x-3 {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .flex.space-x-3 .btn {
        width: 100%;
    }
    
    /* Fix page spacing */
    .py-8 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .mb-8 {
        margin-bottom: 1.5rem;
    }
    
    /* Fix empty state */
    .empty-state {
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .empty-state h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .empty-state p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile business info layout */
    .business-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .business-logo,
    .business-logo-placeholder {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        flex-shrink: 0;
    }
    
    .business-logo {
        object-fit: cover;
    }
    
    .business-logo-placeholder {
        background: #e5e7eb;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        font-weight: 600;
        color: #374151;
    }
    
    .business-details {
        min-width: 0;
        flex: 1;
    }
    
    .business-name {
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 0.25rem;
    }
    
    .business-gstin {
        font-size: 0.75rem;
        color: #6b7280;
    }
    
    /* Mobile table cell adjustments */
    .table tbody td {
        padding: 0.75rem 0.5rem;
        vertical-align: top;
    }
    
    .table tbody td .text-sm {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    /* Mobile form layouts */
    .form-container {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 0;
    }
    
    /* Mobile card adjustments */
    .card-header h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .card-header p {
        font-size: 0.75rem;
    }
    
    /* Mobile client info layout */
    .client-info {
        min-width: 0;
    }
    
    .client-name {
        font-weight: 600;
        color: #1f2937;
        margin-bottom: 0.25rem;
    }
    
    .client-cr {
        font-size: 0.75rem;
        color: #6b7280;
    }
    
    /* Mobile product info layout */
    .product-name {
        font-weight: 600;
        color: #1f2937;
    }
    
    /* Mobile authentication pages */
    .max-w-md {
        max-width: 100%;
        margin: 0 auto;
        padding: 0 1rem;
    }
    
    .card-header.text-center {
        text-align: center;
        padding: 1.5rem 1rem 1rem;
    }
    
    .card-header.text-center .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .card-header.text-center .page-subtitle {
        font-size: 0.875rem;
        color: #6b7280;
    }
    
    /* Mobile form spacing */
    .form-container .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-container .form-group:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile demo credentials */
    .mt-6 {
        margin-top: 1.5rem;
    }
    
    .mt-6 p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .mt-6 .link {
        color: #2563eb;
        text-decoration: none;
        font-weight: 500;
    }
    
    .mt-6 .link:hover {
        text-decoration: underline;
    }
    
    /* Mobile demo box */
    .mt-6.p-4 {
        padding: 1rem;
        background: #f9fafb;
        border-radius: 0.5rem;
        margin-top: 1.5rem;
    }
    
    .mt-6 h3 {
        font-size: 0.875rem;
        font-weight: 600;
        color: #374151;
        margin-bottom: 0.5rem;
    }
    
    .mt-6 .text-sm p {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
}

/* Modern Step-by-Step Form Styles */
.step-card {
    display: none;
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.step-card.active {
    display: block;
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.step-card .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1rem;
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.step-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    position: relative;
}

/* Floating Label Styles */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

/* Floating label styles - only apply to specific form containers */
.floating-labels .form-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.floating-labels .form-label .icon {
    font-size: 1rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    position: relative;
}

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

/* Floating label animation - only for floating-labels containers */
.floating-labels .form-input:focus + .form-label,
.floating-labels .form-input:not(:placeholder-shown) + .form-label,
.floating-labels .form-input.has-value + .form-label,
.floating-labels .form-select:focus + .form-label,
.floating-labels .form-select:not([value=""]) + .form-label,
.floating-labels .form-select.has-value + .form-label,
.floating-labels .form-textarea:focus + .form-label,
.floating-labels .form-textarea:not(:placeholder-shown) + .form-label,
.floating-labels .form-textarea.has-value + .form-label {
    top: 0;
    font-size: 0.75rem;
    color: #3b82f6;
    font-weight: 600;
}

/* For select elements that have a value - only for floating-labels containers */
.floating-labels .form-select:not([value=""]):not([value="0"]) + .form-label,
.floating-labels .form-select.has-value + .form-label {
    top: 0;
    font-size: 0.75rem;
    color: #3b7280;
    font-weight: 600;
}

/* Error states */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.floating-labels .form-input.error + .form-label,
.floating-labels .form-select.error + .form-label,
.floating-labels .form-textarea.error + .form-label {
    color: #ef4444;
}

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

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.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-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Products Section */
.products-section {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}

.products-section.has-products {
    background: white;
    border: 1px solid #e5e7eb;
    text-align: left;
    padding: 1.5rem;
}

.products-empty {
    color: #6b7280;
}

.products-empty h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.products-empty p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.product-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.product-item:last-child {
    margin-bottom: 0;
}

.product-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-title {
    font-weight: 600;
    color: #1f2937;
}

.remove-product {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
}

.remove-product:hover {
    background: #dc2626;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .step-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .step-indicator {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .step-number {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row.single {
        grid-template-columns: 1fr;
    }
}

/* Preview Styles */
.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #ef4444;
}

.preview-error h3 {
    color: #ef4444;
    margin-bottom: 1rem;
}

.preview-error p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

#preview-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
}

#preview-container iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 8px;
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .py-8 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .page-subtitle {
        font-size: 0.875rem;
    }
    
    .table {
        min-width: 500px;
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Touch-friendly */
    }
    
    .badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.5rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state h3 {
        font-size: 1rem;
    }
    
    .empty-state p {
        font-size: 0.875rem;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table th,
    .table td {
        padding: 0.875rem;
    }
    
    .actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .actions a,
    .actions button {
        min-height: 32px;
        padding: 0.5rem 0.75rem;
    }
    
    .table tbody tr:hover {
        background: transparent;
    }
    
    .table tbody tr:active {
        background: #f9fafb;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .py-8 {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .page-header {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

/* Bootstrap Select Dropdown Fixes - High Priority */
select,
select.form-select,
.form-select,
select.form-control,
.form-control[type="select"] {
    background-color: white !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    font-size: 1rem !important;
    padding: 0.75rem !important;
}

select:focus,
select.form-select:focus,
.form-select:focus,
select.form-control:focus,
.form-control[type="select"]:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

/* Force option styling with maximum specificity */
select option,
select.form-select option,
.form-select option,
select.form-control option,
.form-control[type="select"] option,
select option:not(:disabled),
select.form-select option:not(:disabled),
.form-select option:not(:disabled),
select.form-control option:not(:disabled),
.form-control[type="select"] option:not(:disabled) {
    background-color: white !important;
    color: #374151 !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
}

/* Hover states for options */
select option:hover,
select.form-select option:hover,
.form-select option:hover,
select.form-control option:hover,
.form-control[type="select"] option:hover {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
}

/* Selected/checked option styling */
select option:checked,
select.form-select option:checked,
.form-select option:checked,
select.form-control option:checked,
.form-control[type="select"] option:checked,
select option[selected],
select.form-select option[selected],
.form-select option[selected],
select.form-control option[selected],
.form-control[type="select"] option[selected] {
    background-color: #3b82f6 !important;
    color: white !important;
    font-weight: 600 !important;
}

/* Fix dropdown arrow */
select.form-select,
select.form-control {
    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 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.75rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    padding-right: 2.5rem !important;
}

/* Override any Bootstrap or browser defaults */
* {
    box-sizing: border-box;
}

select,
select option {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Force text color for all select elements */
select,
select option,
.form-select,
.form-select option,
select.form-control,
select.form-control option {
    color: #374151 !important;
    background-color: white !important;
}

/* Additional specificity for product form selects */
.product-item select,
.product-item .form-select,
.product-item select option,
.product-item .form-select option {
    color: #374151 !important;
    background-color: white !important;
}

/* Grade and packaging selects specifically */
.grade-select,
.packaging-select,
.product-select {
    color: #374151 !important;
    background-color: white !important;
}

.grade-select option,
.packaging-select option,
.product-select option {
    color: #374151 !important;
    background-color: white !important;
}

/* FINAL OVERRIDE - Maximum specificity for dropdown readability */
html body select,
html body select option,
html body .form-select,
html body .form-select option,
html body select.form-select,
html body select.form-select option,
html body .product-item select,
html body .product-item select option,
html body .product-item .form-select,
html body .product-item .form-select option {
    color: #374151 !important;
    background-color: white !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
}

/* Force dark text on all dropdown options */
html body select option,
html body .form-select option,
html body select.form-select option {
    color: #374151 !important;
    background-color: white !important;
}

/* Force proper contrast for selected options */
html body select option:checked,
html body .form-select option:checked,
html body select.form-select option:checked,
html body select option[selected],
html body .form-select option[selected],
html body select.form-select option[selected] {
    background-color: #3b82f6 !important;
    color: white !important;
    font-weight: 600 !important;
}

/* Utility Classes */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.w-full {
    width: 100%;
}

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

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

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

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

.rounded {
    border-radius: 0.25rem;
}

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

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

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

/* Action Links */
.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.actions a:hover {
    text-decoration: underline;
}

.actions .delete {
    color: #dc2626;
}

.actions .edit {
    color: #7c3aed;
}

.actions .pdf {
    color: #059669;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error Messages */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
