/* --- dashboard ----------------------------------------------------------- */

.kato-dash {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
    color: #333;
}

.kato-dash-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.kato-dash-greeting {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.kato-logout {
    color: var(--base-color, #e30a17);
    text-decoration: none;
    font-weight: 600;
}

.kato-logout:hover {
    text-decoration: underline;
}

.kato-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.kato-switcher-item {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.kato-switcher-item:hover {
    color: #222;
}

.kato-switcher-item.is-current {
    color: var(--base-color, #e30a17);
    border-bottom-color: var(--base-color, #e30a17);
}

.kato-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.kato-card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.kato-card-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 10px;
}

.kato-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: #222;
}

.kato-card-value--belt {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.kato-card-meta {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #888;
}

.kato-section {
    margin-bottom: 40px;
}

.kato-section-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.kato-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    overflow: hidden;
}

.kato-table th,
.kato-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.kato-table th {
    background: #f9f9f9;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.kato-table tr:last-child td {
    border-bottom: none;
}

.kato-table .kato-num {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.kato-table .is-positive {
    color: #2e7d32;
}

.kato-table .is-negative {
    color: #c62828;
}

.kato-empty {
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    border: 1px dashed #ccc;
}
/**
 * Member area styles.
 *
 * Deliberately theme-agnostic and low-specificity: single class selectors, no
 * !important, inheriting the theme's font stack. The Kato theme loads Bootstrap
 * 5, so these are scoped under .kato-auth to avoid colliding with it.
 */

.kato-auth {
    max-width: 720px;
    margin: 0 auto 40px;
}

.kato-auth--narrow {
    max-width: 420px;
}

/* --- notices ------------------------------------------------------------- */

.kato-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #999;
    background: #f4f4f4;
    font-size: 0.95rem;
}

.kato-notice--success {
    border-left-color: #2e7d32;
    background: #edf7ed;
}

.kato-notice--error {
    border-left-color: #c62828;
    background: #fdecea;
}

.kato-notice--info {
    border-left-color: #1565c0;
    background: #e8f1fb;
}

/* --- defensive resets ---------------------------------------------------- */

/*
 * The Kato theme applies `input, textarea { width: 100%; padding: 12px 25px; }`
 * to the bare element selectors (style.css:173, padding again at :1687). That
 * stretches radios and checkboxes to full width, which collapses the flex
 * layouts below — the control ends up full-bleed and its label is squeezed into
 * a narrow wrapping column.
 *
 * The theme sidesteps this for its own radios by hiding the real input
 * off-screen (.radio-item [type="radio"] { left: -9999px }) and drawing a
 * replacement with label::before. We use native controls instead, so reset them
 * here. Scoped to .kato-auth so the site-wide rule is untouched and the plugin
 * renders correctly on any theme.
 */
.kato-auth input[type="radio"],
.kato-auth input[type="checkbox"] {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0;
    flex: 0 0 auto;
    -webkit-appearance: auto;
    appearance: auto;
}

/*
 * Margin is deliberately not reset above: this selector is less specific than
 * the one there, so the small top offset that aligns the control with the first
 * line of its label would be overridden if both set margin.
 */
.kato-auth .kato-radio input,
.kato-auth .kato-checkbox input {
    margin: 0.2em 0 0;
}

/* Same reason: keep buttons from inheriting the full-width input rule. */
.kato-auth input[type="submit"],
.kato-auth button {
    width: auto;
}

/* --- form layout --------------------------------------------------------- */

.kato-fieldset {
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 20px 20px 8px;
    margin: 0 0 24px;
}

.kato-fieldset legend {
    padding: 0 8px;
    font-size: 1rem;
    font-weight: 600;
    width: auto;
    margin-bottom: 0;
}

.kato-field {
    margin: 0 0 18px;
}

.kato-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.95rem;
}

/*
 * Text inputs default to filling their field, but the width is driven by a
 * custom property so individual fields can be narrowed without fighting
 * specificity. Override per field with a modifier class (below) or inline,
 * e.g. style="--kato-input-width: 12rem".
 */
.kato-field {
    --kato-input-width: 100%;
}

.kato-field input[type="text"],
.kato-field input[type="email"],
.kato-field input[type="password"],
.kato-field input[type="date"],
.kato-field input[type="number"],
.kato-field input[type="tel"],
.kato-field select,
.kato-field textarea {
    width: var(--kato-input-width);
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
}

/* Width modifiers — add alongside .kato-field */
.kato-field--xs { --kato-input-width: 7rem; }   /* e.g. a short code */
.kato-field--sm { --kato-input-width: 12rem; }  /* e.g. date of birth */
.kato-field--md { --kato-input-width: 20rem; }  /* e.g. a name */
.kato-field--lg { --kato-input-width: 30rem; }

.kato-field input:focus,
.kato-field select:focus {
    outline: 2px solid var(--base-color, #e30a17);
    outline-offset: 1px;
    border-color: var(--base-color, #e30a17);
}

.kato-field--inline label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.kato-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #666;
}

/* --- radios and checkboxes ---------------------------------------------- */

.kato-radio,
.kato-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 400;
    cursor: pointer;
}

/* Let the label text take the remaining width rather than wrapping early. */
.kato-radio span,
.kato-checkbox span {
    flex: 1 1 auto;
}

/* --- children rows ------------------------------------------------------ */

.kato-child-row {
    padding: 16px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    margin-bottom: 16px;
}

.kato-child-row .kato-field:last-child {
    margin-bottom: 0;
}

/* --- actions ------------------------------------------------------------ */

.kato-actions {
    margin: 24px 0 12px;
}

.kato-button,
a.kato-button {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 4px;
    background: var(--base-color, #e30a17) !important;
    color: #fff !important;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
    text-decoration: none !important;
}

.kato-button:hover,
a.kato-button:hover,
.kato-button:focus,
a.kato-button:focus {
    opacity: 0.88;
    color: #fff !important;
}

@media (min-width: 576px) {
    .kato-child-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 16px;
    }
}
/* --- tooltips ------------------------------------------------------------ */

.kato-tooltip-wrap {
    position: relative;
    cursor: help;
}

.kato-tooltip-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #222;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.kato-tooltip-wrap::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    border: 6px solid transparent;
    border-top-color: #222;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.kato-tooltip-wrap:hover::after,
.kato-tooltip-wrap:hover::before,
.kato-tooltip-wrap:active::after,
.kato-tooltip-wrap:active::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}
.kato-tooltip-wrap:hover::before,
.kato-tooltip-wrap:active::before {
    transform: translateX(-50%) translateY(6px);
}
