/* ==========================================
   DOUBLE ARROW HARDSCAPES - SHARED STYLES
   Common styling for management pages
   ========================================== */

:root {
    --brand-charcoal: #3d3d3d;
    --brand-charcoal-dark: #2b2b2b;
    --brand-charcoal-darker: #1f1f1f;
    --brand-gold: #d4af37;
    --brand-gold-light: #e0bb44;
    --brand-gold-dark: #b8941f;
    --brand-beige: #f5f5dc;
    --brand-beige-light: #fefef8;
}

/* Page Container */
.page-container {
    min-height: 100vh;
    background: 
        linear-gradient(135deg, rgba(245, 245, 220, 0.3) 0%, rgba(212, 175, 55, 0.05) 100%),
        linear-gradient(to bottom, var(--brand-beige-light) 0%, #f8f8f0 100%);
    padding: 0;
    margin: -1rem;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================
   HERO HEADER SECTION
   ========================================== */
.hero-header {
    position: relative;
    background: linear-gradient(135deg, var(--brand-charcoal) 0%, var(--brand-charcoal-dark) 50%, var(--brand-charcoal-darker) 100%);
    padding: 2rem 2rem;
    margin: 0 0.5rem 1.5rem 0.5rem;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(212, 175, 55, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 3px solid var(--brand-gold);
    border-left-width: 0;
    border-right-width: 0;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 15% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(212, 175, 55, 0.12) 0%, transparent 45%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(212, 175, 55, 0.03) 2px,
            rgba(212, 175, 55, 0.03) 4px
        );
    pointer-events: none;
    animation: subtleShimmer 8s ease-in-out infinite;
}

@keyframes subtleShimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.hero-content {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.hero-text {
    flex: 1;
    min-width: 200px;
}

.hero-title {
    color: var(--brand-gold);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.75rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(212, 175, 55, 0.3);
    letter-spacing: -0.5px;
}

/* ==========================================
   LOADING STATE
   ========================================== */
.loading-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 3rem;
}

.loading-card {
    background: white;
    border-radius: 24px;
    padding: 4rem 3rem;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(212, 175, 55, 0.1);
    max-width: 420px;
    border: 2px solid var(--brand-gold);
}

.loading-spinner {
    width: 70px;
    height: 70px;
    margin: 0 auto 2.5rem;
    border: 5px solid rgba(212, 175, 55, 0.15);
    border-top-color: var(--brand-gold);
    border-right-color: var(--brand-gold);
    border-radius: 50%;
    animation: elegantSpin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes elegantSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-card h3 {
    color: var(--brand-charcoal);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.loading-card p {
    color: #6b7280;
    font-size: 1.0625rem;
    margin: 0;
    font-weight: 500;
}

/* ==========================================
   CONTENT SECTION
   ========================================== */
.content-section {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem 2.5rem;
    position: relative;
    z-index: 10;
}

/* ==========================================
   MAIN CARD
   ========================================== */
.main-card {
    background: white;
    border-radius: 0;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(212, 175, 55, 0.1);
    overflow: hidden;
    border: 3px solid var(--brand-gold);
    border-left-width: 0;
    border-right-width: 0;
}

/* ==========================================
   TOOLBAR
   ========================================== */
.card-toolbar {
    background: 
        linear-gradient(135deg, var(--brand-charcoal) 0%, var(--brand-charcoal-dark) 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 3px solid var(--brand-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    box-shadow: inset 0 -1px 0 rgba(212, 175, 55, 0.3);
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-wrapper {
    min-width: 350px;
    flex: 1;
    max-width: 550px;
}

.search-input {
    border-radius: 8px !important;
    border: 2px solid rgba(212, 175, 55, 0.3) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.search-input:focus-within {
    border-color: var(--brand-gold) !important;
    box-shadow: 
        0 0 0 4px rgba(212, 175, 55, 0.2),
        0 8px 16px rgba(212, 175, 55, 0.15) !important;
    background: white !important;
    transform: translateY(-1px);
}

.search-input input {
    padding: 0.875rem 1.125rem !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    color: var(--brand-charcoal) !important;
}

.search-input input::placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
}

.search-input .e-search {
    color: var(--brand-gold) !important;
    font-size: 1.125rem !important;
}

.search-input .e-clear-icon {
    color: #9ca3af !important;
    font-size: 1.0625rem !important;
    transition: all 0.2s ease !important;
}

.search-input .e-clear-icon:hover {
    color: #dc2626 !important;
    transform: scale(1.15);
}

.e-outline {
    border-radius: 8px !important;
    border: 2px solid var(--brand-gold) !important;
    background: transparent !important;
    color: var(--brand-gold) !important;
    font-weight: 700 !important;
    text-transform: none !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2) !important;
    font-family: 'Lato', sans-serif !important;
    letter-spacing: 0.3px !important;
}

.e-outline:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(212, 175, 55, 0.35),
        0 0 0 2px rgba(212, 175, 55, 0.2) !important;
    background: var(--brand-gold) !important;
    color: var(--brand-charcoal) !important;
    border-color: var(--brand-gold-light) !important;
}

.e-outline:active {
    transform: translateY(0);
}

/* Primary Solid Button (for "Add New" style buttons) */
.e-btn.e-primary:not(.e-outline) {
    border-radius: 8px !important;
    border: none !important;
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-light) 100%) !important;
    color: var(--brand-charcoal) !important;
    font-weight: 700 !important;
    text-transform: none !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3) !important;
    font-family: 'Lato', sans-serif !important;
    letter-spacing: 0.3px !important;
}

.e-btn.e-primary:not(.e-outline):hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(212, 175, 55, 0.45),
        0 0 0 2px rgba(212, 175, 55, 0.2) !important;
    background: linear-gradient(135deg, var(--brand-gold-light) 0%, #e8c960 100%) !important;
}

.e-btn.e-primary:not(.e-outline):active {
    transform: translateY(0);
}

/* Add icon styling for buttons with icons */
.e-btn .e-btn-icon {
    font-size: 1.125rem !important;
    margin-right: 0.5rem !important;
}


/* ==========================================
   GRID CONTAINER
   ========================================== */
.grid-container {
    padding: 0;
    display: block;
}

/* ── Color Name Cell ─────────────────────────────────────── */
.color-name-cell {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.color-icon {
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.color-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--brand-charcoal-darker);
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.01em;
}

/* ── Enum value plain text ───────────────────────────────── */
.enum-value {
    font-size: 0.8375rem;
    color: #4a4030;
    font-family: 'Lato', sans-serif;
}

.amount-value {
    font-size: 0.8375rem;
    font-weight: 700;
    color: var(--brand-charcoal);
    font-family: 'Lato', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* ── Family badges ───────────────────────────────────────── */
.family-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.family-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Family color palettes */
.family-red   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.family-red   .family-dot { background: #dc2626; }

.family-beige { background: #fefce8; color: #78350f; border: 1px solid #fde68a; }
.family-beige .family-dot { background: #d97706; }

.family-gray  { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.family-gray  .family-dot { background: #6b7280; }

.family-brown { background: #fdf8f0; color: #6b3a12; border: 1px solid #d4a96a; }
.family-brown .family-dot { background: #92400e; }

/* ── Group caption row ───────────────────────────────────── */
.family-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.5rem;
    border-radius: 20px;
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.family-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.family-content {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.family-name {
    font-weight: 800;
}

.family-count {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.65;
}

/* Apply family colors to group row too */
.family-red.family-group   { background: #fef2f2; color: #991b1b; }
.family-red .family-indicator   { background: #dc2626; }
.family-beige.family-group { background: #fefce8; color: #78350f; }
.family-beige .family-indicator { background: #d97706; }
.family-gray.family-group  { background: #f3f4f6; color: #374151; }
.family-gray .family-indicator  { background: #6b7280; }
.family-brown.family-group { background: #fdf8f0; color: #6b3a12; }
.family-brown .family-indicator { background: #92400e; }

/* ── Aging chips in grid cell ────────────────────────────── */
.aging-chips-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.15rem 0;
    align-items: center;
}

.aging-chip {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #6b4e00;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.aging-chip-none {
    color: #c4b89a;
    font-size: 0.85rem;
}

.e-grid {
    border: none !important;
    font-family: 'Lato', sans-serif !important;
}

.e-grid .e-headercell {
    background: linear-gradient(135deg, var(--brand-charcoal) 0%, var(--brand-charcoal-dark) 100%) !important;
    color: var(--brand-gold) !important;
    font-weight: 700 !important;
    font-size: 0.8125rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 0.5rem 0.75rem !important;
    border-bottom: 2px solid var(--brand-gold) !important;
    border-right: 1px solid rgba(212, 175, 55, 0.2) !important;
    font-family: 'Lato', sans-serif !important;
}

/* Row Cell Styling */
.e-grid .e-rowcell {
    padding: 0.2rem 0.75rem !important;
    border-bottom: 1px solid #f0ece5 !important;
    color: var(--brand-charcoal) !important;
    font-size: 0.8375rem !important;
    background: white !important;
    transition: background 0.15s ease !important;
    vertical-align: middle !important;
}

.e-grid .e-rowcell:first-child {
    padding: 0.25rem !important;
}

.e-grid .e-row:hover .e-rowcell {
    background: linear-gradient(90deg, rgba(245, 245, 220, 0.4) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
}

.e-grid .e-row.e-altrow .e-rowcell {
    background: #fefef8 !important;
}

.e-grid .e-row.e-altrow:hover .e-rowcell {
    background: linear-gradient(90deg, rgba(245, 245, 220, 0.4) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
}

/* ==========================================
   GRID CUSTOM CELLS
   ========================================== */
.grid-actions {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
}

.property-cell {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

/* Color Square Indicators */
.color-square {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.color-square:hover {
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Circular Badges */
.circular-badge,
.badge-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9375rem;
    font-family: 'Lato', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Primary badge (blue) */
.circular-badge.badge-primary,
.badge-circle.badge-primary {
    background: linear-gradient(135deg, #4169E1 0%, #5b7de8 100%);
    color: white;
}

.circular-badge.badge-primary:hover,
.badge-circle.badge-primary:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.4);
}

/* Success badge (green) */
.circular-badge.badge-success,
.badge-circle.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

/* Warning badge (yellow) */
.circular-badge.badge-warning,
.badge-circle.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: var(--brand-charcoal);
}

/* Danger badge (red) */
.circular-badge.badge-danger,
.badge-circle.badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

/* Yes/No Indicators */
.indicator-yes,
.indicator-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.indicator-yes {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #6ee7b7;
}

.indicator-no {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #fca5a5;
}

/* Status Name Cell with Icon */
.status-name-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-name-cell .status-title {
    font-weight: 700;
    color: var(--brand-charcoal);
    font-size: 1.0625rem;
    font-family: 'Playfair Display', Georgia, serif;
    letter-spacing: -0.3px;
}

/* Grid Action Buttons - Modern Styling */
.e-grid .e-row .e-btn {
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-family: 'Lato', sans-serif !important;
    transition: all 0.3s ease !important;
    padding: 0.625rem 1.25rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.e-grid .e-row .e-btn.e-primary,
.e-grid .e-row .e-btn.e-info {
    background: linear-gradient(135deg, #4169E1 0%, #5b7de8 100%) !important;
    color: white !important;
    border: none !important;
}

.e-grid .e-row .e-btn.e-primary:hover,
.e-grid .e-row .e-btn.e-info:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.4) !important;
}

.e-grid .e-row .e-btn.e-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
    color: white !important;
    border: none !important;
}

.e-grid .e-row .e-btn.e-danger:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

/* Small Round Buttons in Grid */
.e-grid .e-small.e-round {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

.e-grid .e-small.e-round .e-btn-icon {
    margin: 0 !important;
    font-size: 0.875rem !important;
}


/* ==========================================
   PAGINATION
   ========================================== */
.e-pager {
    background: linear-gradient(135deg, var(--brand-charcoal) 0%, var(--brand-charcoal-dark) 100%) !important;
    border-top: 3px solid var(--brand-gold) !important;
    padding: 1.25rem 2rem !important;
}

.e-pager .e-numericitem,
.e-pager .e-currentitem,
.e-pager .e-prevpage,
.e-pager .e-nextpage {
    border-radius: 8px !important;
    min-width: 40px !important;
    height: 40px !important;
    border: 2px solid rgba(212, 175, 55, 0.3) !important;
    margin: 0 5px !important;
    font-weight: 700 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(245, 245, 220, 0.7) !important;
}

.e-pager .e-currentitem {
    background: var(--brand-gold) !important;
    color: var(--brand-charcoal) !important;
    border-color: var(--brand-gold-light) !important;
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.4),
        0 0 0 2px rgba(212, 175, 55, 0.2) !important;
    transform: scale(1.05);
}

.e-pager .e-numericitem:hover,
.e-pager .e-prevpage:hover,
.e-pager .e-nextpage:hover {
    background: rgba(212, 175, 55, 0.15) !important;
    border-color: var(--brand-gold) !important;
    color: var(--brand-gold) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.2) !important;
}

/* ==========================================
   DIALOG STYLING - MODERN REDESIGN
   ========================================== */
.e-dialog {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 175, 55, 0.2) !important;
    overflow: hidden !important;
}

.e-dialog .e-dlg-header-content {
    background: linear-gradient(135deg, var(--brand-charcoal) 0%, var(--brand-charcoal-dark) 100%) !important;
    color: white !important;
    padding: 1.75rem 2rem !important;
    border-bottom: 3px solid var(--brand-gold) !important;
    font-family: 'Playfair Display', Georgia, serif !important;
    font-weight: 700 !important;
    font-size: 1.375rem !important;
    letter-spacing: -0.5px !important;
}

.e-dialog .e-dlg-content {
    padding: 0 !important;
    background: linear-gradient(to bottom, #fefefe 0%, var(--brand-beige-light) 100%) !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
}

/* Hide any buttons inside the dialog content (prevent duplicates) */
.e-dialog .e-dlg-content button,
.e-dialog .e-dlg-content .e-btn {
    display: none !important;
}

.e-dialog .e-footer-content {
    background: white !important;
    padding: 1.25rem 2rem !important;
    border-top: 1px solid rgba(212, 175, 55, 0.15) !important;
    display: flex !important;
    gap: 0.75rem !important;
    justify-content: flex-end !important;
}

/* Show only the footer buttons */
.e-dialog .e-footer-content button,
.e-dialog .e-footer-content .e-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.875rem 1.75rem !important;
    font-weight: 700 !important;
    font-family: 'Lato', sans-serif !important;
    border-radius: 10px !important;
    font-size: 0.9375rem !important;
    letter-spacing: 0.3px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 2px solid transparent !important;
}

.e-dialog .e-footer-content .e-primary {
    background: var(--brand-gold) !important;
    color: var(--brand-charcoal) !important;
    border-color: var(--brand-gold) !important;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3) !important;
}

.e-dialog .e-footer-content .e-primary:hover {
    background: var(--brand-gold-light) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4) !important;
}

.e-dialog .e-footer-content button:not(.e-primary) {
    background: transparent !important;
    color: var(--brand-charcoal) !important;
    border-color: #d1d5db !important;
}

.e-dialog .e-footer-content button:not(.e-primary):hover {
    background: #f3f4f6 !important;
    border-color: var(--brand-charcoal) !important;
    transform: translateY(-1px) !important;
}

.e-dialog .e-footer-content .e-danger {
    background: #dc2626 !important;
    color: white !important;
    border-color: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

.e-dialog .e-footer-content .e-danger:hover {
    background: #b91c1c !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4) !important;
}

/* ==========================================
   EDIT FORM STYLING
   ========================================== */
.edit-form {
    padding: 1.25rem 1.5rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* Two-column row for paired fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
    align-items: start;
}

/* Name field takes more room next to the narrow Family dropdown */
.form-group--grow { flex: 1.4; }
.form-group--fixed { flex: 1; }
/* Amount column is deliberately narrow */
.form-row:has(.form-group--narrow) {
    grid-template-columns: 1fr 140px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    color: #6b5a2a;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0;
}

.label-icon {
    font-size: 0.9rem;
}

.required {
    color: #dc2626;
    font-size: 0.85rem;
    margin-left: 0.1rem;
}

.field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

/* Modern Input Styling */
.modern-input,
.modern-dropdown,
.modern-textarea {
    border: 1.5px solid #e5e7eb !important;
    border-radius: 7px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    font-family: 'Lato', sans-serif !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    background: white !important;
}

.modern-input:hover,
.modern-dropdown:hover,
.modern-textarea:hover {
    border-color: rgba(212, 175, 55, 0.5) !important;
}

.modern-input:focus,
.modern-input.e-input-focus,
.modern-dropdown:focus,
.modern-dropdown.e-input-focus,
.modern-textarea:focus,
.modern-textarea.e-input-focus {
    border-color: var(--brand-gold) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
    background: white !important;
}

.modern-input input,
.modern-dropdown input {
    font-size: 0.875rem !important;
    color: var(--brand-charcoal) !important;
    font-weight: 500 !important;
}

.modern-textarea textarea {
    min-height: 72px !important;
    font-size: 0.875rem !important;
    color: var(--brand-charcoal) !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
}

.modern-input::placeholder,
.modern-dropdown::placeholder,
.modern-textarea::placeholder {
    color: #b0b8c4 !important;
    font-weight: 400 !important;
}

/* ==========================================
   DELETE CONFIRMATION DIALOG
   ========================================== */
.dialog-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dialog-icon {
    font-size: 1.5rem;
}

.delete-confirmation {
    padding: 2rem;
}

.warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border: 2px solid #fbbf24;
    margin-bottom: 1.5rem;
}

.warning-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.warning-text h4 {
    margin: 0 0 0.25rem 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--brand-charcoal);
}

.warning-text p {
    margin: 0;
    font-size: 0.9375rem;
    color: #78350f;
    font-weight: 500;
}

.warning-message {
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #991b1b;
    line-height: 1.6;
}

.warning-message strong {
    font-weight: 700;
}

/* Item preview for delete dialog (shared) */
.item-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.item-preview .preview-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.item-preview .preview-details {
    flex: 1;
}

.item-preview .preview-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-charcoal);
    margin-bottom: 0.5rem;
}

/* ==========================================
   DIALOG RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .e-dialog {
        width: 95% !important;
        margin: 1rem !important;
    }

    .edit-form,
    .delete-confirmation {
        padding: 1rem !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .e-dialog .e-dlg-header-content {
        padding: 1.25rem 1.5rem !important;
        font-size: 1.125rem !important;
    }

    .e-dialog .e-footer-content {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .e-dialog .e-footer-content button {
        width: 100% !important;
        justify-content: center !important;
    }
}


/* ==========================================
   AGING TREATMENT PICKER (global - SfDialog portal)
   ========================================== */
.aging-form-group {
    margin-top: 0;
}

.aging-section-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: #6b5a2a;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.07em;
}

.aging-icon {
    width: 16px;
    height: 16px;
    color: var(--brand-gold-dark);
    flex-shrink: 0;
}

.aging-count-badge {
    margin-left: auto;
    background: var(--brand-gold);
    color: var(--brand-charcoal-darker);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.03em;
}

/* ── Picker shell ────────────────────────────────────────── */
.aging-picker {
    display: flex;           /* flex lets us reorder panels with `order` */
    align-items: stretch;
    border: 1.5px solid #e0d8c8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}

/* ── Panels ──────────────────────────────────────────────── */
.aging-panel {
    display: flex;
    flex-direction: column;
    min-height: 140px;
    max-height: 180px;
}

/* Selected panel: left / primary position, gets extra width */
.aging-panel--selected {
    order: 1;
    flex: 1.4;
}

/* Divider sits between the two panels */
.aging-divider {
    order: 2;
}

/* Available panel: right / secondary position, narrower */
.aging-panel--available {
    order: 3;
    flex: 1;
}

/* ── Panel headers ───────────────────────────────────────── */
.aging-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-bottom: 1.5px solid #e0d8c8;
    background: #faf8f3;
}

/* Selected header: strong gold gradient — announces itself */
.aging-panel--selected .aging-panel-header {
    background: linear-gradient(135deg, var(--brand-gold-dark) 0%, var(--brand-gold) 100%);
    border-bottom-color: var(--brand-gold-dark);
}

.aging-panel-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-charcoal);
    font-family: 'Lato', sans-serif;
}

/* Selected title inverts to dark on the gold header */
.aging-panel--selected .aging-panel-title {
    color: var(--brand-charcoal-darker);
}

.aging-panel-hint {
    font-size: 0.68rem;
    color: #aaa;
    font-style: italic;
    font-family: 'Lato', sans-serif;
}

.aging-panel--selected .aging-panel-hint {
    color: rgba(45,35,0,0.55);
}

/* ── Lists ───────────────────────────────────────────────── */
.aging-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Selected list gets a warm tint so it reads as the hero area */
.aging-panel--selected .aging-list {
    background: rgba(212,175,55,0.04);
}

.aging-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 0.78rem;
    font-style: italic;
    font-family: 'Lato', sans-serif;
    padding: 1rem;
    text-align: center;
}

/* ── Items (base) ────────────────────────────────────────── */
.aging-item {
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: Lato, sans-serif;
    line-height: 1.4;
    transition: all 0.15s ease;
    text-align: left;
    gap: 0.5rem;
    background: transparent;
    user-select: none;
    box-sizing: border-box;
}

/* ── Available items: muted, compact, clearly secondary ─── */
.aging-item--available {
    padding: 0.28rem 0.55rem;
    font-size: 0.76rem;
    color: #7a7060;
    justify-content: space-between;
}

.aging-item--available:hover {
    background: rgba(212,175,55,0.1);
    color: var(--brand-charcoal-darker);
    transform: translateX(2px);
}

/* ── Selected items: solid gold chips — the hero ─────────── */
.aging-item--selected {
    padding: 0.38rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-charcoal-darker);
    justify-content: space-between;
    background: var(--brand-gold);
    border-radius: 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    letter-spacing: 0.01em;
}

.aging-item--selected:hover {
    background: #c0392b;
    color: #fff;
    box-shadow: 0 2px 6px rgba(192,57,43,0.3);
    transform: none;
}

/* ── Item text ───────────────────────────────────────────── */
.aging-item-text {
    flex: 1;
    font-weight: 500;
}

.aging-item--selected .aging-item-text {
    font-weight: 700;
}

/* ── Action circles ──────────────────────────────────────── */
.aging-item-action {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.aging-item--available .aging-item-action {
    background: rgba(212,175,55,0.2);
    color: var(--brand-gold-dark);
}

.aging-item--available:hover .aging-item-action {
    background: var(--brand-gold);
    color: #fff;
}

/* On a gold chip, the remove circle inverts */
.aging-item--selected .aging-item-action {
    background: rgba(0,0,0,0.12);
    color: var(--brand-charcoal-darker);
    width: 16px;
    height: 16px;
    font-size: 0.9rem;
}

.aging-item--selected:hover .aging-item-action {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ── Divider ─────────────────────────────────────────────── */
.aging-divider {
    width: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #faf8f3;
    border-left: 1.5px solid #e0d8c8;
    border-right: 1.5px solid #e0d8c8;
    gap: 0.5rem;
    padding: 1rem 0;
}

.aging-divider-line {
    flex: 1;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e0d8c8, transparent);
}

.aging-divider-icon {
    font-size: 0.9rem;
    color: #c8b878;
    line-height: 1;
}
