/**
 * XProfile Table Card View Styles
 * Enables card and list views for XProfile table fields
 *
 * Based on: reisekosten-final-mit-views.html design reference
 * @version 1.0.0
 * @author Taxtastic
 */

/* ==========================================================================
   CSS VARIABLES - Aligned with Taxtastic Material Theme
   ========================================================================== */

:root {
    --xprofile-card-primary: #23036A;
    --xprofile-card-secondary: #0D7377;
    --xprofile-card-background: #F8F9FA;
    --xprofile-card-surface: #FFFFFF;
    --xprofile-card-border: #E5E5E5;
    --xprofile-card-text-primary: #000000;
    --xprofile-card-text-secondary: #666666;
    --xprofile-card-font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Column Type Colors (for future use with custom column types) */
    --xprofile-card-type-1: #2196F3;
    --xprofile-card-type-2: #9C27B0;
    --xprofile-card-type-3: #FF9800;
    --xprofile-card-type-4: #4CAF50;
}

/* ==========================================================================
   ACTION BAR - View Switcher Container
   ========================================================================== */

.xprofile-table-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    font-family: var(--xprofile-card-font-family);
}

.action-bar-left {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Moved action buttons styling within action bar */
.action-bar-left .mdc-button {
    margin: 0; /* Reset any default margins */
}

.action-bar-right {
    display: flex;
    align-items: center;
}

/* New Entry Button (Placeholder for Phase 2) */
.xprofile-btn-new-entry {
    background: var(--xprofile-card-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-family: var(--xprofile-card-font-family);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.xprofile-btn-new-entry:hover {
    background: #1A0250;
    transform: translateY(-1px);
}

/* ==========================================================================
   VIEW SWITCH TOGGLE
   ========================================================================== */

.view-switch {
    display: flex;
    gap: 4px;
    background: var(--xprofile-card-background);
    padding: 4px;
    border-radius: 10px;
}

.view-switch-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--xprofile-card-font-family);
    font-size: 0.9rem;
    color: var(--xprofile-card-text-secondary);
    transition: all 0.2s ease;
}

.view-switch-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.view-switch-btn.active {
    background: var(--xprofile-card-surface);
    color: var(--xprofile-card-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-switch-btn .material-icons {
    font-size: 18px;
}

.view-switch-label {
    font-weight: 500;
}

/* ==========================================================================
   TABLE VIEW - Hide when cards active
   ========================================================================== */

/* High specificity to override theme rules */
.buddypress-template-default .bp-profile__content .mdc-data-table.xprofile-table-hidden,
.page-template-default .bp-profile__content .mdc-data-table.xprofile-table-hidden,
.mdc-data-table.xprofile-table-hidden {
    display: none !important;
}

/* ==========================================================================
   CARDS VIEW - Horizontal Scrolling Container
   ========================================================================== */

.expense-cards-container {
    display: none; /* Hidden by default, shown when active */
    flex-wrap: nowrap; /* Keep cards in single horizontal row */
    gap: 20px;
    margin-bottom: 32px;
    overflow-x: auto;
    overflow-y: visible; /* Prevent vertical scrolling */
    padding-top: 8px; /* Extra space for hover elevation (2px transform + border) */
    padding-bottom: 16px;
}

.expense-cards-container.active {
    display: flex;
}

/* Custom Scrollbar - Match green scrollbar from #rechtespalte */
.expense-cards-container::-webkit-scrollbar {
    height: 5px;
    width: 5px;
    background: var(--secondary-color);
}

.expense-cards-container::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

.expense-cards-container::-webkit-scrollbar-thumb {
    background: var(--secondary-light);
    border-radius: 1ex;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75);
}

.expense-cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-light);
}

/* Placeholder States */
.cards-loading,
.cards-placeholder {
    width: 100%;
    text-align: center;
    padding: 80px 40px;
    color: var(--xprofile-card-text-secondary);
}

.cards-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   EXPENSE CARD - Individual Card Styles
   ========================================================================== */

.expense-card {
    background: var(--xprofile-card-surface);
    border: 1.5px solid var(--xprofile-card-border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 320px;
    max-width: 420px; /* Limit maximum card width */
    max-height: 600px; /* Limit maximum card height */
    flex-shrink: 0;
    position: relative;
    font-family: var(--xprofile-card-font-family);
    display: flex;
    flex-direction: column; /* Stack header, body, footer */
}

.expense-card:hover {
    border-color: var(--xprofile-card-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Card Header */
.expense-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--xprofile-card-border);
    padding-right: 120px; /* Space for badge and actions */
}

.expense-card-header-left {
    flex: 1;
    min-width: 0;
}

/* Card Title/Destination */
.expense-destination {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--xprofile-card-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card Description */
.expense-description {
    font-size: 0.95rem;
    color: var(--xprofile-card-text-secondary);
    margin-bottom: 8px;
}

/* Card Amount/Primary Value */
.expense-amount {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--xprofile-card-secondary);
}

/* ==========================================================================
   TYPE BADGE - Color-coded badges for different types
   ========================================================================== */

.expense-type-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.expense-type-badge .material-icons {
    font-size: 14px;
}

/* Badge Color Variants */
.expense-type-badge--type-1 {
    background: rgba(33, 150, 243, 0.1);
    color: var(--xprofile-card-type-1);
}

.expense-type-badge--type-2 {
    background: rgba(156, 39, 176, 0.1);
    color: var(--xprofile-card-type-2);
}

.expense-type-badge--type-3 {
    background: rgba(255, 152, 0, 0.1);
    color: var(--xprofile-card-type-3);
}

.expense-type-badge--type-4 {
    background: rgba(76, 175, 80, 0.1);
    color: var(--xprofile-card-type-4);
}

/* ==========================================================================
   CARD ACTIONS - Menu button and dropdown
   ========================================================================== */

.expense-card-actions {
    /* PHASE 4: Remove absolute positioning for better alignment */
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-shrink: 0; /* Prevent menu button from shrinking */
}

.expense-card-menu-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--xprofile-card-text-secondary);
    font-size: 1.3rem;
    transition: all 0.2s;
    font-family: 'Material Icons';
    /* PHASE 4: Remove any default margins */
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.expense-card-menu-btn:hover {
    background: var(--xprofile-card-background);
    color: var(--xprofile-card-text-primary);
}

.expense-card-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--xprofile-card-surface);
    border: 1.5px solid var(--xprofile-card-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 8px;
    display: none;
    z-index: 100;
    margin-top: 4px;
}

.expense-card-menu.active {
    display: block;
    animation: menuSlideDown 0.2s ease;
}

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

.expense-card-menu button {
    width: 100%;
    padding: 11px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-family: var(--xprofile-card-font-family);
    font-size: 0.95rem;
    color: var(--xprofile-card-text-primary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.expense-card-menu button:hover {
    background: var(--xprofile-card-background);
}

.expense-card-menu button.delete:hover {
    background: #FFE5E5;
    color: #D32F2F;
}

/* ==========================================================================
   PHASE 2: New Card Structure Styles
   ========================================================================== */

/* Card Header (replaces expense-card-header) */
.card-header {
    display: flex;
    justify-content: space-between;
    /* PHASE 4: Align to start for multi-line titles */
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--xprofile-card-border);
}

.card-title {
    display: flex;
    /* PHASE 4: Align to start so icon stays at top when text wraps */
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.card-icon {
    color: var(--xprofile-card-secondary);
    font-size: 24px;
    /* PHASE 4: Ensure icon aligns properly at top */
    line-height: 1;
    flex-shrink: 0;
}

.card-title-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--xprofile-card-primary);
    /* PHASE 4: Allow text wrapping for long titles */
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Card Body - Fields Container with Scrolling */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scroll */
    flex: 1; /* Take available space */
    min-height: 0; /* Fix for flex scrolling */
    padding-right: 4px; /* Space for scrollbar */
}

/* Custom Scrollbar for Card Body */
.card-body::-webkit-scrollbar {
    width: 5px !important;
}

.card-body::-webkit-scrollbar-track {
    background: rgba(245, 245, 245, 0.8) !important; /* Very light gray track */
    background-color: rgba(245, 245, 245, 0.8) !important; /* Very light gray track */
    border-radius: 4px !important;
}

.card-body::-webkit-scrollbar-thumb {
    background: rgba(158, 193, 207, 0.55) !important; /* Pastel blue thumb - darker for better visibility */
    background-color: rgba(158, 193, 207, 0.55) !important; /* Pastel blue thumb */
    border-radius: 4px !important;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: rgba(158, 193, 207, 0.7) !important; /* Even darker on hover */
    background-color: rgba(158, 193, 207, 0.7) !important; /* Even darker on hover */
}

.card-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-field:last-child {
    border-bottom: none;
}

.field-label {
    font-size: 0.85rem;
    color: var(--xprofile-card-text-secondary);
    font-weight: 400;
    flex-shrink: 1; /* Allow label to shrink */
    min-width: 90px; /* Reduced min width */
    max-width: 180px; /* Limit maximum width */
    word-wrap: break-word; /* Break long words */
    overflow-wrap: break-word; /* Modern alternative */
    hyphens: auto; /* Add hyphens for better breaks */
    line-height: 1.3; /* Better line spacing for multi-line */
}

.field-value {
    font-size: 0.95rem;
    color: var(--xprofile-card-text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

/* Numeric Fields */
.card-field-numeric .field-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: var(--xprofile-card-secondary);
    font-weight: 600;
}

.field-icon {
    font-size: 18px;
    color: var(--xprofile-card-secondary);
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--xprofile-card-border);
}

.card-meta {
    font-size: 0.8rem;
    color: var(--xprofile-card-text-secondary);
}

/* ==========================================================================
   CARD DETAILS - 2-Column Grid for Details (Legacy)
   ========================================================================== */

.expense-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.expense-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expense-detail-label {
    font-size: 0.8rem;
    color: var(--xprofile-card-text-secondary);
    font-weight: 400;
}

.expense-detail-value {
    font-size: 0.95rem;
    color: var(--xprofile-card-text-primary);
    font-weight: 500;
}

/* ==========================================================================
   LIST VIEW - Compact Table Style
   ========================================================================== */

.expenses-list {
    display: none;
    max-height: 600px;
    overflow-y: auto;
    border: 1.5px solid var(--xprofile-card-border);
    border-radius: 12px;
    background: var(--xprofile-card-surface);
}

.expenses-list.active {
    display: block;
}

/* Custom Scrollbar for List */
.expenses-list::-webkit-scrollbar {
    width: 10px;
}

.expenses-list::-webkit-scrollbar-track {
    background: var(--xprofile-card-background);
    border-radius: 10px;
}

.expenses-list::-webkit-scrollbar-thumb {
    background: var(--xprofile-card-border);
    border-radius: 10px;
}

.expenses-list::-webkit-scrollbar-thumb:hover {
    background: var(--xprofile-card-text-secondary);
}

/* List Header Row */
.list-header {
    display: grid;
    grid-template-columns: 120px 140px 1fr 140px 120px 120px 50px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--xprofile-card-background);
    border-bottom: 2px solid var(--xprofile-card-border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--xprofile-card-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Compact List Item Row */
.expense-list-item {
    display: grid;
    grid-template-columns: 120px 140px 1fr 140px 120px 120px 50px;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--xprofile-card-border);
    transition: all 0.15s ease;
    cursor: pointer;
    min-height: 52px;
    font-family: var(--xprofile-card-font-family);
}

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

.expense-list-item:hover {
    background: var(--xprofile-card-background);
}

/* List Type Badge - COMPACT */
.list-type-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    white-space: nowrap;
}

.list-type-badge .material-icons {
    font-size: 12px;
}

/* List Badge Color Variants */
.list-type-badge--type-1 {
    background: rgba(33, 150, 243, 0.1);
    color: var(--xprofile-card-type-1);
}

.list-type-badge--type-2 {
    background: rgba(156, 39, 176, 0.1);
    color: var(--xprofile-card-type-2);
}

.list-type-badge--type-3 {
    background: rgba(255, 152, 0, 0.1);
    color: var(--xprofile-card-type-3);
}

.list-type-badge--type-4 {
    background: rgba(76, 175, 80, 0.1);
    color: var(--xprofile-card-type-4);
}

/* List Columns */
.list-destination {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--xprofile-card-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-description {
    font-size: 0.875rem;
    color: var(--xprofile-card-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-date {
    font-size: 0.875rem;
    color: var(--xprofile-card-text-secondary);
    white-space: nowrap;
}

.list-detail-info {
    font-size: 0.875rem;
    color: var(--xprofile-card-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--xprofile-card-secondary);
    text-align: right;
    white-space: nowrap;
}

/* List Actions */
.list-actions {
    position: relative;
    display: flex;
    justify-content: center;
}

.list-menu-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--xprofile-card-text-secondary);
    font-size: 1.2rem;
    transition: all 0.2s;
    font-family: 'Material Icons';
}

.list-menu-btn:hover {
    background: var(--xprofile-card-background);
    color: var(--xprofile-card-text-primary);
}

/* ==========================================================================
   VIEW STATE MANAGEMENT
   ========================================================================== */

.expense-cards-container.hidden,
.expenses-list.hidden {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    /* List on Tablet - slightly adjusted */
    .list-header,
    .expense-list-item {
        grid-template-columns: 100px 120px 1fr 110px 100px 100px 40px;
        gap: 8px;
        font-size: 0.85rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Action Bar Stacking */
    .xprofile-table-action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .view-switch {
        width: 100%;
    }

    .view-switch-btn {
        flex: 1;
        justify-content: center;
    }

    /* Cards on Mobile */
    .expense-card {
        min-width: 280px;
    }

    .expense-card-header {
        padding-right: 0;
    }

    .expense-type-badge {
        position: static;
        margin-bottom: 12px;
        width: fit-content;
    }

    .expense-card-actions {
        position: static;
        margin-top: 12px;
    }

    /* List on Mobile - Stack vertically */
    .list-header {
        display: none; /* Hide header on mobile */
    }

    .expense-list-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 16px;
    }

    .list-amount {
        text-align: left;
        font-size: 1.2rem;
    }

    .list-type-badge {
        width: fit-content;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Focus States */
.view-switch-btn:focus,
.expense-card-menu-btn:focus,
.list-menu-btn:focus {
    outline: 2px solid var(--xprofile-card-primary);
    outline-offset: 2px;
}

.expense-card:focus {
    outline: 2px solid var(--xprofile-card-primary);
    outline-offset: 4px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .expense-card,
    .view-switch-btn,
    .expense-card-menu-btn,
    .list-menu-btn,
    .expense-list-item {
        transition: none;
    }

    .expense-card:hover {
        transform: none;
    }

    .xprofile-btn-new-entry:hover {
        transform: none;
    }

    .expense-card-menu {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .expense-card {
        border-width: 2px;
    }

    .view-switch-btn.active {
        border: 2px solid var(--xprofile-card-primary);
    }
}

/* ==========================================================================
   PHASE 4: FLEXIBLE DISPLAY TYPES - Card Field Configuration
   ========================================================================== */

/* Highlight Display Type - Emphasized field */
.card-field-highlight {
    background: rgba(13, 115, 119, 0.08);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--xprofile-card-secondary);
}

.card-field-highlight .field-label {
    font-weight: 600;
    color: var(--xprofile-card-secondary);
}

.card-field-highlight .field-value {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--xprofile-card-text-primary);
}

/* Subtle Display Type - De-emphasized field */
.card-field-subtle {
    opacity: 0.7;
    border-bottom-color: rgba(0, 0, 0, 0.03);
}

.card-field-subtle .field-label {
    font-size: 0.8rem;
    color: var(--xprofile-card-text-secondary);
}

.card-field-subtle .field-value {
    font-size: 0.875rem;
    color: var(--xprofile-card-text-secondary);
}

/* Primary Display Type - Used in card header, but can appear in body too */
.card-field[data-display-type="primary"] {
    padding: 12px 0;
    border-bottom: 2px solid var(--xprofile-card-border);
}

.card-field[data-display-type="primary"] .field-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--xprofile-card-primary);
}

.card-field[data-display-type="primary"] .field-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--xprofile-card-primary);
}

/* Standard Display Type - Default styling (already covered by .card-field) */
.card-field[data-display-type="standard"] {
    /* Inherits default .card-field styles */
}

/* ==========================================================================
   PHASE 4: FIELD ICONS - Custom icon support per field
   ========================================================================== */

/* Icon positioning within field value */
.field-value .field-icon {
    font-size: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Icon in highlight fields - slightly larger */
.card-field-highlight .field-value .field-icon {
    font-size: 20px;
    color: var(--xprofile-card-secondary);
}

/* Icon in subtle fields - smaller, muted */
.card-field-subtle .field-value .field-icon {
    font-size: 16px;
    opacity: 0.6;
}

/* ==========================================================================
   PHASE 4: TEXT FORMATTING - Bold, Italic, Uppercase
   ========================================================================== */

/* Bold text format */
.field-value strong {
    font-weight: 700;
}

/* Italic text format */
.field-value em {
    font-style: italic;
}

/* Uppercase text format */
.field-value [style*="text-transform: uppercase"] {
    letter-spacing: 0.5px;
}

/* ==========================================================================
   PHASE 4: LABEL VISIBILITY - Hidden labels still accessible
   ========================================================================== */

/* When label is hidden (card_label_visible='0'), field spans full width */
.card-field:has(.field-label:empty),
.card-field:not(:has(.field-label)) {
    justify-content: flex-end;
}

.card-field:has(.field-label:empty) .field-value,
.card-field:not(:has(.field-label)) .field-value {
    text-align: left;
    width: 100%;
}

/* ==========================================================================
   PHASE 4: CHIP DISPLAY TYPE - Material Design Chips
   ========================================================================== */

/* Chip field container */
.card-field-chip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
}

.card-field-chip .field-label {
    font-size: 0.85rem;
    color: var(--xprofile-card-text-secondary);
    font-weight: 500;
}

/* Chips container */
.field-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Material Design Chip */
.mdc-chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    background-color: var(--xprofile-card-background);
    border: 1px solid var(--xprofile-card-border);
    font-family: var(--xprofile-card-font-family);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--xprofile-card-text-primary);
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mdc-chip:hover {
    background-color: rgba(13, 115, 119, 0.08);
    border-color: var(--xprofile-card-secondary);
}

/* Chip ripple effect */
.mdc-chip__ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
}

/* Chip text */
.mdc-chip__text {
    display: inline-block;
    line-height: 1.5;
}

/* Chip icon (leading) */
.mdc-chip__icon--leading {
    margin-right: 4px;
    font-size: 18px;
    color: var(--xprofile-card-secondary);
}

.mdc-chip__icon--leading.material-icons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* ===================================================================
   DIALOG FORM STYLES (fahrtkostentool.html pattern)
   =================================================================== */

/* Dialog Content Grid (2 columns on desktop, 1 on mobile) */
.mdc-dialog__content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
}

@media (min-width: 768px) {
    .mdc-dialog__content {
        grid-template-columns: 1fr 1fr;
        gap: 24px 32px;
    }
}

/* Field Group Container */
.field-group {
    display: flex;
    flex-direction: column;
}

/* Field Label (above input) */
.field-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--xprofile-card-text-primary, #1a1a1a);
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Label Subtext (description) */
.label-subtext {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--xprofile-card-text-secondary, #666);
    margin-top: 4px;
    line-height: 1.4;
}

/* Standard Input Field */
.field-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--xprofile-card-border, #ddd);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--xprofile-card-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    color: var(--xprofile-card-text-primary, #1a1a1a);
    background-color: var(--xprofile-card-background, #fff);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.field-input:focus {
    outline: none;
    border-color: var(--xprofile-card-secondary, #0d7377);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}

.field-input:hover:not(:focus) {
    border-color: var(--xprofile-card-text-secondary, #999);
}

.field-input::placeholder {
    color: var(--xprofile-card-text-secondary, #999);
}

/* Input with Icon Container */
.field-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.field-input-with-icon .field-input {
    padding-right: 48px; /* Space for icon */
}

/* Field Icon (trailing) */
.field-icon {
    position: absolute;
    right: 12px;
    font-size: 20px;
    color: var(--xprofile-card-secondary, #0d7377);
    pointer-events: none;
}

/* Number inputs - align right for currency */
.field-input[type="number"] {
    text-align: right;
}

/* Dialog Content Spacing */
.mdc-dialog__content .field-group:last-child {
    margin-bottom: 0;
}

/* Edit Row Dialog - single column layout (fewer fields) */
#table_edit_row_dialog {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
}

#table_edit_row_dialog > p {
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .field-label {
        font-size: 13px;
    }

    .field-input {
        height: 40px;
        font-size: 13px;
    }

    .label-subtext {
        font-size: 11px;
    }
}
