/* TD Dorper Studs ERP — V1.6.6 operational geometry policy.
 * Default: square/zero-radius operational UI.
 * Exceptions requested: main dashboard, topbar, animal listing pages,
 * avatars/status dots and circular notification counters.
 *
 * V1.6.6 IMPORTANT:
 * Animal-list page context is scoped to .fi-main ONLY.  It must never be
 * attached to <html>, because a root-level page class can leak page-specific
 * layout rules into Filament's sidebar / cluster navigation shell.
 */

/* Reassert square operational surfaces outside the approved exceptions.
 * The animal-list exception is now tested on .fi-main itself, not on <html>.
 */
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-section,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-section-content-ctn,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-ta-ctn,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-ta-header,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-ta-header-toolbar,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-wi-stats-overview-stat,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-wi-chart,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-wi-table,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-btn,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-icon-btn,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-input-wrp,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-select-input,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-fo-repeater-item,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-fo-builder-item,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-fo-file-upload,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-tabs,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-tabs-item,
html:not(.td-dashboard-page) .fi-main:not(.td-animal-list-page) .fi-pagination-item,
.fi-modal-window,
.fi-dropdown-panel:not(.fi-topbar .fi-dropdown-panel),
.fi-dropdown-list,
.fi-dropdown-list-item {
    border-radius: 0 !important;
}

/* Topbar is an explicit exception: retain clean soft geometry. */
.fi-topbar nav {
    border-radius: 0 !important;
}
.fi-topbar .fi-input-wrp,
.fi-topbar .fi-global-search-field,
.fi-topbar .fi-dropdown-panel,
.fi-topbar .fi-dropdown-list,
.fi-topbar .fi-dropdown-list-item {
    border-radius: 12px !important;
}
.fi-topbar .fi-btn {
    border-radius: 10px !important;
}
.fi-topbar .fi-icon-btn {
    border-radius: 9999px !important;
}
.fi-topbar .fi-badge,
.fi-topbar [class*="notification"] .fi-badge {
    border-radius: 9999px !important;
}

/* Main /admin dashboard is allowed to keep designed card geometry. */
html.td-dashboard-page .fi-main .fi-section,
html.td-dashboard-page .fi-main .fi-section-content-ctn,
html.td-dashboard-page .fi-main .fi-ta-ctn,
html.td-dashboard-page .fi-main .fi-wi-stats-overview-stat,
html.td-dashboard-page .fi-main .fi-wi-chart,
html.td-dashboard-page .fi-main .fi-wi-table {
    border-radius: 14px !important;
}
html.td-dashboard-page .fi-main .fi-btn,
html.td-dashboard-page .fi-main .fi-input-wrp,
html.td-dashboard-page .fi-main .fi-select-input {
    border-radius: 9px !important;
}

/* Animal list pages: scope the exception to the CONTENT AREA ONLY.
 * No selector below targets .fi-sidebar, cluster navigation, or the shell.
 */
.fi-main.td-animal-list-page .fi-ta-ctn,
.fi-main.td-animal-list-page .fi-ta-header,
.fi-main.td-animal-list-page .fi-ta-header-toolbar,
.fi-main.td-animal-list-page .fi-ta-content-ctn,
.fi-main.td-animal-list-page .fi-ta-filters {
    border-radius: 13px !important;
}
.fi-main.td-animal-list-page .fi-input-wrp,
.fi-main.td-animal-list-page .fi-select-input,
.fi-main.td-animal-list-page .fi-btn,
.fi-main.td-animal-list-page .fi-pagination-item {
    border-radius: 9px !important;
}

/* Human/animal imagery and tiny indicators remain circular everywhere. */
.fi-avatar,
.fi-avatar img,
.fi-user-avatar,
.fi-user-avatar img,
.fi-ta-image,
.fi-ta-image img,
img[class*="avatar"],
.fi-badge-dot,
.fi-color-item,
.fi-toggle > span,
.fi-toggle span[aria-hidden="true"],
.td-system-loader-logo-wrap,
.td-system-loader-ring,
.td-system-loader-logo,
.td-system-loader-logo-fallback,
.td-system-loader-spinner,
.td-network-dot {
    border-radius: 9999px !important;
}
