/* InkSoft Transform - Web Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.5;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 24px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
}

header h1 {
    font-size: 22px;
    color: #2c3e50;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.version {
    color: #888;
    font-size: 14px;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sync Status Widget */
.sync-status-widget {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    cursor: help;
}

.sync-status-widget.sync-fresh {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.sync-status-widget.sync-stale {
    background: #fff3e0;
    border-color: #FF9800;
}

.sync-status-widget.sync-critical {
    background: #ffebee;
    border-color: #f44336;
}

.sync-status-icon {
    font-size: 10px;
}

.sync-fresh .sync-status-icon {
    color: #4CAF50;
}

.sync-stale .sync-status-icon {
    color: #FF9800;
}

.sync-critical .sync-status-icon {
    color: #f44336;
}

.sync-status-text {
    color: #666;
}

/* Help Button */
.btn-help {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #4CAF50;
    background: white;
    color: #4CAF50;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-help:hover {
    background: #4CAF50;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Control Row */
.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.control-row label {
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.control-row select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    min-width: 250px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.control-row select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

/* Info Panel */
.info-panel {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 16px;
}

.info-row {
    text-align: center;
    padding: 8px 0;
}

#info-display {
    color: #666;
    font-size: 14px;
}

#info-display.success {
    color: #155724;
    background: #d4edda;
    border-radius: 4px;
    padding: 10px;
}

#info-display.error {
    color: #721c24;
    background: #f8d7da;
    border-radius: 4px;
    padding: 10px;
}

/* Info Panel Grid Layout */
.info-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    text-align: center;
}

.info-item {
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.info-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.info-value small {
    display: block;
    font-size: 11px;
    color: #666;
    font-weight: 400;
}

.info-placeholder {
    color: #888;
    font-style: italic;
}

.info-divider {
    height: 1px;
    background: #ccc;
    margin: 10px 0;
}

.controls-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 14px;
    color: #555;
}

.control-group select,
.control-group input[type="date"] {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: #f8f8f8;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #e8e8e8;
    border-color: #bbb;
    color: #333;
}

/* Sections */
.section {
    margin-bottom: 15px;
}

.section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

textarea[readonly] {
    background: #fafafa;
}

/* Flash animation for auto-update feedback */
textarea.flash-update {
    animation: flashGreen 0.6s ease-out;
}

@keyframes flashGreen {
    0% {
        border-color: #28a745;
        box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.4);
    }
    100% {
        border-color: #ccc;
        box-shadow: none;
    }
}

/* Buttons */
.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.btn-primary:hover {
    background: #43a047;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(76, 175, 80, 0.2);
}

.btn:not(.btn-primary):not(.btn-danger) {
    background: #f8f8f8;
    border: 1px solid #d0d0d0;
    color: #555;
}

.btn:not(.btn-primary):not(.btn-danger):hover {
    background: #eeeeee;
    border-color: #bbb;
    color: #333;
}

/* Status Message */
.status-message {
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.status-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.warning {
    display: block;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    margin: 20px auto;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Store Manager Modal */
.store-manager-body {
    display: flex;
    gap: 20px;
    min-height: 400px;
}

.store-list-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.store-list-panel h3,
.store-details-panel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
}

.store-list {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-y: auto;
    max-height: 350px;
    margin-bottom: 10px;
}

.store-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.store-item:hover {
    background: #f5f5f5;
}

.store-item.selected {
    background: #e3f2fd;
}

.store-item .store-name {
    font-weight: 500;
}

.store-item .store-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #e0e0e0;
    color: #666;
}

.store-item .store-badge.custom {
    background: #fff3cd;
    color: #856404;
}

.store-details-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.store-details {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #fafafa;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    overflow-y: auto;
    max-height: 350px;
    margin-bottom: 10px;
}

.store-details .hint {
    color: #888;
    font-style: italic;
    font-family: inherit;
}

.store-details-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dotted #ddd;
}

.store-details-row:last-child {
    border-bottom: none;
}

.store-details-row .label {
    color: #666;
}

.store-details-row .value {
    font-weight: 500;
}

/* Add Store Modal */
.add-store-step {
    margin-bottom: 20px;
}

.add-store-step h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.add-store-step .hint {
    color: #888;
    font-size: 12px;
    margin-bottom: 8px;
}

.add-store-step textarea {
    height: 120px;
}

.add-store-preview {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
}

.add-store-preview h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

#preview-content {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

#preview-content.error {
    color: #dc3545;
}

#preview-content.success {
    color: #28a745;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.preview-row .label {
    color: #666;
}

.preview-row .value {
    font-weight: 500;
}

.preview-row .value.warning {
    color: #856404;
}

.preview-row .value.error {
    color: #dc3545;
}

/* Danger Button - prominent red for visibility */
.btn-danger {
    background: #dc3545;
    color: white;
    border: 2px solid #c82333;
    font-weight: 500;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Store List Controls */
.store-list-controls {
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* Archived Store Styling */
.store-item.archived {
    background: #f8f8f8;
    opacity: 0.7;
}

.store-item.archived .store-name {
    color: #888;
    font-style: italic;
}

.store-item.archived .store-badge {
    background: #dc3545;
    color: white;
}

/* Store Actions Row */
.store-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Store Details Edit Mode */
.store-details-input {
    width: 100%;
    padding: 4px 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}

.store-details-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.store-details-row.edit-mode {
    flex-direction: column;
    gap: 4px;
}

.store-details-row.edit-mode .label {
    font-size: 12px;
}

/* Help Modal Styles */
.help-body {
    max-height: 70vh;
    overflow-y: auto;
}

.help-section {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.help-section-title {
    background: #f5f5f5;
    padding: 12px 15px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.help-section-title:hover {
    background: #eee;
}

.help-toggle {
    font-size: 12px;
    transition: transform 0.2s;
}

.help-section.collapsed .help-toggle {
    transform: rotate(-90deg);
}

.help-section.collapsed .help-section-content {
    display: none;
}

.help-section-content {
    padding: 15px;
    background: white;
}

.help-section-content h4 {
    margin: 15px 0 8px 0;
    font-size: 14px;
    color: #333;
}

.help-section-content h4:first-child {
    margin-top: 0;
}

.help-section-content p {
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
}

.help-section-content ol,
.help-section-content ul {
    margin: 0 0 10px 25px;
    color: #555;
    font-size: 14px;
}

.help-section-content li {
    margin-bottom: 5px;
}

.help-section-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.help-table th,
.help-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.help-table th {
    background: #f8f8f8;
    font-weight: 600;
}

.help-table tr:last-child td {
    border-bottom: none;
}

.help-table td:first-child {
    width: 140px;
    white-space: nowrap;
}

.contact-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
}

.contact-info a {
    color: #4CAF50;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Header Button (Tax Lookup) */
.btn-header {
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 2px solid #4CAF50;
    background: white;
    color: #4CAF50;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-header:hover {
    background: #4CAF50;
    color: white;
}

/* Tools Dropdown */
.tools-dropdown {
    position: relative;
    display: inline-block;
}

.btn-tools-toggle {
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #4CAF50;
    background: white;
    color: #4CAF50;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.btn-tools-toggle:hover {
    background: #4CAF50;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.2s;
}

.tools-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.tools-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    min-width: 220px;
    z-index: 1000;
    padding: 6px 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s;
}

.tools-dropdown:hover .tools-dropdown-menu,
.tools-dropdown.open .tools-dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tools-dropdown-menu .dropdown-section-label {
    display: block;
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    pointer-events: none;
}

.tools-dropdown-menu .dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 6px 12px;
}

.tools-dropdown-menu a,
.tools-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    text-align: left;
    text-decoration: none;
    color: #444;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.tools-dropdown-menu a:hover,
.tools-dropdown-menu button:hover {
    background: #f0f7f0;
    color: #2e7d32;
    border-left-color: #4CAF50;
}

.tools-dropdown-menu .dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Tax Lookup Modal */
.tax-lookup-form {
    margin-bottom: 20px;
}

.tax-input-group {
    margin-bottom: 15px;
}

.tax-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.tax-input-group input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tax-input-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.tax-input-row {
    display: flex;
    gap: 15px;
}

.tax-input-row .tax-input-group {
    flex: 1;
}

.tax-button-row {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.tax-results {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    min-height: 80px;
}

.tax-results .hint {
    color: #888;
    font-style: italic;
    text-align: center;
    margin: 0;
}

.tax-results .error {
    color: #dc3545;
    text-align: center;
    margin: 0;
}

.tax-results .loading {
    color: #666;
    text-align: center;
    margin: 0;
}

.tax-results.success {
    background: #d4edda;
    border-color: #c3e6cb;
}

.tax-result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.tax-result-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 4px;
}

.tax-result-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tax-result-value {
    font-size: 16px;
    font-weight: 600;
    color: #155724;
}

.tax-rate-large {
    font-size: 24px;
}

.tax-result-status {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: #666;
}

.tax-location-header {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #155724;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(21, 87, 36, 0.2);
}

.modal-hint {
    color: #666;
    font-size: 13px;
    margin: 0 0 15px 0;
    text-align: center;
}

/* Sizing Matrix */
.sizing-matrix {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f5f5;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
}

.matrix-header:hover {
    background: #eee;
}

.matrix-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.matrix-chevron {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #666;
}

.sizing-matrix.collapsed .matrix-chevron {
    transform: rotate(-90deg);
}

.sizing-matrix.collapsed .matrix-header {
    border-bottom: none;
}

.matrix-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sizing-matrix.collapsed .matrix-content {
    max-height: 0;
}

.matrix-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.matrix-other-label {
    font-size: 11px;
    color: #666;
    margin-right: 65px;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.matrix-table thead {
    background: #fafafa;
}

.matrix-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

.matrix-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.matrix-table tbody tr:hover {
    background: #f9f9f9;
}

.matrix-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.col-part { width: 80px; }
.col-color { width: 120px; }
.col-desc { min-width: 180px; }
.col-size { width: 40px; text-align: center !important; }
.col-other { position: relative; }
.col-price { width: 75px; text-align: right !important; }

/* Size columns center alignment */
.matrix-table td:nth-child(n+4):nth-child(-n+9) {
    text-align: center;
}

/* Price column right alignment */
.matrix-table td:last-child {
    text-align: right;
    font-weight: 500;
}

.matrix-footer {
    background: #f5f5f5;
    padding: 12px 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.matrix-footer-left {
    font-size: 13px;
    color: #666;
}

#matrix-pieces {
    font-weight: 500;
}

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

.total-row {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 2px 0;
    font-size: 13px;
}

.total-label {
    color: #666;
}

.total-value {
    min-width: 70px;
    text-align: right;
    color: #333;
}

.total-row.grand-total {
    border-top: 1px solid #ddd;
    margin-top: 4px;
    padding-top: 6px;
    font-weight: 600;
}

.total-row.grand-total .total-label,
.total-row.grand-total .total-value {
    color: #222;
    font-size: 14px;
}

/* Gift Code rows */
.gift-code-row {
    font-style: italic;
    color: #666;
}

.gift-code-row td:first-child {
    color: #888;
}

/* ============ Order Dashboard Styles ============ */

/* Dashboard Section */
.dashboard-section {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.dashboard-section-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Lookup Form */
.lookup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lookup-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.lookup-select {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 140px;
}

.lookup-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.lookup-input:focus,
.lookup-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Results Section */
.results-section {
    margin-top: 20px;
}

/* Order Card */
.order-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.order-card-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.order-card-body {
    padding: 15px 20px;
}

.order-info-row {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dotted #eee;
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-label {
    font-weight: 500;
    color: #666;
    min-width: 80px;
}

.order-info-value {
    color: #333;
}

/* Order Subcards */
.order-subcard {
    border-top: 1px solid #e0e0e0;
    padding: 15px 20px;
}

.order-subcard h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

/* Dates Grid */
.dates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    text-align: center;
}

.date-item {
    background: #f8f8f8;
    padding: 10px;
    border-radius: 4px;
}

.date-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.date-value {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    text-align: center;
}

.status-item {
    padding: 8px;
    border-radius: 4px;
    background: #f8f8f8;
}

.status-icon {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
}

.status-label {
    display: block;
    font-size: 11px;
    color: #666;
}

.status-complete .status-icon {
    color: #28a745;
}

.status-pending .status-icon {
    color: #999;
}

.status-partial .status-icon {
    color: #ffc107;
}

.status-na .status-icon {
    color: #ccc;
}

/* Financials Grid */
.financials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.financial-item {
    background: #f8f8f8;
    padding: 10px;
    border-radius: 4px;
}

.financial-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.financial-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Collapsible Sections */
.collapsible-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
}

.collapsible-header:hover {
    background: #eee;
}

.collapsible-chevron {
    font-size: 12px;
    color: #666;
}

.collapsible-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.collapsible-content {
    padding: 0;
}

/* Dashboard Matrix overrides */
.dashboard-matrix {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.dashboard-matrix-header {
    border-bottom: none;
    cursor: default;
}

.dashboard-matrix-header:hover {
    background: #f5f5f5;
}

/* Invoice Totals in Line Items tab */
.invoice-totals {
    text-align: right;
    min-width: 200px;
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.invoice-label {
    color: #666;
    margin-right: 20px;
}

.invoice-value {
    min-width: 80px;
    text-align: right;
    color: #333;
    font-weight: 500;
}

.invoice-total-row {
    border-top: 2px solid #333;
    margin-top: 6px;
    padding-top: 8px;
}

.invoice-total-row .invoice-label,
.invoice-total-row .invoice-value {
    font-weight: 700;
    color: #222;
    font-size: 14px;
}

/* Payments Table */
.payments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.payments-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.payments-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.payments-table tbody tr:hover {
    background: #f9f9f9;
}

.payments-table tbody tr:last-child td {
    border-bottom: none;
}

/* Not Found / Loading / Error Sections */
.not-found-section,
.loading-section,
.error-section {
    margin-top: 20px;
}

.not-found-card {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #856404;
}

.loading-section {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error-section {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #721c24;
}

/* Header link styling */
a.btn-header {
    text-decoration: none;
}

/* ============ Tab Navigation ============ */

.order-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #5d4e37;
    color: white;
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
}

.order-header-bar h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.order-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.order-type-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
}

.order-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #9C27B0;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.order-type-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.order-header-actions {
    display: flex;
    gap: 10px;
}

.tab-nav {
    display: flex;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-top: none;
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #5d4e37;
    border-bottom-color: #5d4e37;
    font-weight: 600;
}

.tab-count {
    font-size: 11px;
    color: #888;
}

.tab-btn.active .tab-count {
    color: #5d4e37;
}

.tab-content {
    display: none;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    padding: 20px;
    border-radius: 0 0 6px 6px;
}

.tab-content.active {
    display: block;
}

/* Order Card updates for tabs */
.tab-content .order-card {
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tab-content .order-card:last-child {
    margin-bottom: 0;
}

.order-card h3 {
    margin: 0;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

/* Order Details Grid */
.order-details-grid {
    padding: 15px;
}

.order-detail-row {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dotted #eee;
}

.order-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #666;
    min-width: 100px;
}

.detail-value {
    color: #333;
}

/* Dates Grid - update for 5 items */
.order-card .dates-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 15px;
}

/* ============ ShopWorks Style Status Badges ============ */

.status-grid-shopworks {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 15px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.status-row .status-label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    text-align: right;
    flex: 1;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    border-radius: 3px;
    min-width: 45px;
}

.status-badge.status-complete {
    background: #28a745;
    color: white;
}

.status-badge.status-pending {
    background: #dc3545;
    color: white;
}

.status-badge.status-partial {
    background: #ffc107;
    color: #333;
}

.status-badge.status-na {
    background: #17a2b8;
    color: white;
}

/* ============ Address Cards ============ */

.addresses-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.address-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.address-card h3 {
    margin: 0;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

.address-content {
    padding: 15px;
}

.address-field {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dotted #eee;
}

.address-label {
    font-weight: 500;
    color: #666;
}

.address-value {
    color: #333;
}

.address-block {
    line-height: 1.6;
}

.address-line {
    color: #333;
}

.address-line:empty {
    display: none;
}

.map-link {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.map-link:hover {
    background: #45a049;
}

/* ============ Tracking Table ============ */

.tracking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tracking-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.tracking-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.tracking-table tbody tr:hover {
    background: #f9f9f9;
}

.tracking-table tbody tr:last-child td {
    border-bottom: none;
}

.tracking-link {
    color: #0066cc;
    text-decoration: none;
    font-family: monospace;
}

.tracking-link:hover {
    text-decoration: underline;
}

/* Design Tab */
.design-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.design-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.design-detail-row {
    display: flex;
    gap: 10px;
}

.design-label {
    color: #666;
    min-width: 120px;
    font-weight: 500;
}

.design-value {
    color: #333;
    font-weight: 400;
}

/* Design Thumbnail */
.design-thumbnail-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.design-thumbnail-section h4 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.thumbnail-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.design-thumbnail-img {
    max-width: 100%;
    max-height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 150px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #888;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 20px;
    }

    .control-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-row select {
        width: 100%;
    }

    .controls-row {
        flex-direction: column;
        gap: 15px;
    }

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

    .btn {
        flex: 1;
        min-width: 100px;
    }

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

    /* Dashboard responsive */
    .lookup-row {
        flex-direction: column;
        align-items: stretch;
    }

    .lookup-select,
    .lookup-input {
        width: 100%;
        min-width: auto;
    }

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

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

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

    /* Tab responsive */
    .tab-nav {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex: 0 0 auto;
        padding: 10px 12px;
        font-size: 12px;
    }

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

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

    .addresses-container {
        grid-template-columns: 1fr;
    }

    .order-header-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .order-header-bar h2 {
        font-size: 18px;
    }
}

/* ============ Product Image Modal ============ */

.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.product-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.product-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
}

.product-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    z-index: 1;
}

.product-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.product-modal-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
}

.product-modal-loading,
.product-modal-error {
    padding: 60px;
    text-align: center;
    color: #666;
}

/* Part # link styling */
.part-link {
    color: #1976D2;
    text-decoration: none;
    cursor: pointer;
}

.part-link:hover {
    text-decoration: underline;
}

/* ============ Gift Certificates Page Styles ============ */

/* Search Groups */
.gc-search-group {
    margin-bottom: 20px;
}

.gc-search-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.gc-button-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* Certificate Header Bar */
.gc-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #5d4e37;
    color: white;
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
}

.gc-header-bar.gc-header-order {
    background: #2e7d32;
}

.gc-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gc-cert-number {
    font-size: 20px;
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 1px;
}

.gc-order-title {
    font-size: 20px;
    font-weight: 600;
}

/* Status Badges */
.gc-status-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
}

.gc-status-badge.status-active {
    background: #28a745;
    color: white;
}

.gc-status-badge.status-depleted {
    background: #6c757d;
    color: white;
}

.gc-status-badge.status-unknown {
    background: #ffc107;
    color: #333;
}

/* Small status badge for tables */
.gc-status-badge-small {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 10px;
}

.gc-status-badge-small.status-active {
    background: #d4edda;
    color: #155724;
}

.gc-status-badge-small.status-depleted {
    background: #e2e3e5;
    color: #383d41;
}

.gc-status-badge-small.status-unknown {
    background: #fff3cd;
    color: #856404;
}

/* Balance Display */
.gc-details-grid {
    padding: 15px;
}

.gc-balance-section {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.gc-balance-item {
    text-align: center;
}

.gc-balance-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.gc-balance-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.gc-balance-current.balance-positive {
    color: #28a745;
}

.gc-balance-current.balance-zero {
    color: #6c757d;
}

/* Table Container */
.gc-table-container {
    overflow-x: auto;
}

/* Redemption Table */
.gc-redemption-table,
.gc-applied-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gc-redemption-table th,
.gc-applied-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.gc-redemption-table td,
.gc-applied-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.gc-redemption-table tbody tr:hover,
.gc-applied-table tbody tr:hover {
    background: #f9f9f9;
}

.gc-redemption-table tbody tr:last-child td,
.gc-applied-table tbody tr:last-child td {
    border-bottom: none;
}

/* Amount styling */
.gc-amount-issued {
    font-weight: 600;
    color: #28a745;
}

.gc-amount-redeemed,
.gc-amount-applied {
    font-weight: 600;
    color: #dc3545;
}

.gc-no-data {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px !important;
}

/* Certificate and Order links */
.gc-order-link,
.gc-cert-link {
    color: #0066cc;
    text-decoration: none;
}

.gc-order-link:hover,
.gc-cert-link:hover {
    text-decoration: underline;
}

.gc-cert-link {
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gc-balance-section {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .gc-balance-item {
        text-align: left;
    }

    .gc-redemption-table,
    .gc-applied-table {
        font-size: 12px;
    }

    .gc-redemption-table th,
    .gc-redemption-table td,
    .gc-applied-table th,
    .gc-applied-table td {
        padding: 8px 10px;
    }

    .gc-cert-number {
        font-size: 16px;
    }
}

/* ============ Gift Certificate Import Styles ============ */

.gc-import-section {
    background: #fafafa;
    border: 1px dashed #ccc;
}

.gc-import-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.gc-import-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.gc-file-input {
    display: none;
}

.gc-file-label {
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #ccc;
}

.gc-file-label:hover {
    background: #e8e8e8;
}

.gc-file-name {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Preview Panel */
.gc-import-preview {
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.gc-import-preview h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 16px;
}

.gc-import-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.gc-stat-item {
    text-align: center;
    padding: 15px 25px;
    background: #f5f5f5;
    border-radius: 8px;
    min-width: 120px;
}

.gc-stat-item.gc-stat-active {
    background: #d4edda;
    border: 1px solid #28a745;
}

.gc-stat-item.gc-stat-filtered {
    background: #f8d7da;
    border: 1px solid #dc3545;
}

.gc-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.gc-stat-active .gc-stat-value {
    color: #28a745;
}

.gc-stat-filtered .gc-stat-value {
    color: #dc3545;
}

.gc-stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.gc-import-actions {
    display: flex;
    gap: 15px;
}

.btn-large {
    padding: 12px 30px;
    font-size: 16px;
}

/* Progress Indicator */
.gc-import-progress {
    margin-top: 25px;
    text-align: center;
    padding: 30px;
}

.gc-progress-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

#import-status {
    color: #666;
    font-size: 14px;
}

/* Import Result */
.gc-import-result {
    margin-top: 25px;
    text-align: center;
    padding: 25px;
}

.gc-import-success {
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 20px;
}

.gc-success-icon {
    font-size: 48px;
    color: #28a745;
    display: block;
    margin-bottom: 10px;
}

#import-success-message {
    color: #155724;
    font-size: 16px;
    font-weight: 600;
}

.gc-import-error {
    background: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 20px;
}

.gc-error-icon {
    font-size: 48px;
    color: #dc3545;
    display: block;
    margin-bottom: 10px;
}

#import-error-message {
    color: #721c24;
    font-size: 14px;
}

/* Caspio DataPage Container */
.gc-caspio-datapage {
    min-height: 400px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* ============ Gift Certificate Tab Navigation ============ */

.gc-tab-nav {
    display: flex;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    margin-top: 20px;
    gap: 0;
    overflow-x: auto;
}

.gc-tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.gc-tab-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.gc-tab-btn.active {
    background: white;
    color: #5d4e37;
    border-bottom-color: #5d4e37;
    font-weight: 600;
}

.gc-tab-content {
    display: none;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 20px;
    background: white;
}

.gc-tab-content.active {
    display: block;
}

/* Adjust sections inside tabs */
.gc-tab-content .dashboard-section {
    margin-bottom: 0;
    border: none;
    padding: 0;
    background: transparent;
}

/* Browse tab - full width Caspio */
#tab-browse .gc-caspio-datapage {
    border: none;
    padding: 0;
    margin: 0;
}

/* Import tab styling */
#tab-import .gc-import-section {
    border: none;
    background: transparent;
}

/* ============ SanMar Price List Converter Styles ============ */

.sanmar-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.sanmar-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.sanmar-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.sanmar-results-header h3 {
    margin: 0;
    color: #28a745;
    font-size: 18px;
}

.sanmar-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.sanmar-stat {
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 4px;
}

.sanmar-stat strong {
    color: #333;
}

.sanmar-stat-arrow {
    color: #28a745;
    font-size: 18px;
    font-weight: bold;
}

.sanmar-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.sanmar-preview {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
}

.sanmar-preview h4 {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 14px;
}

.sanmar-table-container {
    overflow-x: auto;
}

.sanmar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sanmar-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

.sanmar-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.sanmar-table tbody tr:hover {
    background: #f5f5f5;
}

.sanmar-table tbody tr:last-child td {
    border-bottom: none;
}

.sanmar-table .limit-blocked {
    color: #dc3545;
    font-weight: 600;
}

.sanmar-table .limit-allowed {
    color: #28a745;
}

/* Logic Explanation Section */
.sanmar-logic {
    margin-top: 30px;
}

.sanmar-logic h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.sanmar-logic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.sanmar-logic-item h4 {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 14px;
}

.sanmar-logic-item ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
    font-size: 13px;
}

.sanmar-logic-item li {
    margin-bottom: 6px;
}

.sanmar-logic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.sanmar-logic-table th,
.sanmar-logic-table td {
    padding: 8px 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.sanmar-logic-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #555;
}

.sanmar-logic-table td:first-child {
    text-align: left;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sanmar-logic-grid {
        grid-template-columns: 1fr;
    }

    .sanmar-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .sanmar-actions {
        flex-direction: column;
    }

    .sanmar-actions .btn {
        width: 100%;
    }
}

/* ============================================
   Upload Thumbnail Page Styles
   ============================================ */

.upload-instructions {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.upload-instructions p {
    margin: 0 0 8px 0;
    color: #555;
}

.upload-instructions p:last-child {
    margin-bottom: 0;
}

.upload-hint {
    font-size: 13px;
    color: #777;
}

.upload-hint code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    color: #c7254e;
}

.upload-section {
    margin-bottom: 30px;
}

/* Dropzone Styles */
.upload-dropzone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.upload-dropzone:hover {
    border-color: #4CAF50;
    background: #f0fff0;
}

.upload-dropzone.dragover {
    border-color: #4CAF50;
    background: #e8f5e9;
    border-style: solid;
    transform: scale(1.02);
}

.dropzone-icon {
    color: #999;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.upload-dropzone:hover .dropzone-icon,
.upload-dropzone.dragover .dropzone-icon {
    color: #4CAF50;
}

.dropzone-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropzone-main {
    font-size: 20px;
    font-weight: 500;
    color: #555;
}

.dropzone-sub {
    font-size: 14px;
    color: #888;
}

/* Progress Bar */
.upload-progress {
    padding: 40px;
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    border-radius: 6px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
}

/* Result Message */
.upload-result {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 15px;
}

.upload-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.upload-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.result-icon {
    font-weight: bold;
    margin-right: 8px;
}

/* Preview Section */
.preview-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.preview-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.preview-content {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.preview-image {
    max-width: 250px;
    max-height: 250px;
    border: 1px solid #ddd;
    border-radius: 6px;
    object-fit: contain;
    background: #f5f5f5;
}

.preview-details {
    flex: 1;
}

.preview-row {
    display: flex;
    margin-bottom: 12px;
    align-items: baseline;
}

.preview-label {
    width: 120px;
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.preview-value {
    color: #333;
    font-size: 14px;
}

.preview-value.external-key {
    font-family: monospace;
    font-size: 12px;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

/* Recent Uploads */
.recent-uploads {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.recent-uploads h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.recent-uploads-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.recent-upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.recent-upload-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.recent-upload-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.recent-upload-id {
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.recent-upload-name {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 768px) {
    .preview-content {
        flex-direction: column;
    }

    .preview-image {
        max-width: 100%;
    }

    .upload-dropzone {
        padding: 40px 20px;
        min-height: 200px;
    }

    .dropzone-main {
        font-size: 16px;
    }
}

/* ============================================
   Design Manager Modal Styles
   ============================================ */

.design-manager-body {
    display: flex;
    gap: 20px;
    min-height: 450px;
}

.design-list-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.design-details-panel {
    flex: 1.2;
    display: flex;
    flex-direction: column;
}

.design-list-panel h3,
.design-details-panel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
}

/* Store Filter */
.design-store-filter {
    margin-bottom: 10px;
}

.design-store-filter select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.design-store-filter select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Design List */
.design-list {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-y: auto;
    max-height: 350px;
    margin-bottom: 10px;
}

.design-store-header {
    background: #f0f0f0;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
}

.design-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

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

.design-item:hover {
    background: #f5f5f5;
}

.design-item.selected {
    background: #e3f2fd;
}

.design-item-info {
    flex: 1;
    min-width: 0;
}

.design-item-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.design-item-id {
    font-size: 12px;
    color: #888;
    font-family: 'Consolas', 'Monaco', monospace;
}

.design-item-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Design Badges */
.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-default {
    background: #d4edda;
    color: #155724;
}

.badge-multi {
    background: #cce5ff;
    color: #004085;
}

.badge-auto {
    background: #fff3cd;
    color: #856404;
}

/* Design Form */
.design-form {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #fafafa;
    overflow-y: auto;
    max-height: 350px;
}

.design-form .hint {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 30px 15px;
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row select {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-row input[readonly] {
    background: #e9ecef;
    color: #666;
}

.form-row-inline {
    display: flex;
    gap: 12px;
}

.form-row-inline .form-row {
    flex: 1;
    margin-bottom: 0;
}

.checkbox-row {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Design Form Actions */
.design-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
}

.design-form-actions .btn {
    flex: 1;
}

/* Design List Actions */
.design-list-actions {
    display: flex;
    gap: 8px;
}

.design-list-actions .btn {
    flex: 1;
}

/* Empty State */
.design-empty-state {
    padding: 30px 15px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* Responsive */
@media (max-width: 900px) {
    .design-manager-body {
        flex-direction: column;
    }

    .design-list-panel,
    .design-details-panel {
        min-width: auto;
    }

    .design-list,
    .design-form {
        max-height: 250px;
    }
}

/* ============ SanMar Invoice Converter Styles ============ */

.invoice-ftp-section {
    margin-top: 10px;
}

.invoice-ftp-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.invoice-ftp-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 180px;
}

.invoice-ftp-pass {
    width: 200px;
}

.invoice-ftp-status {
    font-size: 13px;
    color: #666;
    margin-left: 8px;
}

.invoice-ftp-success {
    color: #2e7d32;
    font-weight: 600;
}

.invoice-ftp-error {
    color: #c62828;
    font-weight: 600;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.invoice-amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Quick actions & date range */
.invoice-quick-actions {
    margin-bottom: 15px;
}

.invoice-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.invoice-date-label {
    font-size: 14px;
    color: #555;
}

.invoice-date-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.invoice-date-sep {
    font-size: 14px;
    color: #888;
}

.invoice-stat-total {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #ddd;
}

/* Credit row in flat table */
.invoice-row-credit td {
    color: #c62828;
}

/* Invoice Cards */
.invoice-cards-section {
    margin-top: 20px;
}

.invoice-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.invoice-cards-header h4 {
    margin: 0;
}

.invoice-expand-toggle {
    font-size: 13px;
    color: #1976d2;
    text-decoration: none;
}

.invoice-expand-toggle:hover {
    text-decoration: underline;
}

.invoice-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fff;
    transition: box-shadow 0.15s;
}

.invoice-card:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.invoice-card-expanded {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.invoice-card-credit {
    border-left: 3px solid #c62828;
}

.invoice-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.invoice-card-header:hover {
    background: #f5f5f5;
}

.invoice-expand-arrow {
    font-size: 11px;
    color: #888;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.invoice-card-expanded .invoice-expand-arrow {
    transform: rotate(90deg);
}

.invoice-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

.invoice-card-inv-num {
    font-weight: 600;
    font-size: 14px;
}

.invoice-card-credit-badge {
    background: #ffcdd2;
    color: #b71c1c;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.invoice-card-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
    flex: 1;
}

.invoice-card-amount {
    font-weight: 700;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    text-align: right;
    min-width: 100px;
}

.invoice-card-credit .invoice-card-amount {
    color: #c62828;
}

.invoice-card-body {
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    background: #fafafa;
}

.invoice-card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.invoice-card-table th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    text-transform: uppercase;
}

.invoice-card-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
}

.invoice-card-total-row {
    font-weight: 700;
    background: #f0f0f0;
}

.invoice-card-total-row td {
    padding: 8px 10px;
    border-top: 2px solid #ccc;
    border-bottom: none;
}

@media (max-width: 768px) {
    .invoice-ftp-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-ftp-input {
        width: 100%;
    }

    .invoice-date-range {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-card-header {
        flex-wrap: wrap;
    }

    .invoice-card-meta {
        flex-direction: column;
        gap: 4px;
    }

    .invoice-card-table {
        font-size: 12px;
    }
}
