/* Magic Merchant CSS - Spark Design System */
/* Version: 3.34.1 */

/* Root Variables - Based on Spark/Radix Design System */
:root {
    /* Gray Scale */
    --gray-1: hsl(0, 0%, 99%);
    --gray-2: hsl(0, 0%, 97.3%);
    --gray-3: hsl(0, 0%, 95.1%);
    --gray-4: hsl(0, 0%, 93%);
    --gray-5: hsl(0, 0%, 90.9%);
    --gray-6: hsl(0, 0%, 88.7%);
    --gray-7: hsl(0, 0%, 85.8%);
    --gray-8: hsl(0, 0%, 78%);
    --gray-9: hsl(0, 0%, 56.1%);
    --gray-10: hsl(0, 0%, 52.3%);
    --gray-11: hsl(0, 0%, 43.5%);
    --gray-12: hsl(0, 0%, 9%);
    
    /* Accent Colors */
    --blue-1: hsl(206, 100%, 99.2%);
    --blue-2: hsl(210, 100%, 98%);
    --blue-3: hsl(209, 100%, 96.5%);
    --blue-4: hsl(210, 98.8%, 94%);
    --blue-5: hsl(209, 95%, 90.1%);
    --blue-6: hsl(209, 81.2%, 84.5%);
    --blue-7: hsl(208, 77.5%, 76.9%);
    --blue-8: hsl(206, 81.9%, 65.3%);
    --blue-9: hsl(206, 100%, 50%);
    --blue-10: hsl(208, 100%, 47.3%);
    --blue-11: hsl(211, 100%, 43.2%);
    --blue-12: hsl(211, 100%, 15%);
    
    /* Success Colors */
    --green-1: hsl(116, 50%, 98.9%);
    --green-2: hsl(120, 60%, 97.1%);
    --green-3: hsl(120, 53.6%, 94.8%);
    --green-4: hsl(121, 47.5%, 91.4%);
    --green-5: hsl(122, 42.6%, 86.5%);
    --green-6: hsl(124, 39.4%, 79.7%);
    --green-7: hsl(126, 37.1%, 70.2%);
    --green-8: hsl(131, 38.1%, 56.3%);
    --green-9: hsl(131, 41%, 46.5%);
    --green-10: hsl(132, 43.1%, 42.2%);
    --green-11: hsl(133, 50%, 32.5%);
    --green-12: hsl(133, 50%, 14.9%);
    
    /* Error Colors */
    --red-1: hsl(359, 100%, 99.4%);
    --red-2: hsl(359, 100%, 98.6%);
    --red-3: hsl(360, 100%, 96.8%);
    --red-4: hsl(360, 100%, 94.8%);
    --red-5: hsl(360, 100%, 92.1%);
    --red-6: hsl(360, 100%, 87.9%);
    --red-7: hsl(360, 100%, 81.4%);
    --red-8: hsl(360, 100%, 71.8%);
    --red-9: hsl(358, 75%, 59%);
    --red-10: hsl(358, 69.4%, 55.2%);
    --red-11: hsl(358, 65%, 48.7%);
    --red-12: hsl(354, 50%, 14.6%);
    
    /* Semantic Colors */
    --background: var(--gray-1);
    --foreground: var(--gray-12);
    --card: var(--gray-1);
    --card-foreground: var(--gray-12);
    --popover: var(--gray-1);
    --popover-foreground: var(--gray-12);
    --primary: var(--gray-12);
    --primary-foreground: var(--gray-1);
    --secondary: var(--gray-4);
    --secondary-foreground: var(--gray-11);
    --muted: var(--gray-4);
    --muted-foreground: var(--gray-11);
    --accent: var(--gray-4);
    --accent-foreground: var(--gray-11);
    --destructive: var(--red-9);
    --destructive-foreground: var(--gray-1);
    --border: var(--gray-6);
    --input: var(--gray-6);
    --ring: var(--gray-7);
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.75rem;
    --space-8: 2rem;
    --space-9: 2.25rem;
    --space-10: 2.5rem;
    --space-11: 2.75rem;
    --space-12: 3rem;
    
    /* Typography */
    --font-size-1: 0.75rem;
    --font-size-2: 0.875rem;
    --font-size-3: 1rem;
    --font-size-4: 1.125rem;
    --font-size-5: 1.25rem;
    --font-size-6: 1.5rem;
    --font-size-7: 1.875rem;
    --font-size-8: 2.25rem;
    --font-size-9: 3rem;
    
    /* Line Heights */
    --line-height-1: 1;
    --line-height-2: 1.125;
    --line-height-3: 1.25;
    --line-height-4: 1.375;
    --line-height-5: 1.5;
    --line-height-6: 1.625;
    --line-height-7: 1.75;
    
    /* Border Radius */
    --radius-1: 0.125rem;
    --radius-2: 0.25rem;
    --radius-3: 0.375rem;
    --radius-4: 0.5rem;
    --radius-5: 0.75rem;
    --radius-6: 1rem;
    
    /* Shadows */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-3: 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-4: 0 8px 16px rgba(0, 0, 0, 0.04);
    --shadow-5: 0 16px 32px rgba(0, 0, 0, 0.04);
}

/* Hide WordPress page title on unified teller pages - nuclear approach */
.entry-header,
.page-header,
.site-header .entry-title,
.content-area .entry-title,
.main .entry-title,
#main .entry-title,
.content .entry-title,
#content .entry-title {
    display: none !important;
}

/* Target all possible title elements */
body.page h1.entry-title,
body.page h1.page-title,
.entry-header h1,
.page-header h1,
.wp-block-post-title,
h1.wp-block-post-title,
.entry-title,
.page-title,
article h1:first-child,
.hentry h1:first-child,
.single-post .entry-title,
.page .entry-title,
header h1,
.site-main h1:first-of-type,
.content-area h1:first-of-type {
    display: none !important;
}

/* Nuclear option - hide any h1 that might be the page title */
body h1:not(.teller-title):not(#dynamic-shop-title) {
    display: none !important;
}

/* Base Layout */
.teller-app {
    background: var(--background);
    color: var(--foreground);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size-3);
    line-height: var(--line-height-5);
    max-width: 100%;
    margin: 0 auto;
    padding: var(--space-6);
    gap: var(--space-6);
    display: flex;
    flex-direction: column;
}

/* Header */
.teller-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.teller-title {
    font-size: var(--font-size-8);
    font-weight: 600;
    line-height: var(--line-height-2);
    letter-spacing: -0.025em;
    color: var(--foreground);
    margin: 0 0 var(--space-2) 0;
}

.teller-subtitle {
    font-size: var(--font-size-4);
    color: var(--muted-foreground);
    margin: 0;
}

/* Card Components */
.teller-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-4);
    box-shadow: var(--shadow-2);
    margin-bottom: var(--space-6);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 88px; /* Fixed minimum height for consistent header sizes across all cards */
    display: flex;
    align-items: center; /* Vertically center content */
}

.card-title {
    font-size: var(--font-size-5);
    font-weight: 600;
    line-height: var(--line-height-3);
    color: #ffffff;
    margin: 0 0 var(--space-1) 0;
}

.card-description {
    font-size: var(--font-size-2);
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.card-content {
    padding: var(--space-6);
}

.card-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    margin-top: var(--space-4);
}

/* Form Components */
.form-field {
    margin-bottom: var(--space-4);
}

.field-readonly {
    background: var(--muted);
    color: var(--muted-foreground);
    cursor: not-allowed;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.field-label {
    display: block;
    font-size: var(--font-size-2);
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: var(--space-2);
}

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--input);
    border-radius: var(--radius-2);
    background: var(--background);
    color: var(--foreground);
    font-size: var(--font-size-2);
    line-height: var(--line-height-4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Enhanced Customer Name Input */
.customer-search-container .field-input {
    padding: var(--space-4) var(--space-4);
    font-size: var(--font-size-4);
    font-weight: 500;
    line-height: var(--line-height-3);
    border: 2px solid var(--gray-7);
    border-radius: var(--radius-3);
    background: var(--gray-1);
    min-height: 56px;
    box-shadow: var(--shadow-1);
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* Enhanced Customer Name Input Focus */
.customer-search-container .field-input:focus {
    border-color: var(--blue-8);
    background: white;
    box-shadow: 0 0 0 3px var(--blue-4), var(--shadow-2);
    transform: translateY(-1px);
}

/* Enhanced Customer Name Placeholder */
.customer-search-container .field-input::placeholder {
    color: var(--gray-9);
    font-size: var(--font-size-3);
    font-weight: 400;
    opacity: 0.7;
}

.field-textarea {
    resize: vertical;
    min-height: 80px;
}

.input-group {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    position: relative;
}

.input-group .field-input {
    flex: 1;
}

/* Validation Icons */
.validation-icon-container {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.validation-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s ease;
}

.validation-icon.success-icon {
    background: #22c55e;
    color: white;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.validation-icon.error-icon {
    background: #ef4444;
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.register-container {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--gray-2);
    border-radius: var(--radius-2);
    border-left: 4px solid var(--orange-6);
}

/* Always Visible Registration Button - Same Size as Input */
.registration-button-container {
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
    /* This container sets the baseline positioning for button alignment */
}

.register-new-player-btn {
    width: 100%;
    padding: var(--space-4) var(--space-4);
    font-size: var(--font-size-4);
    font-weight: 500;
    line-height: var(--line-height-3);
    border: 2px solid var(--gray-7);
    border-radius: var(--radius-3);
    background: var(--gray-4);
    color: var(--gray-8);
    min-height: 56px;
    cursor: not-allowed;
    transition: all 0.2s ease;
    text-align: center;
    opacity: 0.6;
}

.register-new-player-btn.enabled {
    background: var(--blue-9);
    color: white;
    border-color: var(--blue-9);
    cursor: pointer;
    box-shadow: var(--shadow-2);
    opacity: 1;
}

.register-new-player-btn.enabled:hover {
    background: var(--blue-10);
    border-color: var(--blue-10);
    transform: translateY(-1px);
    box-shadow: var(--shadow-3);
}

/* Customer Search */
.customer-search-container {
    position: relative;
}

.customer-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-2) var(--radius-2);
    box-shadow: var(--shadow-3);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
}

/* Player suggestions dropdown - matches customer suggestions */
.player-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-2) var(--radius-2);
    box-shadow: var(--shadow-3);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0;
}

/* Force hidden class to override any display issues */
.customer-suggestions.force-hidden,
.player-suggestions.force-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.player-suggestion-item {
    padding: var(--space-3) var(--space-3);
    cursor: pointer;
    border-bottom: 1px solid var(--muted-foreground);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    font-size: var(--font-size-2);
    line-height: var(--line-height-4);
}

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

.player-suggestion-item:hover,
.player-suggestion-item.highlighted {
    background: var(--accent);
    color: var(--accent-foreground);
}

.player-suggestion-item .player-name {
    font-weight: 500;
}

.player-suggestion-item .player-status {
    font-size: var(--font-size-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-1);
}

.player-suggestion-item .player-status.active {
    background: var(--green-3);
    color: var(--green-11);
}

.player-suggestion-item .player-status.inactive {
    background: var(--red-3);
    color: var(--red-11);
}

.customer-suggestion {
    padding: var(--space-3) var(--space-3);
    cursor: pointer;
    border-bottom: 1px solid var(--muted-foreground);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    font-size: var(--font-size-2);
    line-height: var(--line-height-4);
}

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

.customer-suggestion:hover,
.customer-suggestion.highlighted {
    background: var(--accent);
    color: var(--accent-foreground);
}

.customer-suggestion-name {
    font-weight: 500;
}

.customer-suggestion-status {
    font-size: var(--font-size-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-1);
    background: var(--green-3);
    color: var(--green-11);
}

.customer-suggestion-status.inactive {
    background: var(--red-3);
    color: var(--red-11);
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-2);
    font-size: var(--font-size-2);
    font-weight: 500;
    line-height: var(--line-height-4);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--gray-11);
    border-color: var(--gray-11);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--secondary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-5);
    border-color: var(--gray-5);
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border-color: var(--input);
}

.btn-outline:hover:not(:disabled) {
    background: var(--accent);
    color: var(--accent-foreground);
}

/* Shop Info Display */
.shop-info-display {
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: var(--muted);
    border-radius: var(--radius-2);
}

.info-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.shop-name {
    font-weight: 500;
    color: var(--foreground);
}

.shop-type-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    background: var(--blue-3);
    color: var(--blue-11);
    border-radius: var(--radius-1);
    font-size: var(--font-size-1);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Customer Info */
.customer-info-card {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--muted);
    border-radius: var(--radius-2);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.info-label {
    font-size: var(--font-size-1);
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.info-value {
    font-size: var(--font-size-2);
    color: var(--foreground);
}

/* Payment Grid */
.payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.payment-summary {
    padding: var(--space-4);
    background: var(--muted);
    border-radius: var(--radius-2);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

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

.summary-label {
    font-size: var(--font-size-2);
    color: var(--muted-foreground);
}

.summary-value {
    font-size: var(--font-size-2);
    font-weight: 500;
    color: var(--foreground);
}

.summary-status {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-1);
    font-size: var(--font-size-1);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.summary-status.balanced {
    background: var(--green-3);
    color: var(--green-11);
}

.summary-status.overpaid {
    background: var(--blue-3);
    color: var(--blue-11);
}

.summary-status.underpaid {
    background: var(--red-3);
    color: var(--red-11);
}

.change-amount {
    font-weight: 600;
    color: var(--green-11);
}

.change-amount.negative {
    color: var(--red-11);
}

/* Items Controls */
.items-controls {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    align-items: flex-end;
}

.search-field {
    flex: 1;
}

/* Items Grid - FORCE CONTAINER EXPANSION */
.items-container {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
}

.items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box;
    justify-content: flex-start;
}

/* FORCE ALL PARENT CONTAINERS TO FIT CONTENT */
.teller-card.items-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

.teller-card.items-card .card-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Force proper layout flow */
.items-card {
    height: auto !important;
    min-height: auto !important;
}

.items-card .card-content {
    height: auto !important;
    overflow: visible !important;
}

.item-card {
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    background: var(--card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 296px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
}

/* Icon Container with Frame */
.item-icon-container {
    width: 140px;
    height: 140px;
    padding: 6px;
    background: var(--gray-2);
    border-radius: 10px;
    border: 1px solid var(--gray-6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 var(--space-3) 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0; /* Prevent compression by quantity controls */
    min-width: 140px; /* Ensure minimum width */
    max-width: 140px; /* Prevent expansion */
}

.item-icon-container .item-image {
    width: 120%;
    height: 120%;
    object-fit: cover;
    border-radius: 4px;
    transform: scale(0.95);
    transform-origin: center center;
    display: block;
    margin: 0 auto;
}

.item-card:hover {
    border-color: var(--ring);
    box-shadow: var(--shadow-2);
}

.item-name {
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.item-actions {
    display: flex;
    gap: var(--space-2);
}

/* Bottom section wrapper for pricing and actions */
.item-bottom-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Card-specific pricing styling - separate from table pricing */
.item-card-pricing {
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    background: var(--gray-2);
    border-radius: 6px;
}

/* Turn-in item main content layout with fixed columns */
.item-main-content {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    align-items: flex-start;
}



.item-quantity-section {
    flex: 1;
    min-width: 0; /* Allow proper flex behavior */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2);
    min-height: 120px; /* Reserve space for stacks even when hidden - keeps Sell button anchored at bottom */
}

/* Quantity controls styling */
.quantity-control-group {
    margin-bottom: 10px;
}

.quantity-label {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    width: 100%;
}

.qty-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    width: 50px;
    height: 38px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background-color: #5a6268;
}

.qty-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.large-quantity-input, .turnin-large-quantity-input {
    width: 50px;
    height: 38px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield; /* Standard */
    background-color: #e9ecef !important; /* Darker gray default - force override */
    color: #495057;
    cursor: pointer;
    flex-shrink: 0; /* Prevent input from stretching in flex container */
    flex-grow: 0; /* Prevent input from growing in flex container */
}

/* Hide Chrome, Safari, Edge arrows */
.large-quantity-input::-webkit-outer-spin-button,
.large-quantity-input::-webkit-inner-spin-button,
.turnin-large-quantity-input::-webkit-outer-spin-button,
.turnin-large-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.large-quantity-input:focus, .turnin-large-quantity-input:focus {
    outline: none;
    border-color: #6c757d;
    background-color: white !important; /* White when focused/editing - force override */
    cursor: text;
}

.remaining-text {
    font-size: 14px;
    color: var(--gray-9);
    text-align: center;
}

.turnin-progress {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-11);
    text-align: center;
    margin-bottom: var(--space-2);
    padding: var(--space-1);
    background: var(--gray-1);
    border-radius: 4px;
    border: 1px solid var(--gray-4);
}

/* Multi-line progress display styles */
.progress-line {
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
}

.progress-line:last-child {
    margin-bottom: 0;
}

.transaction-progress {
    color: #28a745;
    font-weight: bold;
}

.player-progress {
    color: #6f42c1;
    font-weight: 600;
}

.server-progress {
    color: #495057;
    font-weight: 700;
    font-size: 14px;
}

/* Legacy turn-in quantity input styling - keep for backwards compatibility */
.turnin-quantity-input {
    width: 80px;
    height: 40px;
    padding: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--gray-6);
    border-radius: 6px;
    background: white;
}

.item-btn {
    flex: 1;
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-1);
}

/* Items Table */
.items-table-wrapper {
    overflow-x: auto;
}

/* Multi-column table layouts */
.items-table-wrapper.multi-column-2 {
    display: flex;
    gap: var(--space-4);
}

.items-table-wrapper.multi-column-3 {
    display: flex;
    gap: var(--space-4);
}

.items-table-wrapper.single-column {
    display: block;
}

.items-table-wrapper.multi-column-2 .table-container,
.items-table-wrapper.multi-column-3 .table-container {
    flex: 1;
    min-width: 0;
}

/* Add visual divider between table columns */
.items-table-wrapper.multi-column-2 .table-container:not(:last-child),
.items-table-wrapper.multi-column-3 .table-container:not(:last-child) {
    border-right: 2px solid var(--border);
    padding-right: var(--space-4, 20px);
    margin-right: var(--space-2, 10px);
}

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

.items-table th,
.items-table td {
    padding: var(--space-2);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.items-table th {
    font-weight: 500;
    color: var(--muted-foreground);
    font-size: var(--font-size-2);
}

/* Transaction List */
.transaction-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    overflow: hidden;
}

/* Cart table header - must use specific selector to override later flex rules */
.transaction-list .transaction-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr auto;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--muted);
    border-bottom: 1px solid var(--border);
    font-size: var(--font-size-2);
    font-weight: 500;
    color: var(--muted-foreground);
}

.transaction-items-list {
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

.transaction-items-list .no-items {
    padding: var(--space-6);
    text-align: center;
    color: var(--muted-foreground);
    font-size: var(--font-size-2);
}

.transaction-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: var(--space-2);
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    align-items: center;
}

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

/* Transaction Item Layout - Reset to default */
.transaction-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    padding: var(--space-3);
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Recent Transaction Cards - Taller for more items space */
.transaction-item.recent-transaction-card {
    flex: 0 0 340px;
    min-width: 340px;
    max-width: 340px;
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: var(--space-2);
    padding-bottom: var(--space-3);
}

/* Three-column layout - +20px total to right column for text cutoff fix */
.transaction-columns {
    display: grid;
    grid-template-columns: 80px 120px 130px;
    gap: var(--space-1);
    align-items: start;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-height: 0;
}

.transaction-column-1 {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    height: 100%;
}

.transaction-column-2 {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    height: 100%;
    border-right: 1px solid var(--border);
    padding-right: var(--space-2);
}

.transaction-column-3 {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    height: 100%;
}

.transaction-customer {
    font-weight: 600;
    font-size: var(--font-size-3);
    color: var(--foreground);
}

.transaction-date {
    font-size: var(--font-size-1);
    color: var(--muted-foreground);
    margin-top: auto;
}

.transaction-teller {
    font-weight: 600;
    color: var(--foreground);
    font-size: var(--font-size-2);
}

.transaction-recorded-at {
    font-size: var(--font-size-1);
    color: var(--muted-foreground);
    margin-top: auto;
}

.transaction-recorded-at .recorded-date {
    font-weight: 500;
    margin-bottom: 2px;
}

.transaction-recorded-at .recorded-time {
    font-size: var(--font-size-0);
    opacity: 0.8;
}

.transaction-type {
    font-weight: 600;
    color: var(--blue-11);
    font-size: var(--font-size-2);
}

.transaction-items {
    font-weight: 500;
    color: var(--foreground);
    line-height: 1.3;
    font-size: var(--font-size-2);
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    padding-right: var(--space-1);
    padding-bottom: var(--space-2);
}

.transaction-coins {
    font-size: var(--font-size-2);
    color: var(--green-11);
    font-weight: 500;
}

.transaction-recorded {
    font-size: var(--font-size-2);
    color: var(--muted-foreground);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.transaction-customer {
    font-weight: 600;
    color: var(--accent-foreground);
}

.transaction-date {
    font-size: var(--font-size-1);
    color: var(--muted-foreground);
}

.transaction-item-info {
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: var(--space-1);
}

.transaction-meta {
    font-size: var(--font-size-1);
    color: var(--muted-foreground);
}

.transaction-notes {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
    font-size: var(--font-size-1);
    color: var(--muted-foreground);
    font-style: italic;
}

/* Transaction Grid Layout - Natural flow of fixed-width cards */
.transaction-history-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2);
    align-items: flex-start;
}

.transaction-row-card:hover {
    background-color: var(--accent-2);
}

/* History Controls */
.history-controls {
    margin-bottom: var(--space-4);
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--space-4);
    align-items: end;
}

/* History List */
.history-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
}

.history-item {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}

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

/* Status Messages - Overlay display at top of payment tracking section 
 * Positioned absolutely to prevent layout shift when messages appear/disappear.
 * The container is positioned at the card-content level and overlays all content.
 * pointer-events: none allows clicks to pass through empty space to underlying content.
 */
.payment-status-messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: var(--space-2);
    pointer-events: none; /* Allow clicks through empty space */
}

.payment-status-message {
    padding: var(--space-3);
    border-radius: var(--radius-2);
    font-weight: 500;
    font-size: var(--font-size-3);
    line-height: 1.5;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto; /* Allow clicks on the message itself */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.payment-status-message.success {
    background: var(--green-3);
    color: var(--green-12);
    border: 1px solid var(--green-6);
}

.payment-status-message.error {
    background: var(--red-3, #ffe5e5);
    color: var(--red-12, #5c0a0a);
    border: 1px solid var(--red-6, #ffb3b3);
}

.payment-status-message.info {
    background: var(--blue-3);
    color: var(--blue-12);
    border: 1px solid var(--blue-6);
}

.payment-status-message.warning {
    background: hsl(38, 100%, 95%);
    color: hsl(38, 100%, 35%);
    border: 1px solid hsl(38, 100%, 75%);
}

.status-message-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding-left: var(--space-2);
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.status-message-close:hover {
    opacity: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius-4);
    box-shadow: var(--shadow-5);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

.close {
    cursor: pointer;
    font-size: var(--font-size-5);
    color: var(--muted-foreground);
    line-height: 1;
}

.close:hover {
    color: var(--foreground);
}

/* Responsive Design */
@media (max-width: 768px) {
    .teller-app {
        padding: var(--space-4);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .items-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Cart table responsive: stack columns on mobile */
    .transaction-list .transaction-header,
    .transaction-items-list .transaction-item {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }
    
    /* Ensure cards don't overlap on mobile */
    .teller-card {
        margin-bottom: var(--space-8);
        position: relative;
        z-index: auto;
        display: block;
        width: 100%;
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Items card should expand properly on mobile */
    .teller-card.items-card {
        margin-bottom: var(--space-8);
        clear: both;
        overflow: visible !important;
        height: auto !important;
    }
    
    .teller-card.items-card .card-content {
        overflow: visible !important;
        height: auto !important;
    }
    
    /* Force grid to expand properly */
    .items-container {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .items-grid {
        overflow: visible !important;
        height: auto !important;
        grid-template-columns: repeat(auto-fit, minmax(min(200px, 45%), 1fr));
        gap: var(--space-3);
        max-width: 100%;
        justify-items: center;
    }
}

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

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--muted);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* Focus visible improvements */
.field-input:focus-visible,
.field-select:focus-visible,
.field-textarea:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--blue-8);
    outline-offset: 2px;
}

/* Enhanced item card styling */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2);
}

.item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-12);
    flex: 1;
}

.item-tags {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.item-type {
    font-size: 12px;
    color: var(--gray-9);
    background: var(--gray-3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Biome Tags */
.item-biome {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block;
    text-transform: capitalize;
    text-align: center;
    min-width: 50px;
}

/* Biome Color Coding */
.biome-meadow, .biome-meadows { 
    background: #90EE90; 
    color: #2F4F2F; 
    border: 1px solid #7CCD7C;
}

.biome-forest { 
    background: #228B22; 
    color: #FFFFFF; 
    border: 1px solid #32CD32;
}

.biome-blackforest { 
    background: #1B4B1B; 
    color: #FFFFFF; 
    border: 1px solid #006400;
}

.biome-swamp { 
    background: #8B4513; 
    color: #FFFFFF; 
    border: 1px solid #A0522D;
}

.biome-mountain { 
    background: #708090; 
    color: #FFFFFF; 
    border: 1px solid #778899;
}

.biome-plains { 
    background: #F0E68C; 
    color: #8B4513; 
    border: 1px solid #BDB76B;
}

.biome-mistland, .biome-mistlands { 
    background: #9370DB; 
    color: #FFFFFF; 
    border: 1px solid #8A2BE2;
}

.biome-ashland, .biome-ashlands { 
    background: #DC143C; 
    color: #FFFFFF; 
    border: 1px solid #B22222;
}

.biome-deepnorth { 
    background: #4682B4; 
    color: #FFFFFF; 
    border: 1px solid #5F9EA0;
}

.biome-ocean { 
    background: #006994; 
    color: #FFFFFF; 
    border: 1px solid #4169E1;
}

.biome-unknown { 
    background: var(--gray-3); 
    color: var(--gray-9); 
    border: 1px solid var(--gray-6);
}

.item-pricing {
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    background: var(--gray-2);
    border-radius: 6px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-1);
}

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

.price-label {
    font-size: 12px;
    color: var(--gray-9);
    font-weight: 500;
}

.price-value {
    font-size: 14px;
    color: var(--green-11);
    font-weight: 600;
}

.item-tech {
    font-size: 11px;
    color: var(--gray-8);
    margin-top: var(--space-1);
}

.item-details {
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    background: var(--blue-2);
    border-radius: 6px;
}

.item-points {
    font-size: 14px;
    color: var(--blue-11);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.quantity-input, .table-qty-input, .cart-qty-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--gray-7);
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}

.table-qty-input {
    width: 50px;
    padding: 2px 4px;
}

.cart-qty-input {
    width: 100px;
    padding: 8px 12px;
    margin-right: var(--space-1);
    border: 1px solid var(--gray-7);
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.cart-qty-input:focus {
    outline: none;
    border-color: var(--blue-9);
    box-shadow: 0 0 0 2px var(--blue-3);
}



.action-buttons {
    display: flex;
    gap: var(--space-2);
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.item-btn {
    flex: 1;
    min-width: 70px;
    padding: 6px 12px;
    font-size: 12px;
}

/* Transaction item styling - Cart view */
.transaction-items-list .transaction-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3);
    border: 1px solid var(--gray-6);
    border-radius: 8px;
    margin-bottom: var(--space-2);
    background: var(--gray-1);
}

.item-name-col {
    display: flex;
    align-items: center;
}

.item-name {
    font-weight: 500;
    color: var(--gray-12);
}

.item-type-col {
    display: flex;
    justify-content: flex-start;
}

.item-quantity-col {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.item-value-col {
    display: flex;
    justify-content: flex-end;
}

.item-actions-col {
    display: flex;
    justify-content: flex-end;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.item-action {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    width: fit-content;
    display: inline-block;
}

.item-action.buy {
    background: var(--green-9);
    color: white;
}

.item-action.sell {
    background: var(--red-9);
    color: white;
}

.item-action.turnin {
    background: var(--gray-8);
    color: white;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.stack-info,
.daily-limit-info {
    font-size: 11px;
    color: var(--gray-9);
    white-space: nowrap;
}

.item-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.unit-price {
    font-size: 11px;
    color: var(--gray-9);
}

.stack-price {
    font-size: 11px;
    color: var(--gray-9);
}

.total-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-12);
}

/* Table view enhancements */
.items-data-table th,
.items-data-table td {
    padding: var(--space-2);
    text-align: center;
    vertical-align: middle;
}

.items-data-table th:first-child,
.items-data-table th:nth-child(5) {
    text-align: left;
}

.items-data-table td:first-child,
.items-data-table td:nth-child(5) {
    text-align: left;
    font-weight: 500;
}

/* Compact Header Layout */
.teller-header {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    background: var(--gray-1);
    border-radius: 12px;
    border: 1px solid var(--gray-6);
}

.header-shop-selection {
    display: flex;
    justify-content: center;
}

.shop-selection-box {
    background: var(--gray-2);
    border-radius: 8px;
    border: 1px solid var(--gray-6);
    padding: var(--space-3) var(--space-4);
    width: 100%;
    height: 100px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.header-main {
    text-align: center;
}

.header-teller {
    display: flex;
    justify-content: center;
}

.teller-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-4);
    background: var(--blue-2);
    border-radius: 8px;
    border: 1px solid var(--blue-6);
    width: 100%;
    height: 100px;
    min-height: 100px;
    text-align: center;
    box-sizing: border-box;
}

.teller-label {
    font-size: 14px;
    color: var(--gray-9);
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: var(--space-1);
}

.teller-name {
    font-size: 18px;
    color: var(--blue-11);
    font-weight: 600;
}

/* Compact Config Layout */
.compact-config-card {
    margin-bottom: var(--space-4);
}

.compact-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.compact-config-grid.single-column {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
}

.config-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Enhanced Quantity Controls */
.quantity-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.quantity-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--gray-2);
    border-radius: 6px;
}

.qty-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-11);
    min-width: 80px;
}

.quantity-input {
    width: 60px;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: var(--space-1);
    margin-left: auto;
}

.item-btn {
    padding: 4px 12px;
    font-size: 12px;
    min-height: auto;
    flex-shrink: 0;
}

/* Fix primary button styling */
.btn-primary {
    background: var(--blue-9);
    color: white;
    border: 1px solid var(--blue-9);
}

.btn-primary:hover {
    background: var(--blue-10);
    border-color: var(--blue-10);
}

.btn-primary:focus {
    background: var(--blue-10);
    border-color: var(--blue-10);
    box-shadow: 0 0 0 2px var(--blue-4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .compact-config-grid {
        grid-template-columns: 1fr;
    }
    
    .teller-header {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(100px, auto) auto;
        gap: var(--space-3);
        grid-template-areas: 
            "shop-selection teller"
            "main-title main-title";
    }
    
    .header-shop-selection {
        grid-area: shop-selection;
        width: 100%;
        display: flex;
        align-items: stretch;
        min-height: 100px;
    }
    
    .header-teller {
        grid-area: teller;
        width: 100%;
        justify-content: center;
        display: flex;
        align-items: stretch;
        min-height: 100px;
    }
    
    .header-main {
        grid-area: main-title;
        width: 100%;
        text-align: center;
    }
    
    .teller-info {
        align-items: center;
        text-align: center;
        min-height: 100px;
        width: 100%;
        height: 100%;
    }
    
    .shop-selection-box {
        min-height: 100px;
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .quantity-row {
        flex-wrap: wrap;
    }
    
    /* Mobile stacking for customer-payment-actions row */
    .customer-payment-actions-row {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .customer-card,
    .payment-card,
    .actions-card {
        width: 100%;
        flex: none;
        min-width: auto;
    }
}

/* Context Normalization - Handle admin (#wpbody-content) vs shortcode differences */
#magic-merchant-interface,
.merchant-app {
    /* Reset any inherited styles from WordPress admin or theme */
    box-sizing: border-box;
}

#magic-merchant-interface *,
.merchant-app * {
    box-sizing: border-box;
}

/* Normalize any WordPress admin wrapper styles */
#wpbody-content #magic-merchant-interface {
    margin: 0;
    padding: 0;
}

/* Customer, Payment, and Actions Three-Column Layout */
.customer-payment-actions-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    align-items: stretch;
    min-height: 200px; /* Consistent reasonable height for alignment */
}

.customer-card {
    flex: 0.8;
    min-width: 0; /* Allows flex shrinking */
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Consistent height */
}

.payment-card {
    flex: 1.4;
    min-width: 0; /* Allows flex shrinking */
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Consistent height */
}

.actions-card {
    flex: 0.8;
    min-width: 200px; /* Minimum width for buttons */
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Consistent height */
}

/* Remove bottom margin from cards in customer-payment-actions row - parent row has margin instead */
.teller-card.customer-card,
.teller-card.payment-card,
.teller-card.actions-card {
    margin-bottom: 0;
}

/* Enable container queries for payment card */
.teller-card.payment-card {
    container-type: inline-size;
    container-name: payment-card;
    position: relative; /* Positioning context for absolute overlay messages */
}

/* Ensure all card content sections expand to fill available space and CENTER VERTICALLY */
.customer-card .card-content,
.payment-card .card-content,
.actions-card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* ALWAYS center vertically for consistent alignment */
    padding: var(--space-6); /* Consistent padding for all three cards */
}

/* Payment card content needs relative positioning for overlay messages */
.payment-card .card-content {
    position: relative;
}

.tracking-content {
    display: flex;
    flex-direction: column;
    justify-content: center; /* ALWAYS center vertically */
}

/* Make form fields within actions card expand and align consistently */
.actions-card .card-content .form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Push buttons to bottom in shop view */
}

/* CART VIEW ONLY: Center buttons when in cart view */
.cart-view-active .actions-card .card-content .form-field {
    justify-content: center;
}

/* Customer input wrapper to match button styling approach */
.customer-input-wrapper {
    position: relative;
    width: 100%;
}

.customer-input-wrapper .field-input {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--font-size-3);
    font-weight: 500;
    line-height: var(--line-height-3);
    border: 2px solid var(--gray-7);
    border-radius: var(--radius-3);
    background: var(--gray-1);
    min-height: 56px;
    box-shadow: var(--shadow-2);
}

/* Compact Payment Grid */
.payment-grid-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    align-items: stretch; /* Stretch grid items to match heights - applies to ALL children */
    margin-top: 1px; /* Compensate for visibility:hidden alignment difference */
}

/* Payment Inputs Container - responsive layout matching payment grid */
.payment-inputs-container {
    grid-template-columns: repeat(2, 1fr); /* Default 2-column layout */
}

/* Stack payment grid when card container is too narrow */
/* With wrapping cost text, grid can stay 2-column until very narrow */
@container payment-card (max-width: 280px) {
    .payment-grid-compact {
        grid-template-columns: 1fr;
        gap: var(--space-2); /* Tighter gap when stacked */
    }
    
    /* Stack payment inputs at the same breakpoint */
    .payment-inputs-container {
        grid-template-columns: 1fr;
    }
}

/* Additional mobile breakpoint for very narrow screens (< 400px) */
@media (max-width: 400px) {
    .payment-grid-compact {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    
    /* Stack payment inputs at the same breakpoint */
    .payment-inputs-container {
        grid-template-columns: 1fr;
    }
    
    /* Reduce padding to make more room for the input value on small screens */
    .payment-grid-compact .field-input {
        padding-left: 75px !important; /* Reduced for smaller screens */
        padding-right: var(--space-2) !important; /* Minimal right padding for spinner arrows */
        font-size: var(--font-size-3) !important; /* Slightly smaller font */
    }
    
    .payment-input-label {
        font-size: var(--font-size-1) !important; /* Smaller label */
        left: var(--space-2) !important;
    }
}

/* Payment Input Wrapper - Inline Label Style */
.payment-input-wrapper {
    position: relative;
    width: 100% !important; /* Force full width in both admin and shortcode contexts */
    height: 100%; /* Fill the form-field container */
    visibility: hidden; /* Hidden by default, shown only in cart view */
    opacity: 0;
    pointer-events: none;
}

/* Show payment inputs only in cart view */
.cart-view-active .payment-input-wrapper {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.payment-input-label {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-2);
    font-weight: 600;
    color: var(--gray-11);
    pointer-events: none;
    z-index: 1;
}

/* Enhanced Payment Input Fields - Match Customer Name and Button Height */
.payment-grid-compact .field-input {
    width: 100% !important; /* Force full width - override any admin theme styles */
    padding: var(--space-4) var(--space-3);
    padding-left: 85px; /* Room for label on the left */
    padding-right: var(--space-3); /* Minimal right padding for spinner arrows */
    font-size: var(--font-size-4);
    font-weight: 500;
    line-height: var(--line-height-3);
    border: 2px solid var(--gray-7);
    border-radius: var(--radius-3);
    background: var(--gray-1);
    min-height: 56px; /* Minimum height to match summary boxes */
    height: auto; /* Allow natural height like summary boxes */
    box-sizing: border-box;
    box-shadow: var(--shadow-1);
    text-align: center; /* Center the input value in the available space */
}

/* Center the input value in payment fields */
#ymir-flesh-total,
#gold-total {
    text-align: center;
}

.payment-grid-compact .field-input:focus {
    border-color: var(--blue-8);
    background: white;
    box-shadow: 0 0 0 3px var(--blue-4), var(--shadow-2);
    transform: translateY(-1px);
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.payment-grid-compact .form-field {
    margin-bottom: 0;
    min-height: 56px; /* Minimum height to align with other elements */
    height: 100%; /* Fill grid cell height for uniform sizing */
    display: flex;
    align-items: center; /* Center input vertically within container */
}

/* Only enforce fixed height in cart view when inputs are visible */
.cart-view-active .payment-grid-compact .form-field {
    height: 100%; /* Fill grid cell height for uniform sizing */
    min-height: 56px; /* Maintain minimum height */
}

/* Reset browser default input styles for consistency */
input[type="number"] {
    margin: 0 !important;
    appearance: textfield;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* FORCE BUTTON ALIGNMENT - Nuclear Approach */
.actions-card .form-field {
    position: relative !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

.customer-card .form-field {
    position: relative !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

/* Reset button margins to let flex handle positioning */
.clear-transaction-container,
.record-transaction-btn,
.registration-button-container {
    margin: 0 !important;
}

.clear-transaction-btn,
.record-transaction-btn {
    width: 100%;
    padding: var(--space-4) var(--space-4);
    font-size: var(--font-size-4);
    font-weight: 500;
    line-height: var(--line-height-3);
    border: 2px solid var(--gray-7);
    border-radius: var(--radius-3);
    background: var(--gray-4);
    color: var(--gray-8);
    min-height: 56px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: var(--shadow-2);
}

.clear-transaction-btn:hover {
    background: var(--gray-5);
    border-color: var(--gray-8);
    transform: translateY(-1px);
    box-shadow: var(--shadow-3);
}

.record-transaction-btn {
    background: var(--blue-9);
    color: white;
    border-color: var(--blue-9);
}

.record-transaction-btn:hover:not(:disabled) {
    background: var(--blue-10);
    border-color: var(--blue-10);
    transform: translateY(-1px);
    box-shadow: var(--shadow-3);
}

.record-transaction-btn:disabled {
    background: var(--gray-4);
    color: var(--gray-8);
    border-color: var(--gray-7);
    cursor: not-allowed;
    opacity: 0.6;
}

.transaction-actions-vertical,
.customer-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    height: 100%;
    justify-content: center;
}

.transaction-actions-vertical .btn {
    width: 100%;
    justify-content: center;
    min-height: 56px;
    padding: var(--space-4);
    font-size: var(--font-size-3);
    font-weight: 600;
}

/* Payment Summary Wrappers - Always in DOM for consistent grid layout */
/* Start hidden on page load, shown only in cart view */
.payment-summary-wrapper,
.payment-summary-wrapper-right {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    height: 100%; /* Fill grid cell height for uniform sizing */
    display: flex; /* Flexbox to pass height to child */
    flex-direction: column;
    align-items: stretch; /* Ensure child box fills wrapper width */
}

/* Show payment summaries only in cart view */
.cart-view-active .payment-summary-wrapper,
.cart-view-active .payment-summary-wrapper-right {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Payment Tracking Header - Hide by default, show only in cart view */
.payment-card .card-header #tracking-title {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.cart-view-active .payment-card .card-header #tracking-title {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Payment Status Header - Right-aligned next to Payment Tracking */
.payment-card .card-header {
    justify-content: space-between; /* Override to space between title and status */
}

.payment-status-header {
    font-size: var(--font-size-2); /* Smaller font size: 0.875rem (14px) instead of 1rem */
    font-weight: 600;
    line-height: 1.3; /* Tighter line spacing: 1.3 instead of 1.5 */
    text-align: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: var(--space-2) var(--space-3); /* Reduced padding: 0.5rem/0.75rem instead of 0.75rem/1rem */
    border-radius: var(--radius-3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    max-width: 280px;
    /* Fixed height to prevent header resizing - all content must fit within this */
    max-height: 68px; /* Fits ~4 lines at smaller font size without scrolling */
    overflow: hidden; /* Hide overflow instead of scrolling */
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-view-active .payment-status-header {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.payment-status-header.balanced {
    background: var(--green-3);
    color: var(--green-12);
    border: 2px solid var(--green-9);
}

.payment-status-header.overpaid {
    background: var(--red-3);
    color: var(--red-12);
    border: 2px solid var(--red-9);
}

.payment-status-header.underpaid {
    background: var(--red-3);
    color: var(--red-12);
    border: 2px solid var(--red-9);
}

.payment-status-header.pending {
    background: var(--gray-3);
    color: var(--gray-11);
    border: 2px solid var(--gray-7);
    font-weight: 500;
}


/* Payment Summary Boxes - Now grid items within payment-grid-compact */
.payment-summary-box {
    background: var(--gray-2);
    border: 2px solid var(--gray-7); /* Match payment input border */
    border-radius: var(--radius-3); /* Match payment input radius */
    padding: var(--space-4) var(--space-4); /* Match input field padding for consistent sizing */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically like input fields */
    min-height: 56px; /* Match input height as baseline, grow as needed */
    height: 100%; /* Fill wrapper height for uniform sizing across Cost and Paid */
    box-sizing: border-box;
}

/* Remove fixed height override - let containers expand naturally with content */
/* .cart-view-active .payment-summary-box {
    Removed: Previously had min-height: 120px causing excessive blank space
} */

.payment-summary-box .box-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline; /* Align text baselines for better appearance */
    font-size: 14px; /* Slightly larger for readability */
    line-height: 1.4;
    gap: var(--space-3); /* Add gap between label and value */
}

.payment-summary-box .box-row:not(:last-child) {
    margin-bottom: 6px; /* Space between rows */
}

/* Center status row (no label, just status text) */
.payment-summary-box .box-row.status-row {
    justify-content: center;
    margin-bottom: 0;
}

.payment-summary-box .box-label {
    font-weight: 600; /* Bolder labels */
    color: var(--gray-11);
    white-space: nowrap;
    flex-shrink: 0; /* Prevent label from shrinking */
}

.payment-summary-box .box-value {
    font-weight: 600;
    color: var(--gray-12);
    text-align: right;
    white-space: normal; /* Allow wrapping */
    word-break: break-word;
    overflow: visible;
    flex: 1; /* Allow value to take remaining space */
    min-width: 0; /* Enable text wrapping */
    line-height: 1.6; /* Better spacing for multi-line stacked currencies */
}

/* Cost display with alternative format - allow natural inline wrapping */
#item-total-cost {
    line-height: 1.4; /* Comfortable line spacing for wrapped text */
}

#item-total-cost .cost-primary {
    display: inline;
    white-space: nowrap; /* Keep "10000g or" together */
}

#item-total-cost .cost-alt {
    display: inline;
    white-space: nowrap; /* Keep "83 Ymir & 40g" together */
}

.payment-summary-box .box-value.negative,
#payment-difference.negative {
    color: var(--red-9);
}

.payment-summary-box .box-value.positive,
#payment-difference.positive {
    color: var(--green-9);
}

/* Payment Status Styling */
.payment-status.balanced {
    color: var(--green-9);
    font-weight: 600;
}

.payment-status.overpaid {
    color: var(--red-9);
    font-weight: 600;
    line-height: 1.5; /* Better spacing for multi-line stacked currencies */
    text-align: center; /* Center status text */
}

.payment-status.underpaid {
    color: var(--red-9);
    font-weight: 600;
    line-height: 1.5; /* Better spacing for multi-line stacked currencies */
    text-align: center; /* Center status text */
}

.payment-status.pending {
    color: var(--gray-9);
    font-weight: 500;
}

/* Modal Overpayment Section */
.modal-overpayment-section {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--gray-2);
    border-radius: var(--radius-3);
    border: 2px solid var(--amber-7);
}

.overpayment-alert {
    display: flex;
    gap: var(--space-3);
    align-items: start;
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--amber-2);
    border-radius: var(--radius-2);
    border-left: 4px solid var(--amber-9);
}

.overpayment-alert .alert-icon {
    font-size: var(--font-size-6);
    line-height: 1;
}

.overpayment-alert .alert-content h4 {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-4);
    color: var(--amber-11);
}

.overpayment-alert .alert-content p {
    margin: 0;
    font-size: var(--font-size-3);
    color: var(--gray-12);
}

.change-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.change-verification {
    padding: var(--space-4);
    background: var(--gray-3);
    border-radius: var(--radius-2);
}

.verification-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    font-size: var(--font-size-3);
}

.verification-label {
    font-weight: 500;
    color: var(--gray-11);
}

.verification-value {
    font-weight: 600;
    font-size: var(--font-size-4);
}

.verification-value.balanced {
    color: var(--green-9);
}

.verification-value.overpaid {
    color: var(--red-9);
}

.verification-value.underpaid {
    color: var(--amber-9);
}

.change-status {
    margin-top: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-2);
    text-align: center;
    font-weight: 600;
}

.change-status.balanced {
    background: var(--green-2);
    color: var(--green-11);
    border: 1px solid var(--green-7);
}

.change-status.overpaid {
    background: var(--red-2);
    color: var(--red-11);
    border: 1px solid var(--red-7);
}

.change-status.underpaid {
    background: var(--amber-2);
    color: var(--amber-11);
    border: 1px solid var(--amber-7);
}

/* Spell Claim Option Section */
.modal-spell-claim-section {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--purple-2);
    border-radius: var(--radius-3);
    border: 2px solid var(--purple-7);
}

.spell-claim-option {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.spell-claim-header {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.spell-claim-header .spell-icon {
    font-size: var(--font-size-6);
    line-height: 1;
}

.spell-claim-header h4 {
    margin: 0;
    font-size: var(--font-size-4);
    color: var(--purple-11);
}

.spell-claim-content p {
    margin: 0 0 var(--space-3) 0;
    font-size: var(--font-size-3);
    color: var(--gray-12);
}

.spell-claim-items-list {
    padding: var(--space-3);
    background: var(--purple-3);
    border-radius: var(--radius-2);
    margin-bottom: var(--space-4);
}

.spell-claim-items-list ul {
    margin: 0;
    padding-left: var(--space-5);
    list-style-type: none;
}

.spell-claim-items-list li {
    padding: var(--space-2) 0;
    color: var(--purple-12);
    font-weight: 500;
}

.spell-claim-items-list li::before {
    content: "✨ ";
    margin-right: var(--space-2);
}

.spell-claim-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--purple-3);
    border-radius: var(--radius-2);
    cursor: pointer;
    transition: background-color 0.2s;
}

.spell-claim-checkbox-label:hover {
    background: var(--purple-4);
}

.spell-claim-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.spell-claim-checkbox-label span {
    font-size: var(--font-size-3);
    font-weight: 500;
    color: var(--gray-12);
}

.spell-claim-note {
    display: block;
    margin-top: var(--space-3);
    font-size: var(--font-size-2);
    color: var(--gray-11);
    font-style: italic;
}

/* Turn-in Tracking Styling */
.tracking-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.turnin-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.turnin-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2);
    background: var(--gray-2);
    border-radius: var(--radius-2);
}

.turnin-summary-item .summary-label {
    font-size: var(--font-size-2);
    font-weight: 500;
    color: var(--muted-foreground);
}

.turnin-summary-item .summary-value {
    font-size: var(--font-size-3);
    font-weight: 600;
    color: var(--foreground);
}

.turnin-items-summary {
    border: 1px solid var(--border);
    border-radius: var(--radius-3);
    max-height: 200px;
    overflow-y: auto;
}

.turnin-item-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}

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

.turnin-item-name {
    font-size: var(--font-size-2);
    font-weight: 500;
    color: var(--foreground);
}

.turnin-item-counts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
}

.turnin-current-progress {
    font-size: var(--font-size-1);
    color: var(--muted-foreground);
}

.turnin-projected-progress {
    font-size: var(--font-size-2);
    font-weight: 600;
    color: var(--blue-11);
}

/* Compact Turn-in Tracking Styles */
.turnin-compact-table {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    min-height: 120px;
}

.turnin-compact-item {
    display: grid;
    grid-template-columns: 2fr 80px auto auto;
    gap: 6px;
    align-items: center;
    padding: 3px 6px;
    background: var(--gray-1);
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 1px;
}

.turnin-compact-item:hover {
    background: var(--gray-2);
}

.turnin-compact-name {
    font-weight: 500;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.turnin-compact-progress {
    width: 80px;
    height: 10px;
    flex-shrink: 0;
}

.turnin-compact-bar {
    width: 100%;
    height: 100%;
    background: var(--gray-4);
    border-radius: 1px;
    overflow: hidden;
}

.turnin-compact-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-9), var(--green-10));
    border-radius: 1px;
    transition: width 0.3s ease;
}

.turnin-compact-counts {
    font-size: 12px;
    color: var(--muted-foreground);
    white-space: nowrap;
    min-width: 35px;
    text-align: right;
}

.turnin-compact-percent {
    font-size: 11px;
    color: var(--muted-foreground);
    min-width: 25px;
    text-align: right;
}

.no-turnin-items {
    text-align: center;
    color: var(--muted-foreground);
    font-style: italic;
    padding: var(--space-5);
}

/* Enhanced Transaction History Styling - Card-based Grid Layout (Matches Ledger Archive) */

/* Transaction History Container - Apply grid layout */
.transaction-history,
.transaction-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: auto; /* Allow rows to grow with content */
    gap: 15px;
    /* Remove any height restrictions to let it expand naturally */
}

@media (max-width: 768px) {
    .transaction-history,
    .transaction-history-grid {
        grid-template-columns: 1fr;
    }
}

.transaction-item.recent-transaction-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    padding-bottom: 20px; /* Extra bottom padding for consistent spacing */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
    height: auto; /* Allow cards to grow */
    max-height: none; /* Remove height restrictions */
    overflow: visible; /* Don't clip overflow content */
}

.transaction-item.recent-transaction-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.transaction-columns {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 20px;
    align-items: start;
    overflow: visible; /* Don't clip content */
}

.transaction-customer {
    font-size: 1.1em;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 5px;
}

.transaction-items {
    font-size: 0.95em;
    line-height: 1.4;
    color: #333;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
    padding-right: 5px;
    padding-bottom: 8px;
}

.transaction-coins {
    font-weight: 600;
    color: #d4af37;
    font-size: 0.9em;
}

.transaction-type {
    background: #0073aa;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
    width: fit-content;
    max-width: 100px;
    text-align: center;
}

.transaction-type.turn-in,
.transaction-item.turnin .transaction-type {
    background: #ff8c00;
}

.transaction-type.claim,
.transaction-item.claim .transaction-type {
    background: #2196F3; /* Blue background for claim transactions */
}

.transaction-teller {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
}

.transaction-recorded-at {
    font-size: 0.8em;
    color: #888;
}

.recorded-date {
    font-weight: 500;
}

.recorded-time {
    font-size: 0.9em;
    opacity: 0.8;
}

.transaction-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .transaction-columns {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .transaction-column-3 {
        text-align: left;
    }
}

/* Legacy list-based styling for backward compatibility */
.history-list .transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--card);
    transition: background-color 0.2s ease;
}

.history-list .transaction-item:hover {
    background: var(--muted);
}

.history-list .transaction-item:last-child {
    border-bottom: none;
}

.history-list .transaction-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.transaction-main-line {
    font-size: var(--font-size-3);
    color: var(--foreground);
    line-height: var(--line-height-4);
}

.transaction-details {
    font-size: var(--font-size-1);
    color: var(--muted-foreground);
    line-height: var(--line-height-3);
}

.history-list .transaction-amount {
    font-size: var(--font-size-4);
    font-weight: 600;
    color: var(--blue-11);
    text-align: right;
    white-space: nowrap;
    margin-left: var(--space-3);
}

/* Ledger Balance Styling */
.transaction-item.ledger-header {
    background: var(--blue-2);
    border-left: 4px solid var(--blue-9);
    font-weight: 600;
}

.transaction-item.ledger-balance {
    background: var(--green-1);
    border-left: 3px solid var(--green-8);
}

.transaction-item.ledger-balance:hover {
    background: var(--green-2);
}