/* photos.css — Photo Manager page styles */

/* ── Placeholders ───────────────────────────────────────────────────── */
::placeholder {
    color: #c8cdd5;
    opacity: 1;
}

/* ── Page Layout ────────────────────────────────────────────────────── */
.photos-page {
    padding: 24px 28px 60px;
}

.photos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.photos-title {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.photos-title .material-symbols-outlined {
    font-size: 26px;
}

.photos-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.last-exported-label {
    font-size: 12px;
    color: #888;
}

/* ── Shared Button Base ─────────────────────────────────────────────── */
.photos-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
.photos-btn .material-symbols-outlined {
    font-size: 17px;
}
.photos-btn-primary {
    background: #3498db;
    color: #fff;
}
.photos-btn-primary:hover { background: #2980b9; }
.photos-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.photos-btn-secondary {
    background: #2c3e50;
    color: rgba(255,255,255,0.9);
}
.photos-btn-secondary:hover { background: #1a252f; }

.photos-btn-ghost {
    background: rgba(0,0,0,0.06);
    color: #555;
}
.photos-btn-ghost:hover { background: rgba(0,0,0,0.1); }

.photos-btn-danger {
    background: #e74c3c;
    color: #fff;
}
.photos-btn-danger:hover { background: #c0392b; }

/* ── Action Bar ─────────────────────────────────────────────────────── */
.photos-action-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ── Filter Bar ─────────────────────────────────────────────────────── */
.photos-filter-bar {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 22px;
}

/* Filter pill sections (Location / Service) */
.filter-pill-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.filter-pill-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.filter-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.filter-pill {
    padding: 4px 11px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #f4f4f4;
    font-size: 12px;
    color: #444;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
    white-space: nowrap;
    font-family: inherit;
}
.filter-pill:hover { background: #e8f4ff; border-color: #90c8f0; color: #1a6daa; }
.filter-pill.active { background: #dbeeff; border-color: #3498db; color: #1a6daa; font-weight: 600; }

.photos-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background: #fff;
    cursor: pointer;
}
.photos-select:focus { outline: none; border-color: #3498db; }

.filter-toggle-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
}
.filter-toggle-label input[type=checkbox] {
    accent-color: #3498db;
    width: 14px; height: 14px;
}

.photo-count-label {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

/* ── Before-pick mode ─────────────────────────────────────────────── */
.before-pick-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8e1;
    border: 1.5px solid #f9a825;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #5d4200;
}
.before-pick-icon  { color: #f9a825; font-size: 20px; flex-shrink: 0; }
.before-pick-text  { flex: 1; }
.before-pick-cancel { margin-left: auto; flex-shrink: 0; }

.before-pick-card {
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, outline .15s;
}
.before-pick-card:not(.before-pick-self):hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(249,168,37,.45);
    outline: 2px solid #f9a825;
}
.before-pick-self {
    cursor: default;
    opacity: .45;
    pointer-events: none;
}
.before-pick-self-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    border-radius: 6px 6px 0 0;
}

/* ── Size range filter ───────────────────────────────────────────────── */
.size-filter-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}
.size-filter-label {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}
.size-range-track {
    position: relative;
    width: 120px;
    height: 20px;
    --range-lo: 0%;
    --range-hi: 100%;
}
.size-range-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 4px;
    margin-top: -2px;
    border-radius: 2px;
    background: #e0e0e0;
    pointer-events: none;
}
.size-range-track::after {
    content: '';
    position: absolute;
    top: 50%;
    left: var(--range-lo);
    right: calc(100% - var(--range-hi));
    height: 4px;
    margin-top: -2px;
    border-radius: 2px;
    background: #3498db;
    pointer-events: none;
}
.size-range-track input[type=range] {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
}
.size-range-track input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 2;
}
.size-range-track input[type=range]::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    cursor: pointer;
    pointer-events: all;
}
.size-range-display {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    min-width: 60px;
}
.size-range-display.active {
    color: #3498db;
    font-weight: 600;
}

/* ── Grid Section Headers (legacy, kept for before-pick modal) ───────── */
.grid-section-header {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 4px;
    border-bottom: 2px solid #e8e8e8;
    margin-top: 10px;
}
.grid-section-header:first-child { margin-top: 0; }
.grid-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.grid-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 7px;
    min-width: 20px;
    height: 18px;
    margin-left: 4px;
    vertical-align: middle;
}
.grid-section-sub {
    font-size: 11px;
    color: #aaa;
}

/* ── Badge variants ──────────────────────────────────────────────────── */
.badge-action {
    all: unset;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    line-height: 1;
    transition: filter 0.15s, transform 0.1s;
}
.badge-action:hover  { filter: brightness(1.12); transform: scale(1.05); }
.badge-action:active { transform: scale(0.97); }

.badge-unregistered {
    background: rgba(255,255,255,0.9);
    color: #e67e22;
    border: 1px solid rgba(230,126,34,0.5);
}
.badge-promote {
    background: rgba(39,174,96,0.9);
    color: #fff;
}
.badge-unregister {
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
}
.badge-hide {
    background: rgba(0,0,0,0.35);
    color: #fff;
    border: none;
}
.badge-unhide {
    background: rgba(80,80,80,0.75);
    color: #fff;
    border: none;
}

/* Hidden card — muted appearance when Show Hidden is on */
.photo-card-hidden {
    opacity: 0.45;
    filter: grayscale(60%);
}
.photo-card-hidden:hover {
    opacity: 0.75;
    filter: grayscale(20%);
}

/* Show Hidden toggle in section header */
.show-hidden-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #888;
    cursor: pointer;
    margin-left: 10px;
    user-select: none;
}
.show-hidden-toggle input { cursor: pointer; }
button.admin-section-toggle {
    background: none;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    padding: 2px 10px;
    font-size: 11px;
    color: #555;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}
button.admin-section-toggle:hover { background: #f3f4f6; }

/* ── Admin / no-preview card ─────────────────────────────────────────── */
.photo-card-img-no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf4ff !important;
}
.no-preview-icon {
    font-size: 42px;
    color: #aac8e0;
}

.photo-card-admin    { border: 2px solid #b2dfdb; }
.photo-card-unregistered { border: 2px dashed #f0c070; }

.photo-card.promoting {
    opacity: 0.45;
    pointer-events: none;
}

/* ── Photo Grid ─────────────────────────────────────────────────────── */
.photos-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Each section is a self-contained block */
.photo-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 14px 16px 18px;
    margin-bottom: 18px;
}
.photo-section:last-child { margin-bottom: 0; }
.photo-section-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 14px;
}
.photo-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.photo-section-subtitle {
    font-size: 11px;
    color: #aaa;
    width: 100%;
    margin-top: -4px;
}
.photo-section-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
/* Unregistered section gets a subtle yellow tint */
.photo-section-unreg {
    border-color: #f0d890;
    background: #fffdf3;
}
.photo-section-unreg .photo-section-header { border-bottom-color: #f0d890; }
/* Admin section gets a teal tint */
.photo-section-admin {
    border-color: #b2dfdb;
    background: #f5fffe;
}
.photo-section-admin .photo-section-header { border-bottom-color: #b2dfdb; }

.photos-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #aaa;
    gap: 10px;
    text-align: center;
}
.photos-empty-state .material-symbols-outlined { font-size: 48px; }
.photos-empty-state p { font-size: 14px; margin: 0; }

/* ── Photo Card ─────────────────────────────────────────────────────── */
.photo-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}
.photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.photo-card-img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}
.photo-card-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* Before/After split card */
.photo-card-img-pair {
    display: flex;
    flex-direction: row;
    aspect-ratio: 4/3;
}
.pair-half {
    position: relative;
    flex: 1;
    overflow: hidden;
}
.pair-half img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.pair-label {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.52);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
}
.pair-divider {
    width: 3px;
    background: rgba(255,255,255,0.85);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.photo-card-badges {
    position: absolute;
    top: 6px; left: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-featured {
    background: rgba(243,156,18,0.92);
    color: #fff;
}
.badge-pair {
    background: rgba(52,152,219,0.92);
    color: #fff;
}
.badge-draft {
    background: rgba(127,140,141,0.92);
    color: #fff;
}

.photo-card-info {
    padding: 8px 10px 10px;
    flex: 1;
}
.photo-card-alt {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.photo-card-meta {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-card-year { color: #aaa; }
.photo-card-path {
    font-size: 10px;
    color: #a0a8b8;
    margin-top: 2px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-card-folder {
    opacity: 0.65;
}
.photo-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}
.badge-svc-mini,
.badge-loc-mini {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-svc-mini { background: #e8f0fe; color: #3c5fa8; }
.badge-loc-mini { background: #e6f4ea; color: #2e7d46; }
.photo-card-size,
.photo-card-dims {
    font-size: 10px;
    color: #bbb;
    margin-top: 3px;
}
.dims-mismatch { color: #e05252; }

/* ── Drag-to-reorder ────────────────────────────────────────────────── */
.photo-card-drag-handle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #ccc;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    z-index: 2;
}
.photo-card-drag-handle .material-symbols-outlined { font-size: 18px; }
.photo-card:hover .photo-card-drag-handle { opacity: 1; }
.photo-card-drag-handle:hover { color: #666; }
.photo-card-drag-handle:active { cursor: grabbing; }

.photo-card.drag-source { opacity: 0.4; }
.photo-card.drag-over-before { box-shadow: -4px 0 0 0 #3498db; }
.photo-card.drag-over-after  { box-shadow:  4px 0 0 0 #3498db; }

/* photo-card-info needs position:relative for the absolute handle */
.photo-card-info { position: relative; }

/* ── Layout: grid + docked edit panel ───────────────────────────────── */
.photos-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1600px;
    margin: 0 auto;
}
.photos-page {
    flex: 1;
    min-width: 0;
}

/* ── Edit Side Panel ────────────────────────────────────────────────── */
.edit-panel {
    position: sticky;
    top: 44px;
    height: calc(100dvh - 44px);
    width: 0;
    min-width: 0;
    flex-shrink: 0;
    overflow: hidden;
    background: #fff;
    border-left: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.edit-panel.open {
    width: 440px;
    min-width: 440px;
    border-left: 1px solid #e0e5ec;
    box-shadow: -4px 0 20px rgba(0,0,0,0.08);
}

.edit-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}
.edit-panel-header h3 { font-size: 16px; font-weight: 600; margin: 0; }

.edit-panel-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}
.edit-panel-close-btn:hover { color: #fff; }

.edit-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.edit-preview-img {
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    border-radius: 6px;
    background: #f0f0f0;
    display: block;
}
.edit-preview-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.edit-meta-chip {
    font-size: 11px;
    color: #999;
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 10px;
}

.edit-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.edit-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.edit-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    transition: border-color 0.15s;
}
.edit-input:focus { outline: none; border-color: #3498db; }

.edit-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr;
    gap: 10px;
}

.tag-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-cb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #444;
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    padding: 3px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.tag-cb:has(input:checked) {
    background: #dbeeff;
    border-color: #3498db;
    color: #1a6daa;
}
.tag-cb input { display: none; }

.edit-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}
.edit-toggle-row input[type=checkbox] {
    accent-color: #3498db;
    width: 15px; height: 15px;
}
.edit-toggle-row small { color: #aaa; font-size: 11px; }

.before-pair-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.before-thumb {
    width: 70px;
    height: 55px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #3498db;
    display: none;
}
.before-pair-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.before-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    align-items: center;
}
.before-meta-chip {
    font-size: 10px;
    color: #666;
    background: #f0f4f8;
    border: 1px solid #dde3ec;
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}
.before-meta-filename {
    font-family: 'Courier New', monospace;
    color: #3a5fa8;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edit-panel-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px 14px;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
}
.edit-panel-footer-sep {
    width: 100%;
    height: 0;
    border-top: 1px solid #eee;
    margin: 2px 0;
}

/* ── Modals ─────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90dvh;
    width: 100%;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }

.modal-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.modal-close-btn:hover { color: #fff; }

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* ── Upload Modal ───────────────────────────────────────────────────── */
.upload-modal-box { max-width: 600px; width: 100%; }

.dropzone {
    margin: 20px;
    border: 2px dashed #c0d8f0;
    border-radius: 10px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: #888;
}
.dropzone.drag-over {
    background: #eaf4ff;
    border-color: #3498db;
    color: #3498db;
}
.dropzone-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.dropzone p { font-size: 14px; margin: 4px 0; }
.dropzone-sub { font-size: 13px; color: #aaa; }
.file-input-label { color: #3498db; cursor: pointer; text-decoration: underline; }

.upload-global-folder-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px 6px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}
.upload-global-folder-label { font-size: 12px; color: #666; white-space: nowrap; }
.upload-folder-input { flex: 1; min-width: 80px; max-width: 160px; padding: 4px 8px; font-size: 12px; }
.upload-apply-btn { font-size: 11px; padding: 3px 10px; white-space: nowrap; }

.upload-queue {
    padding: 6px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 280px;
}
.queue-item {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
}
.queue-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    background: #e0e0e0;
}
.queue-info { overflow: hidden; }
.queue-name {
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
}
.queue-size { font-size: 11px; color: #aaa; }
.queue-folder-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #888;
}
.queue-folder-input {
    width: 90px;
    padding: 2px 6px;
    font-size: 11px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    color: #333;
}
.queue-folder-input:focus { outline: none; border-color: #3498db; }
.queue-remove-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}
.queue-remove-btn:hover { color: #e74c3c; }
.queue-status { font-size: 11px; color: #aaa; white-space: nowrap; }
.queue-done   { color: #27ae60; }
.queue-error  { color: #e74c3c; }
.queue-geo      { font-size: 11px; color: #888; margin-top: 2px; }
.queue-geo-done { color: #2e7d32; }
.queue-dup-warn {
    font-size: 11px;
    color: #7a5000;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 4px;
    padding: 4px 7px;
    margin-top: 3px;
    line-height: 1.4;
}
.queue-dup-warn em { font-style: normal; word-break: break-all; }
.queue-dup-overridden {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}
.upload-anyway-btn, .undo-anyway-btn {
    background: none;
    border: 1px solid #f0c000;
    border-radius: 3px;
    font-size: 10px;
    padding: 1px 6px;
    cursor: pointer;
    color: #7a5000;
    margin-left: 5px;
    white-space: nowrap;
}
.upload-anyway-btn:hover { background: #fff3c0; }
.undo-anyway-btn { border-color: #ccc; color: #888; }
.undo-anyway-btn:hover { background: #f5f5f5; }
.edit-meta-chip-filename {
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 2px 7px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Batch / Select Mode ──────────────────────────────────────────── */
.photos-btn-select-active {
    background: #3498db !important;
    color: #fff !important;
}
.photo-card-selected {
    outline: 3px solid #3498db;
    outline-offset: -2px;
}
.card-checkbox-wrap {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 4;
    cursor: pointer;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.12s;
    background: rgba(255,255,255,0.88);
    border-radius: 4px;
    padding: 2px;
}
.photo-card:hover .card-checkbox-wrap,
.photos-grid.select-mode-active .card-checkbox-wrap,
.photo-section-cards.select-mode-active .card-checkbox-wrap,
.photo-card-selected .card-checkbox-wrap { opacity: 1; }
.card-checkbox-blocked {
    animation: cb-block-flash 0.5s ease;
}
@keyframes cb-block-flash {
    0%   { background: rgba(255,255,255,0.88); }
    30%  { background: rgba(255,80,80,0.55); }
    100% { background: rgba(255,255,255,0.88); }
}
.card-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
    display: block;
}
.section-select-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    margin-left: auto;
    user-select: none;
}
.section-select-all input { cursor: pointer; accent-color: #3498db; }

.upload-modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 16px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}
.upload-stage-count { font-size: 12px; color: #888; flex: 1; }

/* ── Transfer Admin Photos Button Badge ─────────────────────────────── */
.transfer-btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 5px;
    line-height: 1;
}

/* ── Transfer Admin Photos Modal ─────────────────────────────────────── */
.transfer-modal-box {
    width: min(960px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.transfer-modal-subhead {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px 4px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.transfer-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    user-select: none;
}
.transfer-selected-count {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}
.transfer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}
.transfer-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}
.transfer-card:hover { border-color: #3498db; }
.transfer-card-selected { border-color: #3498db; background: #eaf4fb; }
.transfer-card-check-wrap {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    cursor: pointer;
}
.transfer-card-check-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    cursor: pointer;
}
.transfer-card-preview {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.transfer-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.transfer-card-no-img {
    font-size: 40px;
    color: #ccc;
}
.transfer-card-info {
    padding: 8px 10px 4px;
    flex: 1;
}
.transfer-card-name {
    font-size: 12px;
    font-weight: 600;
    color: #222;
    word-break: break-all;
    line-height: 1.3;
}
.transfer-card-meta {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.transfer-card-size {
    font-size: 11px;
    color: #aaa;
    margin-top: 1px;
}
.transfer-card-customize-btn {
    align-self: flex-end;
    margin: 4px 8px 8px;
    padding: 3px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.transfer-card-customize-btn .material-symbols-outlined { font-size: 14px; }
.transfer-status {
    font-size: 13px;
    color: #3498db;
    margin-left: 8px;
}

/* ── Promote Confirm Modal ──────────────────────────────────────────── */
.promote-confirm-box {
    max-width: 880px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.promote-confirm-body {
    display: flex;
    gap: 24px;
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
}
.promote-confirm-preview-col {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.promote-confirm-img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    background: #1e1e1e;
    min-height: 160px;
}
.promote-confirm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.promote-confirm-chips span {
    background: #2a2a2a;
    color: #aaa;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid #444;
}
.promote-confirm-form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    min-width: 0;
}
.promote-confirm-footer {
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}
.promote-confirm-status {
    font-size: 13px;
    color: #888;
    margin-left: auto;
}
/* Folder + filename path row inside promote modal */
.promote-path-row {
    display: flex;
    align-items: center;
    gap: 2px;
}
.promote-folder-prefix,
.promote-folder-sep {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    user-select: none;
    padding: 0 2px;
}
.promote-folder-input {
    width: 120px;
    flex: 0 0 120px;
    min-width: 0;
}
.promote-filename-input {
    flex: 1;
    min-width: 0;
}
.edit-label-hint {
    font-weight: 400;
    color: #888;
    margin-left: 6px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}

/* ── Old Promote Modal (unused) ─────────────────────────────────────── */
.promote-modal-box {
    max-width: 800px;
}

#promote-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.promote-projects-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.promote-loading { font-size: 14px; color: #aaa; text-align: center; padding: 20px; margin: 0; }

.promote-project-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: 1px solid #e8e8e8;
    border-radius: 7px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    color: #333;
}
.promote-project-btn:hover { background: #f0f7ff; border-color: #aad4f5; }
.promote-project-btn .material-symbols-outlined { color: #3498db; flex-shrink: 0; }
.promote-project-btn span:nth-child(2) { flex: 1; }
.promote-project-btn small { display: block; color: #aaa; font-size: 11px; margin-top: 1px; }
.promote-arrow { color: #ccc !important; }

.promote-photos-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    align-content: start;
}

.promote-photo-card { cursor: pointer; }
.promote-photo-card.already-promoted { opacity: 0.55; cursor: default; }
.promote-photo-card.promoting { opacity: 0.4; pointer-events: none; }

.promote-badge {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(39,174,96,0.88);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 4px;
}

.promote-back-btn {
    grid-column: 1 / -1;
    justify-self: start;
    margin-bottom: 4px;
}

/* ── Before Picker Modal ────────────────────────────────────────────── */
.before-picker-modal-box {
    max-width: 900px;
}
.before-picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    align-content: start;
}
.before-pick-card { cursor: pointer; }
.before-pick-card:hover { outline: 3px solid #3498db; }

/* ── Register banner (inside edit panel) ───────────────────────────── */
.edit-register-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #eaf4ff;
    border: 1px solid #aad4f5;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #2c5f8a;
    line-height: 1.5;
}
.edit-register-banner .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Delete Modal ───────────────────────────────────────────────────── */
.delete-modal-box {
    max-width: 420px;
    padding: 28px 24px 20px;
}
.delete-modal-box h3 { font-size: 17px; margin: 0 0 10px; color: #2c3e50; }
.delete-modal-box p  { font-size: 14px; color: #555; margin: 0 0 14px; }
.delete-warnings { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.delete-warning  { font-size: 13px; color: #e67e22; background: #fff8f0; border: 1px solid #f0d0a0; border-radius: 5px; padding: 7px 10px; margin: 0; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .photos-page { padding: 16px 14px 40px; }

    .photos-header { flex-direction: column; align-items: flex-start; }
    .photos-header-actions { width: 100%; justify-content: space-between; }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .edit-panel.open {
        position: fixed;
        top: 44px; left: 0; right: 0; bottom: 0;
        width: 100vw; min-width: 100vw;
        height: calc(100dvh - 44px);
        z-index: 300;
    }
    .photos-layout { flex-direction: column; }
    .edit-row-3 { grid-template-columns: 1fr 1fr; }
    .edit-row-3 .edit-field:last-child { grid-column: span 2; }

    .promote-modal-box, .promote-confirm-box { max-width: 100%; }
    .promote-confirm-body { flex-direction: column; }
    .promote-confirm-preview-col { flex: none; width: 100%; }
    .promote-confirm-img { max-height: 200px; }
}

/* ── Floating Batch Bar ──────────────────────────────────────────────────── */
.floating-batch-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a2233;
    color: #fff;
    padding: 10px 18px;
    border-radius: 32px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.32);
    z-index: 1100;
    animation: float-bar-in 0.2s ease;
    white-space: nowrap;
}
@keyframes float-bar-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.floating-batch-label {
    font-size: 13px;
    font-weight: 600;
    color: #a8c4e0;
    padding-right: 4px;
}
.floating-batch-bar .photos-btn {
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
}
.floating-batch-bar .photos-btn-ghost {
    color: #ccc;
    border-color: rgba(255,255,255,0.2);
}
.floating-batch-bar .photos-btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ── Resize badge ──────────────────────────────────────────────────── */
.badge-resize {
    background: #2c3e50;
    color: #ecf0f1;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    transition: background 0.15s;
}
.badge-resize:hover { background: #1a252f; }

/* ── Resize Modal ──────────────────────────────────────────────────── */
.resize-modal-box {
    max-width: 860px;
    width: 95vw;
}

.resize-modal-body {
    display: flex;
    gap: 20px;
    padding: 0 0 16px 0;
    flex-wrap: wrap;
}

/* Controls column */
.resize-controls-col {
    flex: 1 1 280px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.resize-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.resize-info-label {
    color: #888;
    font-weight: 600;
    min-width: 60px;
}
.resize-info-val {
    font-weight: 700;
    color: #2c3e50;
}
.resize-info-bytes {
    color: #aaa;
    font-size: 12px;
}
.resize-estimate-val {
    color: #27ae60;
}

.resize-presets {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.resize-preset-label {
    font-size: 12px;
    color: #888;
    min-width: 52px;
}
.resize-preset-btn {
    background: #ecf0f1;
    border: 1px solid #d5dae0;
    border-radius: 5px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.resize-preset-btn:hover { background: #dde4ea; }

.resize-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.resize-input-label {
    font-size: 12px;
    color: #888;
    min-width: 38px;
}
.resize-dim-input {
    width: 90px !important;
    text-align: center;
    font-size: 13px;
}
.resize-x {
    font-size: 14px;
    color: #aaa;
}
.resize-lock-label {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.resize-estimate-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.resize-pair-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eaf4fb;
    border: 1px solid #bee3f8;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 12px;
    color: #2980b9;
    flex-wrap: wrap;
}
.resize-pair-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 600;
}

.resize-error {
    background: #fff3f3;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 8px 12px;
    color: #c0392b;
    font-size: 12px;
}

/* Preview column */
.resize-preview-col {
    flex: 1 1 340px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resize-preview-tabs {
    display: flex;
    gap: 4px;
}
.resize-preview-tab {
    padding: 4px 14px;
    border: 1px solid #d5dae0;
    border-radius: 6px 6px 0 0;
    background: #f5f7fa;
    font-size: 12px;
    cursor: pointer;
    color: #666;
    transition: background 0.15s;
}
.resize-preview-tab.active {
    background: #fff;
    border-bottom-color: #fff;
    color: #2c3e50;
    font-weight: 700;
}

.resize-preview-wrap {
    position: relative;
    border: 1px solid #d5dae0;
    border-radius: 0 6px 6px 6px;
    background: #f0f2f5;
    overflow: hidden;
    height: 260px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}
.resize-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: top left;
    transition: transform 0.3s ease;
    display: block;
}
.resize-preview-dims-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
}

.upload-resize-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    margin-right: auto;
}

.refresh-dims-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #888;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.refresh-dims-btn:hover { color: #333; background: #f0f0f0; }
.refresh-dims-btn:disabled { opacity: 0.4; cursor: default; }
.refresh-dims-btn .material-symbols-outlined { font-size: 16px; }

@keyframes spin { to { transform: rotate(360deg); } }

.resize-saving-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #888;
}
