/* ==========================================================================
   Admin UI redesign - header bar, icon tabs, breadcrumb, search toolbar,
   toggle switches, page-size selector, refreshed table styling.
   ========================================================================== */

.gf-table th, .gf-table td { vertical-align: middle; }
.gf-form .help-block { color: #777; font-size: 12px; }
.gf-help ol { padding-left: 20px; }

.gf-wrap {
    background: #f4f6fb;
    padding: 0 0 24px 0;
    margin: -15px -15px 0 -15px;
}

.gf-header-bar {
    background: #ffffff;
    border-bottom: 1px solid #e6e9f0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.gf-header-brand-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9aa5b1;
    font-size: 13px;
}

.gf-header-brand-right img {
    height: 26px;
    width: auto;
    max-width: 200px;
    border-radius: 0;
    opacity: 0.9;
}

.gf-header-brand-logo {
    height: 48px !important;
    width: auto !important;
    max-width: none !important;
}

.gf-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gf-header-icon img {
    height: 34px;
    width: 34px;
    border-radius: 8px;
}

.gf-header-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.gf-tabs {
    background: #ffffff;
    border-bottom: 1px solid #e6e9f0;
    padding: 0 24px;
    margin: 0;
    display: flex;
    list-style: none;
}

.gf-tabs li {
    display: inline-block;
}

.gf-tabs li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.gf-tabs li a:hover {
    color: #2f6fed;
    text-decoration: none;
}

.gf-tabs li.active a {
    color: #2f6fed;
    border-bottom-color: #2f6fed;
}

.gf-breadcrumb {
    padding: 14px 24px;
    color: #8792a2;
    font-size: 13px;
}

.gf-tab-content {
    padding: 0 24px;
}

.gf-tab-content > .table,
.gf-tab-content form,
.gf-tab-content > div.alert {
    background: #ffffff;
}

/* Search + add-button toolbar */
.gf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e6e9f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 12px 16px;
    margin-top: 16px;
}

.gf-toolbar-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.gf-toolbar-search .fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa5b1;
    font-size: 13px;
}

.gf-search-input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    font-size: 13px;
}

.gf-search-input:focus {
    outline: none;
    border-color: #2f6fed;
}

/* Tables that follow a toolbar get squared-off top corners and sit
   flush against it */
.gf-toolbar + .table,
.gf-toolbar + table {
    border-top: none;
    margin-top: 0;
}

/* Toggle switch (replaces the plain Enabled/Disabled badge + Toggle link) */
.gf-switch {
    display: inline-block;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    position: relative;
    vertical-align: middle;
    transition: background 0.15s ease;
}

.gf-switch-on {
    background: #2f6fed;
}

.gf-switch-off {
    background: #d1d5db;
}

.gf-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: left 0.15s ease;
}

.gf-switch-on .gf-switch-knob {
    left: 20px;
}

/* Row-count / page-size selector */
.gf-page-size {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    margin: 10px 0;
}

.gf-page-size a {
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
}

.gf-page-size a:hover {
    background: #f0f3f9;
}

.gf-page-size a.active {
    background: #2f6fed;
    color: #ffffff;
}

/* Refresh the base table look to match the reference: flush borders,
   uppercase muted headers, subtle row separators */
.gf-tab-content table.table {
    background: #ffffff;
    border: 1px solid #e6e9f0;
    margin-bottom: 0;
}

.gf-tab-content table.table thead th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.03em;
    color: #8792a2;
    border-bottom: 1px solid #e6e9f0;
    font-weight: 600;
}

.gf-tab-content table.table td {
    vertical-align: middle;
    font-size: 13px;
    color: #374151;
}

.gf-row-actions {
    white-space: nowrap;
}

.gf-row-actions a {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 5px;
    color: #6b7280;
    margin-right: 4px;
}

.gf-row-actions a:hover {
    background: #f0f3f9;
    color: #2f6fed;
    text-decoration: none;
}

/* Confirmation modal (replaces native browser confirm() dialogs) */
.gf-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.gf-modal-overlay.gf-modal-open {
    display: flex;
}

.gf-modal-box {
    background: #ffffff;
    border-radius: 10px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.gf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f6;
}

.gf-modal-header h4 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.gf-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9aa5b1;
    cursor: pointer;
    line-height: 1;
}

.gf-modal-close:hover {
    color: #374151;
}

.gf-modal-body {
    padding: 20px;
    font-size: 14px;
    color: #374151;
}

.gf-modal-footer {
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
}

.gf-modal-footer .btn-confirm {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
}

.gf-modal-footer .btn-confirm:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* Toggle-switch styled checkboxes - applied via class="gf-toggle" on a
   normal <input type="checkbox">, no HTML restructuring required */
input[type="checkbox"].gf-toggle {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: #d1d5db;
    position: relative;
    cursor: pointer;
    outline: none;
    vertical-align: middle;
    transition: background 0.15s ease;
    margin: 0;
}

input[type="checkbox"].gf-toggle:checked {
    background: #2f6fed;
}

input[type="checkbox"].gf-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: left 0.15s ease;
}

input[type="checkbox"].gf-toggle:checked::before {
    left: 20px;
}

/* Card-style form sections, matching the reference Settings page look */
.gf-card {
    background: #ffffff;
    border: 1px solid #e6e9f0;
    border-radius: 8px;
    margin-top: 16px;
}

.gf-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #eef1f6;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.gf-card-body {
    padding: 20px;
}

.gf-form .form-group {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 0;
}

.gf-form .form-group:last-child {
    border-bottom: none;
}

.gf-form .control-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-top: 6px;
    font-weight: 500;
    color: #374151;
}

.gf-help-icon {
    color: #9aa5b1;
    font-size: 12px;
    cursor: help;
}

.gf-form .btn-success {
    background: #22c55e;
    border-color: #22c55e;
}

.gf-form .btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* Modern form controls */
.gf-form input[type="text"],
.gf-form input[type="number"],
.gf-form input[type="password"],
.gf-form select,
.gf-form textarea,
.gf-picker-search {
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    color: #1f2937;
    background: #fbfcfe;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gf-form input[type="text"]:focus,
.gf-form input[type="number"]:focus,
.gf-form input[type="password"]:focus,
.gf-form select:focus,
.gf-form textarea:focus {
    border-color: #2f6fed;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
    outline: none;
}

.gf-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.gf-form .gf-picker {
    border: none;
}

/* Admin footer */
.gf-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-top: 24px;
    border-top: 1px solid #e6e9f0;
    font-size: 12px;
    color: #9aa5b1;
}

.gf-footer-right {
    font-weight: 500;
}

.gf-license-alert {
    margin: 24px;
    font-size: 14px;
    line-height: 1.6;
}

/* Larger AJAX form modal */
.gf-modal-box-lg {
    width: 640px;
    max-width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.gf-modal-box-lg .gf-modal-body {
    overflow-y: auto;
}

.gf-modal-loading {
    text-align: center;
    padding: 40px 0;
    color: #9aa5b1;
    font-size: 14px;
}

/* Inside the AJAX modal, forms shouldn't have their own card wrapper -
   the modal box already provides that visual frame */
#gf_ajax_modal_body .gf-card {
    border: none;
    margin-top: 0;
}

#gf_ajax_modal_body .gf-card-header {
    display: none;
}

#gf_ajax_modal_body .gf-card-body {
    padding: 0;
}

/* Wizard step progress indicator */
.gf-wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.gf-wizard-dot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9aa5b1;
    flex: 1;
}

.gf-wizard-dot span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f3f9;
    color: #9aa5b1;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.gf-wizard-dot.active {
    color: #2f6fed;
    font-weight: 600;
}

.gf-wizard-dot.active span {
    background: #2f6fed;
    color: #ffffff;
}

.gf-wizard-dot.done span {
    background: #22c55e;
    color: #ffffff;
}

.gf-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.gf-wizard-nav-right {
    display: flex;
    gap: 8px;
}

/* Toggle-switch rows for gateway checkbox lists (Country/Currency
   Mapping, Client Exclusion) - replaces plain checkbox + label text */
.gf-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid #f0f2f6;
    border-radius: 6px;
    margin-bottom: 6px;
    font-weight: 400;
    cursor: pointer;
    background: #fbfcfe;
}

.gf-toggle-row:hover {
    background: #f4f7fd;
}

.gf-toggle-row span {
    color: #374151;
    font-size: 13px;
}

/* Client area live fee panel */
.gf-fee-panel {
    margin: 6px 0 14px 0;
    padding: 8px 12px;
    background: #f7f9fc;
    border: 1px solid #e1e6ef;
    border-radius: 4px;
    font-size: 13px;
}
.gf-fee-row { display: flex; justify-content: space-between; padding: 2px 0; }
.gf-fee-total { font-weight: 600; border-top: 1px dashed #d5dbe6; margin-top: 4px; padding-top: 4px; }
.gf-fee-none { color: #6a7685; font-style: italic; }

.gf-rates-table { width: 100%; font-size: 13px; margin-top: 10px; }
.gf-rates-table td { padding: 4px 8px; border-bottom: 1px solid #eef1f6; }

.gf-inline-fee {
    font-size: 12px;
    color: #5b6472;
    font-style: italic;
    margin: 2px 0 8px 0;
}

.gf-checkout-fee {
    display: inline;
    font-weight: normal;
    font-size: 0.85em;
    opacity: 0.85;
}

.gf-total-line {
    text-align: center;
    padding: 2px 0;
}

.gf-gateway-charge {
    opacity: 0.9;
}

.gf-gateway-discount {
    opacity: 0.9;
    color: #16a34a;
}

.gf-row-discount td {
    color: #16a34a;
}

.gf-row-fee td {
    color: inherit;
}

.gf-total-due {
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    padding-top: 6px;
}

.gf-charges-table-wrap {
    margin: 20px 0;
}

.gf-charges-title {
    text-align: center;
    margin-bottom: 12px;
}

.gf-charges-table {
    width: 100%;
    border-collapse: collapse;
}

.gf-charges-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #e1e6ef;
    font-weight: 600;
}

.gf-charges-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eef1f6;
}

/* Admin fee-rule form: searchable country / product autocomplete picker */
.gf-picker {
    position: relative;
}

.gf-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.gf-picker-chips:empty {
    margin-bottom: 0;
}

.gf-chip {
    display: inline-flex;
    align-items: center;
    background: #eef2fb;
    color: #2c3e50;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 12px;
}

.gf-chip-remove {
    margin-left: 6px;
    color: #8391a5;
    text-decoration: none;
    font-weight: bold;
}

.gf-chip-remove:hover {
    color: #d9534f;
}

.gf-picker-search-wrap {
    position: relative;
}

.gf-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ccd3de;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.gf-suggestion {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}

.gf-suggestion:hover {
    background: #f2f5fb;
}

.gf-suggestion-empty {
    color: #99a3b1;
    cursor: default;
}

.gf-suggestion-empty:hover {
    background: none;
}

/* Help tab: architecture diagram styling now lives entirely inside the
   inline SVG itself (see gf_render_architecture_diagram()) so it never
   depends on this stylesheet loading/applying correctly. */

.gf-help h3 {
    margin-top: 28px;
    margin-bottom: 6px;
}

.gf-help h3:first-child {
    margin-top: 0;
}

.gf-help-steps li {
    margin-bottom: 8px;
}

.gf-help-section {
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.gf-help-section h4 {
    margin-top: 0;
    color: #2f6fed;
}

.gf-help-section ul {
    margin-bottom: 0;
}

.gf-help-section li {
    margin-bottom: 6px;
}
