/**
 * Tailor Portal Styles
 * Full-width layout with dashboard-style cards
 * All measurement fields shown (including empty)
 * Includes: Collapsible sections, Settings modal, Autocomplete
 */

/* ========================================
   BASE STYLES & RESET
   ======================================== */
.tailor-portal,
.tailor-portal-login {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    background: #f5f5f5;
    min-height: 80vh;
}

.tailor-portal *,
.tailor-portal-login * {
    box-sizing: border-box;
}

/* Compact Mode */
.tailor-portal.compact-mode {
    padding: 12px;
}

.tailor-portal.compact-mode .tailor-item-detail {
    gap: 16px;
}

.tailor-portal.compact-mode .tailor-section-content {
    padding: 12px;
}

/* ========================================
   LOGIN FORM
   ======================================== */
.tailor-portal-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.tailor-login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.tailor-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.tailor-login-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: #1a1a1a;
}

.tailor-login-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.tailor-login-error {
    background: #fee;
    color: #c00;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.tailor-form-group {
    margin-bottom: 20px;
}

.tailor-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.tailor-form-group input[type="text"],
.tailor-form-group input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.tailor-form-group input:focus {
    outline: none;
    border-color: #1a1a1a;
}

.tailor-remember {
    display: flex;
    align-items: center;
}

.tailor-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.tailor-login-btn {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tailor-login-btn:hover {
    background: #333;
}

/* ========================================
   HEADER
   ======================================== */
.tailor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #1a1a1a !important;
    color: white !important;
    border-radius: 12px;
    margin-bottom: 24px;
}

.tailor-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: white !important;
}

.tailor-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Settings Button */
.tailor-settings-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
}

.tailor-settings-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    color: white;
}

.tailor-settings-btn svg {
    width: 20px;
    height: 20px;
}

.tailor-lang-toggle {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    overflow: hidden;
}

.tailor-lang-toggle a {
    padding: 8px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.tailor-lang-toggle a.active {
    background: white;
    color: #1a1a1a;
}

.tailor-lang-toggle a:hover:not(.active) {
    color: white;
}

.tailor-logout {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    transition: all 0.2s;
}

.tailor-logout:hover {
    color: white;
    border-color: white;
}

/* ========================================
   SEARCH FORM
   ======================================== */
.tailor-search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 50vh;
    padding-top: 60px;
    gap: 30px;
}

.tailor-search-box {
    background: white;
    padding: 48px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.tailor-search-box h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.tailor-search-box p {
    margin: 0 0 24px 0;
    color: #666;
}

.tailor-search-input-group {
    display: flex;
    gap: 12px;
}

.tailor-search-input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 18px;
    transition: border-color 0.2s;
}

.tailor-search-input-group input:focus {
    outline: none;
    border-color: #1a1a1a;
}

.tailor-search-input-group button {
    padding: 14px 32px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tailor-search-input-group button:hover {
    background: #333;
}

/* ========================================
   ORDER SUGGESTIONS / AUTOCOMPLETE
   ======================================== */
.tailor-search-form {
    position: relative;
}

.tailor-order-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: -4px;
}

.tailor-order-suggestions.visible {
    display: block;
}

.tailor-suggestions-header {
    padding: 10px 16px;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.suggestions-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tailor-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    text-align: left;
}

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

.suggestion-item:hover,
.suggestion-item.active {
    background: #f5f5f5;
}

.suggestion-item.active {
    background: #eef5ff;
}

.suggestion-order-id {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 15px;
    min-width: 80px;
}

.suggestion-customer {
    flex: 1;
    color: #444;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-date {
    color: #888;
    font-size: 13px;
    min-width: 80px;
}

.suggestion-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    min-width: 80px;
    text-align: center;
}

.suggestion-status-processing {
    background: #fff3cd;
    color: #856404;
}

.suggestion-status-completed {
    background: #d4edda;
    color: #155724;
}

.suggestion-status-on-hold {
    background: #cce5ff;
    color: #004085;
}

.tailor-suggestions-loading,
.tailor-suggestions-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.tailor-suggestions-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   RECENT ORDERS - PERMANENT LIST
   ======================================== */
.tailor-recent-orders {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    width: 100% !important;
    max-width: 600px !important;
    overflow: hidden !important;
}

.tailor-recent-orders-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 24px !important;
    background: linear-gradient(135deg, #1a1a1a, #333) !important;
    color: white !important;
}

.tailor-recent-orders-header .recent-orders-icon {
    font-size: 20px !important;
}

.tailor-recent-orders-header h3 {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
    background: transparent !important;
}

.tailor-recent-orders-list {
    padding: 0 !important;
}

.tailor-recent-order-item {
    display: flex !important;
    align-items: center !important;
    padding: 16px 24px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
    transition: background-color 0.15s, transform 0.1s !important;
    gap: 16px !important;
    text-decoration: none !important;
    color: inherit !important;
}

.tailor-recent-order-item:last-child {
    border-bottom: none !important;
}

.tailor-recent-order-item:hover {
    background: #f8f9fa !important;
    transform: translateX(4px) !important;
}

.tailor-recent-order-item .order-id {
    font-weight: 700 !important;
    color: #1a1a1a !important;
    font-size: 16px !important;
    min-width: 90px !important;
}

.tailor-recent-order-item .order-id::before {
    content: '#' !important;
    color: #888 !important;
}

.tailor-recent-order-item .order-customer {
    flex: 1 !important;
    color: #444 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.tailor-recent-order-item .order-date {
    color: #888 !important;
    font-size: 13px !important;
    min-width: 85px !important;
}

.tailor-recent-order-item .order-status {
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    text-transform: uppercase !important;
    min-width: 90px !important;
    text-align: center !important;
}

.tailor-recent-order-item .order-status-processing {
    background: #fff3cd !important;
    color: #856404 !important;
}

.tailor-recent-order-item .order-status-completed {
    background: #d4edda !important;
    color: #155724 !important;
}

.tailor-recent-order-item .order-status-on-hold {
    background: #cce5ff !important;
    color: #004085 !important;
}

.tailor-recent-orders-loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 30px !important;
    color: #888 !important;
    font-size: 14px !important;
}

.tailor-recent-orders-loading.hidden {
    display: none !important;
}

/* ========================================
   ORDER CONTAINER
   ======================================== */
.tailor-order-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tailor-customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #1a1a1a, #333) !important;
    color: white !important;
}

.tailor-order-info h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: white !important;
}

.tailor-customer-details {
    display: flex;
    gap: 24px;
    font-size: 14px;
    opacity: 0.9;
}

.tailor-customer-details span {
    display: flex;
    gap: 6px;
}

.tailor-btn {
    padding: 10px 20px;
    background: white;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.tailor-btn:hover {
    background: #f0f0f0;
}

.tailor-btn-primary {
    background: #1a1a1a;
    color: white;
}

.tailor-btn-primary:hover {
    background: #333;
}

.tailor-btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
}

.tailor-btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
    color: white;
}

.tailor-btn-small {
    padding: 6px 14px;
    font-size: 12px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
}

.tailor-btn-small:hover {
    background: #e0e0e0;
    color: #333;
}

/* ========================================
   ITEM TABS
   ======================================== */
.tailor-item-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}

.tailor-tab {
    padding: 16px 24px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    background: white;
}

.tailor-tab:hover {
    color: #1a1a1a;
    background: #fafafa;
}

.tailor-tab.active {
    color: #1a1a1a;
    background: white;
    border-bottom-color: #1a1a1a;
}

.tailor-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.tailor-status-pending {
    background: #fff3cd;
    color: #856404;
}

.tailor-status-in_progress {
    background: #cce5ff;
    color: #004085;
}

.tailor-status-completed {
    background: #d4edda;
    color: #155724;
}

/* ========================================
   ITEM CONTENT
   ======================================== */
.tailor-item-content {
    padding: 24px;
}

.tailor-item-detail {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ========================================
   STATUS CONTROLS
   ======================================== */
.tailor-status-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.tailor-status-controls label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.tailor-status-buttons {
    display: flex;
    gap: 8px;
}

.tailor-status-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tailor-status-btn:hover {
    border-color: #999;
}

.tailor-status-btn.active {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: white;
}

.tailor-status-btn[data-status="pending"].active {
    background: #ffc107;
    border-color: #ffc107;
    color: #1a1a1a;
}

.tailor-status-btn[data-status="in_progress"].active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.tailor-status-btn[data-status="completed"].active {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

/* ========================================
   COLLAPSIBLE SECTIONS
   ======================================== */
.tailor-collapsible {
    transition: all 0.3s ease;
}

.tailor-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.tailor-section-header h3 {
    margin: 0;
    padding: 16px 20px;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.tailor-toggle-btn {
    background: none;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-icon {
    width: 12px;
    height: 12px;
    position: relative;
    transition: transform 0.3s ease;
}

.toggle-icon::before,
.toggle-icon::after {
    content: '';
    position: absolute;
    background: #666;
    transition: all 0.3s ease;
}

.toggle-icon::before {
    width: 12px;
    height: 2px;
    top: 5px;
    left: 0;
}

.toggle-icon::after {
    width: 2px;
    height: 12px;
    top: 0;
    left: 5px;
}

/* Collapsed state */
.tailor-collapsible.collapsed .toggle-icon::after {
    transform: rotate(90deg);
    opacity: 1;
}

.tailor-collapsible:not(.collapsed) .toggle-icon::after {
    transform: rotate(0deg);
    opacity: 0;
}

.tailor-section-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.tailor-collapsible.collapsed .tailor-section-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Section header backgrounds for collapsible */
/* Override Avada's h3 background on all section headers with dark backgrounds */
.tailor-portal .tailor-section-header h3,
.tailor-portal .tailor-section-header h3.fusion-responsive-typography-calculated {
    background: transparent !important;
    background-color: transparent !important;
}

.tailor-3dscan-section .tailor-section-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
}

.tailor-3dscan-section .tailor-section-header h3,
.tailor-3dscan-section .tailor-section-header h3.fusion-responsive-typography-calculated {
    color: white !important;
    background: none !important;
    background-color: transparent !important;
}

.tailor-3dscan-section .tailor-toggle-btn .toggle-icon::before,
.tailor-3dscan-section .tailor-toggle-btn .toggle-icon::after {
    background: white;
}

.tailor-fabric-section .tailor-section-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tailor-embroidery-section .tailor-section-header {
    background: #8B4513 !important;
}

.tailor-embroidery-section .tailor-section-header h3,
.tailor-embroidery-section .tailor-section-header h3.fusion-responsive-typography-calculated {
    color: white !important;
    background: none !important;
    background-color: transparent !important;
}

.tailor-embroidery-section .tailor-toggle-btn .toggle-icon::before,
.tailor-embroidery-section .tailor-toggle-btn .toggle-icon::after {
    background: white;
}

.tailor-design-section .tailor-section-header {
    background: #1a1a1a !important;
    border-radius: 10px 10px 0 0;
}

.tailor-design-section .tailor-section-header h3,
.tailor-design-section .tailor-section-header h3.fusion-responsive-typography-calculated {
    color: white !important;
    background: none !important;
    background-color: transparent !important;
}

.tailor-design-section .tailor-toggle-btn .toggle-icon::before,
.tailor-design-section .tailor-toggle-btn .toggle-icon::after {
    background: white;
}

.tailor-measurements-section .tailor-section-header {
    background: #1a1a1a !important;
    border-radius: 10px 10px 0 0;
}

.tailor-measurements-section .tailor-section-header h3,
.tailor-measurements-section .tailor-section-header h3.fusion-responsive-typography-calculated {
    color: white !important;
    background: none !important;
    background-color: transparent !important;
}

.tailor-measurements-section .tailor-toggle-btn .toggle-icon::before,
.tailor-measurements-section .tailor-toggle-btn .toggle-icon::after {
    background: white;
}

/* ========================================
   SETTINGS MODAL
   ======================================== */
.tailor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tailor-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.tailor-modal-container {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 20px;
}

.tailor-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.tailor-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.tailor-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.tailor-modal-close:hover {
    color: #1a1a1a;
}

.tailor-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.tailor-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* Settings Groups */
.tailor-setting-group {
    margin-bottom: 24px;
}

.tailor-setting-group:last-child {
    margin-bottom: 0;
}

.tailor-setting-group > label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.tailor-setting-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.tailor-setting-group select:focus {
    outline: none;
    border-color: #1a1a1a;
}

.tailor-setting-hint {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #888;
}

.tailor-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.tailor-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a1a1a;
}

.tailor-checkbox-label span {
    font-size: 14px;
    color: #333;
}

.tailor-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* ========================================
   3D SCAN SECTION
   ======================================== */
.tailor-3dscan-section {
    border: 2px solid #6366f1;
    background: linear-gradient(135deg, #f0f0ff, #e8e8ff);
}

.tailor-3dscan-section .tailor-section-content {
    padding: 0;
}

.tailor-3dscan-container {
    padding: 24px;
}

/* Customer Email Display */
.tailor-3dscan-email {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: white;
    border-radius: 8px;
    border: 1px solid #c7d2fe;
    margin-bottom: 20px;
}

.tailor-3dscan-email .email-label {
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tailor-3dscan-email .email-value {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    background: #f0f0ff;
    padding: 4px 12px;
    border-radius: 4px;
}

.tailor-3dscan-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.tailor-load-scan-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.tailor-load-scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.tailor-3dscan-hint {
    margin: 16px 0 0 0;
    color: #666;
    font-size: 14px;
}

.tailor-3dscan-loading {
    text-align: center;
    padding: 40px 20px;
}

.tailor-3dscan-loading .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tailor-3dscan-loading p {
    margin: 16px 0 0 0;
    color: #666;
}

.tailor-3dscan-results {
    /* Container for scan images when loaded */
}

.tailor-3dscan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tailor-3dscan-item {
    text-align: center;
}

.tailor-3dscan-image {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.tailor-3dscan-image:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
    transform: translateY(-4px);
}

.tailor-3dscan-image img {
    width: 100%;
    height: auto;
    display: block;
}

.tailor-3dscan-label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.tailor-3dscan-info {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.tailor-3dscan-info .scan-date {
    color: #666;
    font-size: 13px;
}

.tailor-refresh-scan-btn {
    padding: 6px 14px;
    font-size: 12px;
    background: #f0f0ff;
    color: #6366f1;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tailor-refresh-scan-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.tailor-3dscan-error {
    text-align: center;
    padding: 30px 20px;
    background: #fff5f5;
    border-radius: 8px;
    border: 1px solid #feb2b2;
}

.tailor-3dscan-error .error-message {
    color: #c53030;
    margin: 0 0 16px 0;
    font-weight: 500;
}

.tailor-retry-scan-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tailor-retry-scan-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

/* ========================================
   SECTIONS
   ======================================== */
.tailor-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.tailor-section h3 {
    margin: 0;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ========================================
   FABRIC SECTION
   ======================================== */
.tailor-fabric-section {
    background: linear-gradient(135deg, #fafafa, #f0f0f0);
}

.tailor-fabric-section .tailor-section-content {
    padding: 0;
}

.tailor-fabric-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.tailor-fabric-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.tailor-fabric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tailor-fabric-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.tailor-fabric-sku {
    font-size: 13px;
    color: #666;
    font-family: monospace;
}

.tailor-fabric-material {
    font-size: 14px;
    color: #444;
}

/* ========================================
   EMBROIDERY SECTION
   ======================================== */
.tailor-embroidery-section {
    border: 2px solid #8B4513;
    background: linear-gradient(135deg, #FFF8DC, #FAEBD7);
}

.tailor-embroidery-section .tailor-section-content {
    padding: 0;
}

.tailor-embroidery-content {
    padding: 20px;
}

.tailor-embroidery-chinese {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'SimHei', sans-serif;
    font-size: 15px;
    line-height: 2;
    color: #333;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #DEB887;
    white-space: pre-wrap;
    margin: 0;
}

.tailor-embroidery-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tailor-embroidery-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: white;
    border-radius: 6px;
    border: 1px solid #DEB887;
}

.tailor-embroidery-row .embroidery-label {
    font-weight: 600;
    color: #8B4513;
    min-width: 100px;
    font-size: 13px;
}

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

.tailor-embroidery-text {
    flex-direction: column;
    gap: 8px;
}

.embroidery-text-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.embroidery-line {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #FFF8DC;
    border-radius: 4px;
    border-left: 3px solid #8B4513;
}

.embroidery-line .line-number {
    font-size: 12px;
    color: #8B4513;
    font-weight: 600;
    min-width: 60px;
}

.embroidery-line .line-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* ========================================
   DESIGN SECTION
   ======================================== */
.tailor-design-section {
    border: none;
    background: transparent;
}

.tailor-design-section .tailor-section-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 0;
}

.tailor-design-category {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin: 16px;
    overflow: hidden;
}

.tailor-design-category:first-of-type {
    margin-top: 16px;
}

.tailor-design-category-title {
    margin: 0;
    padding: 14px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    font-size: 18px;
}

.tailor-design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
}

.tailor-design-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.tailor-design-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #ccc;
}

.tailor-design-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f0f0f0;
}

.tailor-design-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tailor-design-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tailor-design-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tailor-design-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ========================================
   MEASUREMENTS SECTION
   ======================================== */
.tailor-measurements-section {
    border: none;
    background: transparent;
}

.tailor-measurements-section .tailor-section-content {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 20px;
}

.tailor-measurements-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 0;
}

.tailor-measurement-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tailor-measurement-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border-bottom: 1px solid #e8e8e8;
}

.tailor-measurement-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.section-icon {
    font-size: 20px;
}

.tailor-measurement-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.tailor-measurement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.tailor-measurement-item:hover {
    background: #fafafa;
}

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

.tailor-measurement-item.empty-value {
    background: #fafafa;
}

.tailor-measurement-item.empty-value:hover {
    background: #f5f5f5;
}

.measurement-label {
    font-size: 13px;
    color: #555;
}

.measurement-value {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    font-family: 'SF Mono', Monaco, monospace;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.measurement-value.no-value {
    color: #bbb;
    font-weight: 400;
    background: #f8f8f8;
    border: 1px dashed #ddd;
}

.measurement-unit {
    font-size: 12px;
    font-weight: 400;
    color: #888;
}

/* ========================================
   GENERELT ROW LAYOUT (matching other cards)
   ======================================== */
.tailor-measurement-row-card {
    grid-column: 1 / -1; /* Full width */
}

.tailor-measurement-row-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0;
}

.tailor-measurement-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-right: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.tailor-measurement-row-item:last-child {
    border-right: none;
}

.tailor-measurement-row-item:hover {
    background: #fafafa;
}

.tailor-measurement-row-item.empty-value {
    background: #fafafa;
}

.tailor-measurement-row-item.empty-value:hover {
    background: #f5f5f5;
}

/* ========================================
   NOTES CARDS
   ======================================== */
.tailor-notes-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    grid-column: 1 / -1;
}

.tailor-notes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
}

.tailor-notes-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.tailor-notes-content {
    margin: 0;
    padding: 18px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.tailor-notes-important {
    border-color: #ffc107;
    background: #fffbf0;
}

.tailor-notes-important .tailor-notes-header {
    background: #fff3cd;
    border-color: #ffc107;
}

/* ========================================
   ERROR & NO ITEMS
   ======================================== */
.tailor-error,
.tailor-no-items {
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.tailor-error h2 {
    margin: 0 0 12px 0;
    color: #c00;
}

.tailor-error p {
    margin: 0 0 24px 0;
    color: #666;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .tailor-portal,
    .tailor-portal-login {
        padding: 12px;
    }

    .tailor-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px;
    }

    .tailor-header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .tailor-customer-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }

    .tailor-customer-details {
        flex-direction: column;
        gap: 8px;
    }

    .tailor-item-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tailor-tab {
        padding: 14px 18px;
        font-size: 14px;
    }

    .tailor-item-content {
        padding: 16px;
    }

    .tailor-status-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tailor-status-buttons {
        width: 100%;
        flex-wrap: wrap;
    }

    .tailor-status-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }

    .tailor-3dscan-email {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .tailor-3dscan-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tailor-3dscan-info {
        flex-direction: column;
        gap: 10px;
    }

    .tailor-design-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .tailor-measurements-dashboard {
        grid-template-columns: 1fr;
    }

    .tailor-fabric-card {
        flex-direction: column;
        text-align: center;
    }

    .tailor-search-input-group {
        flex-direction: column;
    }

    .tailor-login-box {
        padding: 30px 20px;
    }

    .tailor-embroidery-row {
        flex-direction: column;
        gap: 6px;
    }

    .tailor-embroidery-row .embroidery-label {
        min-width: auto;
    }

    /* Responsive Generelt row - 2x2 grid on tablet/mobile */
    .tailor-measurement-row-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tailor-measurement-row-item {
        border-bottom: 1px solid #f0f0f0;
        border-right: 1px solid #f0f0f0;
    }

    .tailor-measurement-row-item:nth-child(2),
    .tailor-measurement-row-item:nth-child(4) {
        border-right: none;
    }

    .tailor-measurement-row-item:nth-child(3),
    .tailor-measurement-row-item:nth-child(4) {
        border-bottom: none;
    }

    /* Modal responsive */
    .tailor-modal-container {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
}

@media (max-width: 480px) {
    .tailor-design-grid {
        grid-template-columns: 1fr;
    }

    .tailor-design-image {
        height: 100px;
    }

    /* Responsive Generelt row - stack on small mobile */
    .tailor-measurement-row-grid {
        grid-template-columns: 1fr;
    }

    .tailor-measurement-row-item {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .tailor-measurement-row-item:last-child {
        border-bottom: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .tailor-portal {
        background: white;
        padding: 0;
    }

    .tailor-header,
    .tailor-status-controls,
    .tailor-item-tabs,
    .tailor-btn,
    .tailor-3dscan-section,
    .tailor-toggle-btn,
    .tailor-settings-btn,
    .tailor-modal {
        display: none !important;
    }

    .tailor-order-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .tailor-customer-header {
        background: #f5f5f5 !important;
        color: #1a1a1a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tailor-item-content {
        display: block !important;
    }

    .tailor-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Expand all sections when printing */
    .tailor-collapsible.collapsed .tailor-section-content {
        max-height: none;
        opacity: 1;
        padding: inherit;
    }

    .tailor-measurement-item.empty-value {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .measurement-value.no-value {
        border: 1px dashed #ccc !important;
    }

    .tailor-embroidery-section {
        border-color: #8B4513 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tailor-embroidery-chinese {
        border: 1px solid #8B4513 !important;
    }

    .tailor-measurement-row-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}