/* Art Invoice System - Shared Styles
   ========================================
   This file contains all shared CSS for the Art Invoice system
   Extracted from art-invoice-creator.html and art-invoice-view.html
   Created: 2025-07-03
   ======================================== */

/* Root Variables - Professional Invoice Theme */
:root {
    /* Primary Colors - Professional Blue/Gray Theme */
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    
    /* Background Colors */
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --hover-bg: #f8f9fa;
    
    /* Border and Text Colors */
    --border-color: #bdc3c7;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    
    /* Invoice Specific Colors */
    --invoice-header-bg: #34495e;
    --invoice-accent: #3498db;
    --table-header-bg: #ecf0f1;
    --table-border: #ddd;
    
    /* Status Colors */
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --info-bg: #dbeafe;
    --info-text: #1e40af;
    
    /* Focus States */
    --focus-shadow: 0 0 0 0.25rem rgba(76, 179, 84, 0.25);
}

/* Alternative Green Theme Variables (from art-invoice-view.html) */
.green-theme {
    --primary-color: #4cb354;
    --primary-dark: #409a47;
    --primary-light: #5bc85f;
}

/* ========================================
   Base Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   Header Styles
   ======================================== */

.header {
    background: var(--invoice-header-bg);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Alternative header style from view page */
.header.light {
    background: var(--card-bg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.header.light .logo {
    filter: none;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
}

.header.light .breadcrumb {
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--invoice-accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ========================================
   Layout Containers
   ======================================== */

/* Main Container - Creator Page (Split Layout) */
.main-container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Main Container - View Page (Single Column) */
.main-container.single-column {
    max-width: 900px;
}

/* Split Screen Layout */
.split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Form and Preview Panels */
.form-panel,
.preview-panel {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-panel {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.preview-panel {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.preview-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.preview-content {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ========================================
   Invoice Document Styles
   ======================================== */

.invoice-document,
.invoice-container {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.invoice-container {
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Invoice Header Section */
.invoice-header-section,
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.invoice-header-section {
    background: var(--invoice-header-bg);
    color: white;
    padding: 2rem;
    margin-bottom: 0;
    border-bottom: none;
}

.invoice-title h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 1px;
}

.invoice-header .invoice-title h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.invoice-number {
    text-align: right;
}

.invoice-number h2 {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.invoice-number .number {
    font-size: 1.5rem;
    font-weight: 600;
}

/* ========================================
   Invoice Details Grid
   ======================================== */

.invoice-details-grid,
.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.invoice-details {
    gap: 3rem;
    margin-bottom: 3rem;
}

.detail-section,
.invoice-section {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
}

.detail-section h3,
.invoice-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.invoice-section h3 {
    color: var(--primary-color);
    font-size: 1rem;
    letter-spacing: 0.05em;
}

/* Form Fields */
.detail-field {
    margin-bottom: 0.75rem;
}

.detail-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail-field input,
.detail-field select,
.detail-field textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.detail-field input:focus,
.detail-field select:focus,
.detail-field textarea:focus {
    outline: none;
    border-color: var(--invoice-accent);
}

/* ========================================
   Service Table Styles
   ======================================== */

.service-table,
.invoice-table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.service-table th,
.invoice-table th {
    background: var(--table-header-bg);
    padding: 0.75rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    border-bottom: 2px solid var(--table-border);
}

.invoice-table th {
    background: var(--bg-color);
    padding: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.service-table td,
.invoice-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--table-border);
}

.invoice-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.service-table .text-right,
.invoice-table .text-right {
    text-align: right;
}

.service-table .text-center,
.invoice-table .text-center {
    text-align: center;
}

/* Service Line Item */
.service-line-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.service-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.875rem;
}

.quantity-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.875rem;
    text-align: center;
}

.line-total {
    font-weight: 600;
    text-align: right;
    min-width: 80px;
}

.remove-line-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
}

.remove-line-btn:hover {
    background: #c0392b;
}

/* Add Service Button */
.add-service-btn {
    background: none;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 1rem;
}

.add-service-btn:hover {
    border-color: var(--invoice-accent);
    color: var(--invoice-accent);
    background: var(--hover-bg);
}

/* ========================================
   Invoice Totals
   ======================================== */

.invoice-totals {
    margin-left: auto;
    width: 350px;
    margin-top: 2rem;
}

.total-line,
.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.total-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.total-line.subtotal {
    border-top: 1px solid var(--table-border);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.total-line.grand-total,
.total-row.grand-total {
    border-top: 2px solid var(--text-primary);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.total-row.grand-total {
    font-size: 1.25rem;
    color: var(--primary-color);
    border-bottom: none;
}

/* ========================================
   Special Sections
   ======================================== */

/* Tax Notice */
.tax-notice {
    background: #fff8dc;
    border: 1px solid #ffd700;
    padding: 1rem;
    border-radius: 3px;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.tax-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Notes Section */
.notes-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.notes-section.highlight {
    background: var(--warning-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    border-top: none;
}

.notes-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.notes-section.highlight h3 {
    color: var(--warning-text);
    margin-bottom: 0.5rem;
}

.notes-section.highlight p {
    color: var(--warning-text);
    margin: 0;
}

/* Payment Section */
.payment-section {
    background: var(--success-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.payment-section h3 {
    color: var(--success-text);
    margin-bottom: 1rem;
}

.payment-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.payment-item p {
    margin: 0.25rem 0;
    color: var(--success-text);
}

/* Spec Art Section */
.spec-art-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

/* ========================================
   Action Buttons
   ======================================== */

.action-buttons,
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: var(--table-header-bg);
    border-top: 1px solid var(--border-color);
}

.action-bar {
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    border-top: none;
}

.action-group {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.action-bar .btn {
    border-radius: 6px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--invoice-accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

.action-bar .btn-primary {
    background: var(--primary-color);
}

.action-bar .btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 179, 84, 0.2);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--hover-bg);
}

.action-bar .btn-secondary {
    background: var(--hover-bg);
    border: none;
}

.action-bar .btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.action-bar .btn-danger {
    background: #dc3545;
}

.action-bar .btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* ========================================
   Status Badges
   ======================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.draft {
    background: var(--hover-bg);
    color: var(--text-secondary);
}

.status-badge.sent {
    background: var(--info-bg);
    color: var(--info-text);
}

.status-badge.paid {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-badge.partial {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status-badge.overdue {
    background: var(--error-bg);
    color: var(--error-text);
}

/* ========================================
   Art Request Search Section
   ======================================== */

.search-section {
    background: white;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.search-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input,
.enhanced-search {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.875rem;
}

.enhanced-search {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
    border-radius: 6px;
}

.enhanced-search:focus {
    border-color: var(--invoice-accent);
    box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.1);
}

/* Request Results */
.request-results {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8f9fa;
    padding: 0.5rem;
}

/* Date Filter Controls */
.date-filter-controls {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.date-filter-controls .form-control {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.date-filter-controls .form-control:focus {
    outline: none;
    border-color: var(--invoice-accent);
}

/* Search Filters */
.search-filters {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    background: var(--hover-bg);
    border-color: var(--invoice-accent);
}

.filter-btn.active {
    background: var(--invoice-header-bg);
    color: white;
    border-color: var(--invoice-header-bg);
}

/* ========================================
   Request Cards
   ======================================== */

.request-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    gap: 1rem;
}

.request-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--invoice-accent);
}

.request-card.selected {
    border-color: var(--success-color);
    border-width: 2px;
    background: #f0fff4;
}

.request-card.invoiced {
    opacity: 0.6;
    background: #f8f9fa;
}

/* Card Content Area */
.card-main-content {
    flex: 1;
    min-width: 0;
}

/* Thumbnail Styles */
.card-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
    position: relative;
    border: 1px solid var(--border-color);
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.card-thumbnail:hover img {
    transform: scale(1.05);
}

.card-thumbnail.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #999;
    font-size: 0.875rem;
}

.card-thumbnail.no-image i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Multiple images indicator */
.image-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 2px;
}

.image-count i {
    font-size: 0.625rem;
}

/* Card Header with Badges */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ready {
    background: #d1fae5;
    color: #065f46;
}

.badge-new-request {
    background: #dbeafe;
    color: #1e40af;
}

.badge-in-progress {
    background: #fed7aa;
    color: #9a3412;
}

.badge-awaiting {
    background: #e9d5ff;
    color: #6b21a8;
}

.badge-invoiced {
    background: #fef3c7;
    color: #92400e;
}

.badge-rush {
    background: #fee2e2;
    color: #991b1b;
}

/* Quick Invoice Button */
.quick-invoice-btn {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--invoice-accent);
}

.quick-invoice-btn:hover {
    background: var(--invoice-accent);
    color: white;
}

/* Card Body */
.card-body h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body .customer {
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.card-body .description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Card Footer */
.card-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
    margin-top: 0.75rem;
}

.card-footer span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-footer i {
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Legacy styles for compatibility */
.request-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.request-item:hover {
    background: var(--hover-bg);
}

.request-item.selected {
    background: #e3f2fd;
    border-left: 3px solid var(--invoice-accent);
}

.request-info {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.request-details {
    flex: 1;
}

.request-details h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.request-details p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

/* ========================================
   Alert Messages
   ======================================== */

.alert {
    padding: 1rem;
    border-radius: 3px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   Loading States
   ======================================== */

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--invoice-accent);
    animation: spin 1s ease-in-out infinite;
}

.loading-container .loading {
    width: 40px;
    height: 40px;
    border-width: 4px;
    border-top-color: var(--primary-color);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Artwork Styles
   ======================================== */

/* Artwork Section Styles */
.artwork-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.artwork-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.artwork-item {
    text-align: center;
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.artwork-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.artwork-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.artwork-item label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
}

.no-artwork {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Artwork Modal */
.artwork-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.artwork-modal.active {
    display: flex;
}

.artwork-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.artwork-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.artwork-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 10001;
}

.artwork-modal-close:hover {
    color: var(--text-primary);
}

.artwork-images-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.modal-artwork-image {
    display: none;
    max-width: 80vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

.modal-artwork-image.active {
    display: block;
}

.artwork-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10001;
}

.artwork-modal-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.artwork-modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.artwork-modal-prev {
    left: -60px;
}

.artwork-modal-next {
    right: -60px;
}

.artwork-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.artwork-modal-indicators {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.artwork-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.artwork-indicator.active {
    background: var(--primary-color);
}

.artwork-indicator:hover {
    background: var(--primary-light);
}

.artwork-modal-download {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.artwork-modal-download:hover {
    background: var(--primary-dark);
}

/* Artwork Thumbnail Enhancements */
.artwork-thumbnail {
    position: relative;
    cursor: pointer;
}

.artwork-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s;
    border-radius: 8px;
    z-index: 1;
}

.artwork-thumbnail:hover::before {
    background: rgba(0, 0, 0, 0.3);
}

.artwork-thumbnail i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.artwork-thumbnail:hover i {
    opacity: 1;
}

.artwork-count-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 3;
}

/* ========================================
   Invoice Preview Styles
   ======================================== */

.invoice-preview {
    background: white;
    border: 1px solid #ddd;
    font-family: 'Inter', sans-serif;
}

.invoice-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #4cb354;
}

.invoice-preview-logo {
    max-width: 120px;
    height: auto;
}

.invoice-preview-title {
    text-align: right;
}

.invoice-preview-title h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    color: #4cb354;
    font-weight: bold;
}

.invoice-preview-title p {
    margin: 0.125rem 0;
    font-size: 0.8rem;
    line-height: 1.2;
}

.invoice-preview-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.invoice-preview-section {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 0.75rem;
    border-radius: 4px;
}

.invoice-preview-section h3 {
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
    color: #4cb354;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
}

.invoice-preview-section p {
    margin: 0.125rem 0;
    font-size: 0.75rem;
    line-height: 1.3;
}

.invoice-preview-project {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
}

.invoice-preview-project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.invoice-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.75rem;
}

.invoice-preview-table th {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: left;
}

.invoice-preview-table td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.25rem;
    font-size: 0.7rem;
    line-height: 1.2;
}

.invoice-preview-totals {
    margin: 1rem 0;
    font-size: 0.75rem;
}

.invoice-preview-total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    line-height: 1.2;
}

.invoice-preview-grand-total {
    border-top: 2px solid #4cb354;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: bold;
    font-size: 0.875rem;
}

.invoice-preview-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.65rem;
    line-height: 1.3;
    color: #666;
}

.invoice-preview-empty {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-style: italic;
}

.invoice-preview-artwork {
    margin: 1rem 0;
    display: none;
}

.invoice-preview-artwork.show {
    display: block;
}

.invoice-preview-artwork h3 {
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
    color: #4cb354;
    font-weight: bold;
}

.invoice-preview-artwork-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.invoice-preview-artwork-item {
    text-align: center;
    padding: 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.invoice-preview-artwork-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 0.25rem;
}

.invoice-preview-artwork-item label {
    font-size: 0.6rem;
    color: #666;
    display: block;
}

/* ========================================
   Print Styles - Comprehensive Single Page Layout
   ======================================== */

@page {
    size: letter;
    margin: 0.5in;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Hide navigation and interactive elements */
    .header,
    .action-bar,
    .action-buttons,
    .btn,
    .add-service-btn,
    .remove-line-btn,
    .artwork-modal,
    .breadcrumb,
    .search-section {
        display: none !important;
    }
    
    /* Main container optimization */
    .main-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Invoice container - single page layout */
    .invoice-container,
    .invoice-document {
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        page-break-inside: avoid !important;
    }
    
    /* Compact header - 15% of page */
    .invoice-header,
    .invoice-header-section {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 0.3in !important;
        padding-bottom: 0.1in !important;
        border-bottom: 2px solid #4cb354 !important;
        flex-shrink: 0 !important;
    }
    
    .invoice-logo {
        max-width: 1.5in !important;
        height: auto !important;
        max-height: 0.6in !important;
    }
    
    .invoice-title {
        text-align: right !important;
        margin: 0 !important;
    }
    
    .invoice-title h1 {
        font-size: 18px !important;
        margin: 0 0 0.1in 0 !important;
        color: #4cb354 !important;
        font-weight: bold !important;
    }
    
    .invoice-title p {
        margin: 0.02in 0 !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
    }
    
    /* Customer/Project info - 20% of page */
    .invoice-details,
    .invoice-details-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 0.2in !important;
        margin-bottom: 0.2in !important;
        flex-shrink: 0 !important;
    }
    
    .invoice-section,
    .detail-section {
        background: white !important;
        border: 1px solid #ddd !important;
        padding: 0.1in !important;
        margin: 0 !important;
        page-break-inside: avoid !important;
    }
    
    .invoice-section h3,
    .detail-section h3 {
        font-size: 12px !important;
        margin: 0 0 0.05in 0 !important;
        color: #4cb354 !important;
        font-weight: bold !important;
        border-bottom: 1px solid #eee !important;
        padding-bottom: 0.02in !important;
    }
    
    .invoice-section p,
    .detail-section p {
        margin: 0.02in 0 !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
    }
    
    /* Project details section optimization */
    .invoice-section[style*="margin-bottom: 2rem"] {
        margin-bottom: 0.1in !important;
        grid-column: 1 / -1 !important;
    }
    
    .invoice-section[style*="margin-bottom: 2rem"] > div {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 0.15in !important;
    }
    
    /* Artwork section - 25% of page */
    .artwork-section,
    #artworkSection {
        display: block !important;
        margin: 0.1in 0 !important;
        flex-shrink: 0 !important;
        page-break-inside: avoid !important;
    }
    
    .artwork-section h3 {
        font-size: 12px !important;
        margin: 0 0 0.05in 0 !important;
        color: #4cb354 !important;
        font-weight: bold !important;
    }
    
    .artwork-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.1in !important;
        margin-bottom: 0.1in !important;
    }
    
    .artwork-item {
        text-align: center !important;
        padding: 0.05in !important;
        background: white !important;
        border: 1px solid #ddd !important;
        border-radius: 3px !important;
        cursor: default !important;
        transition: none !important;
    }
    
    .artwork-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .artwork-item img {
        width: 100% !important;
        height: 0.8in !important;
        object-fit: cover !important;
        border-radius: 2px !important;
        margin-bottom: 0.02in !important;
        display: block !important;
    }
    
    .artwork-item label {
        font-size: 8px !important;
        color: #666 !important;
        display: block !important;
        margin: 0 !important;
    }
    
    .no-artwork {
        color: #999 !important;
        font-style: italic !important;
        text-align: center !important;
        padding: 0.1in !important;
        font-size: 9px !important;
    }
    
    /* Spec Art section */
    #specArtSection {
        margin: 0.1in 0 !important;
        flex-shrink: 0 !important;
    }
    
    #specArtSection div[style*="background: #fff3cd"] {
        background: #fff3cd !important;
        border: 1px solid #ffeaa7 !important;
        padding: 0.08in !important;
        border-radius: 3px !important;
    }
    
    #specArtSection h4 {
        margin: 0 0 0.05in 0 !important;
        color: #856404 !important;
        font-size: 10px !important;
        font-weight: bold !important;
    }
    
    #specArtSection div[style*="display: grid"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.1in !important;
    }
    
    #specArtSection p {
        margin: 0.01in 0 !important;
        font-size: 8px !important;
        line-height: 1.2 !important;
    }
    
    /* Invoice table - 25% of page */
    .invoice-table,
    .service-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 0.1in 0 !important;
        flex-shrink: 0 !important;
        font-size: 10px !important;
    }
    
    .invoice-table th,
    .service-table th {
        background: #f5f5f5 !important;
        border: 1px solid #ddd !important;
        padding: 0.05in !important;
        font-size: 10px !important;
        font-weight: bold !important;
        text-align: left !important;
    }
    
    .invoice-table td,
    .service-table td {
        border: 1px solid #ddd !important;
        padding: 0.05in !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
    }
    
    .text-right {
        text-align: right !important;
    }
    
    /* Totals section - 15% of page */
    .invoice-totals {
        margin: 0.1in 0 !important;
        flex-shrink: 0 !important;
    }
    
    .total-row,
    .total-line {
        display: flex !important;
        justify-content: space-between !important;
        padding: 0.02in 0 !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
    }
    
    .grand-total {
        border-top: 2px solid #4cb354 !important;
        padding-top: 0.05in !important;
        margin-top: 0.05in !important;
        font-weight: bold !important;
        font-size: 12px !important;
    }
    
    /* Payment and notes sections */
    .payment-section,
    .notes-section {
        margin: 0.05in 0 !important;
        padding: 0.05in !important;
        background: #f8f9fa !important;
        border: 1px solid #ddd !important;
        border-radius: 3px !important;
        flex-shrink: 0 !important;
    }
    
    .payment-section h3,
    .notes-section h3 {
        font-size: 10px !important;
        margin: 0 0 0.03in 0 !important;
        color: #4cb354 !important;
        font-weight: bold !important;
    }
    
    .payment-info {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 0.1in !important;
    }
    
    .payment-item p {
        margin: 0.01in 0 !important;
        font-size: 8px !important;
        line-height: 1.2 !important;
    }
    
    /* Footer - at bottom */
    .invoice-container > div:last-child {
        margin-top: auto !important;
        padding-top: 0.1in !important;
        border-top: 1px solid #ddd !important;
        text-align: center !important;
        font-size: 8px !important;
        line-height: 1.2 !important;
        flex-shrink: 0 !important;
    }
    
    .invoice-container > div:last-child p {
        margin: 0.01in 0 !important;
        font-size: 8px !important;
    }
    
    .invoice-container > div:last-child hr {
        margin: 0.05in 0 !important;
        border: none !important;
        border-top: 1px solid #ddd !important;
    }
    
    /* Page break controls */
    .invoice-header,
    .invoice-details,
    .artwork-section,
    .invoice-table,
    .invoice-totals {
        page-break-inside: avoid !important;
    }
    
    /* Ensure single page */
    body, .main-container, .invoice-container {
        max-height: 10in !important;
        overflow: hidden !important;
    }
    
    /* Enhanced print optimization */
    * {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* Force artwork images to print */
    .artwork-item img {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
    }
    
    /* Optimize for different browsers */
    .invoice-container {
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    /* Ensure all content fits */
    .invoice-section {
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Fix tax display based on tax status */
    .has-tax #taxExemptRow {
        display: none !important;
    }
    
    .has-tax #taxRow {
        display: flex !important;
    }
    
    .tax-exempt #taxRow {
        display: none !important;
    }
    
    .tax-exempt #taxExemptRow {
        display: flex !important;
    }
}

/* ========================================
   Responsive Styles
   ======================================== */

@media (max-width: 1200px) {
    .split-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .preview-panel {
        position: static;
        max-height: none;
        order: -1;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .request-card {
        flex-direction: column;
    }
    
    .card-thumbnail {
        width: 100%;
        height: 200px;
        order: -1; /* Move thumbnail to top on mobile */
    }
    
    .invoice-header {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .invoice-title {
        text-align: center;
    }
    
    .invoice-details,
    .invoice-details-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .invoice-totals {
        width: 100%;
    }
    
    .action-bar,
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-group {
        width: 100%;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal responsiveness */
    .artwork-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        padding: 0.5rem;
    }
    
    .artwork-modal-nav {
        padding: 0.75rem;
        font-size: 1.25rem;
    }
    
    .artwork-modal-prev {
        left: -50px;
    }
    
    .artwork-modal-next {
        right: -50px;
    }
    
    .modal-artwork-image {
        max-width: 90vw;
        max-height: 75vh;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

/* End of art-invoice-shared.css */