/* Shared visual foundation for admin, account and buyer experiences. */

.console-theme {
    --gcap-primary: #245340;
    --gcap-primary-dark: #183d30;
    --gcap-primary-600: #1b4434;
    --gcap-navy: #183d30;
    --gcap-lavender: #edf1ec;
    --gcap-indigo-50: #f6f7f3;
    --gcap-indigo-100: #e8eee6;
    --gcap-surface: #f6f5f0;
    --gcap-card: #ffffff;
    --gcap-border: #e2e5dd;
    --gcap-text: #25332d;
    --gcap-text-muted: #66736b;
    --gcap-success-bg: #edf4ee;
    --gcap-success-border: #d5e5d8;
    --gcap-success-text: #326344;
    --gcap-danger-bg: #fbf0eb;
    --gcap-danger-border: #eed8cc;
    --gcap-danger-text: #a34f36;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgb(24 61 48 / 3%);
    --shadow-md: 0 4px 16px rgb(24 61 48 / 6%);
    --shadow-lg: 0 12px 32px rgb(24 61 48 / 10%);
    --admin-forest: #183d30;
    --admin-sidebar-text: #d3dfd6;
    --admin-sidebar-muted: #a3b8aa;
    --admin-accent: #b98936;
    --admin-sidebar-width: 248px;
    --admin-sidebar-compact-width: 80px;
    --admin-content-gutter: clamp(24px, 3vw, 48px);
    --admin-control-height: 44px;
    --admin-focus: #b98936;
    display: block;
    background: var(--gcap-surface);
    color: var(--gcap-text);
    font-size: 14px;
    line-height: 1.5;
}

/* Shared surfaces and controls; component layout belongs to the page. */
.console-theme :is(.card-gcap, .table-wrapper, .filter-bar) {
    border-color: var(--gcap-border);
    border-radius: var(--radius-lg);
    background: var(--gcap-card);
    box-shadow: var(--shadow-sm);
}

.console-theme .card-gcap-title {
    color: var(--gcap-text);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.console-theme .page-header h1 {
    color: var(--gcap-text);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.console-theme .text-muted-sm {
    color: var(--gcap-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.console-theme :is(.summary-value, .registry-metric-value, .donut-center-value, .group-stats strong, .distribution-row) {
    font-variant-numeric: tabular-nums;
}

.console-theme :is(.btn-gcap-primary, .btn-gcap-secondary) {
    min-height: var(--admin-control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.console-theme .btn-gcap-primary {
    background: var(--gcap-primary);
    color: #fff;
}

.console-theme .btn-gcap-primary:hover {
    background: var(--gcap-primary-600);
    color: #fff;
    box-shadow: none;
    transform: none;
}

.console-theme .btn-gcap-secondary {
    background: #fff;
    border-color: var(--gcap-border);
    color: var(--gcap-primary-dark);
}

.console-theme .btn-gcap-secondary:hover {
    background: var(--gcap-indigo-50);
    border-color: #c6d2c8;
    color: var(--gcap-primary-dark);
    box-shadow: none;
    transform: none;
}

.console-theme :is(.input-gcap, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    border-color: var(--gcap-border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--gcap-text);
    font-family: inherit;
    font-size: 14px;
}

.console-theme :is(.input-gcap, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select) {
    min-height: var(--admin-control-height);
}

.console-theme .input-gcap {
    min-width: 0;
    max-width: 100%;
}

.console-theme :is(.input-gcap, input, select, textarea):focus {
    border-color: var(--gcap-primary);
    box-shadow: 0 0 0 3px rgb(36 83 64 / 12%);
}

.console-theme :is(a, button, summary, input, select, textarea):focus-visible {
    outline: 2px solid var(--admin-focus);
    outline-offset: 3px;
}

.console-theme :is(button, .btn-gcap-primary, .btn-gcap-secondary):disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Reusable page components across account, admin and buyer views. */
.console-theme .admin-page-heading {
    margin: 0;
    min-width: 0;
    padding: 4px 0 0;
    background: transparent;
}
.console-theme .admin-page-heading h1 {
    margin: 4px 0 8px;
    color: var(--gcap-text);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.console-theme .admin-page-heading p {
    margin: 0;
    color: var(--gcap-text-muted);
    font-size: 14px;
    line-height: 1.6;
}
.console-theme .admin-page-heading .admin-page-eyebrow {
    margin-bottom: 8px;
    color: var(--gcap-text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.console-theme .admin-metrics {
    display: grid;
    grid-template-columns: repeat(var(--metric-count, 5), minmax(0, 1fr));
    gap: 0;
    padding: 0;
    overflow: hidden;
}
.console-theme .admin-metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 22px 24px;
}
.console-theme .admin-metric + .admin-metric {
    border-left: 1px solid var(--gcap-border);
}
.console-theme .admin-metric-label {
    color: var(--gcap-text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}
.console-theme .admin-metric-value {
    display: block;
    color: var(--gcap-text);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.console-theme .admin-metric-value.is-text {
    font-size: 20px;
    line-height: 1.56;
}
.console-theme .admin-metric-unit {
    margin-left: 4px;
    color: var(--gcap-text-muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
}
.console-theme .admin-metric-detail {
    color: var(--gcap-text-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
}
.console-theme .admin-metric-detail.is-attention {
    color: var(--gcap-danger-text);
}

/* Legacy page structures use the shared foundation while retaining their workflows. */
.console-theme :is(.registry-page, .registry-shell, .users-page, .fee-page, .farmer-detail-shell) {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    max-width: 100%;
}
.console-theme :is(.registry-filter-card, .registry-table-card, .users-list-card, .users-side-card, .fee-country-card) {
    min-width: 0;
    border: 1px solid var(--gcap-border);
    border-radius: var(--radius-lg);
    background: var(--gcap-card);
    box-shadow: var(--shadow-sm);
}
.console-theme :is(.registry-filter-card, .users-list-card, .users-side-card, .fee-country-card, .farmer-detail-shell .card-gcap, .groups-admin-layout .card-gcap, .groups-list-card) {
    padding: 24px;
}
.console-theme :is(.registry-table-head, .registry-table-footer) {
    padding: 20px 24px;
}
.console-theme :is(.users-section-head h2, .users-side-head h2, .fee-section-head h2, .registry-table-head h2, .dashboard-section-head h2, .groups-list-main h2) {
    margin: 0;
    color: var(--gcap-text);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.4;
}
.console-theme :is(.users-section-head p, .users-side-head p, .fee-section-head p, .registry-table-head p, .groups-list-main p) {
    margin: 6px 0 0;
    color: var(--gcap-text-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
}
.console-theme :is(.users-section-head, .users-side-head) {
    margin-bottom: 20px;
}
.console-theme :is(.users-side-icon, .users-note-icon, .fee-metadata-icon, .fee-note-icon) {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--gcap-text-muted);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.console-theme :is(.users-note-card, .fee-note) {
    padding: 16px;
    margin: 0;
    border: 1px solid var(--gcap-border);
    border-radius: var(--radius-md);
    background: #f6f7f3;
    color: var(--gcap-text-muted);
    box-shadow: none;
    font-size: 13px;
}
.console-theme :is(.users-note-card p, .fee-note p) {
    color: var(--gcap-text-muted);
    font-size: 13px;
    line-height: 1.6;
}
.console-theme .fee-note strong {
    color: var(--gcap-text);
    font-size: 14px;
    font-weight: 600;
}
.console-theme :is(.registry-filter-grid-console, .users-toolbar) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
    min-width: 0;
    padding: 0;
    margin-bottom: 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.console-theme .registry-filter-grid-console { margin: 0; }
.console-theme :is(.registry-field, .users-toolbar-field, .registry-filter-grid > label) { min-width: 0; }
.console-theme .registry-field-search { grid-column: span 2; }
.console-theme :is(.registry-field label, .users-filter-label) {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin: 0 0 8px;
    padding: 0;
    clip: auto;
    overflow: visible;
    white-space: normal;
    color: var(--gcap-text-muted);
    font-size: 12px;
    font-weight: 500;
}
.console-theme .registry-filter-grid > label {
    display: grid;
    gap: 8px;
    color: var(--gcap-text-muted);
    font-size: 12px;
    font-weight: 500;
}
.console-theme :is(.registry-field input, .registry-field select, .users-form input, .users-form select, .users-filter-select, .users-search-field .input-gcap, .form-gcap input, .form-gcap select) {
    min-height: var(--admin-control-height);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 400;
}
.console-theme .registry-field.registry-field-search input { padding-left: 36px; }
.console-theme .registry-field-icon { left: 12px; top: 52px; }
.console-theme .users-search-field .input-gcap { padding-left: 36px; }
.console-theme .registry-date-range { grid-column: span 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.console-theme .registry-date-range label { grid-column: 1 / -1; margin-bottom: 0; }
.console-theme :is(.registry-filter-actions-console, .registry-bulk-actions) {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}
.console-theme .registry-bulk-actions { padding-top: 16px; border-top: 1px solid var(--gcap-border); }
.console-theme .users-toolbar { grid-template-columns: minmax(200px, 1.8fr) repeat(3, minmax(120px, 1fr)) auto; }
.console-theme .users-toolbar-field-search { grid-column: auto; }
.console-theme .users-toolbar > .users-filter-button { justify-self: start; }
.console-theme .users-status-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.console-theme .users-status-toolbar .users-filter-button { background: #f6f7f3; color: var(--gcap-text-muted); border-color: var(--gcap-border); }
.console-theme .users-status-toolbar .is-active { background: var(--gcap-primary); color: #fff; border-color: var(--gcap-primary); }
.console-theme :is(.users-filter-button, .users-submit-button, .fee-primary-action, .fee-save-button, .fee-secondary-action, .registry-export-btn, .registry-bulk-btn, .registry-view-btn, .users-action-button, .users-warning-button, .users-danger-button) {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--admin-control-height);
    padding: 10px 16px;
    border: 1px solid var(--gcap-border);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--gcap-primary-dark);
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    transform: none;
    cursor: pointer;
}
.console-theme :is(.users-filter-button, .users-submit-button, .fee-primary-action, .fee-save-button) {
    border-color: var(--gcap-primary);
    background: var(--gcap-primary);
    color: #fff;
}
.console-theme :is(.users-filter-button, .users-submit-button, .fee-primary-action, .fee-save-button):hover:not(:disabled) {
    border-color: var(--gcap-primary-600);
    background: var(--gcap-primary-600);
    color: #fff;
    box-shadow: none;
    transform: none;
}
.console-theme :is(.fee-secondary-action, .registry-export-btn, .registry-bulk-btn, .registry-view-btn, .users-action-button):hover {
    border-color: #c6d2c8;
    background: #f6f7f3;
    color: var(--gcap-primary-dark);
    box-shadow: none;
    transform: none;
}
.console-theme :is(.users-warning-button, .users-danger-button) {
    background: var(--gcap-danger-bg);
    border-color: var(--gcap-danger-border);
    color: var(--gcap-danger-text);
}
.console-theme :is(.registry-view-btn, .users-action-button) { min-height: 36px; padding: 6px 12px; }
.console-theme :is(.registry-reset-link, .users-back-link) { color: var(--gcap-text-muted); font-size: 13px; font-weight: 500; }
.console-theme :is(.users-table-wrap, .registry-table-wrap, .table-scroll, .table-responsive) {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--gcap-border);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: none;
}
.console-theme .registry-table-wrap { margin: 0 24px; }
.console-theme :is(.users-table, .registry-table, .table-gcap, .crops-table) {
    width: 100%;
    border-collapse: collapse;
    color: var(--gcap-text);
    background: #fff;
    font-size: 13px;
}
.console-theme :is(.users-table, .registry-table, .table-gcap, .crops-table) thead th {
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--gcap-border);
    background: #f6f7f3;
    color: var(--gcap-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.5;
    text-transform: uppercase;
    text-align: left;
}
.console-theme :is(.users-table, .registry-table, .table-gcap, .crops-table) tbody td {
    padding: 16px;
    border: 0;
    border-bottom: 1px solid var(--gcap-border);
    color: var(--gcap-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    vertical-align: middle;
}
.console-theme :is(.users-table, .registry-table, .table-gcap, .crops-table) tbody tr:hover { background: #fafbf8; }
.console-theme :is(.users-table, .registry-table, .table-gcap, .crops-table) tbody tr:last-child td { border-bottom: 0; }
.console-theme .users-table { min-width: 780px; }
.console-theme .users-identity { min-width: 180px; }
.console-theme .registry-table-console { min-width: 880px; }
.console-theme .registry-table-console :is(th, td):nth-child(2) { min-width: 220px; width: 25%; }
.console-theme .registry-table-console :is(th, td):nth-child(3) { min-width: 160px; width: 18%; }
.console-theme .registry-table-console :is(th, td):nth-child(6) { min-width: 130px; width: 130px; }
.console-theme .registry-table-console :is(th, td):nth-child(7) { min-width: 96px; width: 96px; }
.console-theme :is(.farmer-identity strong, .users-identity strong) { color: var(--gcap-text); font-size: 13px; font-weight: 600; }
.console-theme :is(.farmer-identity small, .users-identity small) { color: var(--gcap-text-muted); font-size: 12px; font-weight: 400; }
.console-theme :is(.farmer-avatar, .users-avatar) { width: 36px; height: 36px; flex-basis: 36px; border: 0; background: #edf1ec; color: var(--gcap-primary-dark); font-size: 12px; font-weight: 500; box-shadow: none; }
.console-theme :is(.registry-chip, .status-chip, .users-role-badge, .users-status-badge, .users-group-pill, .groups-status-pill, .status-pill, .fee-status-badge) {
    padding: 4px 8px;
    border: 0;
    border-radius: 6px;
    background: #edf1ec;
    color: var(--gcap-primary-dark);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: none;
}
.console-theme :is(.users-status-badge.is-pending, .groups-status-pill.is-inactive, .status-no, .status-chip.is-incomplete) { background: #f8f1e3; color: #805d20; }
.console-theme :is(.users-status-badge.is-disabled, .status-chip.is-unverified) { background: var(--gcap-danger-bg); color: var(--gcap-danger-text); }
.console-theme :is(.users-role-badge.is-group, .registry-chip.is-neutral, .status-neutral) { background: #f1f2ee; color: var(--gcap-text-muted); }
.console-theme :is(.users-table-footer, .registry-table-footer) { color: var(--gcap-text-muted); font-size: 12px; }
.console-theme :is(.users-page-button, .registry-pagination a) { min-width: 36px; min-height: 36px; border-radius: 6px; box-shadow: none; font-size: 12px; font-weight: 500; }
.console-theme :is(.users-page-button.is-active, .registry-pagination a.is-active) { border-color: var(--gcap-primary); background: var(--gcap-primary); color: #fff; }

/* Forms, country settings and account detail pages. */
.console-theme .users-add-layout { grid-template-columns: minmax(200px, 0.5fr) minmax(0, 1fr); gap: 24px; margin-top: 0; }
.console-theme .users-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.console-theme :is(.users-form-row label, .form-row label, .groups-assign-form label, .groups-assigned-admins strong, .fee-country-control label) { color: var(--gcap-text-muted); font-size: 12px; font-weight: 500; }
.console-theme .users-submit-button { grid-column: 1 / -1; grid-row: auto; justify-self: start; align-self: start; width: auto; margin: 0; }
.console-theme .users-submit-button .ui-icon-shell { width: 16px; height: 16px; }
.console-theme .users-detail-form { display: block; }
.console-theme .users-detail-save { margin-top: 20px; }
.console-theme .users-detail-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.5fr); gap: 24px; }
.console-theme .users-detail-summary { padding: 16px 0; margin: 0 0 20px; border: 0; border-top: 1px solid var(--gcap-border); border-bottom: 1px solid var(--gcap-border); background: transparent; border-radius: 0; }
.console-theme .users-detail-summary dt { font-size: 12px; font-weight: 400; color: var(--gcap-text-muted); }
.console-theme .users-detail-summary dd { font-size: 13px; font-weight: 500; color: var(--gcap-text); }
.console-theme .users-detail-header { gap: 16px; }
.console-theme .fee-section-head { align-items: center; flex-wrap: wrap; gap: 16px; padding: 0; }
.console-theme .fee-country-list { gap: 16px; }
.console-theme .fee-country-card { grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1.1fr) minmax(90px, 0.6fr) minmax(130px, 1fr) auto; gap: 20px; }
.console-theme .fee-country-title-row h3 { color: var(--gcap-text); font-size: 16px; font-weight: 600; }
.console-theme .fee-flag { width: 36px; height: 24px; flex-basis: 36px; border-radius: 4px; box-shadow: none; }
.console-theme .fee-country-title-row { flex-wrap: wrap; gap: 8px; }
.console-theme .fee-country-identity { gap: 12px; }
.console-theme .fee-country-identity p { margin-top: 6px; color: var(--gcap-text-muted); font-size: 12px; }
.console-theme .fee-money-input { min-height: 44px; border-color: var(--gcap-border); border-radius: 8px; background: #fff; }
.console-theme .fee-money-input input { min-width: 0; width: 100%; min-height: 42px; border: 0; padding: 10px; border-radius: 0 8px 8px 0; font-size: 14px; font-weight: 500; }
.console-theme .fee-money-input span { background: #f6f7f3; color: var(--gcap-text-muted); font-size: 12px; font-weight: 500; }
.console-theme .fee-currency-chip { min-height: 44px; border-radius: 8px; border-color: var(--gcap-border); background: #f6f7f3; color: var(--gcap-text); font-size: 13px; font-weight: 500; }
.console-theme .fee-country-control small { color: var(--gcap-text-muted); font-size: 12px; font-weight: 400; }
.console-theme .fee-metadata-card { padding: 0; border: 0; background: transparent; border-radius: 0; gap: 8px; box-shadow: none; }
.console-theme .fee-metadata-card strong { color: var(--gcap-text-muted); font-size: 12px; font-weight: 400; }
.console-theme .fee-metadata-card span:not(.ui-icon-shell) { color: var(--gcap-text); font-size: 12px; }
.console-theme .fee-metadata-card small { color: var(--gcap-text-muted); font-size: 12px; }
.console-theme .fee-saved-state { color: var(--gcap-text-muted); font-size: 12px; font-weight: 400; }
.console-theme .groups-admin-layout { gap: 24px; margin-top: 24px; margin-bottom: 24px; }
.console-theme .groups-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
.console-theme :is(.groups-list-item, .groups-admin-tools, .groups-assign-form, .groups-assigned-admins, .groups-admin-chip-form) { min-width: 0; }
.console-theme .groups-list-main > div { min-width: 0; overflow-wrap: anywhere; }
.console-theme .groups-list-item { padding: 24px 0; border: 0; border-bottom: 1px solid var(--gcap-border); border-radius: 0; background: transparent; gap: 20px; }
.console-theme .groups-list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.console-theme .groups-list-main h2 { font-size: 16px; }
.console-theme .groups-admin-chip-form { border: 1px solid var(--gcap-border); border-radius: 8px; background: #f6f7f3; }
.console-theme .groups-admin-chip-form span { color: var(--gcap-text); font-size: 13px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
.console-theme .groups-admin-chip-form button { padding: 6px 10px; border-radius: 6px; background: var(--gcap-danger-bg); color: var(--gcap-danger-text); font-size: 12px; font-weight: 500; }

/* Farmer profiles and forecast panels. */
.console-theme .farmer-breadcrumb { font-size: 12px; font-weight: 400; }
.console-theme .farmer-profile-header { grid-template-columns: minmax(0, 1.3fr) minmax(230px, 0.8fr); gap: 24px; }
.console-theme .farmer-profile-identity { align-items: start; gap: 20px; }
.console-theme .farmer-profile-avatar { width: 80px; height: 80px; flex-basis: 80px; border-radius: 12px; box-shadow: none; }
.console-theme .farmer-profile-avatar-fallback { background: #edf1ec; font-size: 26px; font-weight: 500; }
.console-theme .farmer-title-row h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.035em; }
.console-theme .farmer-code-pill { font-size: 12px; font-weight: 500; border-radius: 6px; }
.console-theme .farmer-profile-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--gcap-border); gap: 12px; }
.console-theme .farmer-profile-actions :is(.btn-gcap-primary, .btn-gcap-secondary) { width: auto; }
.console-theme .farmer-detail-grid { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 24px; }
.console-theme :is(.farmer-detail-main, .farmer-detail-aside) { min-width: 0; gap: 24px; }
.console-theme .farm-overview-topline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.console-theme .overview-highlight { padding: 0; border: 0; background: transparent; }
.console-theme :is(.farmer-meta-item span, .detail-label, .overview-highlight span, .metric-box span) { font-size: 12px; font-weight: 400; }
.console-theme :is(.farmer-meta-item strong, .detail-value, .overview-highlight strong, .detail-field-large .detail-value) { color: var(--gcap-text); font-size: 13px; font-weight: 500; }
.console-theme :is(.detail-group h3, .farmer-profile-completion h2) { color: var(--gcap-text); font-size: 14px; font-weight: 600; }
.console-theme .metric-box { padding: 12px 0; border: 0; border-radius: 0; background: transparent; }
.console-theme .metric-box strong { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.console-theme .personal-detail-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.console-theme .personal-detail-groups .detail-group { border: 0; padding: 0; }
.console-theme .farmer-split-grid { grid-template-columns: 1fr; }
.console-theme .verification-list { font-size: 12px; font-weight: 400; }
.console-theme .completion-ring { font-size: 16px; font-weight: 500; }
.console-theme .farm-status-strip { grid-template-columns: 1fr; border: 0; border-top: 1px solid var(--gcap-border); border-radius: 0; }
.console-theme .farm-status-strip div { padding: 12px 0; }
.console-theme .farm-status-strip div + div { border-left: 0; border-top: 1px solid var(--gcap-border); }
.console-theme .farm-status-strip strong { font-size: 12px; font-weight: 500; }
.console-theme .status-dot-amber { background: var(--admin-accent); }
.console-theme .status-dot-blue { background: #72858f; }
.console-theme :is(.status-row, .admin-action-row, .activity-item) strong { font-size: 13px; font-weight: 500; }
.console-theme .activity-item { padding: 16px 0; border: 0; border-bottom: 1px solid var(--gcap-border); background: transparent; border-radius: 0; }
.console-theme .activity-item :is(span, time) { color: var(--gcap-text-muted); font-size: 12px; font-weight: 400; }
.console-theme #offtaker-forecast-shell .dashboard-management-grid { grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr)); gap: 24px; }
.console-theme #offtaker-forecast-shell .dashboard-management-grid > * { grid-column: auto; min-width: 0; }
.console-theme #offtaker-forecast-shell .dashboard-chart-card { padding: 24px; }
.console-theme #offtaker-forecast-shell .dashboard-side-stack { gap: 24px; }
.console-theme #offtaker-forecast-shell .table-gcap { min-width: 1200px; }
.console-theme #offtaker-forecast-shell .table-gcap :is(th, td):nth-child(7) { text-align: right; font-variant-numeric: tabular-nums; }
.console-theme #offtaker-forecast-shell [hidden] { display: none; }

@media (max-width: 1200px) {
    .console-theme .admin-metric { padding: 20px 16px; }
    .console-theme .fee-country-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .console-theme .fee-country-identity { grid-column: 1 / -1; }
    .console-theme .fee-save-area { align-items: flex-start; }
    .console-theme .users-add-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
    .console-theme :is(.registry-filter-grid-console, .users-toolbar) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .console-theme :is(.users-detail-grid, .farmer-detail-grid, .groups-admin-layout) { grid-template-columns: 1fr; }
    .console-theme #offtaker-forecast-shell .dashboard-management-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .console-theme .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .console-theme .admin-metric:nth-child(odd) { border-left: 0; }
    .console-theme .admin-metric:nth-child(n + 3) { border-top: 1px solid var(--gcap-border); }
    .console-theme .admin-metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .console-theme .admin-page-heading h1 { font-size: 28px; }
    .console-theme :is(.registry-filter-card, .users-list-card, .users-side-card, .fee-country-card, .farmer-detail-shell .card-gcap, .groups-admin-layout .card-gcap, .groups-list-card) { padding: 20px; }
    .console-theme .registry-table-wrap { margin: 0 20px; }
    .console-theme .farmer-profile-header { grid-template-columns: 1fr; }
    .console-theme .farmer-profile-completion { border-left: 0; border-top: 1px solid var(--gcap-border); padding: 20px 0 0; }
    .console-theme .fee-country-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .console-theme .fee-save-area { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .console-theme :is(.registry-filter-grid-console, .users-toolbar, .users-form, .users-form-grid, .groups-admin-tools, .fee-country-card) { grid-template-columns: 1fr; }
    .console-theme :is(.registry-field-search, .registry-date-range, .users-toolbar-field-search) { grid-column: auto; }
    .console-theme .fee-country-identity { grid-column: auto; }
    .console-theme .farmer-profile-identity { flex-direction: column; }
    .console-theme .personal-detail-groups { grid-template-columns: 1fr; }
}

.console-theme :is(.location-cell strong, .users-table-meta) { color: var(--gcap-text); font-size: 13px; font-weight: 500; }
.console-theme .location-cell small { color: var(--gcap-text-muted); font-size: 12px; font-weight: 400; }
.console-theme :is(.admin-action-item summary, .admin-action-link, .admin-action-list button, .document-meta strong) { font-size: 13px; font-weight: 500; }
.console-theme .admin-action-form label { color: var(--gcap-text-muted); font-size: 12px; font-weight: 500; }
.console-theme .document-meta small { font-size: 12px; }
.console-theme .card-gcap-title { padding-bottom: 0; border-bottom: 0; }
.console-theme .status-row { padding: 12px 0; font-size: 13px; }
.console-theme .status-row + .status-row { border-color: var(--gcap-border); }

.console-theme #offtaker-forecast-shell .admin-metric-label { min-height: 36px; }
.console-theme #offtaker-forecast-shell .registry-filter-actions { grid-column: 2 / -1; justify-content: flex-end; }
.console-theme .fee-country-identity p { font-weight: 400; }
@media (max-width: 480px) {
    .console-theme #offtaker-forecast-shell .registry-filter-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.console-theme #offtaker-forecast-shell .dashboard-section-head { min-height: 50px; }
@media (max-width: 1000px) {
    .console-theme #offtaker-forecast-shell .dashboard-section-head { min-height: 0; }
}
.console-theme .registry-table-console { table-layout: fixed; }
.console-theme .registry-table-console :is(th, td) { padding-left: 12px; padding-right: 12px; }
.console-theme .registry-table-console :is(th, td):first-child { width: 44px; }
.console-theme .registry-table-console :is(th, td):nth-child(2) { min-width: 210px; width: 24%; }
.console-theme .registry-table-console :is(th, td):nth-child(7) { min-width: 100px; width: 100px; }
.console-theme .registry-row-actions { gap: 4px; }
.console-theme .registry-view-btn { padding: 6px 10px; }
.console-theme .registry-kebab { width: 24px; min-height: 32px; padding: 0; border-radius: 6px; background: transparent; color: var(--gcap-text-muted); box-shadow: none; }
.console-theme .registry-page .registry-filter-actions-console { grid-column: 3 / -1; justify-content: flex-end; }
@media (max-width: 1000px) {
    .console-theme .registry-page .registry-filter-actions-console { grid-column: 1 / -1; justify-content: flex-start; }
}
.console-theme .registry-view-btn { min-width: 48px; }
.console-theme .registry-table-console tbody td { overflow: visible; text-overflow: clip; }
.console-theme .registry-table-console .farmer-identity small { overflow: visible; text-overflow: clip; white-space: normal; }
.console-theme :is(.registry-chip, .status-chip) { max-width: 100%; white-space: normal; }
/* Keep one table structure at every size; narrow screens scroll within the panel. */
.console-theme :is(.registry-table, .users-table) { display: table; }
.console-theme :is(.registry-table, .users-table) thead { display: table-header-group; }
.console-theme :is(.registry-table, .users-table) tbody { display: table-row-group; }
.console-theme :is(.registry-table, .users-table) tr { display: table-row; }
.console-theme :is(.registry-table, .users-table) :is(th, td) { display: table-cell; }
.console-theme :is(.registry-table, .users-table) td::before { content: none; }

/* Shared brand and account access layout. */
.console-theme .console-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--gcap-primary-dark); font-size: 18px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.35; text-decoration: none; }
.console-theme .console-brand small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--gcap-text-muted); }
.console-theme .console-brand-mark { display: flex; flex: 0 0 36px; align-items: center; justify-content: center; width: 36px; height: 40px; overflow: hidden; }
.console-theme .console-brand-mark img { flex: 0 0 72px; width: 72px; max-width: none; height: 72px; object-fit: contain; }
.console-theme .auth-page { display: grid; grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr); min-height: 100vh; min-height: 100svh; align-items: stretch; justify-content: normal; padding: 0; background: var(--admin-forest); }
.console-theme .auth-brand-panel { position: sticky; top: 0; display: flex; flex-direction: column; justify-content: space-between; height: 100vh; height: 100svh; min-width: 0; padding: clamp(32px, 4vw, 64px); overflow: hidden; background: var(--admin-forest); color: #e5ebe3; }
.console-theme .auth-brand-panel .console-brand { color: #f6f7f3; font-size: 20px; }
.console-theme .auth-brand-panel .console-brand small { color: #a3b8aa; max-width: 250px; font-size: 11px; line-height: 1.6; }
.console-theme .auth-brand-story { position: relative; padding: 64px 0 100px; }
.console-theme .auth-brand-eyebrow { margin: 0 0 20px; color: #a3b8aa; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.console-theme .auth-brand-story h2 { position: relative; z-index: 1; margin: 0 0 24px; font-size: clamp(40px, 4.4vw, 64px); font-weight: 500; letter-spacing: -0.055em; line-height: 1.1; color: #f6f7f3; }
.console-theme .auth-brand-story > p:last-of-type { position: relative; z-index: 1; max-width: 300px; margin: 0; color: #c2d1c6; font-size: 14px; line-height: 1.8; }
.console-theme .auth-landscape { position: absolute; right: -64px; bottom: -60px; width: calc(100% + 100px); height: auto; color: #a3b8aa; opacity: 0.28; pointer-events: none; }
.console-theme .auth-brand-footer { margin: 0; color: #a3b8aa; font-size: 12px; }
.console-theme .auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 48px clamp(24px, 5vw, 80px) 24px; background: var(--gcap-surface); }
.console-theme .auth-card { width: 100%; max-width: 460px; min-width: 0; margin: auto 0; padding: 32px; border: 1px solid var(--gcap-border); border-radius: var(--radius-lg); background: var(--gcap-card); box-shadow: var(--shadow-sm); }
.console-theme .auth-heading { margin-bottom: 28px; text-align: left; }
.console-theme .auth-heading .admin-page-eyebrow { margin: 0 0 12px; color: var(--gcap-text-muted); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.console-theme .auth-heading h1 { margin: 0 0 12px; color: var(--gcap-text); font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -0.04em; }
.console-theme .auth-heading > p:last-child { margin: 0; color: var(--gcap-text-muted); font-size: 13px; line-height: 1.6; }
.console-theme .auth-form { display: grid; gap: 20px; }
.console-theme .auth-form .form-row { display: grid; gap: 8px; min-width: 0; margin: 0; }
.console-theme .auth-form label { margin: 0; color: var(--gcap-text-muted); font-size: 12px; font-weight: 500; }
.console-theme .auth-form input { width: 100%; min-width: 0; padding: 10px 12px; border-width: 1px; }
.console-theme .auth-form input::placeholder { color: var(--gcap-text-muted); font-size: 13px; }
.console-theme .auth-form .btn-gcap-primary { width: 100%; margin-top: 4px; }
.console-theme .auth-secondary { margin: 20px 0 0; color: var(--gcap-text-muted); font-size: 12px; line-height: 1.7; text-align: left; }
.console-theme .auth-secondary + .auth-secondary { margin-top: 12px; }
.console-theme .auth-secondary a { color: var(--gcap-primary); font-weight: 500; text-underline-offset: 3px; }
.console-theme .auth-footer { width: 100%; margin-top: 24px; color: var(--gcap-text-muted); font-size: 11px; text-align: center; }
.console-theme .auth-security-setup { margin-bottom: 24px; padding: 16px; border: 1px solid var(--gcap-border); border-radius: 8px; background: #f6f7f3; overflow-wrap: anywhere; }
.console-theme .auth-qr-section { text-align: center; }
.console-theme .auth-qr-section > p:first-child { margin: 0 0 12px; font-size: 13px; font-weight: 500; }
.console-theme #two-factor-qrcode { display: inline-flex; align-items: center; justify-content: center; width: min(100%, 280px); max-width: 100%; min-height: 240px; padding: 12px; border: 1px solid var(--gcap-border); border-radius: 8px; background: #fff; font-size: 12px; }
.console-theme #two-factor-qrcode :is(img, canvas) { max-width: 100%; height: auto; }
.console-theme .auth-qr-section .text-muted-sm { margin: 12px 0 0; font-size: 12px; }
.console-theme .auth-manual-setup { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--gcap-border); font-size: 12px; }
.console-theme .auth-manual-setup summary { color: var(--gcap-primary-dark); font-size: 12px; font-weight: 500; cursor: pointer; }
.console-theme .auth-manual-setup p { margin: 12px 0 4px; color: var(--gcap-text-muted); font-size: 12px; }
.console-theme .auth-manual-setup :is(code, small) { font-size: 12px; }
.console-theme .auth-access-code { margin: 0 0 24px; color: var(--gcap-text-muted); font-size: 12px; }
.console-theme .auth-card :is(.alert-gcap-danger, .alert-gcap-success) { margin-bottom: 20px; font-size: 13px; }

/* Buyer portal: the same controls, surfaces and typography in a horizontal shell. */
.console-theme.buyer-console-page { min-height: 100vh; display: flex; flex-direction: column; }
.console-theme .buyer-container { width: min(100%, 1280px); margin: 0 auto; padding-right: clamp(20px, 4vw, 48px); padding-left: clamp(20px, 4vw, 48px); }
.console-theme .buyer-header { min-height: 80px; background: #fff; border-bottom: 1px solid var(--gcap-border); }
.console-theme .buyer-header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 80px; gap: 24px; }
.console-theme .buyer-header-nav { display: flex; align-items: center; gap: 24px; min-width: 0; font-size: 13px; }
.console-theme .buyer-marketplace-link { padding: 28px 0; border-bottom: 2px solid var(--gcap-primary); color: var(--gcap-primary-dark); font-weight: 500; text-decoration: none; }
.console-theme .buyer-account-name { max-width: 160px; overflow: hidden; color: var(--gcap-text-muted); text-overflow: ellipsis; white-space: nowrap; }
.console-theme .buyer-signout { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.console-theme .buyer-content { flex: 1; padding-top: 36px; padding-bottom: 48px; }
.console-theme .buyer-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid var(--gcap-border); color: var(--gcap-text-muted); font-size: 12px; }
.console-theme .buyer-tabs { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--gcap-border); }
.console-theme .buyer-tab { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 0 12px; border-bottom: 2px solid transparent; color: var(--gcap-text-muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.console-theme .buyer-tab.is-active { border-bottom-color: var(--gcap-primary); color: var(--gcap-primary-dark); }
.console-theme .buyer-marketplace-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.console-theme .buyer-marketplace-table { min-width: 720px; }
.console-theme .buyer-marketplace-table thead th { width: auto; }
.console-theme .buyer-marketplace-table :is(th, td):nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.console-theme .buyer-marketplace-table td strong { font-weight: 500; }
.console-theme .buyer-listing-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.console-theme .buyer-supply-details { margin: 0; padding: 0; border: 0; gap: 20px; }
.console-theme .buyer-supply-details dt { align-self: center; }
.console-theme .buyer-supply-details .buyer-listing-volume { font-size: 20px; font-weight: 500; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.console-theme .buyer-interest-form { display: grid; gap: 12px; }
.console-theme .buyer-interest-form label { color: var(--gcap-text-muted); font-size: 12px; font-weight: 500; }
.console-theme .buyer-interest-form textarea { width: 100%; min-width: 0; padding: 12px; resize: vertical; }
.console-theme .buyer-interest-form button { justify-self: start; margin-top: 4px; }
@media (max-width: 800px) {
    .console-theme .auth-page { grid-template-columns: 1fr; }
    .console-theme .auth-brand-panel { position: static; height: auto; min-height: 84px; padding: 20px 24px; }
    .console-theme :is(.auth-brand-story, .auth-brand-footer) { display: none; }
    .console-theme .auth-brand-panel .console-brand small { max-width: none; }
    .console-theme .auth-main { padding: 32px 24px 20px; }
    .console-theme .auth-card { margin: 0; }
    .console-theme .buyer-listing-grid { grid-template-columns: 1fr; }
    .console-theme .buyer-header-nav { gap: 16px; }
    .console-theme .buyer-marketplace-link { display: none; }
}
@media (max-width: 480px) {
    .console-theme .auth-page { display: flex; align-items: stretch; justify-content: flex-start; }
    .console-theme .auth-brand-panel { padding: 20px; }
    .console-theme .auth-brand-panel .console-brand { font-size: 18px; }
    .console-theme .auth-main { flex: 1; padding: 32px 20px 20px; }
    .console-theme .auth-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
    .console-theme .auth-footer { margin-top: 32px; }
    .console-theme .auth-heading h1 { font-size: 26px; }
    .console-theme .buyer-account-name { display: none; }
    .console-theme .buyer-header-inner { min-height: 76px; gap: 16px; }
    .console-theme .buyer-marketplace-filters { grid-template-columns: 1fr; }
    .console-theme .buyer-content { padding-top: 24px; }
}
.console-theme .buyer-marketplace-table .users-action-button { width: auto; min-width: 64px; padding: 6px 12px; }
.console-theme .buyer-supply-details { grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr); }
.console-theme .buyer-supply-details dt { text-transform: none; letter-spacing: 0; }
@media (max-width: 480px) {
    .console-theme .buyer-supply-details { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px 16px; }
}

/* Final responsive and keyboard refinements shared by every portal. */
.console-skip-link { position: fixed; top: 12px; left: 16px; z-index: 50; padding: 10px 16px; border-radius: 6px; background: var(--gcap-primary-dark); color: #fff; transform: translateY(-160%); }
.console-skip-link:focus { transform: translateY(0); }
.console-theme :is(.registry-table-wrap, .users-table-wrap, .table-scroll, .table-responsive) { overscroll-behavior-x: contain; }
.console-theme .auth-heading h1 { overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .console-theme :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) { font-size: 16px; }
    .console-theme :is(.registry-view-btn, .registry-kebab, .users-action-button, .users-page-button, .registry-pagination a, .buyer-signout, .groups-admin-chip-form button) { min-height: 44px; min-width: 44px; }
    .console-theme .groups-status-pill { align-self: flex-start; }
    .console-theme :is(.registry-table-wrap, .users-table-wrap, .table-scroll)::before {
        content: 'Scroll sideways to see all columns';
        position: sticky;
        left: 0;
        display: block;
        width: 100%;
        padding: 10px 12px;
        border-bottom: 1px solid var(--gcap-border);
        background: #fff;
        color: var(--gcap-text-muted);
        font-size: 11px;
        line-height: 1.5;
    }
}
@media (min-width: 801px) and (max-height: 650px) {
    .console-theme .auth-brand-panel { padding-top: 24px; padding-bottom: 24px; }
    .console-theme .auth-brand-story { padding-top: 24px; padding-bottom: 40px; }
    .console-theme .auth-brand-story h2 { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    .console-theme *, .console-theme *::before, .console-theme *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
