/* ═══════════════════════════════════════════════════════════════════════
   GENERAL FORMS — Unified Edit/Add Page Styling (gf-* prefix)
   Modeled after WeighbridgeTicket.razor & WeighbridgeContract.razor
   Theme-aware via CSS variables from theme.css
   ═══════════════════════════════════════════════════════════════════════ */

/* ========================================
   LUCIDE ICON ADAPTER
   ======================================== */
.gf-wrapper [data-lucide] > .lucide {
    width: 1em;
    height: 1em;
}

/* ========================================
   WRAPPER & CONTAINER
   ======================================== */
.gf-wrapper {
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: var(--font-sans);
}

.gf-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.gf-spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.gf-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.gf-spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid var(--chrome-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: gf-spin 0.7s linear infinite;
}

.gf-spinner p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

/* ========================================
   BREADCRUMB — Black bar with amber links
   ======================================== */
.gf-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--chrome-bg);
    font-size: 13px;
    flex-shrink: 0;
}

.gf-breadcrumb-back {
    width: 30px;
    height: 30px;
    border: 1px solid var(--chrome-border);
    background: var(--chrome-input-bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chrome-text-muted);
    transition: all 0.15s ease;
    margin-right: 6px;
    flex-shrink: 0;
}

.gf-breadcrumb-back:hover {
    background: var(--accent-10);
    border-color: var(--accent-30);
    color: var(--accent-primary);
}

.gf-breadcrumb-back [data-lucide] { width: 15px; height: 15px; }

.gf-breadcrumb-item { display: flex; align-items: center; }

.gf-breadcrumb-item a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.gf-breadcrumb-item a:hover { color: var(--accent-primary); }
.gf-breadcrumb-item a [data-lucide] { width: 14px; height: 14px; }

.gf-breadcrumb-separator {
    color: var(--chrome-text-dim);
    display: flex;
    align-items: center;
}

.gf-breadcrumb-separator [data-lucide] { width: 14px; height: 14px; }

.gf-breadcrumb-item.active {
    color: var(--chrome-text);
    font-weight: 600;
}

/* ========================================
   HEADER — Dark chrome (matching WeighbridgeTicket)
   ======================================== */
.gf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    background: var(--chrome-bg);
    border-bottom: none;
    box-shadow: var(--chrome-shadow);
    position: relative;
    flex-shrink: 0;
}

.gf-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.gf-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.gf-header-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--accent-10);
    border: 1px solid var(--accent-20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.gf-header-icon [data-lucide] { width: 18px; height: 18px; filter: brightness(1.2); }

.gf-header-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--chrome-text);
    margin: 0;
    letter-spacing: var(--tracking-tight);
    font-family: var(--font-sans);
}

.gf-header-subtitle {
    font-size: var(--text-xs);
    color: var(--chrome-text-dim);
    margin: 2px 0 0;
}

/* ========================================
   CONTENT AREA
   ======================================== */
.gf-main-layout {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gf-details-panel {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gf-panel-card {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.gf-details-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-lg) var(--space-xl, 32px);
    padding-bottom: var(--space-lg);
}

.gf-details-content::-webkit-scrollbar { width: 4px; }
.gf-details-content::-webkit-scrollbar-track { background: var(--bg-primary); }
.gf-details-content::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: var(--radius-md); }
.gf-details-content::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========================================
   EDIT LAYOUT — Single column, full width
   ======================================== */
.gf-edit-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
}

/* ========================================
   SECTION CARDS — WeighbridgeTicket column style
   ======================================== */
.gf-section {
    background: var(--surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    height: fit-content;
    animation: gf-section-enter 0.35s ease-out both;
}

.gf-section:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-md);
}

/* Staggered entrance */
.gf-edit-layout > .gf-section:nth-child(1) { animation-delay: 0.04s; }
.gf-edit-layout > .gf-section:nth-child(2) { animation-delay: 0.1s; }
.gf-edit-layout > .gf-section:nth-child(3) { animation-delay: 0.16s; }
.gf-edit-layout > .gf-section:nth-child(4) { animation-delay: 0.22s; }
.gf-edit-layout > .gf-section:nth-child(5) { animation-delay: 0.28s; }
.gf-edit-layout > .gf-section:nth-child(6) { animation-delay: 0.34s; }
.gf-edit-layout > .gf-section:nth-child(7) { animation-delay: 0.40s; }
.gf-edit-layout > .gf-section:nth-child(8) { animation-delay: 0.46s; }

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

/* ========================================
   SECTION DIVIDER — icon + title + fade line
   (matches wbt-section-divider exactly)
   ======================================== */
.gf-section-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 var(--space-md) 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.gf-section-divider i,
.gf-section-divider [data-lucide] {
    color: var(--text-secondary);
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-primary) 100%);
    border: 1px solid var(--border-secondary);
}

.gf-section-divider [data-lucide] > .lucide {
    width: 13px;
    height: 13px;
}

.gf-section-divider span {
    flex-shrink: 0;
}

.gf-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-secondary) 0%, transparent 100%);
    min-width: 20px;
}

/* Dark mode section divider */
[data-theme="dark"] .gf-section-divider i,
[data-theme="dark"] .gf-section-divider [data-lucide] {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-tertiary) 100%);
    border-color: var(--border-secondary);
    color: var(--text-muted);
}

[data-theme="dark"] .gf-section-divider::after {
    background: linear-gradient(90deg, var(--border-secondary) 0%, transparent 100%);
}

/* ========================================
   IDENTITY CARD — Key entity info display
   (matches wbt-identity-card)
   ======================================== */
.gf-identity-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gf-identity-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.gf-identity-row-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.gf-identity-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.gf-identity-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gf-identity-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.gf-identity-value.gf-identity-primary {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-numeric, var(--font-sans));
    font-variant-numeric: tabular-nums;
}

/* Dark mode identity */
[data-theme="dark"] .gf-identity-card { background: var(--surface); border-color: var(--border-primary); }
[data-theme="dark"] .gf-identity-label { color: var(--text-disabled); }
[data-theme="dark"] .gf-identity-value { color: var(--text-secondary); }
[data-theme="dark"] .gf-identity-value.gf-identity-primary { color: var(--text-primary); }

/* ========================================
   INFO CARD — Entity display with icon
   (matches wbt-info-card)
   ======================================== */
.gf-info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: all 0.15s ease;
}

.gf-info-card:hover { border-color: var(--border-secondary); }

.gf-info-card-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 7px;
    background: var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.gf-info-card-icon [data-lucide] { width: 16px; height: 16px; }

.gf-info-card-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.gf-info-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.gf-info-card-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-numeric, var(--font-sans));
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* Dark mode info card */
[data-theme="dark"] .gf-info-card { background: var(--surface); border-color: var(--border-primary); }
[data-theme="dark"] .gf-info-card:hover { border-color: var(--border-secondary); }
[data-theme="dark"] .gf-info-card-icon { background: var(--bg-tertiary); color: var(--text-muted); }
[data-theme="dark"] .gf-info-card-title { color: var(--text-secondary); }
[data-theme="dark"] .gf-info-card-sub { color: var(--text-disabled); }

/* ========================================
   DETAIL GRID — flat key-value pairs
   (matches wbt-detail-grid)
   ======================================== */
.gf-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-sm);
    background: var(--surface);
}

.gf-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-right: 1px solid var(--bg-tertiary);
    border-bottom: 1px solid var(--bg-tertiary);
}

.gf-detail-item:last-child { border-right: none; }

.gf-detail-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gf-detail-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-numeric, var(--font-sans));
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

/* Dark mode detail grid */
[data-theme="dark"] .gf-detail-grid { border-color: var(--border-primary); background: var(--surface); }
[data-theme="dark"] .gf-detail-item { border-right-color: var(--border-primary); border-bottom-color: var(--border-primary); }
[data-theme="dark"] .gf-detail-label { color: var(--text-disabled); }
[data-theme="dark"] .gf-detail-value { color: var(--text-secondary); }

/* ========================================
   STATUS BADGE (matches wbt-status-badge)
   ======================================== */
.gf-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: 0.02em;
}

.gf-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gf-status-active { background: var(--success-light); color: var(--success); border: 1px solid var(--success-light); }
.gf-status-active .gf-status-dot { background: var(--success); box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.gf-status-inactive { background: var(--error-light); color: var(--error); border: 1px solid var(--error-light); }
.gf-status-inactive .gf-status-dot { background: var(--error); box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }

/* ========================================
   FORM GRID
   ======================================== */
.gf-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.gf-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gf-form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    margin-bottom: 2px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--font-sans);
    line-height: var(--leading-normal);
}

.gf-span-2 { grid-column: span 2; }
.gf-span-3 { grid-column: span 3; }

@media (max-width: 900px) {
    .gf-form-grid { grid-template-columns: repeat(2, 1fr); }
    .gf-span-3 { grid-column: span 2; }
}

@media (max-width: 480px) {
    .gf-form-grid { grid-template-columns: 1fr; }
    .gf-span-2, .gf-span-3 { grid-column: span 1; }
}

/* ========================================
   FIELD ROW (2-column inline)
   ======================================== */
.gf-field-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.gf-field-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

/* ========================================
   INPUT STYLES — matches wbt-input / wbc-input
   ======================================== */
.gf-input,
.gf-select,
.gf-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-primary);
    caret-color: var(--text-primary) !important;
    transition: all var(--transition-base);
    outline: none;
    background: var(--surface);
    font-family: var(--font-sans);
}

.gf-input { height: 42px; }

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

.gf-input:hover,
.gf-select:hover,
.gf-textarea:hover {
    border-color: var(--accent-primary);
}

.gf-input:focus,
.gf-select:focus,
.gf-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-10);
}

.gf-input::placeholder { color: var(--text-muted); }

.gf-input:read-only,
.gf-input:disabled,
.gf-select:disabled,
.gf-textarea:disabled {
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: default;
    opacity: 1;
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */
.gf-active-toggle {
    grid-column: span 1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .gf-active-toggle { background: var(--surface); border-color: var(--border-primary); }

.gf-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.gf-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.gf-switch input { opacity: 0; width: 0; height: 0; }

.gf-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border-secondary);
    transition: 0.2s ease;
    border-radius: 24px;
}

.gf-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s ease;
    border-radius: 50%;
}

.gf-switch input:checked + .gf-switch-slider { background-color: var(--accent-primary); }
.gf-switch input:checked + .gf-switch-slider:before { transform: translateX(20px); }

/* ========================================
   CHECKBOX — matches wbt-checkbox
   ======================================== */
.gf-checkbox-group {
    margin-bottom: var(--space-sm);
}

.gf-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 6px;
}

.gf-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gf-checkbox-mark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid var(--border-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: var(--surface);
}

.gf-checkbox input:checked + .gf-checkbox-mark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.gf-checkbox input:checked + .gf-checkbox-mark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.gf-checkbox-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gf-checkbox-label [data-lucide] { width: 14px; height: 14px; color: var(--text-muted); }

/* ========================================
   ACTION FOOTER — Dark chrome, sticky bottom
   ======================================== */
.gf-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--chrome-bg);
    box-shadow: var(--chrome-shadow);
    z-index: 50;
    flex-shrink: 0;
}

.gf-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-30), transparent);
}

.gf-btn-save,
.gf-btn-cancel,
.gf-btn-delete {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.gf-btn-save [data-lucide],
.gf-btn-cancel [data-lucide],
.gf-btn-delete [data-lucide] { width: 15px; height: 15px; }

.gf-btn-save { background: var(--accent-primary); color: var(--on-accent); font-weight: 600; }
.gf-btn-save:hover { background: var(--accent-secondary); }
.gf-btn-save:disabled { opacity: 0.4; cursor: not-allowed; }

.gf-btn-cancel {
    background: var(--chrome-hover);
    color: var(--chrome-text);
    border: 1px solid var(--chrome-border);
}
.gf-btn-cancel:hover { background: var(--chrome-active); color: white; }

.gf-btn-delete {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid var(--error-light);
}
.gf-btn-delete:hover { background: var(--error-light); }
.gf-btn-delete:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========================================
   VALIDATION ERROR
   ======================================== */
.gf-validation-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--error-light);
    border: 1px solid var(--error-light);
    border-left: 3px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-top: var(--space-sm);
}

.gf-validation-error [data-lucide] { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* ========================================
   INFO BOX
   ======================================== */
.gf-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

.gf-info-box [data-lucide] { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--text-muted); }
.gf-info-box strong { color: var(--text-primary); }

/* ========================================
   CARDS CONTAINER — Lab tests, contacts, etc.
   ======================================== */
.gf-cards-container { margin-top: var(--space-sm); }

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

.gf-cards-header h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gf-cards-header h4 [data-lucide] { width: 16px; height: 16px; color: var(--text-muted); }

.gf-btn-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all 0.15s ease;
}

.gf-btn-add:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: var(--accent-light);
}

.gf-btn-add [data-lucide] { width: 14px; height: 14px; }

.gf-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-sm);
}

/* ========================================
   TEST CARD — Lab test specifications
   ======================================== */
.gf-test-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.15s ease;
}

.gf-test-card:hover { border-color: var(--border-secondary); }

.gf-test-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.gf-test-name { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); }

.gf-test-actions { display: flex; gap: 4px; }

.gf-test-edit-btn,
.gf-test-delete-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.gf-test-edit-btn:hover { background: var(--info-light); color: var(--info); }
.gf-test-delete-btn:hover { background: var(--error-light); color: var(--error); }
.gf-test-edit-btn [data-lucide],
.gf-test-delete-btn [data-lucide] { width: 13px; height: 13px; }

.gf-test-card-body {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gf-test-spec { display: flex; gap: 4px; align-items: baseline; }
.gf-test-spec-scope { display: flex; gap: 4px; align-items: baseline; width: 100%; }

.gf-spec-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gf-spec-value {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-numeric, var(--font-sans));
}

/* Dark mode test cards */
[data-theme="dark"] .gf-test-card { background: var(--surface); border-color: var(--border-primary); }
[data-theme="dark"] .gf-test-card:hover { border-color: var(--border-secondary); }
[data-theme="dark"] .gf-test-card-header { background: var(--bg-tertiary); border-bottom-color: var(--border-primary); }
[data-theme="dark"] .gf-test-name { color: var(--text-secondary); }
[data-theme="dark"] .gf-spec-value { color: var(--text-secondary); }

/* Lab test dialog spec grid */
.pd-test-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin: var(--space-sm) 0;
}

.pd-spec-column { display: flex; flex-direction: column; gap: var(--space-sm); }

.pd-spec-section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-primary);
}

.pd-spec-section-title [data-lucide] { width: 13px; height: 13px; }

@media (max-width: 480px) {
    .pd-test-specs-grid { grid-template-columns: 1fr; }
}

/* ========================================
   CONTACT CARD — Company contacts
   ======================================== */
.gf-contact-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.gf-contact-card:hover { border-color: var(--border-secondary); }

.gf-contact-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-weight: 700;
    font-size: 13px;
}

.gf-contact-body { flex: 1; min-width: 0; }

.gf-contact-name { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }

.gf-contact-email,
.gf-contact-phone {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.gf-contact-email [data-lucide],
.gf-contact-phone [data-lucide] { width: 12px; height: 12px; }

.gf-contact-badges { display: flex; gap: 4px; margin-top: 6px; }

.gf-contact-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gf-badge-admin { background: rgba(168, 85, 247, 0.1); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.2); }
.gf-badge-reports { background: var(--info-light); color: var(--info); border: 1px solid var(--info-light); }

.gf-contact-actions { display: flex; gap: 4px; flex-shrink: 0; }

.gf-contact-edit-btn,
.gf-contact-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.gf-contact-edit-btn:hover { background: var(--info-light); color: var(--info); }
.gf-contact-delete-btn:hover { background: var(--error-light); color: var(--error); }
.gf-contact-edit-btn [data-lucide],
.gf-contact-delete-btn [data-lucide] { width: 14px; height: 14px; }

/* Dark mode contacts */
[data-theme="dark"] .gf-contact-card { background: var(--surface); border-color: var(--border-primary); }
[data-theme="dark"] .gf-contact-card:hover { border-color: var(--border-secondary); }
[data-theme="dark"] .gf-contact-avatar { background: var(--bg-tertiary); color: var(--text-muted); }
[data-theme="dark"] .gf-contact-name { color: var(--text-secondary); }

/* ========================================
   AUTO REPORT ITEM
   ======================================== */
.gf-report-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    margin-bottom: var(--space-xs);
}

.gf-report-item:hover { border-color: var(--border-secondary); }

.gf-report-freq {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.gf-report-freq [data-lucide] { width: 12px; height: 12px; }

.gf-freq-daily { background: var(--info-light); color: var(--info); border: 1px solid var(--info-light); }
.gf-freq-weekly { background: rgba(168, 85, 247, 0.1); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.2); }
.gf-freq-monthly { background: var(--accent-10); color: var(--accent-primary); border: 1px solid var(--accent-20); }

.gf-report-body { flex: 1; min-width: 0; }

.gf-report-recipients {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gf-report-actions { display: flex; gap: 4px; flex-shrink: 0; }

[data-theme="dark"] .gf-report-item { background: var(--surface); border-color: var(--border-primary); }
[data-theme="dark"] .gf-report-item:hover { border-color: var(--border-secondary); }

/* ========================================
   EMAIL TAG
   ======================================== */
.gf-email-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    font-size: var(--text-xs);
    color: var(--text-primary);
}

.gf-email-tag-remove {
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.gf-email-tag-remove:hover { background: var(--error-light); color: var(--error); }
.gf-email-tag-remove [data-lucide] { width: 12px; height: 12px; }

/* ========================================
   NOTES
   ======================================== */
.gf-notes-preview {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    min-height: 60px;
}

[data-theme="dark"] .gf-notes-preview { background: var(--surface); border-color: var(--border-primary); }

/* ========================================
   MODAL — Custom dialog system
   ======================================== */
.gf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: gf-overlay-in 0.2s ease;
}

@keyframes gf-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.gf-modal {
    background: var(--surface);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: gf-modal-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 90vh;
    width: 90%;
}

.gf-modal-sm { max-width: 380px; }
.gf-modal-md { max-width: 480px; }
.gf-modal-lg { max-width: 640px; }

@keyframes gf-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.gf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    background: var(--chrome-bg);
    position: relative;
    flex-shrink: 0;
}

.gf-modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.gf-dialog-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--chrome-text);
}

.gf-dialog-header-content [data-lucide] { width: 18px; height: 18px; color: var(--accent-primary); }

.gf-modal-close {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--chrome-border);
    background: var(--chrome-input-bg);
    color: var(--chrome-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.gf-modal-close:hover { background: var(--chrome-active); color: var(--chrome-text); }
.gf-modal-close [data-lucide] { width: 15px; height: 15px; }

.gf-modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.gf-modal-body p {
    margin: 0 0 var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.gf-dialog-company-info {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

[data-theme="dark"] .gf-dialog-company-info { background: var(--surface); border-color: var(--border-primary); }

.gf-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--chrome-bg);
    position: relative;
}

.gf-modal-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-30), transparent);
}

.gf-dialog-btn-cancel,
.gf-dialog-btn-confirm,
.gf-dialog-btn-save {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all 0.15s ease;
}

.gf-dialog-btn-cancel [data-lucide],
.gf-dialog-btn-confirm [data-lucide],
.gf-dialog-btn-save [data-lucide] { width: 14px; height: 14px; }

.gf-dialog-btn-cancel {
    background: var(--chrome-input-bg);
    color: var(--chrome-text-muted);
    border: 1px solid var(--chrome-border);
}
.gf-dialog-btn-cancel:hover { background: var(--chrome-active); color: var(--chrome-text); }

.gf-dialog-btn-confirm { background: var(--error-light); color: var(--error); }
.gf-dialog-btn-confirm:hover { background: var(--error-light); }

.gf-dialog-btn-save { background: var(--accent-primary); color: var(--on-accent); font-weight: 600; }
.gf-dialog-btn-save:hover { background: var(--accent-secondary); }

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.gf-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    min-width: 300px;
    max-width: 420px;
    animation: gf-toast-in 0.3s ease;
    overflow: hidden;
}

.gf-toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    animation: gf-toast-progress 5s linear forwards;
}

@keyframes gf-toast-progress {
    from { width: 100%; }
    to   { width: 0%; }
}

@keyframes gf-toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.gf-toast-success { background: var(--success-light); border: 1px solid var(--success-light); }
.gf-toast-success::after { background: var(--success); }
.gf-toast-success .gf-toast-icon { color: var(--success); }

.gf-toast-error { background: #fef2f2; border: 1px solid #fecaca; }
.gf-toast-error::after { background: var(--error); }
.gf-toast-error .gf-toast-icon { color: var(--error); }

.gf-toast-info { background: #eff6ff; border: 1px solid #bfdbfe; }
.gf-toast-info::after { background: var(--info); }
.gf-toast-info .gf-toast-icon { color: var(--info); }

[data-theme="dark"] .gf-toast-success { background: #052e16; border-color: #166534; }
[data-theme="dark"] .gf-toast-error { background: #450a0a; border-color: #991b1b; }
[data-theme="dark"] .gf-toast-info { background: #172554; border-color: #1e40af; }

.gf-toast-icon { flex-shrink: 0; margin-top: 1px; }
.gf-toast-icon [data-lucide] { width: 18px; height: 18px; }
.gf-toast-content { flex: 1; }
.gf-toast-title { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.gf-toast-message { font-size: var(--text-xs); color: var(--text-secondary); }

.gf-toast-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.gf-toast-close:hover { background: rgba(0,0,0,0.05); color: var(--text-primary); }
.gf-toast-close [data-lucide] { width: 14px; height: 14px; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .gf-header { padding: var(--space-sm) var(--space-md); }
    .gf-header-title { font-size: var(--text-base); }
    .gf-breadcrumb { padding: 8px 16px; font-size: 12px; }
    .gf-details-content { padding: var(--space-sm); padding-bottom: var(--space-md); }
    .gf-section { padding: var(--space-md); }
    .gf-actions { padding: var(--space-sm) var(--space-md); gap: var(--space-sm); flex-wrap: wrap; }
    .gf-identity-row { grid-template-columns: 1fr; }
    .gf-identity-row-3 { grid-template-columns: 1fr; }
    .gf-cards-grid { grid-template-columns: 1fr; }
    .gf-modal { width: 95%; }
    .gf-toast { min-width: auto; left: 12px; right: 12px; }
}

@media (max-width: 480px) {
    .gf-breadcrumb-item a span { display: none; }
    .gf-header-icon { display: none; }
    .gf-field-row { grid-template-columns: 1fr; }
    .gf-field-row-3 { grid-template-columns: 1fr; }
}

/* ========================================
   GENERIC CARD — Contact cards, etc.
   ======================================== */
.gf-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.15s ease;
    cursor: pointer;
}

.gf-card:hover { border-color: var(--border-secondary); box-shadow: var(--shadow-sm); }
.gf-card-selected { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-10); }

.gf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.gf-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gf-card-actions { display: flex; gap: 4px; }

.gf-card-edit-btn,
.gf-card-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.gf-card-edit-btn:hover { background: var(--info-light); color: var(--info); }
.gf-card-delete-btn:hover { background: var(--error-light); color: var(--error); }
.gf-card-edit-btn [data-lucide],
.gf-card-delete-btn [data-lucide] { width: 14px; height: 14px; }

.gf-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gf-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.gf-card-label {
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.gf-card-value {
    color: var(--text-secondary);
    word-break: break-all;
}

.gf-card-badges {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.gf-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.gf-card-badge [data-lucide] { width: 11px; height: 11px; }

/* Dark mode cards */
[data-theme="dark"] .gf-card { background: var(--surface); border-color: var(--border-primary); }
[data-theme="dark"] .gf-card:hover { border-color: var(--border-secondary); }
[data-theme="dark"] .gf-card-header { background: var(--bg-tertiary); border-bottom-color: var(--border-primary); }
[data-theme="dark"] .gf-card-name { color: var(--text-secondary); }
[data-theme="dark"] .gf-card-value { color: var(--text-secondary); }

/* ========================================
   AUTO REPORTS — Full report item styles
   ======================================== */
.gf-reports-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.gf-report-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.gf-report-item:hover { border-color: var(--border-secondary); }
.gf-report-item.inactive { opacity: 0.6; }

.gf-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gf-report-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gf-report-frequency {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.gf-report-frequency [data-lucide] { width: 16px; height: 16px; color: var(--accent-primary); }

.gf-report-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gf-report-status .gf-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.gf-report-status .gf-status-badge [data-lucide] { width: 12px; height: 12px; }

.gf-status-badge.active { background: var(--success-light); color: var(--success); border: 1px solid var(--success-light); }
.gf-status-badge.inactive { background: rgba(107, 114, 128, 0.1); color: #6b7280; border: 1px solid rgba(107, 114, 128, 0.25); }
.gf-status-badge.protected { background: var(--accent-10); color: var(--accent-primary); border: 1px solid var(--accent-20); }

.gf-report-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-primary);
}

.gf-report-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.gf-report-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 120px;
}

.gf-report-label [data-lucide] { width: 14px; height: 14px; }

.gf-report-value {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gf-recipient-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: var(--info-light);
    border: 1px solid var(--info-light);
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--info);
    font-weight: 500;
}

.gf-recipient-more {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.gf-report-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-primary);
}

.gf-report-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all 0.15s ease;
}

.gf-report-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); background: var(--accent-dim); }
.gf-report-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gf-report-btn [data-lucide] { width: 14px; height: 14px; }

.gf-report-btn-danger:hover { border-color: var(--error); color: var(--error); background: var(--error-light); }

/* Dark mode reports */
[data-theme="dark"] .gf-report-item { background: var(--surface); border-color: var(--border-primary); }
[data-theme="dark"] .gf-report-item:hover { border-color: var(--border-secondary); }
[data-theme="dark"] .gf-report-details { border-top-color: var(--border-primary); }
[data-theme="dark"] .gf-report-actions { border-top-color: var(--border-primary); }
[data-theme="dark"] .gf-report-btn { background: var(--bg-tertiary); border-color: var(--border-primary); color: var(--text-muted); }

/* ========================================
   EMAIL LIST — Dialog email management
   ======================================== */
.gf-email-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gf-email-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.gf-email-remove {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    padding: 0;
}

.gf-email-remove:hover { background: var(--error-light); color: var(--error); }
.gf-email-remove [data-lucide] { width: 12px; height: 12px; }

/* ========================================
   DIALOG FOOTER (inline in modal body)
   ======================================== */
.gf-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-primary);
}

/* ========================================
   CONTACTS ACTIONS (button row)
   ======================================== */
.gf-contacts-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ========================================
   COA TEMPLATES (ProductEdit + Products)
   ======================================== */
.pd-coa-dialog { max-width: 720px; }

.pd-coa-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: var(--space-md) 0 var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-primary);
}

.pd-coa-section-title [data-lucide] {
    width: 14px;
    height: 14px;
    color: var(--accent-primary);
}

.pd-coa-test-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--space-sm);
}

.pd-coa-test-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-md);
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-inset);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease;
}

.pd-coa-test-row:hover { border-color: var(--accent-20); }

.pd-coa-test-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.pd-coa-test-fields {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.pd-coa-test-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.pd-coa-test-field label {
    font-size: 10px;
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.pd-coa-test-field .gf-input {
    height: 32px;
    padding: 4px 8px;
    font-size: var(--text-sm);
}

.pd-coa-test-field-fmt { max-width: 70px; }

.pd-coa-test-fields .gf-test-delete-btn {
    height: 32px;
    width: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    align-self: flex-end;
}

.pd-coa-test-fields .gf-test-delete-btn:hover {
    color: var(--error);
    border-color: var(--error);
}

.pd-coa-test-fields .gf-test-delete-btn [data-lucide] {
    width: 14px;
    height: 14px;
}

.pd-coa-add-test {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border-soft);
}

.pd-coa-add-test .gf-input { flex: 1; }

@media (max-width: 768px) {
    .pd-coa-test-row { grid-template-columns: 1fr; }
    .pd-coa-test-fields { flex-wrap: wrap; }
}
