/* Tailwind Architecture Style Guide CSS
 * This file contains all CSS for the Tailwind component library
 * Used in /style-guide/ and can be imported in base layouts
 */

/* TABLE OF CONTENTS:
 * 1. Page Header Components
 * 2. Filter Bar Components
 * 3. Modal Components
 * 4. Form Components
 * 5. Table Components
 * 6. Button Components
 * 7. Manager Page Components (from manager.html)
 * 8. Base Layout Styles (from base_standardized.html)
 * 9. Dashboard Components (dashboard-rebooted)
 * 10. Tab Navigation Components (For Update Pages)
 * 11. Appointment Update Page Components
 * 12. Foreign Key CRUD Components (from invoice_create_fullpage.html)
 * 13. Print Preview Components (from invoices/print.html)
 * 14. Auth Pages (Login, Register, Password Reset, Landing)
 * 15. Admin Panel Components
 * 16. Footer Components
 */


/* === PAGE HEADER COMPONENTS === */

/* Standard Page Header */
.tw-page-header {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #2563eb, #1e40af);
    color: white;
    position: relative;
    overflow: hidden;
}

.tw-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to right, #2563eb, #1d4ed8, #1e40af);
    opacity: 0.9;
}

.tw-page-header-content {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.tw-page-header-text {
    flex: 1;
    min-width: 0;
}

.tw-page-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Single column layout on mobile */
@media (max-width: 768px) {
    .tw-page-header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tw-page-header-actions {
        align-items: center;
        margin-top: 0.5rem;
    }
}

.tw-page-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.25;
    margin-top: 0;
}

.tw-page-subtitle {
    font-size: 1.125rem;
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.625;
    margin-bottom: 0;
}

/* Header Color Variants */
.tw-page-header-primary {
    background: linear-gradient(to right, #667eea, #764ba2);
}

.tw-page-header-primary::before {
    background: linear-gradient(to right, #667eea, #7c3aed, #764ba2);
}

.tw-page-header-success {
    background: linear-gradient(to right, #059669, #047857);
}

.tw-page-header-success::before {
    background: linear-gradient(to right, #059669, #0d9488, #047857);
}

.tw-page-header-warning {
    background: linear-gradient(to right, #d97706, #b45309);
}

.tw-page-header-warning::before {
    background: linear-gradient(to right, #d97706, #ca8a04, #b45309);
}

.tw-page-header-danger {
    background: linear-gradient(to right, #dc2626, #b91c1c);
}

.tw-page-header-danger::before {
    background: linear-gradient(to right, #dc2626, #e11d48, #b91c1c);
}

.tw-page-header-info {
    background: linear-gradient(to right, #0891b2, #0e7490);
}

.tw-page-header-info::before {
    background: linear-gradient(to right, #0891b2, #0284c7, #0e7490);
}

.tw-page-header-secondary {
    background: linear-gradient(to right, #4b5563, #374151);
}

.tw-page-header-secondary::before {
    background: linear-gradient(to right, #4b5563, #6b7280, #374151);
}

.tw-page-header-dark {
    background: linear-gradient(to right, #1f2937, #111827);
}

.tw-page-header-dark::before {
    background: linear-gradient(to right, #1f2937, #374151, #111827);
}

/* Page Header with Info Section (Connected Design) */
.tw-page-header-with-info {
    border-radius: 0.5rem 0.5rem 0 0; /* Only top corners rounded */
    padding-bottom: 1.5rem; /* Keep padding for header content */
}

.tw-page-header-info {
    position: relative;
    z-index: 10;
    background-color: #f8f9fa;
    color: #212529; /* Dark text for info section */
    padding: 1.5rem;
    margin: 1.5rem -1.5rem -1.5rem -1.5rem; /* Negative margins to extend to edges */
    border-radius: 0 0 0.5rem 0.5rem; /* Only bottom corners rounded */
}

/* Responsive adjustments for page headers */
@media (max-width: 768px) {
    .tw-page-header {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }
    .tw-page-title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    .tw-page-subtitle {
        font-size: 0.813rem;
        line-height: 1.4;
    }
}

/* === Generic Unified Header Wrapper === */
/* Two-tier header: dark gradient top + white action bar bottom, shared shadow */
.tw-unified-header {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    overflow: visible;
}

/* Header inside unified container - top corners only */
.tw-unified-header .tw-page-header {
    border-radius: 0.5rem 0.5rem 0 0;
    margin-bottom: 0;
    box-shadow: none;
}

/* If header is the last child (no action bar), restore full radius */
.tw-unified-header .tw-page-header:last-child {
    border-radius: 0.5rem;
}

/* Generic Action Bar - white bar below header */
.tw-unified-action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0 0 0.5rem 0.5rem;
}

.tw-unified-action-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-unified-action-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

@media (max-width: 768px) {
    .tw-unified-action-bar {
        padding: 0.625rem 1rem;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Dashboard-specific unified header (backward compat) */
.tw-dashboard-header-unified {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    overflow: visible;
}

.tw-dashboard-header-unified .tw-page-header {
    border-radius: 0.5rem 0.5rem 0 0;
    margin-bottom: 0;
    box-shadow: none;
}

.tw-dashboard-header-unified .tw-dashboard-quick-action-bar {
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: none;
    margin-bottom: 0;
    overflow: visible;
}

/* === BASE COMPONENTS === */

/* Typography */
.tw-text-xs { font-size: 0.75rem; line-height: 1rem; }
.tw-text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.tw-text-base { font-size: 1rem; line-height: 1.5rem; }
.tw-text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.tw-text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.tw-text-2xl { font-size: 1.5rem; line-height: 2rem; }
.tw-text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.tw-text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.tw-font-light { font-weight: 300; }
.tw-font-normal { font-weight: 400; }
.tw-font-medium { font-weight: 500; }
.tw-font-semibold { font-weight: 600; }
.tw-font-bold { font-weight: 700; }

.tw-text-gray-500 { color: #6b7280; }
.tw-text-gray-700 { color: #374151; }
.tw-text-gray-900 { color: #111827; }
.tw-text-primary { color: #2563eb; }
.tw-text-secondary { color: #4b5563; }
.tw-text-success { color: #059669; }
.tw-text-danger { color: #dc2626; }
.tw-text-warning { color: #d97706; }
.tw-text-info { color: #0891b2; }

/* Links - Global override for Tailwind's aggressive reset */
a {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

a:active {
    color: #004085;
}

/* Specific contexts where links should not be styled */
.nav-link a,
.navbar a,
.btn a,
button a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.tw-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.tw-flex { display: flex; }
.tw-flex-wrap { flex-wrap: wrap; }
.tw-flex-col { flex-direction: column; }
.tw-items-center { align-items: center; }
.tw-justify-center { justify-content: center; }
.tw-justify-between { justify-content: space-between; }
.tw-gap-2 { gap: 0.5rem; }
.tw-gap-4 { gap: 1rem; }
.tw-gap-6 { gap: 1.5rem; }

/* Overflow Utilities */
.tw-overflow-visible { overflow: visible !important; }
.tw-overflow-hidden { overflow: hidden !important; }

.tw-grid { display: grid; }
.tw-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tw-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:tw-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Spacing */
.tw-m-0 { margin: 0; }
.tw-m-1 { margin: 0.25rem; }
.tw-m-2 { margin: 0.5rem; }
.tw-m-3 { margin: 0.75rem; }
.tw-m-4 { margin: 1rem; }
.tw-mb-0 { margin-bottom: 0; }
.tw-mb-2 { margin-bottom: 0.5rem; }
.tw-mb-3 { margin-bottom: 0.75rem; }
.tw-mb-4 { margin-bottom: 1rem; overflow: visible; }
.tw-mb-6 { margin-bottom: 1.5rem; }
.tw-mt-2 { margin-top: 0.5rem; }
.tw-mt-4 { margin-top: 1rem; }
.tw-mt-6 { margin-top: 1.5rem; }
.tw-ml-2 { margin-left: 0.5rem; }
.tw-mr-2 { margin-right: 0.5rem; }
.tw-mx-auto { margin-left: auto; margin-right: auto; }

.tw-p-2 { padding: 0.5rem; }
.tw-p-3 { padding: 0.75rem; }
.tw-p-4 { padding: 1rem; }
.tw-p-6 { padding: 1.5rem; }
.tw-px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.tw-px-4 { padding-left: 1rem; padding-right: 1rem; }
.tw-px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.tw-py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.tw-py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.tw-py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Background Colors for Use Cases */
.tw-bg-blue-50 { background-color: #eff6ff; }
.tw-bg-green-50 { background-color: #f0fdf4; }
.tw-bg-yellow-50 { background-color: #fefce8; }
.tw-bg-red-50 { background-color: #fef2f2; }
.tw-bg-cyan-50 { background-color: #ecfeff; }
.tw-bg-gray-50 { background-color: #f9fafb; }

/* Border Colors for Use Cases */
.tw-border-l-4 { border-left-width: 4px; }
.tw-border-blue-400 { border-color: #60a5fa; }
.tw-border-green-400 { border-color: #4ade80; }
.tw-border-yellow-400 { border-color: #facc15; }
.tw-border-red-400 { border-color: #f87171; }
.tw-border-cyan-400 { border-color: #22d3ee; }
.tw-border-gray-400 { border-color: #9ca3af; }

/* Text Colors for Use Cases */
.tw-text-blue-800 { color: #1e40af; }
.tw-text-green-800 { color: #166534; }
.tw-text-yellow-800 { color: #92400e; }
.tw-text-red-800 { color: #991b1b; }
.tw-text-cyan-800 { color: #155e75; }
.tw-text-gray-800 { color: #1f2937; }

/* Space utilities */
.tw-space-y-1 > * + * { margin-top: 0.25rem; }
.tw-space-y-2 > * + * { margin-top: 0.5rem; }
.tw-space-y-4 > * + * { margin-top: 1rem; }
.tw-space-y-6 > * + * { margin-top: 1.5rem; }

/* === PAGINATION COMPONENTS === */

/* Pagination Container */
.tw-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e5e7eb;
    background-color: white;
    padding: 0.75rem 1rem;
}

@media (min-width: 640px) {
    .tw-pagination {
        padding: 0.75rem 1.5rem;
    }
}

/* Mobile Pagination (Previous/Next only) */
.tw-pagination-mobile {
    display: flex;
    flex: 1;
    justify-content: space-between;
}

@media (min-width: 640px) {
    .tw-pagination-mobile {
        display: none;
    }
}

/* Desktop Pagination */
.tw-pagination-desktop {
    display: none;
}

@media (min-width: 640px) {
    .tw-pagination-desktop {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: space-between;
    }
}

/* Pagination Info Text */
.tw-pagination-info {
    font-size: 0.875rem;
    color: #374151;
}

.tw-pagination-info .tw-font-medium {
    font-weight: 500;
}

/* Pagination Navigation */
.tw-pagination-nav {
    isolation: isolate;
    display: inline-flex;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Pagination Link Base */
.tw-pagination-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    border: 1px solid #d1d5db;
    background-color: white;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    margin-left: -1px;
}

.tw-pagination-link:hover {
    background-color: #f9fafb;
    text-decoration: none;
    color: #111827;
}

.tw-pagination-link:focus {
    z-index: 20;
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Mobile Pagination Links */
.tw-pagination-mobile .tw-pagination-link {
    border-radius: 0.375rem;
    margin-left: 0;
    padding: 0.5rem 1rem;
}

.tw-pagination-mobile .tw-pagination-link:last-child {
    margin-left: 0.75rem;
}

/* Navigation Arrow Links */
.tw-pagination-arrow {
    padding: 0.5rem;
    color: #6b7280;
}

.tw-pagination-arrow svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* First/Last Navigation Links */
.tw-pagination-nav .tw-pagination-link:first-child,
.tw-pagination-nav .tw-pagination-arrow:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    margin-left: 0;
}

.tw-pagination-nav .tw-pagination-link:last-child,
.tw-pagination-nav .tw-pagination-arrow:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Current Page Link */
.tw-pagination-link.active {
    z-index: 10;
    background-color: #2563eb;
    color: white;
}

.tw-pagination-link.active:hover {
    background-color: #1d4ed8;
    color: white;
}

.tw-pagination-link.active:focus {
    outline-color: #2563eb;
}

/* Disabled Pagination Links */
.tw-pagination-disabled {
    color: #9ca3af !important;
    background-color: #f9fafb !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.tw-pagination-disabled:hover {
    color: #9ca3af !important;
    background-color: #f9fafb !important;
    border-color: #e5e7eb !important;
}

/* Pagination Ellipsis */
.tw-pagination-ellipsis {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    border: 1px solid #d1d5db;
    background-color: white;
    margin-left: -1px;
}

/* Hidden on Mobile */
.tw-pagination-hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .tw-pagination-hidden-mobile {
        display: inline-flex;
    }
}

/* Screen Reader Only */
.tw-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Compact Pagination Variant */
.tw-pagination-compact {
    padding: 0.5rem 1rem;
}

.tw-pagination-compact .tw-pagination-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.tw-pagination-compact .tw-pagination-arrow {
    padding: 0.375rem;
}

/* Large Pagination Variant */
.tw-pagination-large {
    padding: 1rem 1.5rem;
}

.tw-pagination-large .tw-pagination-link {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
}

.tw-pagination-large .tw-pagination-arrow {
    padding: 0.75rem;
}

/* === STICKY TABLE OF CONTENTS === */

/* Fixed Table of Contents */
.tw-toc-sidebar {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 280px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1500; /* Tooltips/Dropdowns layer */
    padding: 1.5rem;
}

.tw-toc-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1400; /* UI controls layer */
    transition: all 0.2s ease-in-out;
}

.tw-toc-toggle:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.tw-toc-toggle i {
    font-size: 1.25rem;
}

/* TOC Header */
.tw-toc-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.tw-toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* TOC Content */
.tw-toc-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tw-toc-section h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.tw-toc-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tw-toc-links li {
    margin: 0;
}

.tw-toc-links a {
    display: block;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.tw-toc-links a:hover {
    color: #2563eb;
    background-color: #f3f4f6;
    text-decoration: none;
    padding-left: 0.5rem;
}

.tw-toc-links a.active {
    color: #2563eb;
    font-weight: 500;
    background-color: #eff6ff;
    padding-left: 0.5rem;
}

/* Hide TOC when closed */
.tw-toc-sidebar.hidden {
    display: none;
}

/* Responsive behavior */
@media (max-width: 1200px) {
    .tw-toc-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        border-right: none;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .tw-toc-sidebar.show {
        transform: translateX(0);
    }
    
    .tw-toc-sidebar.hidden {
        display: block;
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .tw-toc-sidebar {
        width: 100%;
    }
    
    .tw-toc-toggle {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* Close button for mobile */
.tw-toc-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.5rem;
}

@media (max-width: 1200px) {
    .tw-toc-close {
        display: block;
    }
}

/* === SEARCH BAR COMPONENTS === */

/* Search Bar Container */
.tw-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 400px;
    width: 100%;
}

/* Search Input */
.tw-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    color: #374151;
    transition: all 0.2s ease-in-out;
}

.tw-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tw-search-input::placeholder {
    color: #9ca3af;
}

/* Search Icon */
.tw-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1rem;
    pointer-events: none;
}

/* Search Clear Button */
.tw-search-clear {
    flex-shrink: 0;
    padding: 0 1rem;
    background-color: #ef4444;
    color: white;
    border: 1px solid #ef4444;
    border-left: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tw-search-clear:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

.tw-search-clear:focus {
    outline: none;
    background-color: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Adjust search input when clear button is present */
.tw-search-bar:has(.tw-search-clear) .tw-search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

/* Search clear button connects to clear-filters button */
.tw-search-bar:has(.tw-clear-filters-button) .tw-search-clear {
    border-right: none;
}

/* Adjust search input when followed by clear-filters button (no search-clear) */
.tw-search-bar:has(.tw-clear-filters-button):not(:has(.tw-search-clear)) .tw-search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

/* Search Bar Variants */
.tw-search-bar-compact {
    max-width: 300px;
}

.tw-search-bar-expanded {
    max-width: 600px;
}

.tw-search-bar-full {
    max-width: none;
}

/* Search Bar with Button */
.tw-search-with-button {
    display: flex;
    max-width: 500px;
    width: 100%;
}

.tw-search-with-button .tw-search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

/* Search input inside filter bar with clear button */
.tw-filter-bar .tw-search-bar .tw-search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.tw-search-with-button .tw-search-button,
.tw-search-button {
    padding: 0.80rem 1rem;
    background-color: #1f2937;
    color: white;
    border: 1px solid #1f2937;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}

.tw-search-with-button .tw-search-button:hover,
.tw-search-button:hover {
    background-color: #111827;
    border-color: #111827;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tw-search-with-button .tw-search-button:focus,
.tw-search-button:focus {
    outline: none;
    background-color: #111827;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.1);
}

/* Search Button Active/Ready State */
.tw-search-button.ready {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.tw-search-button.ready:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
}

/* Clear All Filters Button */
.tw-clear-filters-button {
    padding: 0.80rem 1rem;
    background-color: #1f2937;
    color: white;
    border: 1px solid #1f2937;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Clear All Filters Button inside search bar - connected styling */
.tw-search-bar .tw-clear-filters-button {
    margin-left: 0;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.tw-clear-filters-button:hover {
    background-color: #111827;
    border-color: #111827;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.tw-clear-filters-button:focus {
    outline: none;
    background-color: #111827;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.1);
}

/* Clear Filters Button Active State (when filters are applied) */
.tw-clear-filters-button.filters-active {
    background-color: #dc2626;
    border-color: #dc2626;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.tw-clear-filters-button.filters-active:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 6px 16px rgba(185, 28, 28, 0.4);
}
.tw-clear-filters-button.filters-active:focus {
    outline: none;
    background-color: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tw-search-bar {
        max-width: none;
    }
    
    .tw-search-with-button {
        max-width: none;
    }
}

/* === FILTER BAR COMPONENTS === */

/* List Controls Container */
.tw-list-controls {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* List Controls Left Section */
.tw-list-controls-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* List Controls Right Section */
.tw-list-controls-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive adjustments for list controls */
@media (max-width: 768px) {
    .tw-list-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .tw-list-controls-left,
    .tw-list-controls-right {
        justify-content: center;
    }
}

/* === NEW FILTER BAR STYLES === */

/* Filter Bar Container */
.tw-filter-bar {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem; /* 48px spacing from filter cards */
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* Filter Bar Left Section - Search and Filters */
.tw-filter-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

/* Filter Bar Right Section - Status Tabs and Counter */
.tw-filter-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Filter Bar Tabs Wrapper — sits at end of row 1 */
.tw-filter-bar-tabs {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

/* Search bar grows to fill row 1 */
.tw-filter-bar .tw-search-bar {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: none;
}

/* Detail filters flow inline with tabs on desktop, wrap to next row only if needed */
.tw-filter-bar .manager-detail-filters-collapse .mobile-collapse-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* === Connected Button Group — Filter Bar Tabs === */
.tw-filter-bar .tw-filter-tab {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.tw-filter-bar .tw-filter-tab:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    color: white;
    background-color: #1e293b;
    text-decoration: none;
    z-index: 2;
}

.tw-filter-bar .tw-filter-tab:focus {
    color: white;
    background-color: #1e293b;
    z-index: 2;
    outline: none;
}

.tw-filter-bar .tw-filter-tab.active {
    color: white;
    background-color: #1e293b;
    z-index: 2;
}

.tw-filter-bar .tw-filter-tab.active:hover {
    background-color: #0f172a;
}

.tw-filter-bar .tw-filter-tab:disabled {
    pointer-events: none;
    opacity: 0.5;
    box-shadow: none;
}

/* First tab — rounded left */
.tw-filter-bar .tw-filter-tab:first-child {
    border-radius: 0.375rem 0 0 0.375rem;
}

/* Middle tabs — no radius, left border */
.tw-filter-bar .tw-filter-tab:not(:first-child):not(:last-child) {
    border-radius: 0;
    border-left: 1px solid #cbd5e1;
}

.tw-filter-bar .tw-filter-tab:not(:first-child):not(:last-child):hover,
.tw-filter-bar .tw-filter-tab:not(:first-child):not(:last-child):focus,
.tw-filter-bar .tw-filter-tab:not(:first-child):not(:last-child).active {
    border-left: 1px solid #1e293b;
}

/* Last tab — rounded right, left border */
.tw-filter-bar .tw-filter-tab:last-child:not(:first-child) {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: 1px solid #cbd5e1;
}

.tw-filter-bar .tw-filter-tab:last-child:not(:first-child):hover,
.tw-filter-bar .tw-filter-tab:last-child:not(:first-child):focus,
.tw-filter-bar .tw-filter-tab:last-child:not(:first-child).active {
    border-left: 1px solid #1e293b;
}

/* Single tab — fully rounded */
.tw-filter-bar .tw-filter-tab:first-child:last-child {
    border-radius: 0.375rem;
}

/* Filter Bar Field Group */
.tw-filter-field-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Filter Bar Field Label */
.tw-filter-field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Filter Bar Counter */
.tw-filter-counter {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
}

/* Filter Bar Date Input */
.tw-filter-date-input {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    width: 140px;
    transition: border-color 0.15s ease-in-out;
}

.tw-filter-date-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Responsive adjustments for filter bar */
@media (max-width: 768px) {
    .tw-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .tw-filter-bar-left {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .tw-filter-bar .tw-search-bar {
        flex: 1 1 100%;
        max-width: none;
    }

    .tw-filter-bar-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .tw-filter-field-group {
        justify-content: space-between;
    }

    .tw-filter-date-input {
        width: auto;
        flex: 1;
    }
}

/* === CARD COMPONENTS === */
.tw-card {
    @apply bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden;
}

.tw-card-header {
    @apply px-6 py-4 border-b border-gray-200 bg-gray-50;
}

.tw-card-title {
    @apply text-lg font-semibold text-gray-900 mb-0;
}

.tw-card-body {
    @apply px-6 py-4;
}

.tw-card-footer {
    @apply px-6 py-4 border-t border-gray-200 bg-gray-50;
}

/* === BUTTON COMPONENTS === */
.tw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
    min-height: 38px;
}

.tw-btn-primary {
    background-color: #2563eb;
    color: white;
}
.tw-btn-primary:hover {
    background-color: #1d4ed8;
    text-decoration: none;
    color: white;
}

.tw-btn-secondary {
    background-color: #4b5563;
    color: white;
}
.tw-btn-secondary:hover {
    background-color: #374151;
    text-decoration: none;
    color: white;
}

.tw-btn-success {
    background-color: #059669;
    color: white;
    border-color: #059669;
}
.tw-btn-success:hover {
    background-color: #047857;
    color: white;
    border-color: #047857;
    text-decoration: none;
}
.tw-btn-success:focus {
    background-color: #047857;
    color: white;
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.tw-btn-danger {
    @apply bg-red-600 text-white hover:bg-red-700 focus:ring-red-500;
}

.tw-btn-warning {
    @apply bg-yellow-600 text-white hover:bg-yellow-700 focus:ring-yellow-500;
}

.tw-btn-info {
    background-color: #0891b2;
    color: white;
    border-color: #0891b2;
}
.tw-btn-info:hover {
    background-color: #0e7490;
    color: white;
    border-color: #0e7490;
    text-decoration: none;
}
.tw-btn-info:focus {
    background-color: #0e7490;
    color: white;
    border-color: #0e7490;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.tw-btn-light {
    @apply bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500;
}

.tw-btn-dark {
    @apply bg-gray-900 text-white hover:bg-gray-800 focus:ring-gray-700;
}

/* Outline buttons */
.tw-btn-outline-primary {
    @apply border-blue-600 text-blue-600 hover:bg-blue-600 hover:text-white focus:ring-blue-500;
}

.tw-btn-outline-secondary {
    @apply border-gray-600 text-gray-600 hover:bg-gray-600 hover:text-white focus:ring-gray-500;
}

/* Solid slate button for headers */
.tw-btn-slate {
    background-color: #64748b;
    border: 1px solid #64748b;
    color: white;
    transition: all 0.2s ease-in-out;
}

.tw-btn-slate:hover {
    background-color: #475569;
    border-color: #475569;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tw-btn-slate:focus {
    background-color: #475569;
    border-color: #475569;
    color: white;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1);
}

.tw-btn-slate.active {
    background-color: #334155;
    border-color: #334155;
    color: white;
}

/* Slate outline button to match filter tabs */
.tw-btn-outline-slate {
    border: 1px solid #cbd5e1;
    color: #64748b;
    background: transparent;
    transition: all 0.2s ease-in-out;
}

.tw-btn-outline-slate:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background-color: #1e293b;
    border-color: #1e293b;
    color: white;
    text-decoration: none;
}

.tw-btn-outline-slate:focus {
    background-color: #1e293b;
    border-color: #1e293b;
    color: white;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}

.tw-btn-outline-slate.active {
    background-color: #1e293b;
    border-color: #1e293b;
    color: white;
}

.tw-btn-outline-success {
    @apply border-green-600 text-green-600 hover:bg-green-600 hover:text-white focus:ring-green-500;
}

.tw-btn-outline-danger {
    @apply border-red-600 text-red-600 hover:bg-red-600 hover:text-white focus:ring-red-500;
}

.tw-btn-outline-blue {
    @apply border-blue-600 text-blue-600 hover:bg-blue-600 hover:text-white focus:ring-blue-500;
}

.tw-btn-outline-green {
    @apply border-green-600 text-green-600 hover:bg-green-600 hover:text-white focus:ring-green-500;
}

.tw-btn-outline-red {
    @apply border-red-600 text-red-600 hover:bg-red-600 hover:text-white focus:ring-red-500;
}

.tw-btn-outline-yellow {
    @apply border-yellow-600 text-yellow-600 hover:bg-yellow-600 hover:text-white focus:ring-yellow-500;
}

.tw-btn-outline-purple {
    @apply border-purple-600 text-purple-600 hover:bg-purple-600 hover:text-white focus:ring-purple-500;
}

.tw-btn-outline-orange {
    @apply border-orange-600 text-orange-600 hover:bg-orange-600 hover:text-white focus:ring-orange-500;
}

.tw-btn-outline-pink {
    @apply border-pink-600 text-pink-600 hover:bg-pink-600 hover:text-white focus:ring-pink-500;
}

.tw-btn-outline-indigo {
    @apply border-indigo-600 text-indigo-600 hover:bg-indigo-600 hover:text-white focus:ring-indigo-500;
}

.tw-btn-outline-gray {
    @apply border-gray-600 text-gray-600 hover:bg-gray-600 hover:text-white focus:ring-gray-500;
}

/* White solid button for dark backgrounds */
.tw-btn-white {
    background-color: white;
    border: 1px solid white;
    color: #1f2937;
    transition: all 0.2s ease-in-out;
}

.tw-btn-white:hover {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tw-btn-white:focus {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.tw-btn-white.active {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
    color: #1f2937;
}

/* Button sizes */
.tw-btn-sm {
    @apply px-3 py-1.5 text-xs;
}

.tw-btn-lg {
    @apply px-6 py-3 text-lg;
}

/* Info/Help Button - Small circular button for card headers */
.tw-info-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background-color: white;
    border: 1px solid #d1d5db;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.tw-info-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
    text-decoration: none;
}

.tw-info-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

/* === UTILITY CLASSES === */
.tw-opacity-50 {
    opacity: 0.5;
}

.tw-text-center {
    text-align: center;
}

/* === ACTION BUTTONS === */
.tw-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .tw-action-btn {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.15rem;
    }
}

/* Ensure all action button icons are properly centered */
a.tw-action-btn {
    text-decoration: none;
}

.tw-action-btn i,
.tw-action-btn .fas,
.tw-action-btn .far,
.tw-action-btn .fab {
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.tw-action-btn svg {
    width: 1em;
    height: 1em;
    pointer-events: none;
}

.tw-action-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.tw-action-btn:focus {
    outline: none;
    ring: 2px solid #3b82f6;
    ring-offset: 2px;
}

.tw-action-btn:active {
    transform: translateY(0);
}

/* Action Button Variants */
.tw-action-btn-view {
    color: #3b82f6;
    border-color: #3b82f6;
}

.tw-action-btn-view:hover {
    background-color: #3b82f6;
    color: white;
}

.tw-action-btn-edit {
    color: #059669;
    border-color: #059669;
}

.tw-action-btn-edit:hover {
    background-color: #059669;
    color: white;
}

.tw-action-btn-archive {
    color: #d97706;
    border-color: #d97706;
}

.tw-action-btn-archive:hover {
    background-color: #d97706;
    color: white;
}

.tw-action-btn-duplicate {
    color: #7c3aed;
    border-color: #7c3aed;
}

.tw-action-btn-duplicate:hover {
    background-color: #7c3aed;
    color: white;
}

.tw-action-btn-restore {
    color: #059669;
    border-color: #059669;
}

.tw-action-btn-restore:hover {
    background-color: #059669;
    color: white;
}

.tw-action-btn-clone {
    color: #7c3aed;
    border-color: #7c3aed;
}

.tw-action-btn-clone:hover {
    background-color: #7c3aed;
    color: white;
}

.tw-action-btn-merge {
    color: #dc2626;
    border-color: #dc2626;
}

.tw-action-btn-merge:hover {
    background-color: #dc2626;
    color: white;
}

.tw-action-btn-pdf {
    color: #dc2626;
    border-color: #dc2626;
}

.tw-action-btn-pdf:hover {
    background-color: #dc2626;
    color: white;
}

.tw-action-btn-email {
    color: #0891b2;
    border-color: #0891b2;
}

.tw-action-btn-email:hover {
    background-color: #0891b2;
    color: white;
}

.tw-action-btn-print {
    color: #374151;
    border-color: #374151;
}

.tw-action-btn-print:hover {
    background-color: #374151;
    color: white;
}

/* Action Button Group */
.tw-action-btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow: visible; /* Allow tooltips to escape */
    position: relative; /* Create positioning context for tooltips */
    z-index: 100; /* Ensure action buttons are above other content */
}

.tw-action-btn-group .tw-action-btn {
    flex-shrink: 0;
}

/* === FORM COMPONENTS === */
.tw-form-group {
    @apply mb-4;
}

.tw-form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

.tw-form-control {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 disabled:bg-gray-100 disabled:cursor-not-allowed;
}

.tw-form-select {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm bg-white focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 disabled:bg-gray-100 disabled:cursor-not-allowed;
}

.tw-form-check {
    @apply flex items-center;
}

.tw-form-check-input {
    @apply h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded;
}

.tw-form-check-label {
    @apply ml-2 text-sm text-gray-700;
}

/* Form validation states */
.tw-is-valid {
    @apply border-green-500 focus:ring-green-500 focus:border-green-500;
}

.tw-is-invalid {
    @apply border-red-500 focus:ring-red-500 focus:border-red-500;
}

.tw-valid-feedback {
    @apply text-sm text-green-600 mt-1;
}

.tw-invalid-feedback {
    @apply text-sm text-red-600 mt-1;
}

/* === TOGGLE SWITCHES === */
.tw-form-switch {
    @apply flex items-center space-x-3;
}

.tw-switch-input {
    position: relative;
    display: inline-flex;
    width: 2.5rem;
    height: 1.25rem;
    background-color: #dee2e6;
    border-radius: 50rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: none;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.tw-switch-input:checked {
    background-color: #667eea;
}

.tw-switch-input:focus {
    box-shadow: 0 0 0 2px #667eea40;
}

.tw-switch-input::before {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1rem;
    height: 1rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.15s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tw-switch-input:checked::before {
    transform: translateX(1.25rem);
}

.tw-switch-input::after {
    display: none !important;
}

.tw-switch-input:checked::after {
    display: none !important;
    content: none !important;
}

/* Ensure no external CSS adds checkmarks to our toggle switches */
.tw-switch-input:checked {
    background-image: none !important;
}

.tw-switch-input:checked::before,
.tw-switch-input:checked::after {
    font-family: inherit !important;
    content: '' !important;
}

.tw-switch-label {
    @apply text-sm text-gray-700 font-medium;
    cursor: pointer;
}

/* Column Toggle Switch - Used in Column Visibility Panels */
.column-toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background-color: #ccc;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
    outline: none;
}

.column-toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.column-toggle-switch.active {
    background-color: #2196F3;
}

.column-toggle-switch.active::after {
    transform: translateX(16px);
}

/* === BULK EDIT BOOLEAN TOGGLE SWITCH === */
/* Toggle switch with dynamic text labels for bulk edit modals */
.bulk-edit-toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
}

.bulk-edit-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.bulk-edit-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.bulk-edit-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #6c757d;
    transition: all 0.3s ease;
    border-radius: 34px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bulk-edit-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bulk-edit-toggle-input:checked + .bulk-edit-toggle-slider {
    background-color: #28a745;
}

.bulk-edit-toggle-input:checked + .bulk-edit-toggle-slider:before {
    transform: translateX(28px);
}

.bulk-edit-toggle-input:focus + .bulk-edit-toggle-slider {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.bulk-edit-toggle-input:disabled + .bulk-edit-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dynamic text label that changes based on toggle state */
.bulk-edit-toggle-text {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    transition: color 0.3s ease;
    flex-grow: 1;
}

.bulk-edit-toggle-input:checked ~ .bulk-edit-toggle-text {
    color: #28a745;
}

/* Icon support (optional) */
.bulk-edit-toggle-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
    transition: color 0.3s ease;
}

.bulk-edit-toggle-input:checked ~ .bulk-edit-toggle-icon {
    color: #28a745;
}

/* === RADIO BUTTON GROUPS === */
.tw-radio-group {
    @apply space-y-3;
}

.tw-radio-item {
    @apply flex items-center;
}

.tw-radio-input {
    @apply h-4 w-4 text-blue-600 border-gray-300 focus:ring-blue-500;
    cursor: pointer;
}

.tw-radio-label {
    @apply ml-3 text-sm text-gray-700;
    cursor: pointer;
}

.tw-radio-group-inline {
    @apply flex space-x-6;
}

.tw-radio-group-inline .tw-radio-item {
    @apply mb-0;
}

/* === SMALL ACTION BUTTONS === */
.tw-btn-sm {
    @apply px-2 py-1 text-xs font-medium rounded border transition-colors duration-200;
}

.tw-action-btn-sm {
    @apply inline-flex items-center px-2 py-1 text-xs font-medium rounded-md border transition-colors duration-200 cursor-pointer;
}

.tw-action-btn-sm:hover {
    @apply transform -translate-y-0.5 shadow-sm;
}

/* Small Action Button Variants */
.tw-action-btn-edit {
    @apply bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100 hover:border-blue-300;
}

.tw-action-btn-add {
    @apply bg-green-50 text-green-700 border-green-200 hover:bg-green-100 hover:border-green-300;
}

.tw-action-btn-delete {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.tw-action-btn-delete:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.tw-action-btn-view {
    @apply bg-gray-50 text-gray-700 border-gray-200 hover:bg-gray-100 hover:border-gray-300;
}

.tw-category-action-btn {
    @apply inline-flex items-center px-2 py-1 text-xs font-semibold rounded-full border-2 transition-all duration-200;
}

/* === ENHANCED FORM CONTROLS WITH ICONS === */
.tw-form-control-with-icon {
    @apply relative;
}

.tw-form-control-with-icon .tw-form-control {
    @apply pl-10;
}

.tw-form-icon {
    @apply absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 pointer-events-none;
    font-size: 0.875rem;
}

.tw-form-control-with-icon .tw-form-control:focus + .tw-form-icon,
.tw-form-control-with-icon .tw-form-control:not(:placeholder-shown) + .tw-form-icon {
    @apply text-blue-500;
}

/* === ALERT COMPONENTS === */
.tw-alert {
    @apply px-4 py-3 rounded-md border-l-4 mb-4;
}

.tw-alert-primary {
    @apply bg-blue-50 border-blue-400 text-blue-700;
}

.tw-alert-success {
    @apply bg-green-50 border-green-400 text-green-700;
}

.tw-alert-warning {
    @apply bg-yellow-50 border-yellow-400 text-yellow-700;
}

.tw-alert-danger {
    @apply bg-red-50 border-red-400 text-red-700;
}

.tw-alert-info {
    @apply bg-cyan-50 border-cyan-400 text-cyan-700;
}

/* === MODAL COMPONENTS === */
/* Z-Index Hierarchy:
 * 1-999: Base content
 * 1000-1999: Dropdowns, tooltips, popovers
 * 2000-2999: Modals (handled by unified-modal.css)
 * 3000-3999: Toast notifications, top-level alerts
 */

/* === UNIFIED MODAL SYSTEM === */
/* Modal styles are now handled by unified-modal.css */
@import url('unified-modal.css');

/* Contact Edit Modal - Tabbed Interface */
.um-body .section-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

.um-body .nav-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.um-body .nav-btn.active {
    background-color: #667eea;
    color: white;
}

.um-body .nav-btn:hover:not(.active) {
    background-color: #e9ecef;
    color: #495057;
}

.um-body .section-content {
    display: none;
}

.um-body .section-content.active {
    display: block;
}

.um-body .section-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.um-body .section-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.um-body .form-section {
    margin-bottom: 2rem;
}

.um-body .card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.um-body .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
}

.um-body .card-body {
    padding: 1.5rem;
}

/* === TABLE COMPONENTS === */
/* Note: Main table definition is in the LIST VIEW COMPONENTS section below */

/* === BADGE COMPONENTS === */
.tw-badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.tw-badge-primary {
    @apply bg-blue-100 text-blue-800;
}

.tw-badge-secondary {
    @apply bg-gray-100 text-gray-800;
}

.tw-badge-success {
    @apply bg-green-100 text-green-800;
}

.tw-badge-danger {
    @apply bg-red-100 text-red-800;
}

.tw-badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.tw-badge-info {
    @apply bg-cyan-100 text-cyan-800;
}

/* Status Badge Color Variants for Beleg Status */
.tw-badge-gray {
    @apply bg-gray-100 text-gray-800;
}

.tw-badge-blue {
    @apply bg-blue-100 text-blue-800;
}

.tw-badge-green {
    @apply bg-green-100 text-green-800;
}

.tw-badge-purple {
    @apply bg-purple-100 text-purple-800;
}

.tw-badge-orange {
    @apply bg-orange-100 text-orange-800;
}

.tw-badge-red {
    @apply bg-red-100 text-red-800;
}

.tw-badge-yellow {
    @apply bg-yellow-100 text-yellow-800;
}

.tw-badge-pink {
    @apply bg-pink-100 text-pink-800;
}

.tw-badge-indigo {
    @apply bg-indigo-100 text-indigo-800;
}

/* Status Editing Components */
.status-field-wrapper {
    display: inline-block;
    position: relative;
}

.status-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-badge.clickable:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-dropdown {
    min-width: 150px;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

/* Filter Chip Components */
.tw-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #93c5fd;
    transition: all 0.15s ease;
}

.tw-filter-chip:hover {
    background-color: #bfdbfe;
    border-color: #60a5fa;
}

.tw-filter-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background-color: transparent;
    color: #60a5fa;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    padding: 0;
}

.tw-filter-chip-remove:hover {
    background-color: #93c5fd;
    color: #1e40af;
}

.tw-filter-chip-remove svg {
    width: 0.75rem;
    height: 0.75rem;
}

.tw-filter-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.tw-filter-chips-container:empty {
    display: none;
}

/* Collapsible Filter Section */
.tw-filter-collapsible {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.tw-filter-collapsible.collapsed {
    max-height: 0;
}

.tw-filter-collapsible.expanded {
    max-height: 500px;
}

.tw-filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tw-filter-toggle-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.tw-filter-toggle-btn svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

.tw-filter-toggle-btn.expanded svg {
    transform: rotate(180deg);
}

/* === COLUMN VISIBILITY TOGGLE === */
.tw-column-toggle-dropdown {
    position: relative;
    display: inline-block;
}

.tw-column-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tw-column-toggle-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.tw-column-toggle-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
    min-width: 200px;
    display: none;
}

.tw-column-toggle-menu.show {
    display: block;
}

.tw-column-toggle-menu-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.tw-column-toggle-menu-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tw-column-toggle-menu-item:hover {
    background-color: #f9fafb;
}

.tw-column-toggle-menu-item input[type="checkbox"] {
    cursor: pointer;
}

.tw-column-toggle-menu-item label {
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-size: 0.875rem;
    color: #374151;
}

/* Hidden columns */
.column-hidden {
    display: none !important;
}

/* Sortable column headers */
.tw-sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.tw-sortable-header:hover {
    background-color: #e5e7eb !important;
}

.tw-sort-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
    opacity: 0.3;
    transition: opacity 0.15s ease;
}

.tw-sortable-header:hover .tw-sort-icon {
    opacity: 0.6;
}

.tw-sortable-header.sorted .tw-sort-icon {
    opacity: 1;
}

.tw-sort-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* === FILTER CARDS === */
.tw-filter-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.tw-filter-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.tw-filter-card:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Filter Card Color Variants */
.tw-filter-card-blue {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.tw-filter-card-green {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.tw-filter-card-red {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.tw-filter-card-yellow {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.tw-filter-card-purple {
    border-color: #a855f7;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #6b21a8;
}

.tw-filter-card-pink {
    border-color: #ec4899;
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #9f1239;
}

.tw-filter-card-indigo {
    border-color: #6366f1;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
}

.tw-filter-card-gray {
    border-color: #6b7280;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
}

/* Filter Card Action Buttons */
.tw-filter-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.8);
    color: inherit;
    opacity: 0.6;
    transition: all 0.15s ease;
    cursor: pointer;
}

.tw-filter-card-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.tw-filter-card-action:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Filter Cards Grid */
.tw-filter-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Filter Card Collection */
.tw-filter-card-collection {
    margin-bottom: 2rem;
}

.tw-filter-card-collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tw-filter-card-collection-header:hover {
    background: #f3f4f6;
}

.tw-filter-card-collection-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-filter-card-collection-count {
    font-size: 0.875rem;
    color: #6b7280;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.tw-filter-card-collection-toggle {
    transition: transform 0.2s;
}

.tw-filter-card-collection.collapsed .tw-filter-card-collection-toggle {
    transform: rotate(-90deg);
}

.tw-filter-card-collection-body {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tw-filter-card-collection.collapsed .tw-filter-card-collection-body {
    max-height: 0;
}

/* === FILTER CARD TABS === */
.tw-filter-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tw-filter-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-filter-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.tw-filter-tab.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    font-weight: 600;
}

.tw-filter-tab i {
    font-size: 1rem;
}

.tw-filter-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 9999px;
}

.tw-filter-tab.active .tw-filter-tab-badge {
    background: #ede9fe;
    color: #7c3aed;
}

.tw-filter-tab-content {
    display: none;
}

.tw-filter-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* === ENHANCED STATUS BADGES === */
.tw-status-badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-semibold;
}

.tw-status-company {
    @apply bg-blue-100 text-blue-800 border border-blue-200;
}

.tw-status-department {
    @apply bg-purple-100 text-purple-800 border border-purple-200;
}

.tw-status-motif {
    @apply bg-orange-100 text-orange-800 border border-orange-200;
}

.tw-status-person {
    @apply bg-green-100 text-green-800 border border-green-200;
}

/* Enhanced badge with icons */
.tw-status-badge-with-icon {
    @apply tw-status-badge space-x-1;
}

.tw-status-badge-with-icon i {
    @apply text-xs;
}

/* === DROPDOWN COMPONENTS === */
.tw-dropdown {
    @apply relative inline-block;
}

.tw-dropdown-menu {
    @apply absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none z-50;
}

.tw-dropdown-item {
    @apply block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 cursor-pointer;
}

.tw-dropdown-header {
    @apply px-4 py-2 text-sm text-gray-500 font-medium;
}

.tw-dropdown-divider {
    @apply border-t border-gray-100 my-1;
}

/* === PAGINATION COMPONENTS === */
.tw-pagination {
    @apply flex items-center justify-between border-t border-gray-200 bg-white px-4 py-3 sm:px-6;
}

.tw-pagination-info {
    @apply text-sm text-gray-700;
}

.tw-pagination-nav {
    @apply relative z-0 inline-flex rounded-md shadow-sm -space-x-px;
}

.tw-pagination-item {
    @apply relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50;
}

.tw-pagination-item.active {
    @apply z-10 bg-blue-50 border-blue-500 text-blue-600;
}

.tw-pagination-prev {
    @apply rounded-l-md;
}

.tw-pagination-next {
    @apply rounded-r-md;
}

/* === LIST VIEW COMPONENTS === */
.tw-list-view {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    overflow: visible;
}

.tw-list-view-header {
    background-color: #f9fafb;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.tw-bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-list-view-table {
    /* No horizontal scrolling - use responsive design instead */
}

.tw-table {
    width: 100%;
    border-collapse: separate; /* Changed from collapse to allow tooltip overflow */
    border-spacing: 0; /* Maintain visual appearance with no gaps */
    font-size: 0.875rem;
    overflow: visible; /* Allow tooltips to escape */
}

.tw-table-header {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.tw-table-header th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
}

/* Allow alignment override on table headers */
.tw-table-header th.tw-text-center {
    text-align: center;
}

.tw-table-header th.tw-text-right {
    text-align: right;
}

/* Sticky Table Header - sticks to top when scrolling */
/* Apply to individual th elements for best browser compatibility */
.tw-table-sticky-header th {
    position: -webkit-sticky; /* Safari compatibility */
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb;
    /* Add shadow when stuck to indicate header is sticky */
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    /* Ensure proper layering */
    background-clip: padding-box;
}

/* Sticky Header Clone Styles - for viewport-fixed sticky headers */
.sticky-header-clone {
    /* Ensure proper overflow handling for horizontal scroll */
    overflow: hidden;
    /* Prevent pointer events on the clone (except for interactive elements) */
    pointer-events: none;
}

.sticky-header-clone th {
    /* Re-enable pointer events for interactive th elements (like sorting) */
    pointer-events: auto;
    /* Prevent text wrapping to maintain consistent height */
    white-space: nowrap;
    /* Ensure background is opaque */
    background-color: #f9fafb;
}

/* Add visual distinction to sticky clone */
.sticky-header-clone thead {
    background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
}

/* Sticky Bulk Toolbar - appears below sticky header when items are selected */
.bulk-toolbar-sticky {
    position: fixed !important;
    z-index: 99; /* Just below sticky header (z-index: 100) */
    transition: all 0.15s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tw-table-checkbox {
    width: 3rem;
    text-align: center;
}

.tw-table-sortable {
    position: relative;
}

.tw-sort-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    width: 100%;
    justify-content: flex-start;
}

.tw-sort-button:hover {
    color: #1f2937;
}

.tw-sort-icon {
    opacity: 0.5;
    font-size: 0.75rem;
}

.tw-sort-button:hover .tw-sort-icon {
    opacity: 1;
}

/* Icon-only header styles for centered, larger icons */
.tw-table-sortable.tw-text-center .tw-sort-button,
.tw-table-cell.tw-text-center {
    justify-content: center;
}

.tw-table-sortable.tw-text-center .tw-sort-button > i:first-child,
.tw-table-cell.tw-text-center > i {
    font-size: 1.125rem; /* Larger icon size (18px) */
}

.tw-table-sortable.tw-text-center .tw-sort-button {
    gap: 0.375rem; /* Tighter gap for icon headers */
}

.tw-table-actions {
    width: 8rem;
    text-align: right;
    overflow: visible; /* Allow tooltips to escape */
}

.tw-table-body tr {
    border-bottom: 1px solid #f3f4f6;
    overflow: visible; /* Allow tooltips to escape table rows */
}

.tw-table-body tr:last-child {
    border-bottom: none;
}

.tw-table-row:hover {
    background-color: #f9fafb;
}

.tw-row-selected {
    background-color: #eff6ff !important;
}

.tw-row-selected:hover {
    background-color: #dbeafe !important;
}

.tw-table-cell {
    padding: 0.75rem 1rem;
    vertical-align: top;
    overflow: visible; /* Allow tooltips to escape */
}

.tw-action-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
}

/* Center action buttons when cell has tw-text-center */
.tw-text-center .tw-action-buttons {
    justify-content: center;
}

.tw-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    transition: all 0.15s ease-in-out;
}

.tw-checkbox:checked {
    background-color: #2563eb;
    border-color: #2563eb;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7.5 7.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6 10.293l7.146-7.147a.5.5 0 0 1 .708.708z'/%3e%3c/svg%3e");
    background-size: 0.75rem;
    background-position: center;
    background-repeat: no-repeat;
}

.tw-checkbox:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Text truncation utilities for table cells */
.tw-truncate-text {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.tw-truncate-email {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.tw-truncate-date {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Responsive adjustments for list view */
@media (max-width: 768px) {
    .tw-list-view-header {
        padding: 0.75rem 1rem;
    }
    
    .tw-table-header th,
    .tw-table-cell {
        padding: 0.5rem 0.5rem;
    }
    
    .tw-action-buttons {
        gap: 0.125rem;
    }
    
    /* Tighter truncation on mobile */
    .tw-truncate-text {
        max-width: 100px;
    }
    
    .tw-truncate-email {
        max-width: 80px;
    }
    
    .tw-truncate-date {
        max-width: 70px;
    }
}

/* === UTILITY CLASSES === */
.tw-sr-only {
    @apply sr-only;
}

.tw-shadow {
    @apply shadow;
}

.tw-shadow-sm {
    @apply shadow-sm;
}

.tw-shadow-md {
    @apply shadow-md;
}

.tw-shadow-lg {
    @apply shadow-lg;
}

.tw-shadow-xl {
    @apply shadow-xl;
}

.tw-rounded {
    @apply rounded;
}

.tw-rounded-sm {
    @apply rounded-sm;
}

.tw-rounded-md {
    @apply rounded-md;
}

.tw-rounded-lg {
    @apply rounded-lg;
}

.tw-rounded-xl {
    @apply rounded-xl;
}

.tw-border {
    @apply border;
}

.tw-border-t {
    @apply border-t;
}

.tw-border-b {
    @apply border-b;
}

.tw-border-l {
    @apply border-l;
}

.tw-border-r {
    @apply border-r;
}

.tw-w-full {
    @apply w-full;
}

.tw-h-full {
    @apply h-full;
}

.tw-max-w-sm {
    @apply max-w-sm;
}

.tw-max-w-md {
    @apply max-w-md;
}

.tw-max-w-lg {
    @apply max-w-lg;
}

.tw-max-w-xl {
    @apply max-w-xl;
}

.tw-max-w-2xl {
    @apply max-w-2xl;
}

.tw-max-w-4xl {
    @apply max-w-4xl;
}

.tw-transition {
    @apply transition;
}

.tw-duration-150 {
    @apply duration-150;
}

.tw-duration-200 {
    @apply duration-200;
}

.tw-duration-300 {
    @apply duration-300;
}

.tw-ease-in-out {
    @apply ease-in-out;
}

.tw-transform {
    @apply transform;
}

.tw-scale-95 {
    @apply scale-95;
}

.tw-scale-100 {
    @apply scale-100;
}

.tw-opacity-0 {
    @apply opacity-0;
}

.tw-opacity-100 {
    @apply opacity-100;
}

/* Tom Select Integration */
.tw-tom-select {
    @apply w-full;
}

.tw-tom-select .ts-dropdown {
    @apply border border-gray-300 rounded-md shadow-lg bg-white z-50;
}

.tw-tom-select .ts-dropdown-content {
    @apply max-h-60 overflow-y-auto;
}

.tw-tom-select .ts-dropdown .option {
    @apply px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 cursor-pointer;
}

.tw-tom-select .ts-dropdown .option.active {
    @apply bg-blue-600 text-white;
}

.tw-tom-select .ts-control {
    @apply border border-gray-300 rounded-md px-3 py-2 focus:ring-1 focus:ring-blue-500 focus:border-blue-500;
}

/* Show/Hide utilities */
.tw-show {
    @apply block;
}

.tw-hide {
    @apply hidden;
}

/* Focus utilities */
.tw-focus-within\:ring-2:focus-within {
    @apply focus-within:ring-2;
}

.tw-focus\:ring-2:focus {
    @apply focus:ring-2;
}

.tw-focus\:ring-blue-500:focus {
    @apply focus:ring-blue-500;
}

.tw-focus\:outline-none:focus {
    @apply focus:outline-none;
}

/* Hover utilities */
.tw-hover\:bg-gray-50:hover {
    @apply hover:bg-gray-50;
}

.tw-hover\:bg-blue-600:hover {
    @apply hover:bg-blue-600;
}

.tw-hover\:text-white:hover {
    @apply hover:text-white;
}

/* Animation utilities */
.tw-fade {
    @apply transition-opacity duration-300 ease-in-out;
}

.tw-fade.tw-show {
    @apply opacity-100;
}

/* Tabbed Form Components */
.tw-tab-content {
    @apply mt-4;
}

.tw-tab-pane {
    @apply transition-all duration-200 ease-in-out;
}

.tw-tab-pane.active {
    @apply block;
}

.tw-tab-pane:not(.active) {
    display: none;
}

/* === CUSTOM TOOLTIPS === */
/* Tooltip display handled by JS portal system (style-guide.js) */
/* Direction classes (tw-tooltip-top/bottom/left/right) are read by JS, not CSS */
.tw-tooltip {
    cursor: default;
}

/* CSS pseudo-element tooltips disabled — JS portal system handles all tooltips */
.tw-tooltip::after,
.tw-tooltip::before {
    display: none !important;
}

/* === DEPRECATED TOOLTIP SYSTEMS === */
/* ⛔ DEPRECATED: Bootstrap tooltips are no longer used in this project */
/* All tooltips should use the .tw-tooltip class with data-tooltip attribute */
/* The JS portal system handles rendering — no CSS pseudo-elements needed */

/* Deprecation warning for Bootstrap 5 tooltips (visual indicator in development) */
[data-bs-toggle="tooltip"] {
    /* Uncomment the line below to show red border in development */
    /* border: 2px solid red !important; */
    /* Add warning comment to make it obvious in inspector */
}

/* Deprecation warning for Bootstrap 4 tooltips (legacy) */
[data-toggle="tooltip"] {
    /* Uncomment the line below to show red border in development */
    /* border: 2px solid red !important; */
}

/* Z-index utilities for modals and dropdowns */
.tw-z-40 {
    @apply z-40;
}

.tw-z-50 {
    @apply z-50;
}

/* Modal animations and component integration are now handled by unified-modal.css */

/* === TAB COMPONENTS === */

/* Tab Container */
.tw-tabs {
    margin-bottom: 1.5rem;
}

/* Tab Navigation */
.tw-tabs-nav {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background-color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Tab Button */
.tw-tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    text-decoration: none;
}

.tw-tab-button:hover {
    color: #374151;
    background-color: #f9fafb;
    text-decoration: none;
}

.tw-tab-button:focus {
    outline: none;
    color: #374151;
    background-color: #f9fafb;
}

/* Active Tab Button */
.tw-tab-button.tw-tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background-color: white;
}

.tw-tab-button.tw-tab-active:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    background-color: white;
}

/* Tab Content */
.tw-tab-content {
    margin-top: 0;
}

/* Tab Pane */
.tw-tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.tw-tab-pane.tw-tab-show {
    display: block;
    opacity: 1;
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .tw-tabs-nav {
        flex-direction: column;
        border-radius: 0.5rem;
    }
    
    .tw-tab-button {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e5e7eb;
        border-right: none;
        justify-content: flex-start;
        text-align: left;
    }
    
    .tw-tab-button:last-child {
        border-bottom: none;
    }
    
    .tw-tab-button.tw-tab-active {
        border-bottom-color: #e5e7eb;
        border-left: 3px solid #2563eb;
        background-color: #eff6ff;
    }
}

/* === ENHANCED LIST VIEW COMPONENTS === */

/* List View Header Info */
.tw-list-header-info {
    flex: 1;
    min-width: 0;
}

/* List Title */
.tw-list-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
    line-height: 1.25;
}

/* List Subtitle */
.tw-list-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* List Header Actions */
.tw-list-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Table Row Variants */
.tw-table-row-archived {
    background-color: #f9fafb;
    opacity: 0.8;
}

.tw-table-row-archived:hover {
    background-color: #f3f4f6;
    opacity: 0.9;
}

.tw-table-row-highlight {
    background-color: #fefce8;
    border-left: 3px solid #eab308;
}

.tw-table-row-highlight:hover {
    background-color: #fef3c7;
}

/* === TEXT UTILITIES === */

/* Text Muted */
.tw-text-muted {
    color: #6b7280;
}

/* Text Truncate */
.tw-text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    display: inline-block;
}

/* Link Styling */
.tw-link {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.tw-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.tw-link:focus {
    color: #1d4ed8;
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* === APPOINTMENT-SPECIFIC COMPONENTS === */

/* Appointment Info Container */
.tw-appointment-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Appointment Headline */
.tw-appointment-headline {
    font-weight: 500;
    color: #111827;
    line-height: 1.25;
}

/* Appointment Subjects */
.tw-appointment-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* Date Time Styling */
.tw-date-time {
    font-family: 'Courier New', Monaco, monospace;
    white-space: nowrap;
}

/* === EMPTY STATE COMPONENTS === */

/* Empty State Container */
.tw-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    background-color: white;
    border-radius: 0.5rem;
    border: 2px dashed #e5e7eb;
    margin: 1rem 0;
}

/* Empty State Icon */
.tw-empty-icon {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

/* Empty State Title */
.tw-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem 0;
}

/* Empty State Text */
.tw-empty-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    max-width: 400px;
    line-height: 1.5;
}

/* === ADDITIONAL BADGE VARIANTS === */

/* Status-specific badges */
.tw-badge-canceled {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.tw-badge-past {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.tw-badge-upcoming {
    background-color: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

/* === ACTION BUTTON SUCCESS VARIANT === */
.tw-action-btn-success {
    color: #059669;
    border-color: #059669;
}

.tw-action-btn-success:hover {
    background-color: #059669;
    color: white;
    text-decoration: none;
}

.tw-action-btn-primary {
    color: #667eea;
    border-color: #667eea;
}

.tw-action-btn-primary:hover {
    background-color: #667eea;
    color: white;
    text-decoration: none;
}

.tw-action-btn-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.tw-action-btn-danger:hover {
    background-color: #dc3545;
    color: white;
    text-decoration: none;
}

/* === RESPONSIVE TABLE ADJUSTMENTS === */
@media (max-width: 768px) {
    .tw-list-view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .tw-list-header-actions {
        justify-content: center;
    }
    
    .tw-appointment-info {
        gap: 0.25rem;
    }
    
    .tw-appointment-subjects {
        gap: 0.125rem;
    }
    
    .tw-text-truncate {
        max-width: 120px;
    }
    
    .tw-date-time {
        font-size: 0.75rem;
    }
    
    .tw-empty-state {
        padding: 2rem 1rem;
    }
    
    .tw-empty-icon {
        font-size: 2rem;
    }
    
    .tw-empty-title {
        font-size: 1rem;
    }
    
    .tw-empty-text {
        font-size: 0.75rem;
    }
}

/* === FILTER CARDS COMPONENTS === */

/* Base Filter Card */
.tw-filter-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.tw-filter-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

/* Filter Card Header */
.tw-filter-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
    min-height: 2.5rem;
}

.tw-filter-card-title-area {
    flex: 1;
    min-width: 0;
}

.tw-filter-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.25;
    margin: 0 0 0.5rem 0;
    word-wrap: break-word;
}

.tw-filter-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
}

.tw-filter-card-badge.tw-badge-count {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.tw-filter-card-badge.tw-badge-sum {
    background-color: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

/* Filter Card Actions */
.tw-filter-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tw-filter-card:hover .tw-filter-card-actions {
    opacity: 1;
}

.tw-filter-card-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0.25rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tw-filter-card-settings-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.tw-filter-card-settings-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Filter Card Content */
.tw-filter-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tw-filter-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin: 0;
}

.tw-filter-card-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* Create New Filter Card */
.tw-filter-card-create {
    background: white;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 8rem;
    color: #6b7280;
}

.tw-filter-card-create:hover {
    border-color: #2563eb;
    background-color: #fafbff;
    color: #2563eb;
}

.tw-filter-card-create:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
}

.tw-filter-create-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.tw-filter-create-text {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

/* Filter Cards Grid */
.tw-filter-cards-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .tw-filter-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .tw-filter-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .tw-filter-cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .tw-filter-cards-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Saved Filter Card (Clickable) */
.tw-filter-card-saved {
    cursor: pointer;
    border: 2px solid transparent;
}

.tw-filter-card-saved:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.tw-filter-card-saved:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
}

.tw-filter-card-saved:active {
    transform: translateY(0px);
}

/* Saved Filter Card - Enhanced Layout */
.tw-filter-card-saved {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
}

.tw-filter-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tw-filter-card-icon i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.tw-filter-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.tw-filter-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-filter-card-description {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tw-filter-card-count {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Filter Card Action Buttons */
.tw-filter-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tw-filter-card-saved:hover .tw-filter-card-actions {
    opacity: 1;
}

.tw-filter-card-edit-btn,
.tw-filter-card-delete-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.375rem;
    background-color: white;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tw-filter-card-edit-btn:hover {
    background-color: #2563eb;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tw-filter-card-delete-btn:hover {
    background-color: #dc2626;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tw-filter-card-edit-btn:active,
.tw-filter-card-delete-btn:active {
    transform: scale(0.95);
}

.tw-filter-card-edit-btn:focus,
.tw-filter-card-delete-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Create New Filter Card - Enhanced */
.tw-filter-card-create {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
}

.tw-filter-card-create-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.tw-filter-card-create-icon {
    font-size: 1.5rem;
    font-weight: 300;
}

.tw-filter-card-create-text {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

/* Mobile: Always show actions */
@media (max-width: 640px) {
    .tw-filter-card-actions {
        opacity: 1;
    }
}

/* Filter Card Dropdown Menu */
.tw-filter-card-dropdown {
    position: relative;
    display: inline-block;
}

.tw-filter-card-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 160px;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1500; /* Dropdowns layer */
    margin-top: 0.25rem;
}

.tw-filter-card-dropdown.show .tw-filter-card-dropdown-content {
    display: block;
}

.tw-filter-card-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tw-filter-card-dropdown-item:hover {
    background-color: #f3f4f6;
}

.tw-filter-card-dropdown-item:first-child {
    border-radius: 0.375rem 0.375rem 0 0;
}

.tw-filter-card-dropdown-item:last-child {
    border-radius: 0 0 0.375rem 0.375rem;
}

.tw-filter-card-dropdown-item.destructive {
    color: #dc2626;
}

.tw-filter-card-dropdown-item.destructive:hover {
    background-color: #fef2f2;
}

.tw-filter-card-dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

/* Filter Cards Section */
.tw-filter-cards-section {
    margin-bottom: 2rem;
}

.tw-filter-cards-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-filter-cards-section-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

/* Value Formatting Utilities */
.tw-value-currency::before {
    content: "€";
    margin-right: 0.125rem;
    opacity: 0.8;
}

.tw-value-large {
    font-size: 2.25rem;
}

.tw-value-medium {
    font-size: 1.875rem;
}

.tw-value-small {
    font-size: 1.5rem;
}

/* Status Variants */
.tw-filter-card-status-active {
    border-left: 4px solid #10b981;
}

.tw-filter-card-status-inactive {
    border-left: 4px solid #6b7280;
}

.tw-filter-card-status-warning {
    border-left: 4px solid #f59e0b;
}

.tw-filter-card-status-error {
    border-left: 4px solid #ef4444;
}

/* Loading State */
.tw-filter-card-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tw-filter-card-loading .tw-filter-card-value {
    background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
    background-size: 200% 100%;
    animation: tw-loading-shimmer 1.5s ease-in-out infinite;
    border-radius: 0.25rem;
    height: 2rem;
    width: 4rem;
}

@keyframes tw-loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ===== Dashboard Page Loading Skeleton ===== */
.tw-dashboard-container {
    position: relative;
}

.tw-dashboard-skeleton-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--bs-body-bg, #f3f4f6);
    padding: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

.tw-dashboard-skeleton-overlay.tw-skeleton-hidden {
    opacity: 0;
}

.tw-skeleton-app-icon {
    display: none;
}

@media (max-width: 768px) {
    .tw-dashboard-skeleton-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        display: flex;
        flex-direction: column;
    }

    .tw-skeleton-app-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
    }

    .tw-skeleton-app-icon img {
        border-radius: 1.25rem;
        animation: tw-skeleton-pulse 1.8s ease-in-out infinite;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    }

    .tw-skeleton-shimmer-rows {
        display: none;
    }
}

@keyframes tw-skeleton-pulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.96); }
}

.tw-skeleton-block {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: tw-loading-shimmer 1.4s ease-in-out infinite;
    border-radius: 0.75rem;
}

/* Compact Filter Cards */
.tw-filter-cards-grid-compact {
    gap: 1rem;
}

.tw-filter-cards-grid-compact .tw-filter-card {
    padding: 1rem;
}

.tw-filter-cards-grid-compact .tw-filter-card-value {
    font-size: 1.5rem;
}

.tw-filter-cards-grid-compact .tw-filter-card-title {
    font-size: 0.8125rem;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .tw-filter-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tw-filter-card {
        padding: 1.25rem;
    }
    
    .tw-filter-card-value {
        font-size: 1.75rem;
    }
    
    .tw-filter-card-create {
        padding: 1.5rem;
        min-height: 6rem;
    }
    
    .tw-filter-create-icon {
        font-size: 1.5rem;
    }
    
    .tw-filter-card-actions {
        opacity: 1; /* Always visible on mobile */
    }
}

/* Filter Settings Modal - now handled by unified modal system */
/* All modal functionality handled by unified-modal.css and unified-modal.js */

.tw-form-group {
    margin-bottom: 1.5rem;
}

.tw-form-group:last-child {
    margin-bottom: 0;
}

.tw-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.tw-form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background-color: white;
}

.tw-form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tw-form-input::placeholder {
    color: #9ca3af;
}

/* Radio Button Group */
.tw-radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tw-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tw-radio-option:hover {
    border-color: #2563eb;
    background-color: #f8faff;
}

.tw-radio-option input[type="radio"] {
    display: none;
}

.tw-radio-indicator {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.tw-radio-option input[type="radio"]:checked + .tw-radio-indicator {
    border-color: #2563eb;
    background-color: #2563eb;
}

.tw-radio-option input[type="radio"]:checked + .tw-radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.375rem;
    height: 0.375rem;
    background-color: white;
    border-radius: 50%;
}

.tw-radio-option input[type="radio"]:checked ~ .tw-radio-label {
    color: #2563eb;
}

.tw-radio-label {
    flex: 1;
    font-size: 0.875rem;
    color: #374151;
    transition: color 0.2s;
}

.tw-text-muted {
    color: #6b7280;
    font-size: 0.8125rem;
}

/* Responsive adjustments for form components */
@media (max-width: 640px) {
    .tw-form-group {
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support for form components */
@media (prefers-color-scheme: dark) {
    .tw-form-label {
        color: #d1d5db;
    }

    .tw-form-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .tw-form-input:focus {
        border-color: #2563eb;
    }

    .tw-form-input::placeholder {
        color: #6b7280;
    }

    .tw-radio-option {
        border-color: #4b5563;
        background-color: #374151;
    }

    .tw-radio-option:hover {
        border-color: #2563eb;
        background-color: #1e3a8a;
    }

    .tw-radio-indicator {
        border-color: #6b7280;
    }
    
    .tw-radio-label {
        color: #d1d5db;
    }
    
    .tw-text-muted {
        color: #9ca3af;
    }
    
    .tw-filter-card {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .tw-filter-card-title {
        color: #f9fafb;
    }
    
    .tw-filter-card-value {
        color: #f9fafb;
    }
    
    .tw-filter-card-label {
        color: #9ca3af;
    }
    
    .tw-filter-card-badge {
        background-color: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .tw-filter-card-create {
        background-color: #1f2937;
        border-color: #4b5563;
        color: #9ca3af;
    }
    
    .tw-filter-card-create:hover {
        background-color: #111827;
        border-color: #2563eb;
        color: #2563eb;
    }
    
    .tw-filter-card-dropdown-content {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .tw-filter-card-dropdown-item {
        color: #d1d5db;
    }
    
    .tw-filter-card-dropdown-item:hover {
        background-color: #374151;
    }
    
    .tw-filter-card-dropdown-item.destructive {
        color: #f87171;
    }
    
    .tw-filter-card-dropdown-item.destructive:hover {
        background-color: #422532;
    }
}

/* === SLIDESHOW COMPONENTS === */
/* DEPRECATED 2025-10-25: Slideshow functionality removed - use full-page views instead */
/*
.tw-slideshow-container {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

/* Slides */
.tw-slide {
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
}

.tw-slide.tw-active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Slide Content */
.tw-slide-content {
    padding: 1rem;
    animation: slideIn 0.3s ease-in-out;
}

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

/* Slide Headings */
.tw-slide-heading {
    color: #1e40af;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Progress Components */
.tw-progress-bar-container {
    background-color: #f8fafc;
    padding: 0;
}

.tw-progress {
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 0.25rem;
    overflow: hidden;
}

.tw-progress-bar {
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s ease-in-out;
}

/* Progress Steps */
.tw-progress-steps {
    background-color: #f8fafc;
    font-size: 0.9rem;
    border-bottom: 1px solid #e2e8f0;
}

.tw-step {
    display: flex;
    align-items: center;
    color: #64748b;
    transition: color 0.3s ease;
}

.tw-step.active {
    color: #2563eb;
    font-weight: 600;
}

.tw-step.completed {
    color: #10b981;
}

.tw-step-text {
    font-size: 0.85rem;
}

/* Progress Indicator */
.tw-progress-indicator {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Icon Sizing */
.tw-fa-3x {
    font-size: 3rem;
    opacity: 0.8;
}

/* Form Control Large */
.tw-form-control-lg,
.tw-form-select-lg {
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border-radius: 0.5rem;
    min-height: 3rem;
}

/* Button Group */
.tw-btn-group {
    display: flex;
    border-radius: 0.5rem;
    overflow: hidden;
}

.tw-btn-group .tw-btn {
    flex: 1;
    border-radius: 0;
}

.tw-btn-group .tw-btn:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.tw-btn-group .tw-btn:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Button Check (Radio Button styling) */
.tw-btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.tw-btn-check:checked + .tw-btn-outline-primary {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

/* Close Button Variants */
.tw-btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tw-slideshow-container {
        min-height: 350px;
    }
    
    .tw-slide-content {
        padding: 0.5rem;
    }
    
    .tw-btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .tw-progress-steps {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .tw-step-text {
        display: none;
    }
    
    .tw-slide-heading {
        font-size: 1.25rem;
    }
    
    .tw-fa-3x {
        font-size: 2rem;
    }
}
*/
/* End of deprecated slideshow CSS */

@media (max-width: 576px) {
    .tw-btn-group .tw-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .tw-form-control-lg,
    .tw-form-select-lg {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        min-height: 2.5rem;
    }
}

/* === 8. BASE LAYOUT STYLES (from base_standardized.html) === */

/* Body Layout - Space for Fixed Navigation */
body.tw-layout-body {
    padding-top: 90px; /* Space for fixed navigation header (67px nav + 23px breathing room) */
    min-height: 100vh;
}

/* Content Wrapper - Full Height Layout */
.content-wrapper {
    flex: 1 0 auto;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0.75rem 0;
    }
}

/* Bootstrap Tab Pane Display Fixes */
.tab-content {
    display: block !important;
}

.tab-pane {
    display: none !important;
}

.tab-pane.active,
.tab-pane.show.active {
    display: block !important;
}

/* Table Responsive Display Fixes */
.table-responsive {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.table {
    width: 100% !important;
    margin-bottom: 1rem !important;
}

/* === DASHBOARD COMPONENTS (dashboard-rebooted) === */

/* Main Content Wrappers - Allow tooltips to overflow */
.content-wrapper,
.tw-content-wrapper,
.container,
.tw-main-container {
    overflow: visible !important;
}

@media (max-width: 768px) {
    .container.tw-main-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Dashboard Container */
.tw-dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    overflow: visible; /* Allow tooltips to overflow */
}

/* Dashboard Quick Action Bar */
.tw-dashboard-quick-action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .tw-dashboard-quick-action-bar {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Dashboard Grid Layout */
.tw-dashboard-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Stats Cards Grid - 4 columns on desktop, responsive */
.tw-dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Dashboard Stat Card */
.tw-dashboard-stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: visible;
}

.tw-dashboard-stat-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    border-color: #e5e7eb;
    z-index: 1;
}

.tw-dashboard-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.3;
}

/* Stat Card Header */
.tw-dashboard-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.tw-dashboard-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.tw-dashboard-stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Stat Card Body */
.tw-dashboard-stat-body {
    display: flex;
    flex-direction: column;
}

.tw-dashboard-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.tw-dashboard-stat-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.tw-dashboard-stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.tw-dashboard-stat-change.positive {
    color: #059669;
}

.tw-dashboard-stat-change.negative {
    color: #dc2626;
}

/* Stat Card Color Variants */
.tw-dashboard-stat-card.primary {
    color: #2563eb;
}

.tw-dashboard-stat-card.primary .tw-dashboard-stat-icon {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.tw-dashboard-stat-card.success {
    color: #059669;
}

.tw-dashboard-stat-card.success .tw-dashboard-stat-icon {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.tw-dashboard-stat-card.warning {
    color: #d97706;
}

.tw-dashboard-stat-card.warning .tw-dashboard-stat-icon {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.tw-dashboard-stat-card.danger {
    color: #dc2626;
}

.tw-dashboard-stat-card.danger .tw-dashboard-stat-icon {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.tw-dashboard-stat-card.info {
    color: #0891b2;
}

.tw-dashboard-stat-card.info .tw-dashboard-stat-icon {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.tw-dashboard-stat-card.purple {
    color: #7c3aed;
}

.tw-dashboard-stat-card.purple .tw-dashboard-stat-icon {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

/* Quick Actions Panel */
.tw-dashboard-quick-actions {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.tw-dashboard-quick-actions-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-dashboard-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tw-dashboard-quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tw-dashboard-quick-action-btn:hover {
    background: white;
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tw-dashboard-quick-action-icon {
    font-size: 2rem;
    color: currentColor;
}

.tw-dashboard-quick-action-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Activity Feed */
.tw-dashboard-activity-feed {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.tw-dashboard-activity-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-dashboard-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tw-dashboard-activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.tw-dashboard-activity-item:hover {
    background: #f9fafb;
}

.tw-dashboard-activity-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    color: white;
}

.tw-dashboard-activity-content {
    flex: 1;
    min-width: 0;
}

.tw-dashboard-activity-main {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.25rem;
}

.tw-dashboard-activity-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.tw-dashboard-activity-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tw-dashboard-activity-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.tw-dashboard-activity-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.tw-dashboard-activity-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.tw-dashboard-activity-badge.info {
    background: #dbeafe;
    color: #1e40af;
}

/* Widget Panel */
.tw-dashboard-widget {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

/* All widgets in tab panel have consistent spacing and rounding */
.tw-tab-panel > .tw-dashboard-widget {
    margin-top: 1.5rem;
}

.tw-tab-panel > .tw-dashboard-widget:first-child {
    margin-top: 0;
}

.tw-dashboard-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.tw-dashboard-widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-dashboard-widget-action {
    font-size: 0.875rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tw-dashboard-widget-action:hover {
    color: #1d4ed8;
}

.tw-dashboard-widget-body {
    padding: 0;
}

/* Fix table rounding inside widget */
.tw-dashboard-widget-body .tw-table-responsive {
    overflow-x: auto;
    overflow-y: visible; /* Allow tooltips to overflow vertically */
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
    border-radius: 0.5rem;
}

.tw-dashboard-widget-body .tw-table {
    border-radius: 0.5rem;
    overflow: visible; /* Allow tooltips to overflow */
}

.tw-dashboard-widget-body .tw-table thead th:first-child {
    border-top-left-radius: 0.5rem;
}

.tw-dashboard-widget-body .tw-table thead th:last-child {
    border-top-right-radius: 0.5rem;
}

/* Allow tooltips to overflow the widget body */
.tw-dashboard-widget-body {
    overflow: visible;
}

.tw-dashboard-widget {
    overflow: visible;
}

@media (max-width: 768px) {
    .tw-dashboard-widget {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .tw-dashboard-widget-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .tw-dashboard-widget-title {
        font-size: 1rem;
        flex-wrap: wrap;
        line-height: 1.4;
    }

    .tw-tab-panel > .tw-dashboard-widget {
        margin-top: 0.75rem;
    }
}

/* Widget Highlight Animations for Email Notifications */
@keyframes widgetPulseSuccess {
    0% {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
}

@keyframes widgetPulseInfo {
    0% {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
}

@keyframes textHighlightInfo {
    0%, 100% {
        background-color: transparent;
        color: inherit;
    }
    50% {
        background-color: #dbeafe;
        color: #1e40af;
    }
}

.tw-dashboard-widget-highlight-success {
    animation: widgetPulseSuccess 1s ease-in-out 2;
    border: 2px solid #22c55e;
    transition: all 0.3s ease;
}

.tw-dashboard-widget-highlight-info {
    animation: widgetPulseInfo 1s ease-in-out 2;
    border: 2px solid #3b82f6;
    transition: all 0.3s ease;
}

.tw-text-highlight-info {
    animation: textHighlightInfo 1s ease-in-out 2;
    padding: 0.5rem;
    border-radius: 0.375rem;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Copy Info Widget Specific Styling - Separated Header and Scrollable Body */
.copy-info-table-container {
    overflow: visible;
}

/* Header table - non-scrolling */
.copy-info-header-table {
    border-bottom: 2px solid #e5e7eb;
}

/* Scrollable body container */
.copy-info-body-scroll {
    overflow-x: hidden !important;
    overflow-y: auto;
    max-height: 400px;
    scroll-behavior: smooth;
}

/* Remove top border from body table to avoid double border */
.copy-info-body-table tbody tr:first-child td {
    border-top: none;
}

.copy-info-table-container .tw-action-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.copy-info-table-container .tw-action-buttons {
    gap: 0.15rem;
}

.copy-info-table-container .tw-table td,
.copy-info-table-container .tw-table th {
    padding: 0.5rem 0.75rem;
}

/* Copy Info Widget — Mobile Card Layout */
@media (max-width: 768px) {
    /* Hide the fixed header table on mobile — labels come from card layout */
    .copy-info-header-table {
        display: none;
    }

    /* Stack rows as cards */
    .copy-info-body-table,
    .copy-info-body-table tbody,
    .copy-info-body-table tr,
    .copy-info-body-table td {
        display: block;
        width: 100% !important;
    }

    .copy-info-body-table tr {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: #fafafa;
    }

    .copy-info-body-table td {
        padding: 0.25rem 0 !important;
        border: none !important;
        text-align: left !important;
    }

    /* Label each cell with data-label */
    .copy-info-body-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.7rem;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.125rem;
    }

    /* Actions row — horizontal layout */
    .copy-info-body-table td.copy-info-col-actions {
        margin-top: 0.5rem;
        padding-top: 0.5rem !important;
        border-top: 1px solid #e5e7eb !important;
    }

    .copy-info-body-table td.copy-info-col-actions::before {
        display: none;
    }

    /* Bigger copy buttons for touch */
    .copy-info-table-container .tw-btn-sm {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.875rem !important;
    }

    /* Bigger action buttons in copy-info */
    .copy-info-table-container .tw-action-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.875rem;
    }

    /* Reduce scroll height since cards take more vertical space */
    .copy-info-body-scroll {
        max-height: 500px;
    }
}

/* Empty State */
.tw-dashboard-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #9ca3af;
}

.tw-dashboard-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.tw-dashboard-empty-state-text {
    font-size: 0.875rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tw-dashboard-container {
        padding: 0.5rem;
    }

    .tw-dashboard-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .tw-dashboard-stat-card {
        padding: 0.875rem;
    }

    .tw-dashboard-stat-value {
        font-size: 1.5rem;
    }

    .tw-dashboard-stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }

    .tw-dashboard-stat-label {
        font-size: 0.7rem;
    }

    .tw-dashboard-quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ====================================================================
 * 10. TAB NAVIGATION COMPONENTS (For Update Pages)
 * ==================================================================== */

/* Section Navigation - Used in appointment/contact update pages */
/* Pill-style tabs matching contact modal design */
.section-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn.active {
    background-color: #667eea;
    color: white;
}

.nav-btn:hover:not(.active) {
    background-color: #e9ecef;
    color: #495057;
}

.nav-btn i {
    font-size: 0.9rem;
}

/* Section Content - Tab Panels */
.section-content {
    display: none;
}

.section-content.active {
    display: block;
}

/* Section Titles and Descriptions */
.section-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.section-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

/* Responsive Tab Navigation */
@media (max-width: 768px) {
    .section-nav {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ====================================================================
 * 11. APPOINTMENT UPDATE PAGE COMPONENTS
 * ==================================================================== */

/* Info Grid - Summary Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: #212529;
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

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

.status-canceled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Invoice-Specific Status Badges */
.invoice-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.invoice-status-paid {
    background: #10b981;
    color: white;
}

.invoice-status-sent {
    background: #10b981;
    color: white;
}

.invoice-status-finalized {
    background: #3b82f6;
    color: white;
}

.invoice-status-draft {
    background: #f59e0b;
    color: #1f2937;
}

/* Invoice Page Layout Styles */
.invoice-header-rounded-top {
    margin-bottom: 0;
    border-radius: 0.5rem 0.5rem 0 0;
}

.invoice-summary-card {
    margin-bottom: 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    margin-top: 0;
}

.invoice-summary-card-body {
    background-color: white;
}

.invoice-amount-total {
    color: #10b981;
    font-weight: 700;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

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

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}


/* ========================================
 * 12. BOOTSTRAP-FREE COMPONENTS
 * Custom implementations to replace Bootstrap
 * ======================================== */

/* === TAB SYSTEM === */

.tw-tabs-nav {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    background: white;
    border: 1px solid #e5e7eb;
    border-bottom: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.tw-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: 1rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-tab:hover {
    color: #3b82f6;
    border-bottom-color: #bfdbfe;
    background: transparent;
}

.tw-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: transparent;
}

.tw-tab i {
    font-size: 1.1rem;
}

.tw-tab .tw-badge {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
}

.tw-tab.active .tw-badge {
    background: #bfdbfe;
    color: #1e40af;
}

.tw-tab-content {
    position: relative;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    overflow: visible; /* Allow tooltips to overflow */
}

/* Remove padding when tab content has dashboard widgets - let widgets show their backgrounds */
.tw-tab-content:has(.tw-dashboard-widget),
.tw-tab-content:has(.tw-tab-panel .tw-dashboard-widget) {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible; /* Allow tooltips to overflow */
}

/* Remove padding/styling when tab content has cards - let cards show directly */
.tw-tab-content:has(.card),
.tw-tab-content:has(.tw-tab-panel .card) {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible; /* Allow tooltips to overflow */
}

.tw-tab-panel {
    display: none;
    animation: tabFadeIn 0.2s ease-in-out;
    overflow: visible; /* Allow tooltips to overflow */
}

.tw-tab-panel.active {
    display: block;
    overflow: visible; /* Allow tooltips to overflow */
}

/* Nested tabs inside tab panels - lighter, more integrated styling */
.tw-tab-panel .tw-tabs-nav {
    border: none;
    border-bottom: 2px solid #e5e7eb;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
    margin-bottom: 1rem;
    padding: 0;
}

.tw-tab-panel .tw-tab {
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1.5rem;
    margin-bottom: -2px;
    background: transparent;
}

.tw-tab-panel .tw-tab.active {
    border-bottom-color: #3b82f6;
    background: transparent;
}

.tw-tab-panel .tw-tab:hover:not(.active) {
    background: rgba(59, 130, 246, 0.05);
}

.tw-tab-panel .tw-tab-content {
    border: 1px solid #e5e7eb;
    box-shadow: none;
    padding: 1.5rem;
    margin-top: 0;
    background: #f9fafb;
    border-radius: 0.5rem;
}

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

@media (max-width: 768px) {
    .tw-tabs-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 2px solid #e5e7eb;
        gap: 0;
    }

    .tw-tabs-nav::-webkit-scrollbar {
        display: none;
    }

    .tw-tab {
        flex-shrink: 0;
        border-bottom: 3px solid transparent;
        border-left: none;
        padding: 0.625rem 1rem;
        font-size: 0.813rem;
        white-space: nowrap;
        width: auto;
    }

    .tw-tab:hover {
        border-left-color: transparent;
        border-bottom-color: #bfdbfe;
    }

    .tw-tab.active {
        border-left-color: transparent;
        border-bottom-color: #3b82f6;
        background: transparent;
    }
}


/* === FK CRUD BUTTONS === */
/* Foreign Key field CRUD action buttons (New, Edit, Duplicate, Move to Bin)
   Used in modal forms for inline foreign key management
   See: item_modal_form.html, invoice_profile_modal_tabbed.html */

/* Layout: Side-by-side with field */
.profile-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

/* Layout: Row of buttons below field (most common) */
.profile-actions-row {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

/* Base button style */
.btn-profile-action {
    padding: 0.375rem 0.5rem;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 40px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
}

.btn-profile-action:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-profile-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-profile-action:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

.btn-profile-action i {
    margin-right: 0.25rem;
}

/* Create/New button (green) */
.btn-profile-create {
    background-color: #d1e7dd;
    border-color: #a3cfbb;
    color: #0f5132;
}

.btn-profile-create:hover:not(:disabled) {
    background-color: #b8d9c7;
}

.btn-profile-create:focus {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Edit button (blue) */
.btn-profile-edit {
    background-color: #cfe2ff;
    border-color: #9ec5fe;
    color: #084298;
}

.btn-profile-edit:hover:not(:disabled) {
    background-color: #b6d4fe;
}

.btn-profile-edit:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Duplicate button (yellow) */
.btn-profile-duplicate {
    background-color: #fff3cd;
    border-color: #ffda6a;
    color: #664d03;
}

.btn-profile-duplicate:hover:not(:disabled) {
    background-color: #ffe69c;
}

.btn-profile-duplicate:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

/* Archive/Move to Bin button (red) */
.btn-profile-archive {
    background-color: #f8d7da;
    border-color: #f1aeb5;
    color: #842029;
}

.btn-profile-archive:hover:not(:disabled) {
    background-color: #f5c2c7;
}

.btn-profile-archive:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Responsive adjustments for FK buttons */
@media (max-width: 576px) {
    .profile-actions-row {
        flex-direction: column;
        gap: 0.375rem;
    }

    .btn-profile-action {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile: CRUD buttons become icon-only squares */
@media (max-width: 768px) {
    .btn-profile-action {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0;  /* hides text */
    }
    .btn-profile-action i {
        margin-right: 0;
        font-size: 0.875rem;
    }
}


/* Email Template Selector Row - inline layout with CRUD buttons */
.email-tpl-selector-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.email-tpl-crud-btns {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* Squared icon-only CRUD buttons */
.email-tpl-crud-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.2s;
    flex-shrink: 0;
}

.email-tpl-crud-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.email-tpl-crud-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.email-tpl-crud-btn:focus {
    outline: none;
}

/* Override margin-right from .btn-profile-action i */
.email-tpl-crud-btn i {
    margin-right: 0;
}

@media (max-width: 576px) {
    .email-tpl-selector-row {
        flex-wrap: wrap;
    }
    .email-tpl-selector-row > select {
        flex: 1 1 100%;
        order: 1;
    }
    .email-tpl-selector-row > label {
        order: 0;
    }
    .email-tpl-crud-btns {
        order: 2;
    }
}

/* === LOADING BUTTON STATES === */
/* Submit button loading spinner states for modal forms
   Pattern: Button contains .btn-text (normal), .btn-spinner (loading)
   JavaScript toggles visibility on form submit
   See: contact_detailed_edit_modal.html */

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ensure spinner is properly hidden when not loading */
.btn-spinner.d-none {
    display: none !important;
}

/* Loading state button */
button[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner animation (if not using Bootstrap spinner) */
@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.125rem solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.1rem;
}

/* Button with spinner should maintain width to prevent layout shift */
.um-btn:has(.btn-spinner),
.btn:has(.btn-spinner) {
    min-width: 120px;
    justify-content: center;
}

/* Spinner icon inside fixed-size action buttons */
.tw-action-btn[disabled] .fa-spinner { font-size: inherit; }

/* === UNIFIED MODAL ALERT STYLES === */

.um-alert-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 8px 0;
}

.um-alert-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.um-alert-message {
    margin: 0;
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
}

.um-alert-error .um-alert-icon {
    color: #ef4444;
}

.um-alert-warning .um-alert-icon {
    color: #f59e0b;
}

.um-alert-success .um-alert-icon {
    color: #10b981;
}

.um-alert-info .um-alert-icon {
    color: #3b82f6;
}


/* === AI CONFIG MODAL STYLES === */

/* Model suggestions visibility toggle */
.ai-model-suggestions {
    display: inline;
}

.ai-model-suggestions-hidden {
    display: none !important;
}

/* Model suggestion links */
.ai-model-suggestions a {
    text-decoration: none;
    color: #0d6efd;
    cursor: pointer;
}

.ai-model-suggestions a:hover {
    text-decoration: underline;
}


/* === COLLAPSE/ACCORDION SYSTEM === */

.tw-collapse-trigger {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.tw-collapse-trigger:hover {
    opacity: 0.8;
}

.tw-collapse-trigger .tw-collapse-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.tw-collapse-trigger.expanded .tw-collapse-icon {
    transform: rotate(180deg);
}

.tw-collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.tw-collapse-content.expanded {
    max-height: 10000px;
    opacity: 1;
    overflow: visible; /* Allow tooltips and other absolutely positioned elements to escape */
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

/* === MOBILE-ONLY COLLAPSE GROUPS === */
/* Desktop (>768px): always visible, trigger is plain header, no chevron */
.mobile-collapse-group .mobile-collapse-trigger {
    pointer-events: none;
}

.mobile-collapse-group .mobile-collapse-trigger .tw-collapse-icon {
    display: none;
}

.mobile-collapse-group .mobile-collapse-content {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
}

@media (max-width: 768px) {
    .mobile-collapse-group .mobile-collapse-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        pointer-events: auto;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 0.5rem;
    }

    .mobile-collapse-group .mobile-collapse-trigger .tw-collapse-icon {
        display: inline-block;
        transition: transform 0.3s ease;
        font-size: 1rem;
        color: #6b7280;
    }

    .mobile-collapse-group .mobile-collapse-trigger.expanded .tw-collapse-icon {
        transform: rotate(180deg);
    }

    .mobile-collapse-group .mobile-collapse-content {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    }

    .mobile-collapse-group .mobile-collapse-content.expanded {
        max-height: 10000px !important;
        opacity: 1 !important;
        overflow: visible !important;
        transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
    }
}

/* Desktop: hide the detail filters collapse trigger (filters always visible inline) */
@media (min-width: 769px) {
    .manager-detail-filters-collapse .mobile-collapse-trigger {
        display: none;
    }
}

/* Specific collapse for year panels */
.tw-year-collapse {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.tw-year-collapse.collapsed {
    max-height: 0;
}

.tw-year-collapse.expanded {
    max-height: 5000px;
}


/* === FORM SWITCHES === */

.tw-switch-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tw-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.tw-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.tw-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.tw-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tw-switch-input:checked + .tw-switch-slider {
    background-color: #10b981;
}

.tw-switch-input:checked + .tw-switch-slider:before {
    transform: translateX(20px);
}

.tw-switch-input:disabled + .tw-switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.tw-switch-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.tw-switch-input:checked ~ .tw-switch-label {
    color: #10b981;
    font-weight: 500;
}


/* === TABLE COMPONENTS === */

.tw-table-responsive {
    overflow-x: auto;
    overflow-y: visible; /* Allow tooltips to overflow vertically */
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.tw-table {
    width: 100%;
    border-collapse: separate; /* Changed from collapse to allow tooltip overflow */
    border-spacing: 0; /* Maintain visual appearance with no gaps */
    background-color: white;
    overflow: visible; /* Allow tooltips to escape */
}

.tw-table thead {
    background-color: #f3f4f6;
    overflow: visible; /* Allow tooltips in table header */
}

.tw-table tbody {
    overflow: visible; /* Allow tooltips in table body */
}

.tw-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    overflow: visible; /* Allow tooltips to escape */
}

.tw-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    overflow: visible; /* Allow tooltips to escape */
    position: relative; /* Create stacking context for proper tooltip rendering */
}

.tw-table tbody tr {
    transition: background-color 0.15s ease;
}

.tw-table tbody tr:hover {
    background-color: #f9fafb;
}

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

.tw-table tfoot {
    background-color: #f3f4f6;
    font-weight: 600;
}

.tw-table tfoot td {
    padding: 0.75rem 1rem;
    border-top: 2px solid #e5e7eb;
    border-bottom: none;
}

/* Table sizes */
.tw-table-sm th,
.tw-table-sm td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.tw-table-lg th,
.tw-table-lg td {
    padding: 1rem 1.25rem;
}

@media (max-width: 768px) {
    .tw-table {
        font-size: 0.875rem;
    }

    .tw-table th,
    .tw-table td {
        padding: 0.5rem 0.75rem;
    }
}


/* === BUTTON GROUP === */

.tw-btn-group {
    display: inline-flex;
    gap: 0;
}

.tw-btn-group .tw-btn,
.tw-btn-group .tw-action-btn,
.tw-btn-group button,
.tw-btn-group a {
    border-radius: 0;
    margin: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.tw-btn-group .tw-btn:first-child,
.tw-btn-group .tw-action-btn:first-child,
.tw-btn-group button:first-child,
.tw-btn-group a:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.tw-btn-group .tw-btn:last-child,
.tw-btn-group .tw-action-btn:last-child,
.tw-btn-group button:last-child,
.tw-btn-group a:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-right: none;
}

.tw-btn-group .tw-btn:only-child,
.tw-btn-group .tw-action-btn:only-child,
.tw-btn-group button:only-child,
.tw-btn-group a:only-child {
    border-radius: 0.375rem;
}


/* === UTILITY CLASSES === */

/* Spacing utilities */
.tw-mb-1 { margin-bottom: 0.25rem; }
.tw-mb-2 { margin-bottom: 0.5rem; }
.tw-mb-3 { margin-bottom: 0.75rem; }
.tw-mb-4 { margin-bottom: 1rem; overflow: visible; }
.tw-mb-5 { margin-bottom: 1.5rem; }
.tw-mb-6 { margin-bottom: 2rem; }

.tw-mt-1 { margin-top: 0.25rem; }
.tw-mt-2 { margin-top: 0.5rem; }
.tw-mt-3 { margin-top: 0.75rem; }
.tw-mt-4 { margin-top: 1rem; }

.tw-p-2 { padding: 0.5rem; }
.tw-p-3 { padding: 0.75rem; }
.tw-p-4 { padding: 1rem; }
.tw-p-5 { padding: 1.5rem; }

.tw-py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.tw-py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.tw-py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.tw-py-5 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.tw-pb-2 { padding-bottom: 0.5rem; }
.tw-pb-3 { padding-bottom: 0.75rem; }

/* Flexbox utilities */
.tw-flex { display: flex; }
.tw-inline-flex { display: inline-flex; }
.tw-items-center { align-items: center; }
.tw-items-start { align-items: flex-start; }
.tw-items-end { align-items: flex-end; }
.tw-justify-center { justify-content: center; }
.tw-justify-between { justify-content: space-between; }
.tw-justify-end { justify-content: flex-end; }
.tw-flex-wrap { flex-wrap: wrap; }
.tw-gap-1 { gap: 0.25rem; }
.tw-gap-2 { gap: 0.5rem; }
.tw-gap-3 { gap: 0.75rem; }
.tw-gap-4 { gap: 1rem; }

/* Text utilities */
.tw-text-center { text-align: center; }
.tw-text-left { text-align: left; }
.tw-text-right { text-align: right; }
.tw-text-muted { color: #6b7280; }
.tw-text-success { color: #10b981; }
.tw-text-danger { color: #ef4444; }
.tw-text-warning { color: #f59e0b; }
.tw-font-semibold { font-weight: 600; }
.tw-font-bold { font-weight: 700; }

/* Display utilities */
.tw-d-inline { display: inline; }
.tw-d-inline-block { display: inline-block; }
.tw-d-block { display: block; }

/* Border utilities */
.tw-border-bottom { border-bottom: 1px solid #e5e7eb; }


/* ========================================
 * 9. CLOUD INTEGRATION COMPONENTS
 * ======================================== */

/* Cloud Provider Cards */
.tw-cloud-provider-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    background: white;
}

.tw-cloud-provider-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

/* Provider Icons */
.tw-provider-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
}

.tw-provider-icon-microsoft {
    background: linear-gradient(45deg, #00a1f1, #0078d4);
}

.tw-provider-icon-google {
    background: linear-gradient(45deg, #4285f4, #34a853);
}

.tw-provider-icon-icloud {
    background: linear-gradient(45deg, #007aff, #5ac8fa);
}

/* Account Status Badges */
.tw-account-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tw-account-status-connected {
    background: #d4edda;
    color: #155724;
}

.tw-account-status-error {
    background: #f8d7da;
    color: #721c24;
}

.tw-account-status-not-connected {
    background: #f8f9fa;
    color: #6c757d;
}

/* Connection Status (for auto-testing) */
.tw-connection-status {
    display: inline-block;
}

.tw-status-connected .tw-account-status,
.tw-status-connected {
    background: #d4edda;
    color: #155724;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tw-status-error .tw-account-status,
.tw-status-error {
    background: #f8d7da;
    color: #721c24;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tw-status-testing .tw-account-status,
.tw-status-testing {
    background: #fff3cd;
    color: #856404;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tw-status-testing i {
    animation: spin 1s linear infinite;
}

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

/* Account Items */
.tw-account-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.tw-account-item:last-child {
    margin-bottom: 0;
}

/* Feature Badges */
.tw-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tw-feature-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tw-feature-badge-available {
    background: #d1ecf1;
    color: #0c5460;
}

.tw-feature-badge-coming-soon {
    background: #fff3cd;
    color: #856404;
}

/* Provider Description */
.tw-provider-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Cloud Connection Buttons */
.tw-btn-connect {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tw-btn-connect:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    color: white;
}

.tw-btn-connect:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tw-btn-disconnect {
    background: #dc3545;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tw-btn-disconnect:hover {
    background: #c82333;
    color: white;
}

.tw-btn-test {
    background: #17a2b8;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tw-btn-test:hover {
    background: #138496;
    color: white;
}

/* Sync Statistics */
.tw-sync-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.tw-sync-stat {
    text-align: center;
}

.tw-sync-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #007bff;
}

.tw-sync-stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Empty State */
.tw-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.tw-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}


/* ===================================================================
 * 12. FOREIGN KEY CRUD COMPONENTS
 * ===================================================================
 * Styles for foreign key fields with CRUD action buttons
 * Used in invoice/offer creation forms and other forms with FK fields
 */

/* Profile field and action buttons styles */
.profile-field-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.profile-select-wrapper {
    flex: 1;
}

.btn-create-from-profile {
    margin-top: 0;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.btn-create-from-profile:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-create-from-profile:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-create-from-profile i {
    font-size: 0.875rem;
}

/* Profile actions button row */
.profile-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Contact creation button styles */
.field-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.field-with-button > div:first-child {
    flex: 1;
}

.btn-create-contact {
    margin-top: 1.875rem; /* Aligns with form field after label */
    padding: 0.625rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-create-contact:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-create-contact i {
    font-size: 0.875rem;
}

/* Success notification for CRUD actions */
.contact-success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000; /* Notifications layer - above modals (2000+) */
    font-weight: 500;
}

.contact-success-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.contact-success-notification i {
    font-size: 1.25rem;
}

/* Profile selection notice */
.profile-selection-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: none;
}

.profile-selection-notice.active {
    display: block;
}

.profile-selection-notice i {
    color: #0284c7;
    margin-right: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .field-with-button {
        flex-direction: column;
    }

    .btn-create-contact {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }

    .contact-success-notification {
        left: 10px;
        right: 10px;
        transform: translateY(-100px);
    }

    .contact-success-notification.show {
        transform: translateY(0);
    }
}

/* Invoice/Offer Creation Page Specific Styles */
.invoice-create-container,
.offer-create-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.invoice-create-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.offer-create-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.invoice-create-header h1,
.offer-create-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.invoice-create-header p,
.offer-create-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.invoice-create-body,
.offer-create-body {
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 2rem;
}

.form-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.form-section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.form-section-description {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
    margin-top: 2rem;
}

.btn-create-invoice,
.btn-create-offer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-create-invoice:hover,
.btn-create-offer:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-cancel {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    border-color: #cbd5e1;
    color: #475569;
}

/* Collapsible sections */
.section-collapsible {
    cursor: pointer;
}

.section-collapsible .form-section-icon {
    transition: transform 0.3s;
}

.section-collapsible.collapsed .form-section-icon {
    transform: rotate(-90deg);
}

.section-content.collapse:not(.show) {
    display: none;
}

.section-content.collapse.show {
    display: block;
}

/* Required field indicator */
.required-indicator {
    color: #dc2626;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Responsive adjustments for invoice/offer creation */
@media (max-width: 768px) {
    .invoice-create-container,
    .offer-create-container {
        margin: 1rem auto;
    }

    .invoice-create-header,
    .offer-create-header {
        padding: 1.5rem;
    }

    .invoice-create-body,
    .offer-create-body {
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-create-invoice,
    .btn-create-offer,
    .btn-cancel {
        width: 100%;
    }
}

/* === INVOICE MANAGEMENT COMPONENTS (Buchhaltung) === */

/* Fixed Header Scrollable Table Components */
.tw-invoice-table-container {
    max-height: 70vh;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tw-invoice-table-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.tw-invoice-pagination-area {
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
    background: white;
}

/* Sticky table headers within scrollable area */
.tw-invoice-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f3f4f6;
    backdrop-filter: blur(8px);
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Table row hover effects - no transform to prevent layout shifts */
.tw-invoice-table-scroll tbody tr:hover {
    background-color: #f8fafc;
    transform: none;
}

.tw-invoice-table-scroll tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.tw-invoice-table-scroll tbody tr:first-child td {
    border-top: none;
}

/* Connected Expenses Components */
.tw-connected-expenses-container {
    min-width: 200px;
}

.tw-expense-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #dbeafe;
    color: #1e40af;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.tw-expense-badge-remove {
    margin-left: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 0.75rem;
    width: 0.75rem;
    border-radius: 9999px;
    color: #60a5fa;
    cursor: pointer;
}

.tw-expense-badge-remove:hover {
    background-color: #bfdbfe;
    color: #1e40af;
}

/* Invoice Badge Styles */
.tw-invoice-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.tw-invoice-badge-clickable {
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.tw-invoice-badge-clickable:hover {
    background-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.tw-invoice-badge-clickable:active {
    transform: translateY(0);
}

.tw-invoice-badge-remove {
    margin-left: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
}

.tw-invoice-badge-remove:hover {
    background-color: #bfdbfe;
    color: #1e40af;
}

/* Transaction Badge Styles */
.tw-transaction-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.tw-transaction-badge-clickable {
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.tw-transaction-badge-clickable:hover {
    background-color: #a7f3d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(6, 95, 70, 0.2);
}

.tw-transaction-badge-clickable:active {
    transform: translateY(0);
}

.tw-transaction-badge-remove {
    margin-left: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
}

.tw-transaction-badge-remove:hover {
    background-color: #a7f3d0;
    color: #065f46;
}

/* Confidence Badge Colors */
.tw-confidence-badge {
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 2px;
    display: inline-block;
}

.tw-confidence-badge-high {
    background-color: #10b981; /* Green for >=80% */
}

.tw-confidence-badge-medium {
    background-color: #f59e0b; /* Yellow for >=60% */
}

.tw-confidence-badge-low {
    background-color: #6b7280; /* Gray for <60% */
}

/* Table Column Widths */
.tw-col-checkbox {
    width: 40px;
}

.tw-col-sm {
    max-width: 200px;
}

.tw-col-md {
    max-width: 300px;
}

/* Utility Classes */
.tw-cursor-pointer {
    cursor: pointer;
}

/* Tom Select Styling for Invoice Page */
.tw-expense-selector .ts-control {
    min-height: 32px;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.tw-expense-selector .ts-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tw-expense-selector .ts-control.disabled {
    opacity: 0.6;
    background-color: #f9fafb;
    color: #6b7280;
}

.ts-dropdown {
    z-index: 1050;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Invoice Action Buttons */
.tw-invoice-action-btn {
    cursor: pointer;
    min-width: 32px;
    min-height: 32px;
    border: 1px solid #e5e7eb;
    background: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.tw-invoice-action-btn:hover {
    border-color: #fbbf24;
    background: #fef3c7;
}

.tw-invoice-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: #f9fafb;
}

/* Finanzamt Copy Button */
.finanzamt-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.375rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
    vertical-align: middle;
    border-radius: 0.25rem;
}

.finanzamt-copy-btn:hover {
    color: #3b82f6;
    background-color: #eff6ff;
    transform: scale(1.1);
}

.finanzamt-copy-btn:active {
    transform: scale(0.95);
}

.finanzamt-copy-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Finanzamt copy button icon */
.finanzamt-copy-btn i {
    pointer-events: none;
}

/* Tax Report Buchungen Link */
.tax-report-buchungen-link {
    color: #2563eb;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.tax-report-buchungen-link:hover {
    color: #1d4ed8;
    text-decoration-style: solid;
}

.tax-report-buchungen-link--card {
    color: inherit;
    text-decoration-color: currentColor;
}

.tax-report-buchungen-link--card:hover {
    color: #2563eb;
    text-decoration-color: #2563eb;
}

/* Auto-save Indicator Styling */
.tw-alert-auto-save {
    border-left: 4px solid #10b981;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Bootstrap Icons Support */
.bi::before {
    display: inline-block;
    font-family: bootstrap-icons !important;
    font-style: normal;
    font-weight: normal !important;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: -.125em;
}

/* === PRINT PREVIEW COMPONENTS === */

/* Print Controls Sticky Bar */
.tw-print-controls {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Draft Banner */
.tw-draft-banner {
    background: #fff3cd;
    color: #856404;
    padding: 10px 20px;
    text-align: center;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Print Controls Button Container */
.tw-print-controls-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

/* Print Control Buttons */
.tw-print-btn {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.tw-print-btn:hover {
    background: #0b5ed7;
}

.tw-print-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tw-download-btn {
    background: #198754;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease;
}

.tw-download-btn:hover {
    background: #146c43;
    color: white;
    text-decoration: none;
}

/* Payment Toggle in Print Controls */
.tw-payment-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    user-select: none;
    transition: background 0.2s ease;
}

.tw-payment-toggle:hover {
    background: #e9ecef;
}

.tw-payment-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
}

.tw-payment-toggle span {
    color: #495057;
    font-weight: 500;
}

/* Payment rows in invoice print */
.document-payment-header {
    padding-top: 0.5rem;
    font-size: 0.95em;
    text-align: left;
}

.document-payment-row td {
    font-size: 0.9em;
    color: #555;
}

.document-payment-summary td,
.document-payment-remaining td {
    padding-top: 0.25rem;
}

/* Print Content Container */
.tw-print-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tw-print-controls {
        padding: 10px 0;
    }

    .tw-print-btn,
    .tw-download-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Print Media Queries */
@media print {
    .tw-print-controls {
        display: none !important;
    }

    /* Hide navigation and other non-print elements */
    nav, .navbar, .nav, header, footer,
    .modern-nav-wrapper,
    .nav-accent-bar {
        display: none !important;
    }

    /* Hide modal containers and other UI chrome */
    #unified-modal-container,
    #modal {
        display: none !important;
    }

    /* Ensure content uses full page */
    body {
        margin: 0;
        padding: 0;
    }

    .content-wrapper,
    .tw-content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    .tw-print-content {
        margin: 0;
        padding: 0;
        max-width: none;
    }
}

/* Hide controls on load if URL has print parameter */
.print-mode .tw-print-controls {
    display: none !important;
}


/* ========================================================================
   14. LIST VIEW PREFERENCES COMPONENTS
   ======================================================================== */

/* Preset Selector Dropdown */
.preset-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preset-selector-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

#preset-selector {
    min-width: 200px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

#preset-selector:hover {
    border-color: #9ca3af;
}

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

/* Column Settings Button */
#column-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

#column-settings-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

#column-settings-btn:active {
    background-color: #f3f4f6;
}

#column-settings-btn i {
    font-size: 1rem;
}

/* Manager Toolbar with Preferences */
.manager-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    gap: 1rem;
    flex-wrap: wrap;
}

.manager-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.manager-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Column Settings Modal Styles */
.column-item {
    padding: 0.75rem 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: move;
}

.column-item:hover {
    background-color: #f9fafb;
}

.column-item.dragging {
    opacity: 0.5;
    background-color: #e0e7ff;
}

.column-item .drag-handle {
    cursor: grab;
    user-select: none;
}

.column-item .drag-handle:active {
    cursor: grabbing;
}

.column-item .form-check-label {
    cursor: pointer;
    user-select: none;
}

.column-item .small {
    font-size: 0.75rem;
    line-height: 1.25;
}

/* Filter Toggle Switch */
.filter-toggle {
    cursor: pointer;
}

.filter-toggle:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Column List Container */
#column-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

#column-list .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
}

#column-list .list-group-item:first-child {
    border-top: none;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

#column-list .list-group-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Preset Action Buttons */
#save-as-new-preset-btn,
#delete-preset-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#save-as-new-preset-btn:hover {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

#delete-preset-btn:hover:not(:disabled) {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
}

#delete-preset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Select All/Deselect All Buttons */
#select-all-columns,
#deselect-all-columns {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Reset to Defaults Button */
#reset-to-defaults-btn {
    margin-right: auto;
}

#reset-to-defaults-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .manager-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .manager-toolbar-left,
    .manager-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .preset-selector-container {
        flex: 1;
    }

    #preset-selector {
        flex: 1;
    }

    #column-list {
        max-height: 300px;
    }
}

/* Animation for drag-drop feedback */
@keyframes columnDragEnter {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

.column-item.drag-over {
    animation: columnDragEnter 0.3s ease;
    border-color: #3b82f6;
}

/* ============================================================================
   BULK EDIT - Expense Table Column Hover
   ============================================================================
   Styles for bulk-editable column headers with keyboard shortcuts.
   Hover over column header + press "b" to trigger bulk edit modal.
*/

.bulk-editable-column {
    position: relative;
    transition: all 0.2s ease;
}

/* Hover state - indicates column is bulk-editable */
.bulk-editable-column:hover {
    background-color: #eff6ff !important;  /* Light blue background */
    box-shadow: inset 0 0 0 2px #3b82f6;   /* Blue border effect */
}

/* Active hover state when JavaScript detects hover */
.bulk-editable-column.bulk-edit-hover {
    background-color: #dbeafe !important;  /* Slightly darker blue */
    box-shadow: inset 0 0 0 2px #2563eb;   /* Darker blue border */
    cursor: pointer;
}

/* Add visual indicator for keyboard shortcut */
.bulk-editable-column::after {
    content: 'B';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    font-weight: bold;
    color: #94a3b8;  /* Gray text */
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.bulk-editable-column:hover::after {
    opacity: 1;
}

/* Bulk edit modal enhancements */
.bulk-edit-form .btn-group label {
    flex: 1;
    text-align: center;
}

.bulk-edit-form .alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* ========================================
   EXPENSE TABBED VIEW STYLES
   ======================================== */

/* Locked Field Styling (CSV Import Fields) */
.locked-field {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
    border: 1px solid #ddd !important;
    color: #666 !important;
    position: relative;
}

.locked-field::before {
    content: "\f023";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

/* Import Metadata Banner */
.import-metadata-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.import-metadata-banner i {
    font-size: 18px;
}

.import-metadata-banner strong {
    font-weight: 600;
}

/* Info Card (View Mode Display) */
.info-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 15px;
    min-height: 38px;
    display: flex;
    align-items: center;
    color: #495057;
    font-size: 14px;
}

.info-card.empty {
    color: #999;
    font-style: italic;
}

/* Tab Section Organization */
.tab-section {
    padding: 20px 0;
}

.tab-section:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.tab-section-header {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

/* ============================================
   EXPENSE FORM STYLES
   Centralized from expense_detail_edit_modal.html
   and expense_tabbed_unified.html inline styles
   ============================================ */

/* Expense field grid (2-column responsive) */
.expense-field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (max-width: 768px) {
    .expense-field-grid { grid-template-columns: 1fr; }
}

.expense-field-full {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .expense-field-full { grid-column: span 1; }
}

/* 3-column flag row */
.expense-field-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    grid-column: span 2;
}
@media (max-width: 768px) {
    .expense-field-trio { grid-template-columns: 1fr; grid-column: span 1; }
}

/* Scoped form input styling */
.expense-form .form-control,
.expense-form .form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.expense-form .form-control:focus,
.expense-form .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.expense-form .form-control:disabled,
.expense-form .form-select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}
.expense-form .form-check-input {
    height: 1rem;
    width: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    accent-color: #3b82f6;
}

/* Financial summary cards (view mode) */
.expense-summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    grid-column: span 2;
}
@media (max-width: 768px) {
    .expense-summary-row { grid-template-columns: 1fr; grid-column: span 1; }
}
.expense-summary-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
}
.expense-summary-card h6 {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}
.expense-summary-card p {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Section headers within expense tabs */
.expense-section-header {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #d1d5db;
}
.expense-section-header:first-child {
    margin-top: 0;
}

/* Overview tab cards (modal) */
.info-card-overview {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.info-card-overview .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.info-card-overview .card-body {
    padding: 1rem;
}

/* Field rows in overview cards */
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.field-row:last-child { border-bottom: none; }
.field-row.flex-col { flex-direction: column; align-items: flex-start; }
.field-row .label { color: #6b7280; font-size: 0.875rem; font-weight: 500; }
.field-row .value { color: #111827; font-size: 0.875rem; font-weight: 600; }
.field-row .value.amount { font-size: 1.125rem; }
.field-row .value.amount.negative { color: #dc2626; }
.field-row .value.amount.positive { color: #16a34a; }

/* Connected data sections */
.connected-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.connected-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}
.connected-item:last-child { margin-bottom: 0; }
.connected-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.items-table {
    width: 100%;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    border-collapse: collapse;
}
.items-table th {
    background: #f3f4f6;
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}
.items-table td {
    padding: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Progress bar */
.progress-bar-expense {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill-expense {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
}

/* Backwards compatibility aliases */
.modal-field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (max-width: 768px) {
    .modal-field-grid { grid-template-columns: 1fr; }
}
.field-full-width {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .field-full-width { grid-column: span 1; }
}

/* CSV Import Data Display */
.csv-import-section {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.import-data-display dl {
    margin-bottom: 0;
}

.import-data-display dt {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}

.import-data-display dd {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 10px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    font-size: 24px;
    margin: 0;
    color: #212529;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Invoice Cards */
.invoice-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 15px;
    transition: all 0.2s;
}

.invoice-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.invoice-card a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.invoice-card a:hover {
    text-decoration: underline;
}

/* Keyword Badges */
.keyword-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-badges .badge {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
}

/* Tab Content Styling */
.tab-content {
    padding: 20px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    color: #6c757d;
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    padding: 12px 20px;
}

.nav-tabs .nav-link:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

.nav-tabs .nav-link.active {
    color: #667eea;
    background-color: transparent;
    border-bottom-color: #667eea;
}

/* Form Elements in Locked State */
select.locked-field,
input.locked-field,
textarea.locked-field {
    opacity: 0.7;
}

/* Progress Bar in Business Classification */
.progress {
    background-color: #e9ecef;
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* === CLOUD SYNC STATUS BADGES === */

/* Sync provider row container */
.sync-provider-row {
    transition: all 0.2s ease-in-out;
}

.sync-provider-row:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Status badge styles */
.badge-success {
    background-color: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Error message styling */
.sync-provider-row .tw-bg-red-50 {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        margin-top: 15px;
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }

    /* Stack sync provider elements on mobile */
    .sync-provider-row .form-check-switch {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .sync-provider-row .tw-ml-4 {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-start;
    }
}

/* === CONTACT MERGE DRAG-DROP STYLES === */

/* Draggable sync cards */
.sync-card[draggable="true"] {
    cursor: grab;
    transition: all 0.2s ease;
}

.sync-card[draggable="true"]:active {
    cursor: grabbing;
}

/* Card being dragged */
.sync-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Valid drop target */
.sync-card.drop-target {
    border: 2px dashed #2563eb !important;
    background-color: rgba(37, 99, 235, 0.05);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Invalid drop target (same card or different source) */
.sync-card.drop-invalid {
    border: 2px dashed #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Drag handle icon indicator */
.sync-card .drag-handle {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sync-card:hover .drag-handle {
    opacity: 0.5;
}

.sync-card:hover .drag-handle:hover {
    opacity: 1;
}

/* === CONTACT MERGE DRAG-DROP STYLES (Table Rows) === */

/* Make table rows draggable with visual cue */
.tw-merge-draggable {
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.tw-merge-draggable:active {
    cursor: grabbing;
}

/* Row being dragged */
.tw-merge-draggable.tw-merge-dragging {
    opacity: 0.5;
    background-color: #e0e7ff !important;
    transform: scale(0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Valid drop target */
.tw-merge-draggable.tw-merge-drop-target {
    background-color: rgba(37, 99, 235, 0.08) !important;
    outline: 2px dashed #2563eb;
    outline-offset: -2px;
    transform: scale(1.01);
}

/* Invalid drop target (same row) */
.tw-merge-draggable.tw-merge-drop-invalid {
    background-color: rgba(220, 53, 69, 0.08) !important;
    outline: 2px dashed #dc3545;
    outline-offset: -2px;
}

/* Merge preview form - fields that received data from source contact */
.merge-field-changed {
    border-left: 3px solid #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05);
    padding-left: 0.75rem;
    transition: all 0.2s ease;
}

.merge-field-changed:focus-within {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Merge field label indicator */
.merge-field-indicator {
    display: inline-block;
    font-size: 0.75rem;
    color: #dc3545;
    margin-left: 0.5rem;
}

/* Merge arrow indicator between contacts */
.merge-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: #e5e7eb;
    border-radius: 50%;
    color: #6b7280;
    margin: 0 0.75rem;
}

/* Contact preview cards in merge confirmation */
.merge-contact-preview {
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.merge-contact-preview.source {
    border-color: #fbbf24;
    background-color: #fffbeb;
}

.merge-contact-preview.target {
    border-color: #22c55e;
    background-color: #f0fdf4;
}

/* === AI IMAGE UPLOAD STYLES === */

/* Drop zone for image upload */
.ai-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ai-drop-zone:hover,
.ai-drop-zone.drag-over {
    border-color: var(--tw-primary-color, #2563eb);
    background: #eff6ff;
}

.ai-drop-zone i {
    font-size: 2rem;
    color: #9ca3af;
}

.ai-drop-zone span {
    color: #6b7280;
    font-size: 0.875rem;
}

/* File upload label (clickable) */
.ai-image-upload-label {
    color: var(--tw-primary-color, #2563eb);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

.ai-image-upload-label:hover {
    color: #1d4ed8;
}

/* Image preview container */
.ai-image-preview {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    max-width: 100%;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 0.5rem;
}

.ai-image-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 0.375rem;
    display: block;
    margin: 0 auto;
}

/* Remove image button */
.ai-remove-image {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ai-remove-image:hover {
    background: rgba(0, 0, 0, 0.8);
}

.ai-remove-image i {
    font-size: 0.875rem;
}

/* Image upload section container */
.ai-image-upload-section {
    margin-bottom: 1rem;
}

/* === AI ASSIST PANEL - PROGRESSIVE DISCLOSURE === */

/* Main panel container */
.ai-assist-panel {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Mode buttons row (Text eingeben / Aufnehmen) */
.ai-mode-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.ai-mode-buttons .tw-btn {
    flex: 1;
    max-width: 200px;
}

.ai-mode-buttons .tw-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Text section container (hidden by default) */
.ai-text-section {
    margin-top: 1rem;
    animation: slideDown 0.2s ease-out;
}

.ai-text-section .form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.ai-text-section textarea {
    resize: vertical;
    min-height: 120px;
}

/* Compact drop zone (shown in text-first mode) */
.ai-compact-drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    border: 1px dashed #d1d5db;
    border-radius: 0.375rem;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 0.875rem;
}

.ai-compact-drop-zone:hover,
.ai-compact-drop-zone.drag-over {
    border-color: var(--tw-primary-color, #2563eb);
    background: #eff6ff;
    color: var(--tw-primary-color, #2563eb);
}

.ai-compact-drop-zone i {
    font-size: 1rem;
}

/* Submit buttons row (Extract / Clear) */
.ai-submit-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    animation: slideDown 0.2s ease-out;
}

/* Slide down animation for progressive disclosure */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Email processing table — no horizontal scroll needed, allow tooltip overflow */
.email-processing-table.tw-table-responsive {
    overflow: visible;
}

/* === EMAIL PROCESSING TABLE - MOBILE === */
@media (max-width: 768px) {
    .email-processing-table table,
    .email-processing-table thead,
    .email-processing-table tbody,
    .email-processing-table tr,
    .email-processing-table td,
    .email-processing-table th {
        display: block;
        width: 100%;
    }

    .email-processing-table thead {
        display: none;
    }

    .email-processing-table tr {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: white;
    }

    .email-processing-table td {
        padding: 0.25rem 0;
        border: none;
        text-align: left;
    }

    .email-processing-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.7rem;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.125rem;
    }

    /* Actions row — wrap buttons, hide text labels */
    .email-processing-table .email-col-actions {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #e5e7eb;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .email-processing-table .email-col-actions::before {
        display: none;
    }

    /* Ensure buttons have proper touch targets */
    .email-processing-table .tw-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Subject truncation — allow wrapping on mobile */
    .email-processing-table .email-col-subject {
        word-break: break-word;
    }
}


/* ==========================================================================
   14. AUTH PAGES (Login, Register, Password Reset, Landing)
   ========================================================================== */

/* Auth page wrapper — vertically centered layout */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 3rem 1rem 2rem;
}

/* Puggle brand logo above card */
.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo-text {
    font-family: var(--theme-logo-font, 'Doto', sans-serif);
    font-weight: var(--theme-logo-font-weight, 800);
    font-size: 2.5rem;
    letter-spacing: 0.02em;
    background: var(--theme-logo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Auth card — clean white */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.auth-card-header {
    padding: 1.25rem 1.5rem;
    background: #1f2937;
    border-bottom: none;
    text-align: center;
}

.auth-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

.auth-card-header h3 i {
    color: rgba(255, 255, 255, 0.7);
}

.auth-card-body {
    padding: 1.5rem;
}

.auth-card-footer {
    padding: 1rem 1.5rem;
    background: #1f2937;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.auth-card-footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
}

.auth-card-footer a:hover {
    text-decoration: underline;
    color: #ffffff;
}

.auth-card-footer .auth-btn-secondary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.auth-card-footer .auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.auth-card-footer .auth-divider {
    border-top-color: rgba(255, 255, 255, 0.15);
}

.auth-card-footer .auth-text-muted {
    color: rgba(255, 255, 255, 0.5);
}

/* Auth form groups */
.auth-form-group {
    margin-bottom: 1rem;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Auth inputs — clean white */
.auth-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #1f2937;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--theme-input-focus-border);
    box-shadow: 0 0 0 3px rgba(var(--theme-input-focus-border), 0.15);
}

.auth-input::placeholder {
    color: #9ca3af;
}

/* Auth primary button — gradient bg */
.auth-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--theme-brand-gradient);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.auth-btn-primary:hover {
    opacity: 0.9;
    color: #ffffff;
    text-decoration: none;
}

.auth-btn-primary:active {
    transform: scale(0.98);
}

/* Auth secondary/outline button */
.auth-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--theme-brand-primary);
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.auth-btn-secondary:hover {
    background: #f9fafb;
    border-color: var(--theme-brand-primary);
    color: var(--theme-brand-primary);
    text-decoration: none;
}

/* Auth links — themed color */
.auth-link {
    color: var(--theme-brand-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.auth-link:hover {
    opacity: 0.8;
    color: var(--theme-brand-primary);
    text-decoration: underline;
}

/* Auth divider */
.auth-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.25rem 0;
}

/* Auth alerts — themed */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.auth-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.auth-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.auth-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* Auth text helpers */
.auth-text-muted {
    color: #6b7280;
    font-size: 0.8125rem;
}

.auth-text-center {
    text-align: center;
}

.auth-text-danger {
    color: var(--theme-danger, #ef4444);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Auth icon color in card context */
.auth-card .auth-icon-accent {
    color: var(--theme-brand-primary);
}

/* Auth steps list for info pages */
.auth-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}

.auth-steps li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.auth-steps li i {
    color: var(--theme-brand-primary);
    width: 1.25rem;
    text-align: center;
}

/* Auth success icon (large) */
.auth-success-icon {
    color: var(--theme-success, #22c55e);
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

/* Auth password requirements */
.auth-password-hints {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.auth-password-hints ul {
    padding-left: 1.25rem;
    margin: 0.375rem 0 0;
}

.auth-password-hints li {
    margin-bottom: 0.125rem;
}

/* Auth footer (links below card) */
.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-page {
        padding: 2rem 0.75rem 1.5rem;
    }

    .auth-logo-text {
        font-size: 2rem;
    }

    .auth-card-body {
        padding: 1.25rem;
    }
}

/* Auth pages are always white-mode — no per-theme overrides needed */


/* ==========================================================================
   15. ADMIN PANEL COMPONENTS
   Always light — like auth pages, no per-theme overrides needed.
   ========================================================================== */

/* --- Page Header --- */
.admin-page-header {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.admin-page-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.admin-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.admin-page-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.125rem 0 0 0;
}

/* --- Stat Cards --- */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
    .admin-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .admin-stats-row {
        grid-template-columns: 1fr;
    }
}

.admin-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.admin-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.admin-stat-icon.icon-brand {
    background: #ede9fe;
    color: #7c3aed;
}

.admin-stat-icon.icon-success {
    background: #dcfce7;
    color: #16a34a;
}

.admin-stat-icon.icon-warning {
    background: #fef3c7;
    color: #d97706;
}

.admin-stat-icon.icon-info {
    background: #dbeafe;
    color: #2563eb;
}

.admin-stat-info {
    display: flex;
    flex-direction: column;
}

.admin-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.admin-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.125rem;
}

/* --- Filter Bar --- */
.admin-filter-bar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-filter-bar label {
    color: #374151;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.admin-filter-bar .form-select,
.admin-filter-bar .form-control {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #1f2937;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-filter-bar .form-select:focus,
.admin-filter-bar .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

.admin-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1.25rem;
    background: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.admin-filter-btn:hover {
    background: #4f46e5;
}

/* --- Table Card --- */
.admin-table-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-table-card-header {
    padding: 0.875rem 1.5rem;
    background: #1f2937;
    display: flex;
    align-items: center;
}

.admin-table-card-header h5 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
}

.admin-table-card-header h5 i {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 0.5rem;
}

.admin-table-card-body {
    padding: 0;
}

/* --- Admin Table --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: #374151;
    font-size: 0.875rem;
}

.admin-table thead th {
    padding: 0.625rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

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

.admin-table tbody tr {
    transition: background-color 0.1s ease;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

.admin-table .text-muted {
    color: #9ca3af !important;
}

.admin-table .text-end {
    text-align: right;
}

.admin-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Admin Badges --- */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.admin-badge-superuser {
    background: #fef2f2;
    color: #dc2626;
}

.admin-badge-staff {
    background: #fffbeb;
    color: #d97706;
}

.admin-badge-user {
    background: #f3f4f6;
    color: #6b7280;
}

.admin-badge-active {
    background: #f0fdf4;
    color: #16a34a;
}

.admin-badge-blocked {
    background: #fef2f2;
    color: #dc2626;
}

.admin-badge-verified {
    color: #16a34a;
}

.admin-badge-unverified {
    color: #d1d5db;
}

/* --- Action Buttons --- */
.admin-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #ffffff;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.admin-action-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f5f3ff;
}

.admin-action-btn.action-block:hover {
    color: #d97706;
    border-color: #fbbf24;
    background: #fffbeb;
}

.admin-action-btn.action-unblock:hover {
    color: #16a34a;
    border-color: #4ade80;
    background: #f0fdf4;
}

.admin-action-btn.action-export:hover {
    color: #2563eb;
    border-color: #60a5fa;
    background: #eff6ff;
}

.admin-action-btn.action-delete:hover {
    color: #dc2626;
    border-color: #f87171;
    background: #fef2f2;
}

.admin-action-group {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

/* --- Role Select --- */
.admin-role-select {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #1f2937;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    min-width: 110px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.admin-role-select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

/* --- Empty State --- */
.admin-table tbody .admin-empty-row td {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
    font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .admin-page-header {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    .admin-page-header h1 {
        font-size: 1.25rem;
    }
}

/* ============================================================
   MANAGER PAGES — MOBILE UX POLISH (≤ 768px)
   Targets all ConfigurableManagerMixin list/manager pages.
   Placed last so later-position wins at equal specificity.
   ============================================================ */
@media (max-width: 768px) {

    /* --- 1. Horizontal scroll on table --- */
    .tw-list-view-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tw-list-view-table .tw-table {
        min-width: 500px;
    }

    /* --- 2. Reduce container padding (gain ~16px) --- */
    .main-container.tw-px-4 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .tw-filter-bar {
        padding: 0.75rem;
    }
    .tw-list-view-header {
        padding: 0.5rem 0.75rem;
    }
    .tw-page-header {
        padding: 0.75rem;
    }

    /* --- 3. Shrink checkbox column (48 → 32px) --- */
    .tw-table-checkbox {
        width: 2rem;
        padding: 0.25rem;
    }
    .tw-table-checkbox .tw-checkbox {
        width: 0.875rem;
        height: 0.875rem;
    }

    /* --- 4. Shrink actions column & buttons --- */
    .tw-table-actions {
        width: auto;
        min-width: 0;
        white-space: nowrap;
    }
    .tw-action-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
    .tw-action-buttons {
        gap: 2px;
    }

    /* --- 5. Icon-only toolbar buttons --- */
    .manager-toolbar-right .btn {
        font-size: 0;
        padding: 0.375rem;
        min-width: 2.25rem;
        min-height: 2.25rem;
    }
    .manager-toolbar-right .btn > i {
        font-size: 0.875rem;
        margin-right: 0 !important;
    }
    .manager-toolbar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    .preset-selector-label {
        font-size: 0;
    }
    .preset-selector-label > i {
        font-size: 0.875rem;
    }

    /* --- 6. Icon-only create button in header --- */
    .tw-page-header-actions .tw-btn {
        font-size: 0;
        padding: 0.5rem;
        min-width: 2.5rem;
        min-height: 2.5rem;
    }
    .tw-page-header-actions .tw-btn > i {
        font-size: 1rem;
        margin-right: 0 !important;
    }
    .tw-page-header-actions .tw-btn > span {
        display: none;
    }

    /* --- 7. Date filter labels visible, inputs full width --- */
    .tw-filter-field-group .tw-filter-date-input {
        width: auto;
        flex: 1;
    }

    /* --- 8. Smaller table text & padding --- */
    .tw-table {
        font-size: 0.75rem;
    }
    .tw-table-header th {
        font-size: 0.625rem;
        padding: 0.375rem;
    }
    .tw-table-cell {
        padding: 0.375rem;
        font-size: 0.75rem;
    }
    .tw-truncate-text {
        max-width: 80px;
    }
    .tw-truncate-email {
        max-width: 70px;
    }
    .tw-truncate-date {
        max-width: 60px;
    }

    /* --- 9. Polish — filter tabs, bulk actions, filter cards --- */
    .tw-filter-bar .tw-filter-tab {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
    .tw-filter-bar .tw-filter-tab > i {
        display: none;
    }
    .tw-bulk-actions {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    .tw-bulk-actions .tw-btn-sm {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
    #noSelectionText {
        font-size: 0.75rem;
    }
    .tw-filter-cards-section {
        margin-top: 0.5rem;
    }
    .tw-filter-cards-grid {
        gap: 0.5rem;
    }
    .tw-filter-card {
        padding: 0.75rem;
    }

    /* --- 10. Mobile: Collapse saved filter cards --- */
    .tw-filter-cards-section .mobile-collapse-trigger {
        padding: 0.5rem 0;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 0.25rem;
    }
    .tw-filter-cards-section .mobile-collapse-trigger .tw-filter-cards-section-title {
        margin-bottom: 0 !important;
    }

    /* --- 11. Mobile: Hide preference toolbar --- */
    .manager-toolbar {
        display: none !important;
    }

    /* --- 12. Mobile: Detail filter trigger styling --- */
    .manager-detail-filters-collapse {
        width: 100%;
    }
    .manager-detail-filters-collapse .mobile-collapse-trigger {
        padding: 0.25rem 0;
        border-bottom: none;
        margin-bottom: 0;
    }
    .tw-detail-filters-label {
        font-size: 0.8125rem;
        font-weight: 500;
        color: #6b7280;
    }

    /* --- 13. Mobile: Filter bar ordering — search, tabs, detail filters --- */
    .tw-filter-bar .tw-search-bar {
        order: 1;
    }
    .tw-filter-bar .tw-filter-bar-tabs {
        width: 100%;
        justify-content: center;
        order: 2;
    }
    .tw-filter-bar .manager-detail-filters-collapse {
        order: 3;
    }
}

/* ==========================================================================
   BUCHHALTUNG MODULE — MOBILE UX POLISH
   Scoped to [data-module="buchhaltung"] so zero impact on other pages.
   ========================================================================== */
@media (max-width: 768px) {

    /* 1. General container padding reduction */
    [data-module="buchhaltung"] .container.mx-auto {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    [data-module="buchhaltung"] .max-w-full.mx-auto,
    [data-module="buchhaltung"] .max-w-none.mx-auto {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* 2. Expense list header buttons → icon-only */
    [data-module="buchhaltung"] .admin-page-header .flex-wrap > a,
    [data-module="buchhaltung"] .admin-page-header .flex-wrap > button {
        font-size: 0 !important;
        padding: 0.5rem !important;
        min-width: 2.5rem;
        min-height: 2.5rem;
    }
    [data-module="buchhaltung"] .admin-page-header .flex-wrap > a > i,
    [data-module="buchhaltung"] .admin-page-header .flex-wrap > button > i {
        font-size: 1rem;
        margin-right: 0 !important;
    }
    [data-module="buchhaltung"] .admin-page-header .flex-wrap > a > span,
    [data-module="buchhaltung"] .admin-page-header .flex-wrap > button > span {
        display: none;
    }

    /* 3. Transaction/report header buttons → icon-only */
    [data-module="buchhaltung"] .tw-page-header-actions a.inline-flex {
        font-size: 0;
        padding: 0.5rem !important;
        min-width: 2.5rem;
    }
    [data-module="buchhaltung"] .tw-page-header-actions a.inline-flex > svg,
    [data-module="buchhaltung"] .tw-page-header-actions a.inline-flex > i {
        font-size: 1rem;
        margin-right: 0 !important;
    }

    /* 4. Control panel tabs → icon-only with badges preserved */
    [data-module="buchhaltung"] .control-panel-tab,
    [data-module="buchhaltung"] .transaction-control-panel-tab {
        font-size: 0 !important;
        padding: 0.5rem 0.625rem !important;
    }
    [data-module="buchhaltung"] .control-panel-tab > i,
    [data-module="buchhaltung"] .transaction-control-panel-tab > i {
        font-size: 0.875rem;
        margin-right: 0.25rem !important;
    }
    [data-module="buchhaltung"] .control-panel-tab > span,
    [data-module="buchhaltung"] .transaction-control-panel-tab > span {
        font-size: 0.625rem !important;
        padding: 0.125rem 0.375rem !important;
        margin-left: 0.125rem !important;
    }
    /* Tab header row — reduce padding */
    [data-module="buchhaltung"] #controlPanelContainer > .border-b > .flex {
        padding: 0.5rem 0.75rem !important;
    }

    /* 5. Bulk action toolbar → compact */
    [data-module="buchhaltung"] #bulk-action-toolbar-expenses {
        padding: 0.5rem !important;
    }
    [data-module="buchhaltung"] #bulk-action-toolbar-expenses button {
        font-size: 0;
        padding: 0.375rem 0.5rem !important;
    }
    [data-module="buchhaltung"] #bulk-action-toolbar-expenses button > i {
        font-size: 0.875rem;
        margin-right: 0 !important;
    }
    [data-module="buchhaltung"] #bulk-action-toolbar-expenses .selected-count {
        font-size: 0.75rem !important;
    }

    /* 6. Table cells → compact padding */
    [data-module="buchhaltung"] table thead th {
        padding: 0.5rem !important;
        font-size: 0.625rem !important;
    }
    [data-module="buchhaltung"] table tbody td {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    /* 7. Stats cards → compact text & padding */
    /* Gradient stats cards (SVS, transaction list) */
    [data-module="buchhaltung"] .bg-gradient-to-br .p-6 {
        padding: 1rem !important;
    }
    [data-module="buchhaltung"] .bg-gradient-to-br .text-3xl {
        font-size: 1.25rem !important;
    }
    /* Flat stats cards */
    [data-module="buchhaltung"] .border-l-4 {
        padding: 0.625rem !important;
    }
    [data-module="buchhaltung"] .border-l-4 .text-2xl {
        font-size: 1.125rem !important;
    }
    /* Stats bar header */
    [data-module="buchhaltung"] .bg-gray-800.text-white {
        padding: 0.75rem !important;
    }
    [data-module="buchhaltung"] .bg-gray-800 .text-lg {
        font-size: 0.875rem !important;
    }
    /* Inner stat values */
    [data-module="buchhaltung"] .text-lg.font-bold {
        font-size: 1rem !important;
    }

    /* 8. Filter forms → compact */
    [data-module="buchhaltung"] form .flex.items-center {
        gap: 0.5rem !important;
    }
    [data-module="buchhaltung"] .p-6 > form {
        padding: 0 !important;
    }
    [data-module="buchhaltung"] form select,
    [data-module="buchhaltung"] form input[type="date"] {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    /* Card containers with p-6 → p-3 */
    [data-module="buchhaltung"] .bg-white.rounded-lg.shadow-md > .p-6 {
        padding: 0.75rem !important;
    }

    /* 9. Finance calendar → compact header controls */
    /* View toggle buttons */
    [data-module="buchhaltung"] .tw-page-header-actions .inline-flex.rounded-md a {
        padding: 0.375rem 0.5rem !important;
        font-size: 0 !important;
    }
    [data-module="buchhaltung"] .tw-page-header-actions .inline-flex.rounded-md a > i {
        font-size: 0.875rem;
        margin-right: 0 !important;
    }
    /* Add Event + Info buttons → icon-only */
    [data-module="buchhaltung"] .tw-page-header-actions > button {
        font-size: 0 !important;
        padding: 0.375rem !important;
        min-width: 2.25rem;
    }
    [data-module="buchhaltung"] .tw-page-header-actions > button > i {
        font-size: 0.875rem;
        margin-right: 0 !important;
    }
    /* Navigation bar */
    [data-module="buchhaltung"] .p-4.flex.items-center.justify-between {
        padding: 0.75rem !important;
        gap: 0.5rem !important;
    }
    /* Legend — smaller */
    [data-module="buchhaltung"] .flex.items-center.gap-4.text-sm.flex-wrap {
        gap: 0.375rem !important;
        font-size: 0.625rem !important;
    }

    /* 10. Matching manager → compact cards */
    /* Filter panel padding */
    [data-module="buchhaltung"] .bg-white.rounded-lg.shadow-sm.border > .p-4 {
        padding: 0.75rem !important;
    }
    /* Expense match cards */
    [data-module="buchhaltung"] [data-expense-id] > .grid {
        padding: 1rem !important;
        gap: 0.75rem !important;
    }
    [data-module="buchhaltung"] [data-expense-id] .p-5 {
        padding: 0.75rem !important;
    }
    /* Toggle labels */
    [data-module="buchhaltung"] .toggle-label {
        font-size: 0.75rem;
    }
}


/* === FOOTER COMPONENTS === */

/* Sticky footer layout */
body.tw-layout-body {
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1 0 auto;
}

.tw-footer {
    flex-shrink: 0;
    background: var(--theme-nav-bg, #1e293b);
    border-top: 1px solid var(--theme-card-border, rgba(255, 255, 255, 0.1));
    color: var(--theme-menu-text, #cbd5e1);
    padding: 1rem 0;
    font-size: 0.8125rem;
}

.tw-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tw-footer a {
    color: var(--theme-menu-text, #cbd5e1);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
}

.tw-footer a:hover {
    color: var(--theme-menu-text-hover, #ffffff);
    opacity: 1;
    text-decoration: none;
}

.tw-footer-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tw-footer-links a {
    font-weight: 500;
}

.tw-footer-copy,
.tw-footer-contact {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .tw-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0 1rem;
    }
}

/* ============================================================================
   TRANSACTION CONSOLIDATION
   ============================================================================ */

.consolidation-child-row {
    background-color: #eff6ff; /* bg-blue-50 */
    border-left: 3px solid #93c5fd; /* border-blue-300 */
}

.consolidation-child-row td {
    color: #6b7280; /* text-gray-500 */
    font-size: 0.8125rem;
}

.consolidation-child-row:hover {
    background-color: #dbeafe; /* bg-blue-100 */
}

.consolidation-summary-row {
    background-color: #f0f9ff; /* bg-sky-50 */
    border-left: 3px solid #93c5fd;
    border-top: 1px dashed #bfdbfe;
}

.consolidation-reference-row {
    border-left: 3px solid #c4b5fd; /* border-violet-300 */
}

.consolidation-toggle-btn {
    line-height: 1;
    white-space: nowrap;
}

/* ==========================================================================
   TAX REPORT CLARITY IMPROVEMENTS
   ========================================================================== */

/* 1A: Connected Header + Filter Group */
.tax-report-header-group {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.tax-report-header-group .tw-page-header {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.tax-report-header-group .tax-report-filter-bar {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* 1B: Sticky Section Navigation */
.tax-report-section-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tax-report-section-nav::-webkit-scrollbar {
    display: none;
}

.tax-report-section-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 9999px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.tax-report-section-nav a:hover {
    color: #374151;
    background: #e5e7eb;
    text-decoration: none;
}

.tax-report-section-nav a.active {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 600;
}

.tax-report-section-nav a i {
    margin-right: 0.375rem;
    font-size: 0.75rem;
}

/* Section scroll offset for sticky nav */
.tax-report-section {
    scroll-margin-top: 3.5rem;
}

/* 1C: Validation Warnings Banner */
.tax-report-warnings {
    margin-bottom: 1.5rem;
}

.tax-report-warning-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: white;
    background: #ef4444;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

/* 1D: Copy Button Hover-Reveal */
.finanzamt-copy-btn {
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.tw-dashboard-stat-card:hover .finanzamt-copy-btn,
.tw-table-row:hover .finanzamt-copy-btn,
.kz-row:hover .finanzamt-copy-btn,
tr:hover .finanzamt-copy-btn,
td:hover .finanzamt-copy-btn {
    opacity: 1;
}

@media (hover: none) {
    .finanzamt-copy-btn {
        opacity: 0.5;
    }
}

/* 1E: Section Accent Borders */
.tax-section-accent-vorsteuer {
    border-left: 4px solid #ef4444;
}

.tax-section-accent-umsatzsteuer {
    border-left: 4px solid #22c55e;
}

.tax-section-accent-eu {
    border-left: 4px solid #3b82f6;
}

.tax-section-accent-e1a {
    border-left: 4px solid #a855f7;
}

.tax-section-accent-afa {
    border-left: 4px solid #f97316;
}

.tax-section-accent-uva {
    border-left: 4px solid #06b6d4;
}

.tax-section-accent-einkommensteuer {
    border-left: 4px solid #ec4899;
}

/* 1G: Print Support */
@media print {
    .tax-report-section-nav,
    .tax-report-filter-bar,
    .finanzamt-copy-btn,
    .kz-detail-btn,
    .copy-btn,
    .tax-report-header-group form,
    [data-tax-dropdown-toggle],
    [data-tax-dropdown],
    button[onclick*="openCreate"],
    button[onclick*="copyUVA"],
    .no-print {
        display: none !important;
    }

    .tax-report-header-group {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .tax-report-section {
        page-break-inside: avoid;
    }

    .tw-dashboard-stats-grid {
        page-break-inside: avoid;
    }

    body {
        font-size: 11pt;
    }
}

/* ==========================================================================
   U30 FORM STYLES (migrated from inline <style> block)
   ========================================================================== */

.u30-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.u30-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.u30-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.u30-header h1 i {
    margin-right: 0.5rem;
}

.u30-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

.u30-period-selector {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.u30-period-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
}

.u30-period-selector form {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.u30-period-selector .form-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.u30-period-selector label {
    font-weight: 500;
    color: #334155;
}

.u30-period-selector .period-info {
    margin-left: auto;
    color: #64748b;
    font-size: 0.9rem;
}

.u30-tabs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.u30-tab-buttons {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    background: #f8f9fa;
}

.u30-tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.u30-tab-button:hover {
    background: #e2e8f0;
    color: #334155;
}

.u30-tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.u30-tab-content {
    display: none;
    padding: 2rem;
}

.u30-tab-content.active {
    display: block;
}

.u30-section-header {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    margin: 1.5rem 0 0.75rem 0;
    border-left: 4px solid #667eea;
    font-weight: 600;
    color: #334155;
    border-radius: 4px;
}

.u30-section-header:first-child {
    margin-top: 0;
}

.kz-row {
    display: grid;
    grid-template-columns: 80px 1fr 250px;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.kz-row:hover {
    background: #fafafa;
}

.kz-row.has-value {
    background: #f0fdf4;
}

.kz-row.has-value .kz-badge {
    background: #10b981;
    color: white;
}

.kz-row.zero-value {
    opacity: 0.5;
}

.kz-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    background: #e2e8f0;
    color: #475569;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 60px;
}

.kz-description {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.4;
}

.kz-row.has-value .kz-description {
    font-weight: 500;
}

.kz-value-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.kz-value {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
    text-align: right;
    min-width: 100px;
}

.kz-row.has-value .kz-value {
    font-weight: 700;
    color: #059669;
}

.kz-row .copy-btn {
    padding: 0.25rem 0.5rem;
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kz-row .copy-btn:hover {
    background: #667eea;
    color: white;
}

.kz-detail-btn {
    padding: 0.25rem 0.5rem;
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kz-detail-btn:hover {
    background: #667eea;
    color: white;
}

.kz-row.zero-value .kz-detail-btn {
    display: none;
}

.kz-row .indented-row,
.kz-row.indented-row {
    padding-left: 2rem;
}

/* U30 Validation Section */
.u30-validation-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.u30-validation-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #334155;
}

.u30-validation-formula {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.u30-validation-formula.valid {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
}

.u30-validation-formula.invalid {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.u30-validation-icon {
    font-size: 1.5rem;
}

.u30-validation-icon.valid {
    color: #10b981;
}

.u30-validation-icon.invalid {
    color: #ef4444;
}

/* U30 Summary Section */
.u30-summary-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.u30-summary-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.u30-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.u30-summary-row:last-child {
    border-bottom: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 1.25rem;
    font-weight: 700;
}

.u30-summary-label {
    font-weight: 500;
}

.u30-summary-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1.1rem;
}

.u30-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.u30-back-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
}

.u30-summary-section .copy-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.u30-summary-section .copy-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* U30 KZ Info Toggle (plain-language explanations) */
.kz-info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.375rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.15s ease;
    vertical-align: middle;
    border-radius: 50%;
}

.kz-info-toggle:hover {
    color: #667eea;
}

.kz-info-toggle.active {
    color: #667eea;
}

.kz-info-text {
    display: none;
    margin-top: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: #f0f4ff;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.5;
    border-left: 3px solid #667eea;
}

.kz-info-text.visible {
    display: block;
}

/* ============================================================
 * APPOINTMENT TITLE & HEADER CONTROLS
 * ============================================================ */

.appointment-title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.8rem;
}

.appointment-title-display {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-title-input {
    font-size: 1rem;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #fff;
    padding: 0.15rem 0.5rem;
    max-width: 500px;
    width: 100%;
}

.appointment-title-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.appointment-title-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.appointment-title-edit-btn,
.appointment-title-regen-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.appointment-title-edit-btn:hover,
.appointment-title-regen-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.appointment-title-regen-btn.spinning i {
    animation: spin 0.8s linear infinite;
}

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

.appointment-canceled-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.appointment-canceled-toggle .form-check-input {
    width: 2.25rem;
    height: 1.15rem;
    margin-top: 0;
    cursor: pointer;
}

.appointment-tabs-nav.tw-tabs-nav {
    border-radius: 0;
    border-top: none;
    margin-top: 0;
    box-shadow: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 2px solid #e5e7eb;
}

.appointment-canceled-tabbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding: 0 1rem;
    flex-shrink: 0;
}

.appointment-canceled-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6c757d;
    white-space: nowrap;
}

.appointment-canceled-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.appointment-canceled-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.appointment-canceled-slider {
    position: absolute;
    inset: 0;
    background-color: #ced4da;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.appointment-canceled-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.appointment-canceled-switch input:checked + .appointment-canceled-slider {
    background-color: #dc3545;
}

.appointment-canceled-switch input:checked + .appointment-canceled-slider::before {
    transform: translateX(16px);
}

.appointment-set-default-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    font-size: 1rem;
    transition: color 0.15s;
}

.appointment-set-default-btn:hover {
    color: #ffc107;
}

.appointment-set-default-btn.is-default {
    color: #ffc107;
}

.appointment-field-edit-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.appointment-field-edit-btn:hover {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

.appointment-summary-display {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.6;
    padding: 0.25rem 0;
    cursor: default;
}

.appointment-summary-display p {
    margin-bottom: 0.35rem;
}

.appointment-summary-display p:last-child {
    margin-bottom: 0;
}

/* Map button highlight after generation */
.map-btn-highlight {
    animation: mapBtnHighlight 2s ease;
}

@keyframes mapBtnHighlight {
    0%   { background-color: #198754; color: #fff; border-color: #198754; }
    60%  { background-color: #198754; color: #fff; border-color: #198754; }
    100% { background-color: transparent; color: #0d6efd; border-color: #0d6efd; }
}


/* === COMMUNICATION CENTER COMPONENTS === */

/* Compose form: CC/BCC hidden by default */
#compose-cc-container[data-visible="false"],
#compose-bcc-container[data-visible="false"] {
    display: none;
}

/* Draft indicator hidden by default */
#compose-draft-indicator[data-visible="false"] {
    display: none;
}

/* Variable chips */
.compose-var-chip {
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    transition: all 0.15s ease;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #4b5563;
    border-radius: 0.25rem;
}

.compose-var-chip:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Document search results dropdown */
#compose-document-results {
    max-height: 200px;
    overflow-y: auto;
}

/* Communication Center tab content area */
#comm-tab-content {
    min-height: 400px;
}

/* Compose form email account selector full width */
#compose-email-account {
    width: 100%;
}

/* Communication Center: seamless header-to-tabs join */
.comm-center-tabs {
    margin-top: -1px;
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Mobile card detail sections -- hidden by default, shown by overlay JS */
.tw-mobile-card-detail {
    display: none;
}

/* Detail section badge container (replaces inline flex styles in mobile cards) */
.tw-detail-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* Detail value size variants */
.tw-detail-value-sm { font-size: 0.85rem; }
.tw-detail-value-title { font-size: 1.1rem; font-weight: 600; }

/* Detail icon muted (replaces inline width/color styles) */
.tw-detail-icon-muted { width: 1rem; color: #6b7280; }


/* === MOBILE CARD VIEW === */
/* Responsive card layout for manager list views on small screens */

/* Desktop: hide mobile cards entirely */
.tw-mobile-card-grid {
    display: none;
}

/* Mobile (<=768px): show cards, hide table and bulk header */
@media (max-width: 768px) {
    /* Hide the desktop table when mobile cards are present */
    .tw-list-view-table:has(~ .tw-mobile-card-grid),
    .has-mobile-cards > .tw-list-view-table {
        display: none !important;
    }

    /* Hide bulk actions header on mobile (desktop-only feature) */
    .tw-list-view-header:has(~ .tw-mobile-card-grid),
    .has-mobile-cards > .tw-list-view-header {
        display: none !important;
    }

    /* Show card grid */
    .tw-mobile-card-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    /* Individual card */
    .tw-mobile-card {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        padding: 0.75rem;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    /* Card header: badges left, date right */
    .tw-mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
    }

    .tw-mobile-card-badges {
        display: flex;
        gap: 0.375rem;
        flex-wrap: wrap;
    }

    .tw-mobile-card-date {
        font-size: 0.8rem;
        color: #6b7280;
        white-space: nowrap;
        margin-left: 0.5rem;
    }

    /* Card body */
    .tw-mobile-card-body {
        margin-bottom: 0.5rem;
    }

    .tw-mobile-card-customer {
        font-weight: 600;
        color: #111827;
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .tw-mobile-card-meta {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }

    .tw-mobile-card-number {
        font-size: 0.8rem;
        color: #9ca3af;
    }

    .tw-mobile-card-amount {
        font-size: 1.125rem;
        font-weight: 700;
        color: #059669;
    }

    /* Card actions footer */
    .tw-mobile-card-actions {
        display: flex;
        gap: 0.375rem;
        padding-top: 0.5rem;
        border-top: 1px solid #f3f4f6;
        flex-wrap: wrap;
    }

    .tw-mobile-card-actions .tw-action-btn {
        width: 2.5rem;
        height: 2.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
    }

    /* Empty state */
    .tw-mobile-card-empty {
        text-align: center;
        color: #9ca3af;
        padding: 2rem 1rem;
        font-size: 0.95rem;
    }
}


/* === MOBILE DETAIL OVERLAY === */

.tw-mobile-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: #f0f4f8;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease, visibility 0s 0.3s;
}

.tw-mobile-detail-overlay.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.15s ease, visibility 0s 0s;
}

/* Header bar — comfortable touch target */
.tw-mobile-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 3rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tw-mobile-detail-counter {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.04em;
}

.tw-mobile-detail-close {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 2.125rem;
    height: 2.125rem;
    font-size: 1.15rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.tw-mobile-detail-close:hover,
.tw-mobile-detail-close:active {
    background: #e2e8f0;
    color: #1e293b;
}

/* Scrollable body */
.tw-mobile-detail-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure Font Awesome icons render inside overlay (prevent inheritance issues) */
.tw-mobile-detail-body .fas,
.tw-mobile-detail-body .far,
.tw-mobile-detail-body .fab,
.tw-mobile-detail-body .bi {
    display: inline;
    font-style: normal;
    line-height: 1;
}

/* Bottom nav bar */
.tw-mobile-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.06);
    /* safe area for phones with gesture bars */
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.tw-mobile-detail-prev,
.tw-mobile-detail-next {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tw-mobile-detail-prev:active,
.tw-mobile-detail-next:active {
    background: #f1f5f9;
    border-color: #94a3b8;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tw-mobile-detail-prev:disabled,
.tw-mobile-detail-next:disabled {
    opacity: 0.25;
    cursor: default;
    box-shadow: none;
}

/* Detail content sections */
.tw-detail-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.tw-detail-section:first-child {
    border-top: none;
}

.tw-detail-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tw-detail-label i {
    color: #3b82f6;
    font-size: 0.75rem;
}

.tw-detail-value {
    font-size: 1rem;
    color: #1e293b;
    line-height: 1.5;
}

/* Utility classes for detail overlay content */
.tw-detail-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.tw-detail-value-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.tw-detail-value-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.tw-detail-contact-line {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tw-detail-contact-line i {
    width: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8125rem;
}

.tw-detail-contact-line + .tw-detail-contact-line {
    margin-top: 0.15rem;
}

.tw-detail-inline-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.tw-detail-inline-row:last-child {
    margin-bottom: 0;
}

.tw-detail-inline-row .tw-detail-label {
    min-width: 5.5rem;
    margin-bottom: 0;
    flex-shrink: 0;
}

.tw-detail-inline-row .tw-detail-value {
    flex: 1;
}

.tw-detail-number {
    margin-left: auto;
    font-weight: 600;
    color: #1f2937;
}

.tw-detail-directions {
    font-size: 0.875rem;
    color: #3b82f6;
    margin-top: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
}

.tw-detail-directions:hover {
    color: #2563eb;
    text-decoration: underline;
}

.tw-detail-icon-location {
    color: #ef4444;
    margin-right: 0.35rem;
}

/* Items table */
.tw-detail-items-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.tw-detail-items-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.tw-detail-items-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.tw-detail-items-table tr:last-child {
    border-bottom: none;
}

.tw-detail-items-table td {
    padding: 0.5rem 0.625rem;
    vertical-align: top;
}

.tw-detail-item-desc {
    color: #334155;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 50%;
}

.tw-detail-item-qty {
    color: #64748b;
    white-space: nowrap;
    text-align: right;
    padding-right: 0.5rem !important;
    font-size: 0.75rem;
}

.tw-detail-item-total {
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

/* Financial summary */
.tw-detail-summary {
    padding: 1rem 1.25rem;
    background: #ffffff;
}

.tw-detail-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9375rem;
    color: #64748b;
}

.tw-detail-summary-row.tw-detail-total {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 2px solid #cbd5e1;
    font-size: 1.2rem;
    font-weight: 800;
    color: #059669;
}

/* Action buttons in detail view — pill buttons with icon + text */
.tw-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem !important;
    background: #f0f4f8;
    border-bottom: none !important;
}

.tw-detail-actions .tw-action-btn {
    width: auto;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.5rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.5rem 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    text-decoration: none;
}

.tw-detail-actions .tw-action-btn:active {
    transform: scale(0.97);
}

/* Color accents for action types */
.tw-detail-actions .tw-action-btn-edit {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.tw-detail-actions .tw-action-btn-edit:active {
    background: #dbeafe;
}

.tw-detail-actions .tw-action-btn-archive {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.tw-detail-actions .tw-action-btn-archive:active {
    background: #fee2e2;
}

.tw-detail-actions .tw-action-btn-restore {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.tw-detail-actions .tw-action-btn-restore:active {
    background: #dcfce7;
}

.tw-detail-actions .tw-action-btn i {
    font-size: 0.875rem;
    width: auto;
    height: auto;
    color: inherit;
}

/* Hide overlay on desktop */
@media (min-width: 769px) {
    .tw-mobile-detail-overlay {
        display: none !important;
    }
}

/* === COPY INFO MOBILE CARD === */

.tw-copy-info-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tw-copy-info-card-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tw-copy-info-card-date i {
    color: #94a3b8;
}

.tw-copy-info-card-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-top: 1px solid #f1f5f9;
}

.tw-copy-info-card-row:first-of-type {
    border-top: none;
}

.tw-copy-info-card-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 4.5rem;
    flex-shrink: 0;
    padding-top: 0.2rem;
}

.tw-copy-info-card-value {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.4;
}

.tw-copy-info-card-value .tw-copy-info-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.tw-copy-info-card-value .tw-copy-info-item:last-child {
    margin-bottom: 0;
}

.tw-copy-info-card-value .tw-copy-info-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-copy-info-card-value .tw-copy-info-btn {
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s;
}

.tw-copy-info-card-value .tw-copy-info-btn:active {
    background: #e2e8f0;
}

.tw-copy-info-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

/* === TRANSIT MODE OVERLAY === */
/* Mobile-only fullscreen overlay for upcoming appointments */

.tw-transit-mode-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 1300;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    color: #fff;
}

.tw-transit-mode-overlay.active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .tw-transit-mode-overlay {
        display: flex;
    }
}

/* Header */
.tw-transit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.tw-transit-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.tw-transit-header-left i {
    color: #4fc3f7;
}

.tw-transit-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Doto', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
}

.tw-transit-header-center {
    font-size: 0.85rem;
    opacity: 0.7;
}

.tw-transit-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tw-transit-close:hover {
    opacity: 1;
}

/* Dot indicators */
.tw-transit-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    flex-shrink: 0;
}

.tw-transit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.2s, transform 0.2s;
}

.tw-transit-dot.active {
    background: #4fc3f7;
    transform: scale(1.25);
}

/* Carousel */
.tw-transit-carousel {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tw-transit-carousel::-webkit-scrollbar {
    display: none;
}

/* Card */
.tw-transit-card {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    padding: 1rem 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Countdown badge */
.tw-transit-countdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.tw-transit-countdown i {
    color: #4fc3f7;
}

.tw-transit-countdown.tw-transit-countdown-imminent {
    background: rgba(255, 183, 77, 0.2);
    border-color: rgba(255, 183, 77, 0.4);
}

.tw-transit-countdown.tw-transit-countdown-imminent i {
    color: #ffb74d;
}

.tw-transit-countdown.tw-transit-countdown-now {
    background: rgba(239, 83, 80, 0.2);
    border-color: rgba(239, 83, 80, 0.4);
    animation: transit-pulse 2s infinite;
}

.tw-transit-countdown.tw-transit-countdown-now i {
    color: #ef5350;
}

@keyframes transit-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Card body fields */
.tw-transit-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.tw-transit-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tw-transit-field-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tw-transit-field-value {
    font-size: 0.95rem;
    line-height: 1.4;
}

.tw-transit-datetime {
    font-size: 1.05rem;
    font-weight: 500;
}

.tw-transit-client-name {
    display: block;
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

/* Google search links for persons/motives */
.tw-transit-search-link {
    color: inherit;
    text-decoration: none;
}

.tw-transit-search-link:hover {
    color: #4fc3f7;
}

.tw-transit-search-icon {
    font-size: 0.65em;
    opacity: 0.4;
    margin-left: 0.25rem;
}

a.tw-transit-subject-tag {
    text-decoration: none;
    color: inherit;
}

a.tw-transit-subject-tag:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: rgba(79, 195, 247, 0.3);
    color: #fff;
}

.tw-transit-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #4fc3f7;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.tw-transit-phone-link:hover {
    color: #81d4fa;
}

.tw-transit-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #fff;
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    margin-top: 0.5rem;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.tw-transit-directions-btn:hover {
    background: rgba(79, 195, 247, 0.35);
    color: #fff;
}

/* Subject tags */
.tw-transit-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tw-transit-subject-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 0.2rem 0.625rem;
    font-size: 0.8rem;
}

/* Footer */
.tw-transit-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.tw-transit-edit-btn,
.tw-transit-dismiss-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: none;
    text-decoration: none;
}

.tw-transit-edit-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.tw-transit-edit-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.tw-transit-dismiss-btn {
    background: #4fc3f7;
    color: #1a1a2e;
}

.tw-transit-dismiss-btn:hover {
    background: #81d4fa;
}

.tw-transit-edit-btn:active,
.tw-transit-dismiss-btn:active {
    transform: scale(0.97);
}

/* Transit Mode navbar button — mobile only */
.tw-transit-nav-btn {
    display: none !important;
}

@media (max-width: 768px) {
    .tw-transit-nav-btn {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        color: var(--nav-text);
        border-radius: 0.5rem;
        font-weight: 500;
        font-size: 0.9rem;
    }

    .tw-transit-nav-btn i {
        color: #4fc3f7;
    }
}

/* === CLICK-TO-COPY VALUES === */
.copyable-value {
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    padding: 0 0.25rem;
}
.copyable-value:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
.copyable-value.copied {
    background-color: rgba(34, 197, 94, 0.15);
}

/* === CODEMIRROR IN MODALS === */
.CodeMirror {
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.375rem;
    font-size: 13px;
    height: auto;
    min-height: 200px;
}

/* === AI CONSENT GATING === */
.ai-consent-required {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

#ai-consent-checkbox {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    flex-shrink: 0;
}

/* === 17. SETUP WIZARD COMPONENTS === */

/* Progress indicator */
.setup-wizard-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.setup-wizard-step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
}

.setup-wizard-step-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--card-bg, #fff);
    border: 2px solid var(--border-color, #dee2e6);
    color: var(--text-muted, #6c757d);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.setup-wizard-step-dot.active {
    background: var(--accent-1, #2563eb);
    border-color: var(--accent-1, #2563eb);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.setup-wizard-step-dot.completed {
    background: var(--success, #22c55e);
    border-color: var(--success, #22c55e);
    color: #fff;
}

.setup-wizard-step-label {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    text-align: center;
    margin-top: 0.5rem;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.setup-wizard-step-indicator.active .setup-wizard-step-label {
    color: var(--accent-1, #2563eb);
    font-weight: 600;
}

.setup-wizard-step-indicator.completed .setup-wizard-step-label {
    color: var(--success, #22c55e);
}

.setup-wizard-step-connector {
    width: 4rem;
    height: 2px;
    background: var(--border-color, #dee2e6);
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.setup-wizard-step-connector.completed {
    background: var(--success, #22c55e);
}

@media (max-width: 576px) {
    .setup-wizard-step-connector { width: 1.5rem; }
    .setup-wizard-step-dot { width: 2rem; height: 2rem; font-size: 0.8rem; }
    .setup-wizard-step-label { font-size: 0.65rem; }
}

/* Step panels */
.setup-wizard-panel {
    display: none;
    animation: wizardFadeIn 0.3s ease;
}

.setup-wizard-panel.active {
    display: block;
}

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

/* Navigation buttons */
.setup-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color, #dee2e6);
}

.setup-wizard-nav .btn {
    min-width: 8rem;
}

/* Welcome header */
.setup-wizard-welcome {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.setup-wizard-welcome h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #1f2937);
}

.setup-wizard-welcome p {
    color: var(--text-muted, #6c757d);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}
