/* Official QuickBooks Brand Colors (from design.intuit.com/quickbooks) */
:root {
    /* Primary QuickBooks Colors */
    --qb-primary-blue: #0077C5;        /* Primary brand blue */
    --qb-secondary-blue: #2E8DCC;      /* Secondary blue variant */
    --qb-dark-blue: #005A99;           /* Dark blue for hover states */
    --qb-light-blue: #E8F4FD;          /* Light blue backgrounds */
    
    /* QuickBooks Logo Green (reserved for logo only) */
    --qb-logo-green: #2CA01C;          /* Only for logo - not for UI */
    
    /* Neutral Colors */
    --qb-text-primary: #393A3D;        /* Primary text - Charcoal */
    --qb-text-secondary: #6B7280;      /* Secondary text - Gray */
    --qb-text-light: #9CA3AF;          /* Light text - Light gray */
    
    /* Background Colors */
    --qb-background: #FAFAFA;          /* Page background - Tofu */
    --qb-white: #FFFFFF;               /* Pure white */
    --qb-gray-50: #F9FAFB;             /* Light gray backgrounds */
    --qb-gray-100: #F3F4F6;            /* Card backgrounds - Ice */
    
    /* Border Colors */
    --qb-border-light: #E5E7EB;        /* Light borders */
    --qb-border-medium: #D1D5DB;       /* Medium borders */
    
    /* Brand Accent Colors (from official palette) */
    --qb-teal: #16A085;               /* Teal accent */
    --qb-purple: #7C3AED;             /* Purple accent */
    --qb-orange: #EA580C;             /* Orange accent */
    --qb-yellow: #F59E0B;             /* Yellow accent */
    
    /* Status Colors */
    --qb-success: #059669;            /* Success green */
    --qb-error: #DC2626;              /* Error red */
    --qb-warning: #D97706;            /* Warning orange */
    --qb-info: var(--qb-primary-blue); /* Info blue */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--qb-text-primary);
    background-color: var(--qb-background);
    font-size: 14px;
    font-weight: 400;
}

/* QuickBooks Header */
.qb-header {
    background: var(--qb-white);
    border-bottom: 1px solid var(--qb-border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qb-header-content {
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.qb-header-title h2 {
    color: var(--qb-text-primary);
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

/* Official QuickBooks Logo */
.qb-logo {
    display: flex;
    align-items: center;
}

.qb-logo-icon {
    flex-shrink: 0;
}

/* Navigation */
.qb-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.qb-nav-item {
    padding: 20px 16px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.qb-nav-item:hover {
    color: var(--qb-primary-blue);
    background-color: var(--qb-gray-50);
}

.qb-nav-item.qb-nav-active {
    color: var(--qb-primary-blue);
    border-bottom-color: var(--qb-primary-blue);
    background-color: var(--qb-light-blue);
}

.qb-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.qb-create-btn {
    background: var(--qb-primary-blue);
    color: white;
    border: 1px solid var(--qb-primary-blue);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.qb-create-btn:hover {
    background: var(--qb-dark-blue);
    border-color: var(--qb-dark-blue);
}

.qb-user-menu {
    width: 32px;
    height: 32px;
    background: var(--qb-primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: white;
    font-weight: 600;
    border: none;
    transition: background-color 0.2s ease;
}

.qb-user-menu:hover {
    background: var(--qb-dark-blue);
}

.qb-breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.qb-breadcrumb-link {
    color: var(--qb-primary-blue);
    text-decoration: none;
}

.qb-breadcrumb-link:hover {
    text-decoration: underline;
}

.qb-breadcrumb .separator {
    margin: 0 8px;
    color: var(--qb-text-light);
}

.qb-breadcrumb .current {
    color: var(--qb-text-primary);
    font-weight: 500;
}

/* Main Container */
.qb-main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Page Header */
.qb-page-header {
    margin-bottom: 32px;
}

.qb-page-title {
    font-size: 32px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.qb-page-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Official QuickBooks Cards */
.qb-card {
    background: var(--qb-white);
    border: 1px solid var(--qb-border-light);
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.qb-card-header {
    padding: 24px 24px 0 24px;
    border-bottom: none;
}

.qb-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.qb-card-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.qb-card-content {
    padding: 24px;
    padding-top: 16px;
}

/* Form Grid System */
.qb-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
}

.qb-form-group {
    display: flex;
    flex-direction: column;
}

.qb-form-group.qb-full-width {
    grid-column: 1 / -1;
}

.qb-form-group.qb-half-width {
    grid-column: span 1;
}

/* QuickBooks Form Elements */
.qb-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.qb-input,
.qb-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--qb-border-light);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: var(--qb-white);
    transition: all 0.2s ease;
}

.qb-input:focus,
.qb-textarea:focus {
    outline: none;
    border-color: var(--qb-primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 119, 197, 0.1);
    background-color: #fefefe;
}

.qb-input::placeholder,
.qb-textarea::placeholder {
    color: #9ca3af;
}

.qb-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Input Groups (for currency) */
.qb-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.qb-input-prefix {
    position: absolute;
    left: 16px;
    color: #6b7280;
    font-weight: 500;
    z-index: 1;
    pointer-events: none;
}

.qb-input-with-prefix {
    padding-left: 32px;
}

/* QuickBooks Buttons */
.qb-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid #e1e5e9;
    margin-top: 32px;
}

.qb-actions-left,
.qb-actions-right {
    display: flex;
    gap: 12px;
}

.qb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    min-height: 40px;
}

.qb-btn-primary {
    background: var(--qb-primary-blue);
    color: var(--qb-white);
    border-color: var(--qb-primary-blue);
}

.qb-btn-primary:hover {
    background: var(--qb-dark-blue);
    border-color: var(--qb-dark-blue);
}

.qb-btn-primary:disabled {
    background: var(--qb-text-light);
    border-color: var(--qb-text-light);
    cursor: not-allowed;
}

.qb-btn-secondary {
    background-color: var(--qb-white);
    color: var(--qb-text-primary);
    border-color: var(--qb-border-medium);
}

.qb-btn-secondary:hover {
    background-color: var(--qb-gray-50);
    border-color: var(--qb-border-medium);
}

/* QuickBooks Status Messages */
.qb-status-message {
    margin: 24px 0;
    padding: 16px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.qb-status-message.success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.qb-status-message.error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.qb-status-message.hidden {
    display: none;
}

/* Success/Error icons */
.qb-status-message.success:before {
    content: "✓";
    margin-right: 8px;
    font-weight: 700;
}

.qb-status-message.error:before {
    content: "✕";
    margin-right: 8px;
    font-weight: 700;
}

/* QuickBooks Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #0077c5;
    border-radius: 50%;
    animation: qb-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes qb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* QuickBooks Responsive Design */
@media (max-width: 1024px) {
    .qb-nav {
        display: none;
    }
    
    .qb-header-content {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .qb-header-content {
        padding: 0 16px;
        gap: 12px;
    }
    
    .qb-sub-header {
        padding: 12px 16px;
    }
    
    .qb-main-container {
        padding: 24px 16px;
    }
    
    .qb-page-title {
        font-size: 24px;
    }
    
    .qb-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .qb-card-header,
    .qb-card-content {
        padding: 16px;
    }
    
    .qb-form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }
    
    .qb-actions-left,
    .qb-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .qb-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* QuickBooks Form Validation */
.qb-input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.qb-input:valid:not(:focus):not(:placeholder-shown) {
    border-color: #059669;
}

.qb-textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.qb-textarea:valid:not(:focus):not(:placeholder-shown) {
    border-color: #059669;
}

/* Required field indicator */
.qb-label::after {
    content: "";
}

input[required] + .qb-label::after,
textarea[required] + .qb-label::after,
input[required] ~ .qb-label::after,
textarea[required] ~ .qb-label::after {
    content: " *";
    color: #dc2626;
    font-weight: 700;
}

/* QuickBooks-style focus states */
.qb-input:hover:not(:focus) {
    border-color: #9ca3af;
}

.qb-textarea:hover:not(:focus) {
    border-color: #9ca3af;
}

/* Print Styles */
@media print {
    body {
        background: white;
        font-size: 12px;
    }
    
    .qb-header {
        box-shadow: none;
        border-bottom: 2px solid #000;
    }
    
    .qb-card {
        border: 1px solid #000;
        box-shadow: none;
        margin-bottom: 20px;
        break-inside: avoid;
    }
    
    .qb-form-actions {
        display: none;
    }
    
    .qb-main-container {
        max-width: none;
        padding: 0;
    }
}

/* Additional QuickBooks-specific styles */
.qb-form {
    max-width: none;
}

/* Improved spacing for better QB look */
.qb-card:last-child {
    margin-bottom: 0;
}

/* Official QuickBooks Card Styling */
.qb-card-header {
    background: var(--qb-gray-50);
    border-bottom: 1px solid var(--qb-border-light);
    border-radius: 4px 4px 0 0;
}

/* QuickBooks section accent colors (from official brand palette) */
.qb-card:nth-child(1) .qb-card-header {
    border-left: 3px solid var(--qb-primary-blue);
}

.qb-card:nth-child(2) .qb-card-header {
    border-left: 3px solid var(--qb-teal);
}

.qb-card:nth-child(3) .qb-card-header {
    border-left: 3px solid var(--qb-purple);
}

.qb-card:nth-child(4) .qb-card-header {
    border-left: 3px solid var(--qb-orange);
}

/* QuickBooks Page Title */
.qb-page-title {
    color: var(--qb-text-primary);
}

/* Loading animation */
.loading {
    border-top-color: var(--qb-primary-blue);
}

/* Status messages */
.qb-status-message.success {
    background-color: #F0FDF4;
    color: var(--qb-success);
    border: 1px solid #BBF7D0;
    border-left: 3px solid var(--qb-success);
}

.qb-status-message.error {
    background-color: #FEF2F2;
    color: var(--qb-error);
    border: 1px solid #FECACA;
    border-left: 3px solid var(--qb-error);
}

/* Payment Method Sections */
.payment-method-section {
    background: #f8fcfe;
    border: 2px solid #e8f4f8;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.qb-payment-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e5e9;
}

.qb-payment-header h3 {
    color: var(--qb-primary-blue);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qb-payment-header p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* Credit Card Specific Styling */
#creditCardFields {
    border-color: #dbeafe;
    background: #f0f9ff;
}

#creditCardFields .qb-payment-header {
    border-bottom-color: #93c5fd;
}

/* ACH Specific Styling */
#achFields {
    border-color: #d1fae5;
    background: #f0fdf4;
}

#achFields .qb-payment-header {
    border-bottom-color: #86efac;
}

/* Payment method select styling */
#paymentMethod {
    font-weight: 500;
}

#paymentMethod option {
    padding: 8px;
}

/* Responsive adjustments for payment fields */
@media (max-width: 768px) {
    .payment-method-section {
        padding: 16px;
        margin-top: 16px;
    }
    
    .qb-payment-header h3 {
        font-size: 14px;
    }
}