.ep-fee-table {
    overflow-x: auto;
}
.ep-fee-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.ep-fee-table th,
.ep-fee-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e4e9e3;
    text-align: left;
}
.ep-fee-table th {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}
.ep-fee-table .ep-fee-num {
    text-align: right;
    white-space: nowrap;
}
.ep-fee-table .ep-fee-strong td {
    font-weight: 700;
}
.ep-fee-table .ep-fee-empty {
    text-align: center;
    color: #6b7280;
}
.ep-fee-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    color: #237a06;
}
.ep-fee-table a:focus-visible {
    outline: 2px solid #237a06;
    outline-offset: 2px;
}
.ep-fee-status p {
    margin: 12px 0;
    color: #4b5563;
}
.ep-fee-badges {
    display: inline-flex;
    gap: 6px;
}
.ep-fee-example {
    border: 1px solid #e4e9e3;
    border-radius: 12px;
    padding: 14px 16px;
    background: #f6faf5;
    align-self: start;
}
.ep-fee-example small {
    display: block;
    color: #6b7280;
    margin: 4px 0 8px;
}
.ep-fee-example table {
    width: 100%;
    border-collapse: collapse;
}
.ep-fee-example td {
    padding: 4px 0;
    border-top: 1px solid #e4e9e3;
}
.ep-fee-num {
    text-align: right;
    white-space: nowrap;
}
.ep-admin-fees-page .fi-ta-text-input {
    min-width: 90px;
}

.ep-counter-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ep-slip-check { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.ep-slip-proof { border: 1px solid #e4e9e3; border-radius: .75rem; background: #f6f8f5; min-height: 20rem; overflow: auto; }
.ep-slip-proof img { display: block; width: 100%; height: auto; }
.ep-slip-proof iframe { width: 100%; height: 60vh; border: 0; }
.ep-slip-meta { margin-top: .5rem; color: #5f6b63; font-size: .875rem; }
@media (max-width: 768px) { .ep-slip-check { grid-template-columns: 1fr; } }
@media print { .fi-sidebar, .fi-topbar, .fi-header-actions, .fi-page-header-actions { display: none !important; } }
.ep-whatsapp { display: grid; gap: .75rem; }
.ep-whatsapp-text { width: 100%; padding: .75rem; border: 1px solid #e4e9e3; border-radius: .75rem; background: #f6f8f5; font-size: .875rem; }
.ep-whatsapp-text:focus { outline: 2px solid #2fa50b; outline-offset: 1px; }
.ep-fee-table a:focus-visible { outline: 2px solid #2fa50b; outline-offset: 1px; }
.ep-fee-table td a { color: #1d5a0c; }

/* Add-on header: name, then how many shown students are ticked. */
.ep-extra-head { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ep-extra-head small { font-size: .7rem; font-weight: 500; color: #6b7280; white-space: nowrap; }

/* Phones (#111): one card per student, add-on counts stick on top. */
@media screen and (max-width: 39.98rem) {
    .ep-extras-table .fi-ta-content-ctn { overflow: visible; }
    .ep-extras-table .fi-ta-table > thead { position: sticky; top: var(--topbar-height, 4rem); z-index: 3; background: #f6f8f5; box-shadow: 0 1px 0 #e4e9e3, 0 6px 10px -8px rgba(22, 48, 12, .28); }
    .ep-extras-table .fi-ta-table-stacked-header-cell { padding-block: .5rem; }
    .ep-extras-table .fi-ta-table > thead > tr:not(.fi-ta-table-stacked-header-row):has(> .ep-extra-col) { display: flex; flex-wrap: wrap; gap: .375rem; padding: .5rem 1rem .625rem; background: #f6f8f5; }
    .ep-extras-table .fi-ta-table > thead > tr:not(.fi-ta-table-stacked-header-row) > :not(.ep-extra-col) { display: none; }
    .ep-extras-table .fi-ta-table > thead > tr > .ep-extra-col { display: block; padding: .25rem .625rem; border: 1px solid #cfe3c8; border-radius: 999px; background: #fff; text-align: left; white-space: normal; }
    .ep-extras-table thead .ep-extra-head { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .25rem; }
    .ep-extras-table .fi-ta-table > tbody > tr:not(.fi-ta-group-header-row) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: .75rem; row-gap: .375rem; padding: .875rem 1rem; }
    .ep-extras-table .fi-ta-table > tbody > tr > .fi-ta-cell:not(.fi-ta-selection-cell) { min-width: 0; padding: 0; }
    .ep-extras-table .fi-ta-table > tbody > tr > .fi-ta-selection-cell { top: .5rem; }
    .ep-extras-table .fi-ta-table > tbody > tr > .fi-ta-cell-index { display: none; }
    .ep-extras-table .fi-ta-table > tbody > tr > :is(.fi-ta-cell-name, .fi-ta-cell-fee-package-id, .fi-ta-cell-discount-percent, .ep-extra-cell, .fi-ta-cell:has(> .fi-ta-actions)) { grid-column: 1 / -1; }
    .ep-extras-table .fi-ta-table > tbody > tr > .fi-ta-cell-name { padding-inline-end: 2.5rem; }
    .ep-extras-table .fi-ta-table > tbody > tr > .fi-ta-cell-name > .fi-ta-cell-label { display: none; }
    .ep-extras-table .fi-ta-table > tbody > tr > .fi-ta-cell > .fi-ta-cell-label { padding-top: 0; font-size: .75rem; line-height: 1.25rem; }
    .ep-extras-table .fi-ta-table > tbody > tr > .fi-ta-cell.ep-extra-cell:not(.fi-ta-selection-cell) { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .375rem .75rem; border: 1px solid #e4e9e3; border-radius: .625rem; background: #f9fbf8; }
    .ep-extras-table .fi-ta-table > tbody > tr > .ep-extra-cell > .fi-ta-cell-label { color: #1f2923; font-size: .875rem; font-weight: 600; }
    .ep-extras-table .fi-ta-table > tbody > tr > .ep-extra-cell .ep-extra-head { align-items: flex-start; }
    .ep-extras-table .fi-ta-table > tbody > tr > .ep-extra-cell .ep-extra-head small { display: none; }
}

/* Students chosen: count, select-all and the add-on buttons float at the bottom. */
.ep-extras-table { --ep-bulk-w: min(40rem, calc(100% - 1rem)); }
.ep-extras-table:has(.fi-ta-selection-indicator:not([hidden])) { margin-bottom: 8rem; }
.ep-extras-table .fi-ta-selection-indicator:not([hidden]) {
    position: fixed;
    z-index: 20;
    bottom: calc(.75rem + env(safe-area-inset-bottom));
    left: 50%;
    width: var(--ep-bulk-w);
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: .75rem 1rem 3.75rem;
    border: 1px solid #cfe3c8;
    border-radius: .875rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    font-weight: 600;
}
.ep-extras-table:has(.fi-ta-selection-indicator:not([hidden])) .fi-ta-header-toolbar > .fi-ta-actions {
    position: fixed;
    z-index: 21;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    right: calc((100% - var(--ep-bulk-w)) / 2 + 1rem);
    flex-wrap: nowrap;
    gap: .5rem;
}
.ep-extras-table .fi-ta-selection-indicator .fi-ta-selection-indicator-actions-ctn { flex-wrap: wrap; }
@media print {
    .ep-extras-table .fi-ta-selection-indicator { display: none !important; }
}
.ep-gateway-error { margin-top: 0.25rem; font-size: 0.75rem; color: #b42318; }
.ep-gateway-help { display: grid; gap: 0.5rem; padding-left: 1.25rem; list-style: disc; font-size: 0.875rem; color: #374151; }
.dark .ep-gateway-help { color: #d1d5db; }
.dark .ep-gateway-error { color: #fda29b; }

.ep-gw { --gw-border: #e5e7eb; --gw-muted: #6b7280; --gw-card: #fff; --gw-head: #f9fafb; --gw-accent: var(--primary-600, #237a06); --gw-soft: color-mix(in srgb, var(--gw-accent) 9%, transparent); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.dark .ep-gw { --gw-border: rgb(255 255 255 / .1); --gw-muted: #9ca3af; --gw-card: rgb(255 255 255 / .03); --gw-head: rgb(255 255 255 / .04); --gw-accent: var(--primary-400, #6cc04a); --gw-soft: color-mix(in srgb, var(--gw-accent) 16%, transparent); }
.ep-gw-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border: 1px solid var(--gw-border); border-radius: .75rem; background: var(--gw-card); }
.ep-gw-account { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.ep-gw-account-icon { width: 1.5rem; height: 1.5rem; flex: none; color: var(--gw-accent); }
.ep-gw-account span { display: grid; min-width: 0; }
.ep-gw-account small { font-size: .75rem; color: var(--gw-muted); }
.ep-gw-account b { font-size: .9375rem; overflow-wrap: anywhere; }
.ep-gw-bar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ep-gw-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.ep-gw-tab { position: relative; display: inline-flex; align-items: center; gap: .375rem; padding: .5rem 1rem; border: 1px solid var(--gw-border); border-radius: 9999px; background: var(--gw-card); color: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.ep-gw-tab:hover { border-color: color-mix(in srgb, var(--gw-accent) 45%, var(--gw-border)); }
.ep-gw-tab:focus-visible { outline: 2px solid var(--gw-accent); outline-offset: 2px; }
.ep-gw-tab.is-active { border-color: var(--gw-accent); background: var(--gw-soft); color: var(--gw-accent); }
.ep-gw-tab-error { width: .5rem; height: .5rem; border-radius: 9999px; background: #d92d20; }
.ep-gw-card { border: 1px solid var(--gw-border); border-radius: .75rem; background: var(--gw-card); box-shadow: 0 1px 2px rgb(16 24 40 / .05); padding: 1.25rem; }
.ep-gw-card-head h2 { font-size: 1.0625rem; font-weight: 700; }
.ep-gw-card-head p { margin-top: .25rem; font-size: .875rem; color: var(--gw-muted); }
.ep-gw-table-wrap { margin-top: 1rem; overflow-x: auto; border: 1px solid var(--gw-border); border-radius: .75rem; -webkit-overflow-scrolling: touch; }
.ep-gw-table { width: 100%; min-width: 60rem; border-collapse: collapse; font-size: .875rem; }
.ep-gw-table th { padding: .75rem; background: var(--gw-head); border-bottom: 1px solid var(--gw-border); font-weight: 600; text-align: center; white-space: nowrap; }
.ep-gw-table td { padding: .625rem .75rem; border-bottom: 1px solid var(--gw-border); vertical-align: middle; }
.ep-gw-table tbody tr:last-child td { border-bottom: 0; }
.ep-gw-table td:nth-child(n+3) { min-width: 9rem; }
.ep-gw-table td.ep-gw-type-cell { min-width: 12rem; }
.ep-gw-tip { border-bottom: 1px dotted currentColor; cursor: help; }
.ep-gw-tip:focus-visible { outline: 2px solid var(--gw-accent); outline-offset: 2px; border-radius: 2px; }
.ep-gw-channel b { display: block; font-weight: 600; }
.ep-gw-channel small { display: block; margin-top: .125rem; max-width: 18rem; font-size: .75rem; color: var(--gw-muted); }
.ep-gw-center { text-align: center; }
.ep-gw-switch { position: relative; display: inline-flex; cursor: pointer; }
.ep-gw-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.ep-gw-switch span { width: 2.75rem; height: 1.5rem; border-radius: 9999px; background: #d1d5db; transition: background-color .15s; position: relative; }
.ep-gw-switch span::after { content: ""; position: absolute; top: .125rem; left: .125rem; width: 1.25rem; height: 1.25rem; border-radius: 9999px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s; }
.ep-gw-switch input:checked + span { background: var(--gw-accent); }
.ep-gw-switch input:checked + span::after { transform: translateX(1.25rem); }
.ep-gw-switch input:focus-visible + span { outline: 2px solid var(--gw-accent); outline-offset: 2px; }
.ep-gw-switch input:disabled + span { opacity: .55; }
.ep-gw-switch:has(input:disabled) { cursor: not-allowed; }
.dark .ep-gw-switch span { background: rgb(255 255 255 / .2); }
.ep-gw-type { position: relative; }
.ep-gw-type .fi-select-input { padding-inline-end: 3.75rem; }
.ep-gw-placeholder { color: var(--gw-muted); }
.ep-gw-clear { position: absolute; top: 50%; right: 2rem; transform: translateY(-50%); display: inline-flex; padding: .125rem; border-radius: .375rem; color: var(--gw-muted); }
.ep-gw-clear:hover, .ep-gw-clear:focus-visible { color: inherit; background: rgb(0 0 0 / .05); outline: none; }
.dark .ep-gw-clear:hover, .dark .ep-gw-clear:focus-visible { background: rgb(255 255 255 / .1); }
.ep-gw-clear svg { width: 1rem; height: 1rem; }
@media (max-width: 640px) {
    .ep-gw-card { padding: 1rem; }
    .ep-gw-tab { flex: 1 1 auto; justify-content: center; }
}
