/* GravityFlow Custom Approval Widget - Modern UI Styles */

/* Main Container */
.gflow-approval-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 100%;
    margin: 0;
    --gflow-primary: #16a34a;
    --gflow-primary-2: #0f766e;
    --gflow-approve-accent: #16a34a;
    --gflow-reject-accent: #ef4444;
    --gflow-bg: #ffffff;
    --gflow-border-color: rgba(229, 231, 235, 0.9);
    --gflow-container-padding: 24px;
    --gflow-header-bg: #ffffff;
    --gflow-header-text: #111827;
    --gflow-header-padding: 20px 24px;
    --gflow-content-padding: 24px;
    --gflow-action-padding: 24px;
    --gflow-table-border: #e5e7eb;
    --gflow-table-header-bg: #ffffff;
    --gflow-table-header-text: #111827;
    --gflow-table-row-bg: #ffffff;
    --gflow-table-row-hover-bg: #f8fafc;
    background: var(--gflow-bg);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    border: none;
    padding: var(--gflow-container-padding);
}

/* Table View - Remove ALL outer padding for clean look */
.gflow-approval-widget.gflow-table-view {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: hidden !important;
}

.gflow-table-view .gflow-content-section {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
}

/* Header Section */
.gflow-header {
    background: var(--gflow-header-bg);
    color: var(--gflow-header-text);
    padding: var(--gflow-header-padding);
    border-bottom: 1px solid var(--gflow-border-color);
}

/* Table Header with Search - Left aligned and clean */
.gflow-table-view .gflow-table-header {
    background: #ffffff !important;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
    text-align: left;
}

.gflow-table-search-container {
    max-width: 400px;
    display: block;
}

/* Company Name Column */
.gflow-th-company,
.gflow-td-company {
    font-weight: 600;
    color: #374151;
}

.gflow-td-company {
    font-size: 14px;
}

/* Desktop: Hide entire Company column (not needed in card layout) */
.gflow-th-company,
.gflow-td-company {
    display: none;
}

.gflow-company-desktop {
    display: none;
}

.gflow-company-mobile {
    display: none;
}

/* Card layout: Show avatar */
.gflow-td-date-wide {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}



/* Desktop: Keep card layout clean */
@media (min-width: 769px) {
    .gflow-entries-table tbody tr.gflow-entry-row {
        display: flex !important;
    }
    
    .gflow-entries-table td {
        display: flex !important;
    }
}

/* Mobile: Show Company column with actual company name from form data */
@media (max-width: 768px) {
    /* Reset card layout for mobile accordion */
    .gflow-entries-table tbody tr.gflow-entry-row {
        display: block;
        cursor: pointer;
    }
    
    .gflow-entries-table td {
        display: block;
    }
    
    .gflow-th-company,
    .gflow-td-company {
        display: table-cell !important;
    }
    
    .gflow-company-desktop {
        display: none !important;
    }
    
    /* Company name visible in accordion header */
    .gflow-td-company .gflow-company-mobile {
        display: block !important;
    }
    
    .gflow-td-company .gflow-company-desktop {
        display: none !important;
    }
    
    .gflow-table-view .gflow-td-company {
        cursor: pointer;
        position: relative;
        padding-right: 40px;
        width: 100% !important;
        display: block !important;
        min-width: 100%;
    }
    
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row {
        width: 100%;
    }
    
    .gflow-table-view .gflow-td-company::after {
        content: '>';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        font-weight: 700;
        color: #6b7280;
        transition: transform 0.3s ease;
        line-height: 1;
    }
    
    .gflow-table-view .gflow-details-row.show + .gflow-entry-row .gflow-td-company::after {
        transform: translateY(-50%) rotate(90deg);
    }
    
    /* Hide date from accordion header area */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:nth-child(2) {
        display: none;
    }
    
    /* Show date below company name in a clean layout */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-company::before {
        content: attr(data-date);
        display: block;
        font-size: 12px;
        color: #6b7280;
        font-weight: 400;
        margin-top: 4px;
        text-transform: none;
        letter-spacing: normal;
    }
}

/* Card-based Layout for Desktop */
.gflow-table-container {
    overflow-x: hidden;
    overflow-y: visible;
    border-radius: 0;
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
    background: transparent !important;
}

.gflow-entries-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent !important;
    font-size: 14px;
    table-layout: fixed;
}

/* Hide table header on desktop */
.gflow-entries-table thead {
    display: none;
}

.gflow-entries-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: #374151;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.gflow-entries-table th:last-child {
    border-right: none;
}

/* Card layout column widths - fixed for alignment */
.gflow-td-date-wide {
    flex: 0 0 56px;
    font-size: 13px;
    color: #6b7280;
    padding: 0;
    margin-right: 12px;
}

/* Avatar column styling */
.gflow-td-date-wide .date-wrapper {
    display: none;
}

.gflow-td-date-wide::before {
    content: attr(data-avatar);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #10b981;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
}

.gflow-td-field {
    flex: 0 0 auto;
    padding: 0;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
}

/* Company name - fixed width (1st field, 3rd column overall) */
.gflow-td-field:nth-child(3) {
    flex: 0 0 180px;
    padding-right: 16px;
}

/* Representative name - fixed width (2nd field, 4th column overall) */
.gflow-td-field:nth-child(4) {
    flex: 0 0 140px;
    padding-right: 12px;
}

/* Address/Location - fixed width (3rd field, 5th column overall) */
.gflow-td-field:nth-child(5) {
    flex: 0 0 120px;
    padding-right: 12px;
}

/* Phone - fixed width (4th field, 6th column overall) */
.gflow-td-field:nth-child(6) {
    flex: 0 0 140px;
    padding-right: 12px;
}

/* Email - fixed width (5th field, 7th column overall) */
.gflow-td-field:nth-child(7) {
    flex: 0 0 160px;
    padding-right: 12px;
}

/* Remove avatar from company field */
.gflow-td-field:nth-child(3) span::before {
    display: none;
}

.gflow-td-field:first-of-type {
    padding-left: 0;
}

/* Field labels for card layout - no boxes */
.gflow-td-field strong {
    display: none;
}

.gflow-td-field span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #111827;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    width: 100%;
    min-width: 0;
}

/* Ensure text truncates properly */
.gflow-td-field span > *:not(::before) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Professional SVG icons before field values */
/* Company field - bold, no icon */
.gflow-td-field:nth-child(3) span {
    font-size: 16px;
    font-weight: 700;
    gap: 0;
}

/* Representative name icon (2nd field) */
.gflow-td-field:nth-child(4) span::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-right: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Address/Location icon (3rd field) */
.gflow-td-field:nth-child(5) span::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-right: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Phone icon (4th field) */
.gflow-td-field:nth-child(6) span::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-right: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Email icon (5th field) */
.gflow-td-field:nth-child(7) span::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-right: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Hide 8th field and beyond (we now show 5 fields) */
.gflow-td-field:nth-child(n+8) {
    display: none;
}

.gflow-td-status {
    flex: 0 0 100px;
    text-align: center;
    font-size: 12px;
    padding: 0;
    margin-right: 12px;
}

/* Status badge in card */
.gflow-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
    white-space: nowrap;
}

.gflow-td-actions {
    flex: 0 0 240px;
    margin-left: auto;
    padding: 0;
    flex-shrink: 0;
}

/* Card layout for desktop */
.gflow-entries-table tbody tr.gflow-entry-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 18px 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    gap: 0;
}

.gflow-entries-table tbody tr.gflow-entry-row:hover {
    background: #f3f4f6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    border-color: #d1d5db;
}

.gflow-entries-table td {
    padding: 0;
    border: none !important;
    vertical-align: middle;
    color: #374151;
    background: transparent !important;
    display: flex;
    align-items: center;
    min-width: 0;
}

.gflow-entries-table td:last-child {
    border-right: none;
}

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

/* Remove bottom line from table container - Higher specificity */
.gflow-approval-widget .gflow-table-container {
    border: none !important;
    border-bottom: none !important;
    overflow: hidden !important;
}

/* Remove bottom border from table itself */
.gflow-entries-table {
    border-bottom: none !important;
}

/* Ensure no bottom border in table view - Higher specificity */
.gflow-approval-widget.gflow-table-view .gflow-table-container {
    border: none !important;
    border-bottom: none !important;
}

.gflow-approval-widget.gflow-table-view .gflow-entries-table {
    border-bottom: none !important;
}

/* Additional rule to override any Elementor dynamic styles */
.elementor-widget-wrap .gflow-table-container {
    border: none !important;
}

/* Ultra-high specificity rules to override any theme or framework styles */
body .gflow-approval-widget .gflow-table-container,
html body .gflow-approval-widget .gflow-table-container,
.elementor-section .gflow-approval-widget .gflow-table-container,
.elementor-container .gflow-approval-widget .gflow-table-container,
.elementor-widget-container .gflow-approval-widget .gflow-table-container {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Also remove borders from the table itself */
body .gflow-approval-widget .gflow-entries-table,
html body .gflow-approval-widget .gflow-entries-table,
.elementor-section .gflow-approval-widget .gflow-entries-table,
.elementor-container .gflow-approval-widget .gflow-entries-table,
.elementor-widget-container .gflow-approval-widget .gflow-entries-table {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
}

/* Maximum specificity rule - this should override everything */
html body.elementor-page .elementor-section .elementor-container .elementor-row .elementor-column .elementor-widget-wrap .elementor-widget.elementor-widget-gravityflow-approval-widget .gflow-approval-widget.gflow-table-view .gflow-content-section .gflow-table-container {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Also remove borders from content section and any parent containers */
.gflow-content-section {
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    overflow: hidden !important;
}

.gflow-approval-widget.gflow-table-view .gflow-content-section {
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    overflow: hidden !important;
}

/* Remove any borders from all table-related elements */
.gflow-table-container *,
.gflow-entries-table *,
.gflow-table-container::before,
.gflow-table-container::after,
.gflow-entries-table::before,
.gflow-entries-table::after {
    border: none !important;
    outline: none !important;
    background: transparent !important;
}

/* No borders on table cells for card layout */
.gflow-entries-table td,
.gflow-entries-table th {
    border: none !important;
    background: transparent !important;
}

.gflow-entries-table th:last-child,
.gflow-entries-table td:last-child {
    border: none !important;
}


.gflow-table-search {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background-color: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gflow-table-search:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.gflow-table-search::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Header Top Section with Company Name and Search */
.gflow-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 20px;
}

.gflow-company-name {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.gflow-search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.gflow-search-field {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background-color: #f9fafb;
    font-size: 16px;
    transition: all 0.2s ease;
    outline: none;
}

.gflow-search-field:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.gflow-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 16px;
}

/* Mobile Responsive Header */
@media (max-width: 768px) {
    .gflow-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .gflow-company-name {
        text-align: center;
        font-size: 20px;
    }
    
    .gflow-search-container {
        max-width: none;
    }
    
    /* Table View Mobile - Search field full width */
    .gflow-table-search-container {
        max-width: none;
        width: 100%;
    }
    
    }

.gflow-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.gflow-form-title {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    letter-spacing: -0.4px;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.gflow-entry-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.gflow-header .gflow-entry-meta {
    justify-content: flex-start;
    margin-top: 0;
}

.gflow-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.gflow-meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Entry Details Card */
.gflow-entry-details {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
}

.gflow-content-section {
    padding: var(--gflow-content-padding);
}

/* Status Text - Simple text connected to row style */
.gflow-td-status {
    /* Inherit all table cell styling */
    font-weight: inherit;
    color: inherit;
    text-transform: none;
    letter-spacing: normal;
    font-size: inherit;
    vertical-align: middle;
}


/* Fields Grid */
.gflow-fields {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.gflow-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    margin-bottom: 0;
}

.gflow-field:hover {
    border-color: rgba(203, 213, 225, 1);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.gflow-field-label {
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin: 0;
    min-width: auto;
}

.gflow-field-value {
    color: #1f2937;
    font-size: 16px;
    line-height: 1.7;
    word-break: break-word;
}

.gflow-custom-info {
    display: grid;
    gap: 16px;
    margin: 16px 0 0 0;
}

.gflow-custom-info-item {
    padding: 18px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
}

.gflow-custom-info-label {
    font-weight: 700;
    color: #065f46;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin-bottom: 8px;
}

.gflow-custom-info-value {
    color: #111827;
    font-size: 15px;
    line-height: 1.7;
}

/* Action Section */
.gflow-action-section {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    padding: var(--gflow-action-padding);
    border-top: 1px solid var(--gflow-border-color);
}

.gflow-note-field {
    margin-bottom: 24px;
}

.gflow-note-field label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.gflow-note {
    width: 100%;
    padding: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
}

.gflow-note:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.gflow-note::placeholder {
    color: #9ca3af;
}

/* Approval Buttons */
.gflow-approval-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.gflow-approval-buttons.gflow-buttons-stacked {
    flex-direction: column;
}

.gflow-approval-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 56px;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gflow-approval-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.gflow-approval-btn:hover::before {
    left: 100%;
}

.gflow-approval-btn i {
    font-size: 18px;
}

.gflow-approve-btn {
    background-color: var(--gflow-approve-accent);
    color: white;
    border-color: var(--gflow-approve-accent);
}

.gflow-reject-btn {
    background-color: var(--gflow-reject-accent);
    color: white;
    border-color: var(--gflow-reject-accent);
}

.gflow-approve-btn:hover {
    background: rgba(22, 163, 74, 0.22);
    background: color-mix(in srgb, var(--gflow-approve-accent) 22%, white);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 20px 48px rgba(22, 163, 74, 0.15);
}


.gflow-reject-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    background: color-mix(in srgb, var(--gflow-reject-accent) 18%, white);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 20px 48px rgba(239, 68, 68, 0.12);
}

.gflow-approval-btn:active {
    transform: translateY(0);
}

.gflow-approval-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gflow-approval-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

/* Loading State */
.gflow-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    margin-top: 20px;
    color: #6b7280;
    font-weight: 500;
}

.gflow-loading i {
    margin-right: 12px;
    font-size: 20px;
    animation: spin 1s linear infinite;
}

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

/* Message Display */
.gflow-message {
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.gflow-message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #10b981;
}

.gflow-message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
}

.gflow-message i {
    font-size: 20px;
}

/* Status Message */
.gflow-status-message {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 20px;
    font-size: 16px;
}

.gflow-status-message i {
    font-size: 20px;
}

/* Debug Information */
.gflow-debug {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.gflow-debug strong {
    color: #374151;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.gflow-available-entries {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #3b82f6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.gflow-available-entries ul {
    margin: 12px 0;
    padding-left: 20px;
}

.gflow-available-entries li {
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

.gflow-available-entries code {
    background: #1f2937;
    color: #f9fafb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Icons */
.gflow-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.gflow-icon-calendar {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>');
}

.gflow-icon-user {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>');
}

/* Responsive Design */
@media (max-width: 768px) {
    .gflow-approval-widget {
        margin: 0;
        border-radius: 0;
        border: none !important;
    }
    
    .gflow-header {
        padding: 32px 24px;
    }
    
    .gflow-form-title {
        font-size: 28px;
    }
    
    .gflow-entry-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .gflow-content-section,
    .gflow-action-section {
        padding: var(--gflow-content-padding);
    }
    
    .gflow-field {
        padding: 16px;
    }
    
    .gflow-approval-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .gflow-approval-btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Table -> Mobile accordion/cards */
    .gflow-table-view .gflow-table-container {
        overflow-x: visible;
    }
    
    .gflow-table-view .gflow-entries-table thead {
        display: none;
    }

    .gflow-table-view .gflow-entries-table,
    .gflow-table-view .gflow-entries-table tbody,
    .gflow-table-view .gflow-entries-table tr,
    .gflow-table-view .gflow-entries-table td {
        display: block;
        width: 100%;
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row {
        border: 1px solid var(--gflow-table-border);
        border-radius: 12px;
        background: var(--gflow-table-row-bg);
        margin: 12px 0;
        overflow: hidden;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row:hover {
        background: var(--gflow-table-row-hover-bg);
    }

    /* Compact summary layout: Company/Date/Status visible in collapsed card */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td {
        border: none;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Mobile accordion header - company name column */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:first-child {
        display: flex !important;
        padding: 16px 20px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        font-size: 16px;
        font-weight: 700;
        color: #111827;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        position: relative;
        width: 100%;
    }
    
    /* Position avatar before company name */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-date-wide {
        order: -1;
        margin-right: 12px;
    }
    
    /* Show company name in mobile header */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:first-child .gflow-company-mobile {
        display: block !important;
        flex: 1;
    }

    /* Accordion arrow - chevron down/up on company column */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:first-child::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 8px solid #111827;
        transition: transform 0.3s ease;
    }

    .gflow-table-view .gflow-entry-row.expanded td:first-child::after {
        transform: translateY(-50%) rotate(180deg);
    }

    /* Date and status as secondary info */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:nth-child(2),
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-status {
        padding: 10px 14px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: #ffffff;
        font-size: 14px;
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:first-child::before {
        content: none;
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:nth-child(2)::before,
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-status::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6b7280;
        font-size: 11px;
        letter-spacing: 0.4px;
        text-transform: uppercase;
    }

    .gflow-table-view .gflow-entries-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6b7280;
        font-size: 11px;
        letter-spacing: 0.4px;
        text-transform: uppercase;
    }
    
    /* Override for avatar column - show avatar letter, not data-label */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-date-wide::before {
        content: attr(data-avatar) !important;
        font-weight: 700 !important;
        font-size: 18px !important;
        letter-spacing: 0 !important;
        text-transform: uppercase !important;
        color: white !important;
    }

    .gflow-table-view .gflow-entries-table td + td {
        border-left: none;
        border-top: 1px solid color-mix(in srgb, var(--gflow-table-border) 45%, white);
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-company {
        background: color-mix(in srgb, var(--gflow-table-header-bg) 70%, white);
    }

    /* Show avatar in mobile accordion header - same as desktop */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-date-wide {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        flex: 0 0 auto;
        width: auto;
    }
    
    /* Hide date wrapper and data-label on mobile, only show avatar */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-date-wide .date-wrapper {
        display: none !important;
    }
    
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-date-wide::before {
        content: attr(data-avatar) !important;
    }
    
    /* Remove data-label from avatar column on mobile */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-date-wide[data-label]::before {
        content: attr(data-avatar) !important;
    }
    
    /* Avatar styling on mobile - same as desktop */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-date-wide::before {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #10b981;
        border-radius: 50%;
        color: white;
        font-weight: 700;
        font-size: 18px;
        text-transform: uppercase;
    }
    
    /* Hide all other columns except avatar (2nd) and company (1st) on mobile */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td:not(:first-child):not(.gflow-td-date-wide) {
        display: none !important;
    }

    /* Show Approve/Disapprove on the front (collapsed card) */
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-actions {
        display: block;
        padding: 12px 14px;
        background: var(--gflow-table-row-bg);
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-actions::before {
        content: none;
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-actions .gflow-pdf-actions,
    .gflow-details-actions {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
        align-items: center;
    }

    .gflow-pdf-actions .gflow-approval-btn,
    .gflow-details-actions .gflow-table-btn {
        margin: 0;
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-actions .gflow-view-btn {
        display: none;
    }

    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-actions .gflow-approve-btn,
    .gflow-table-view .gflow-entries-table tr.gflow-entry-row td.gflow-td-actions .gflow-reject-btn {
        flex: 1 1 46%;
        justify-content: center;
    }

    .gflow-table-view .gflow-td-id strong {
        font-weight: 700;
    }

    .gflow-table-view .gflow-td-date small {
        display: inline;
    }

}

@media (max-width: 480px) {
    .gflow-approval-widget {
        margin: 0;
        border: none !important;
    }
    
    .gflow-header {
        padding: 24px 16px;
    }
    
    .gflow-content-section,
    .gflow-action-section {
        padding: var(--gflow-content-padding);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .gflow-approval-widget {
        background: #1f2937;
        border: none !important;
    }
    
    .gflow-content-section {
        background: #1f2937;
    }
    
    .gflow-action-section {
        background: #111827;
        border-color: #374151;
    }
    
    .gflow-field {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .gflow-field:hover {
        background: #4b5563;
        border-color: #6b7280;
    }
    
    .gflow-field-label {
        color: #d1d5db;
    }
    
    .gflow-field-value {
        color: #f3f4f6;
    }
    
    .gflow-note {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .gflow-note:focus {
        border-color: #3b82f6;
    }
}

.gflow-th-actions {
    width: 140px;
    text-align: center;
}

.gflow-entries-table tbody tr {
    background: transparent !important;
    border-bottom: none;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.gflow-entries-table tbody tr:hover {
    background: transparent !important;
}

.gflow-entry-row:hover {
    background: #ffffff !important;
}

.gflow-entry-row.approved {
    background: #f0fdf4 !important;
}

.gflow-entry-row.rejected {
    background: #fef2f2 !important;
}

.gflow-entries-table td {
    padding: 0;
    vertical-align: middle;
    border: none !important;
    color: #374151;
    background: transparent !important;
}

.gflow-entries-table td + td,
.gflow-entries-table th + th {
    border-left: none !important;
}

.gflow-td-id a,
.gflow-td-id a:visited {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.gflow-td-id a:hover {
    text-decoration: underline;
}

.gflow-td-id {
    text-align: center;
    font-weight: 600;
    color: #374151;
}

.gflow-td-date {
    color: #6b7280;
    font-size: 13px;
}

.gflow-td-date small {
    color: #9ca3af;
}

.gflow-td-field {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gflow-td-status {
    text-align: center;
}

.gflow-td-actions {
    text-align: center;
}

/* Table Action Buttons */
.gflow-table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.gflow-table-btn {
    width: auto;
    height: auto;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px !important;
    font-size: 15px !important;
    font-weight: 700;
    line-height: 1 !important;
    white-space: nowrap;
    min-width: 100px;
    text-transform: none;
    letter-spacing: 0;
}

.gflow-table-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gflow-table-btn:active {
    transform: translateY(0);
}

.gflow-table-btn.gflow-approve-btn {
    background: #10b981 !important;
    color: #ffffff !important;
    border: none !important;
}

.gflow-table-btn.gflow-approve-btn:hover {
    background: #0ea472 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.gflow-table-btn.gflow-reject-btn {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
}

.gflow-table-btn.gflow-reject-btn:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}


.gflow-table-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Expandable Details Row */
.gflow-details-row {
    background: #f9fafb !important;
    width: 100%;
}

.gflow-details-row td {
    width: 100% !important;
    display: block !important;
    padding: 0 !important;
}

.gflow-entry-details-expanded {
    padding: 24px;
    border-top: 2px solid #e5e7eb;
    width: 100%;
}

.gflow-details-actions,
.gflow-pdf-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    margin-top: 20px;
}

.gflow-details-actions .gflow-table-btn,
.gflow-pdf-actions .gflow-approval-btn {
    margin: 0;
}

/* Company Name in Accordion Header */
.gflow-accordion-company-header {
    background: #ffffff;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
}

.gflow-accordion-company-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

/* View Button Styles */
.gflow-table-btn.gflow-view-btn {
    background: #ffffff;
    color: #111827;
    border-color: rgba(0, 0, 0, 0.10);
}

.gflow-table-btn.gflow-view-btn:hover {
    background: #f3f4f6;
}


.gflow-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.gflow-field-item {
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    width: 100%;
}

.gflow-field-item strong {
    color: #6b7280;
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.gflow-field-item span {
    color: #1f2937;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.gflow-note-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

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

.gflow-table-note {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.gflow-table-note:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* No Entries State */
.gflow-no-entries {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.gflow-no-entries p {
    font-size: 16px;
    margin: 0;
}


/* Loading States for Table */
.gflow-entry-row.processing {
    opacity: 0.6;
    pointer-events: none;
}

.gflow-entry-row.processing .gflow-table-btn {
    opacity: 0.5;
}

/* Responsive field hiding to prevent overflow */
@media (max-width: 1400px) {
    .gflow-td-field:nth-child(n+5) {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .gflow-td-field:nth-child(n+4) {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .gflow-td-field:nth-child(n+3) {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .gflow-entries-table {
        font-size: 12px;
    }
    
    .gflow-entries-table th,
    .gflow-entries-table td {
        padding: 8px 6px;
    }
    
    .gflow-th-field:nth-child(n+4) {
        display: none;
    }
    
    .gflow-td-field:nth-child(n+4) {
        display: none;
    }
    
    .gflow-table-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .gflow-table-actions {
        gap: 2px;
    }
    
    }

@media (max-width: 480px) {
    .gflow-table-container {
        border-radius: 12px;
    }
    
    .gflow-entries-table th,
    .gflow-entries-table td {
        padding: 6px 4px;
    }
    
    .gflow-table-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    }

/* Print styles */
@media print {
    .gflow-approval-buttons,
    .gflow-loading,
    .gflow-message,
    .gflow-debug,
    .gflow-available-entries,
    .gflow-table-actions {
        display: none !important;
    }
    
    .gflow-approval-widget {
        box-shadow: none;
        border: none !important;
    }
    
    .gflow-header {
        background: #f5f5f5 !important;
        color: #000 !important;
    }
    
    .gflow-entries-table {
        border: 1px solid #000;
    }
    
    .gflow-entries-table th,
    .gflow-entries-table td {
        border: 1px solid #000;
        padding: 8px;
    }
    
    .gflow-approve-btn,
    .gflow-reject-btn {
        display: none;
    }
}


/* End of CSS file */
