/* batchChildEntry.css — Batch child entry panel (B2) */

/* ── Panel shell ─────────────────────────────────────────────────────────── */

.batch-child-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 520px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.18);
    z-index: 8500;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
}

.batch-child-panel.visible {
    display: flex;
    animation: bce-slide-in 0.2s ease-out;
}

@keyframes bce-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0);    }
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.bce-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f7f8fa;
    flex-shrink: 0;
}

.bce-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2328;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 40px);
}

.bce-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #57606a;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: -2px;
}

.bce-close:hover { background: #e5e7eb; color: #1f2328; }

/* ── Parent info line ────────────────────────────────────────────────────── */

.bce-parent-info {
    margin: 0;
    padding: 4px 18px 10px;
    font-size: 12px;
    color: #57606a;
    background: #f7f8fa;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* ── Location bar ────────────────────────────────────────────────────────── */

.bce-location-bar {
    padding: 10px 18px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

.bce-location-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #57606a;
    margin-bottom: 6px;
}

.bce-location-wrap {
    position: relative;
}

.bce-location-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2328;
    background: #fff;
    box-sizing: border-box;
    min-height: 40px;
}

.bce-location-input:focus {
    outline: none;
    border-color: #3b82d4;
    box-shadow: 0 0 0 3px rgba(59, 130, 212, 0.15);
}

/* Suggestions dropdown — reuses the shared .ap-location-suggestions styles from search.css */
.bce-location-wrap .ap-location-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
}

/* ── Body ────────────────────────────────────────────────────────────────── */

.bce-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* ── Table ───────────────────────────────────────────────────────────────── */

.bce-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

.bce-table thead th {
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #57606a;
    border-bottom: 1px solid #e5e7eb;
    background: #f7f8fa;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

.bce-required {
    color: #cf222e;
}

/* Column widths */
.bce-col-name   { width: auto; }          /* flexible */
.bce-col-gender { width: 90px; }
.bce-col-year   { width: 86px; }
.bce-col-living { width: 90px; }
.bce-col-remove { width: 36px; text-align: center; }

.bce-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

.bce-row:hover { background: #f7f8fa; }

.bce-table td {
    padding: 7px 10px;
    vertical-align: middle;
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */

.bce-name-input,
.bce-gender-select,
.bce-year-input,
.bce-living-select {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #1f2328;
    background: #fff;
    min-height: 36px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.bce-year-input {
    text-align: center;
    /* Remove spin arrows */
    -moz-appearance: textfield;
}

.bce-year-input::-webkit-outer-spin-button,
.bce-year-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.bce-name-input:focus,
.bce-gender-select:focus,
.bce-year-input:focus,
.bce-living-select:focus {
    outline: none;
    border-color: #3b82d4;
    box-shadow: 0 0 0 3px rgba(59, 130, 212, 0.15);
}

.bce-gender-select,
.bce-living-select {
    /* Re-add native arrow for selects after appearance reset */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2357606a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 26px;
}

/* ── Remove row button ───────────────────────────────────────────────────── */

.bce-remove-btn {
    background: none;
    border: none;
    color: #cf222e;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    min-height: 36px;
    min-width: 36px;
}

.bce-remove-btn:hover { background: #ffebe9; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.bce-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
    background: #f7f8fa;
    flex-shrink: 0;
}

.bce-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.bce-add-row-btn {
    padding: 8px 14px;
    background: #fff;
    color: #3b82d4;
    border: 1px solid #3b82d4;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px;
    transition: background 0.15s;
}

.bce-add-row-btn:hover { background: #ddf4ff; }

.bce-hint {
    font-size: 11px;
    color: #57606a;
    line-height: 1.4;
    white-space: nowrap;
}

.bce-save-btn {
    padding: 9px 22px;
    background: #2da44e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px;
    transition: background 0.15s;
}

.bce-save-btn:hover:not(:disabled) { background: #2c974b; }
.bce-save-btn:disabled { opacity: 0.6; cursor: default; }

/* ── Status bar ──────────────────────────────────────────────────────────── */

.bce-status {
    min-height: 0;
    font-size: 12px;
    padding: 0 18px;
    line-height: 1.5;
    transition: all 0.2s;
    flex-shrink: 0;
}

.bce-status:not(:empty) {
    padding: 8px 18px;
    border-top: 1px solid #e5e7eb;
}

.bce-status--success { color: #1a7f37; background: #dafbe1; }
.bce-status--error   { color: #cf222e; background: #ffebe9; }
.bce-status--info    { color: #0550ae; background: #ddf4ff; }

/* ── Mobile adjustments ─────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .batch-child-panel {
        max-width: 100%;
    }

    /* Tighten column widths on small screens */
    .bce-col-gender { width: 70px; }
    .bce-col-year   { width: 70px; }
    .bce-col-living { width: 76px; }

    .bce-hint { display: none; }

    .bce-name-input,
    .bce-gender-select,
    .bce-year-input,
    .bce-living-select {
        font-size: 16px; /* prevents iOS zoom on focus */
        min-height: 44px;
    }
}
