/* ADMIN_DASHBOARD_V1 */
.admin-entry-btn,
.admin-topbar-btn {
    border: 1px solid #111827;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.admin-entry-btn {
    width: 100%;
    min-height: 38px;
    margin-top: 10px;
    border-radius: 10px;
}
.admin-topbar-btn {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 9px;
    white-space: nowrap;
}
.admin-login-modal,
.admin-dashboard-overlay,
.admin-detail-overlay,
.admin-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 30000;
}
.admin-login-modal {
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(8px);
}
.admin-login-modal.hidden,
.admin-dashboard-overlay.hidden,
.admin-detail-overlay.hidden,
.admin-image-viewer.hidden { display: none !important; }
.admin-login-card {
    position: relative;
    width: min(430px, calc(100vw - 32px));
    padding: 30px;
    border: 1px solid #dbe3ee;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}
.admin-login-card h2 { margin: 8px 0 5px; font-size: 26px; color: #111827; }
.admin-login-card > p { margin: 0 0 20px; color: #64748b; font-size: 13px; }
.admin-login-badge,
.admin-kicker {
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .14em;
}
.admin-login-card form { display: grid; gap: 13px; }
.admin-login-card label { display: grid; gap: 6px; color: #334155; font-size: 12px; font-weight: 800; }
.admin-login-card input,
.admin-search-row input,
.admin-date-row input {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    outline: none;
}
.admin-login-card input:focus,
.admin-search-row input:focus,
.admin-date-row input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.admin-login-message { min-height: 18px; color: #dc2626; font-size: 12px; }
.admin-primary-btn {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}
.admin-x-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 24px;
    cursor: pointer;
}
.admin-login-card > .admin-x-btn { position: absolute; top: 15px; right: 15px; }

.admin-dashboard-overlay {
    overflow: auto;
    background: #eef2f7;
}
.admin-dashboard-shell { min-height: 100%; }
.admin-dashboard-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px;
    border-bottom: 1px solid #dbe3ee;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
}
.admin-dashboard-head h1 { margin: 2px 0 1px; color: #0f172a; font-size: 24px; }
.admin-dashboard-head p { margin: 0; color: #64748b; font-size: 12px; }
.admin-dashboard-head-actions { display: flex; align-items: center; gap: 8px; }
.admin-dashboard-head-actions > button,
.admin-detail-actions > button,
.admin-search-row button,
.admin-date-row button,
.admin-small-btn {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-weight: 800;
    cursor: pointer;
}
.admin-session-text {
    margin-right: 3px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
}
.admin-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 10px;
    padding: 16px 28px 10px;
}
.admin-summary-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #fff;
}
.admin-summary-card span { display: block; color: #64748b; font-size: 11px; font-weight: 800; }
.admin-summary-card strong { display: block; margin: 6px 0 3px; overflow: hidden; color: #0f172a; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.admin-summary-card small { color: #94a3b8; font-size: 10px; }
.admin-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 28px 14px;
}
.admin-tabs button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-weight: 900;
    cursor: pointer;
}
.admin-tabs button.active { border-color: #111827; background: #111827; color: #fff; }
.admin-dashboard-body { padding: 0 28px 36px; }
.admin-tab-panel { display: grid; gap: 14px; }
.admin-tab-panel.hidden { display: none; }
.admin-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 0 1px;
}
.admin-section-head.compact { align-items: center; padding: 0 0 10px; }
.admin-section-head h2,
.admin-section-head h3 { margin: 0 0 3px; color: #0f172a; }
.admin-section-head h2 { font-size: 20px; }
.admin-section-head h3 { font-size: 15px; }
.admin-section-head p { margin: 0; color: #64748b; font-size: 11px; }
.admin-auto-refresh,
.admin-phase-badge {
    padding: 6px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 10px;
    font-weight: 900;
}
.admin-block {
    padding: 15px;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #fff;
}
.admin-block > h3 { margin: 0 0 11px; color: #0f172a; font-size: 14px; }
.admin-worker-list { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-worker-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
}
.admin-worker-chip small { color: #94a3b8; }
.admin-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
.admin-table-wrap { overflow: auto; }
.admin-table { width: 100%; min-width: 880px; border-collapse: collapse; color: #334155; font-size: 11px; }
.admin-table th {
    position: sticky;
    top: 0;
    padding: 9px 10px;
    border-bottom: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #64748b;
    text-align: left;
    white-space: nowrap;
}
.admin-table td { padding: 9px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.admin-table tbody tr:hover { background: #fafcff; }
.admin-table.dense td,
.admin-table.dense th { padding: 7px 8px; font-size: 10px; }
.admin-link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: #2563eb;
    font: inherit;
    cursor: pointer;
    text-align: left;
}
.admin-link-btn.strong { font-weight: 900; }
.admin-status {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}
.admin-status.running { background: #dcfce7; color: #166534; }
.admin-status.queued { background: #fef3c7; color: #92400e; }
.admin-status.cancelling { background: #ffedd5; color: #9a3412; }
.admin-status.failed { background: #fee2e2; color: #991b1b; }
.admin-status.completed { background: #dbeafe; color: #1e40af; }
.admin-progress { width: 110px; height: 6px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.admin-progress span { display: block; height: 100%; border-radius: inherit; background: #2563eb; }
.admin-table td > small { display: block; margin-top: 3px; color: #94a3b8; font-size: 9px; }
.admin-empty,
.admin-empty-cell,
.admin-loading,
.admin-error { color: #94a3b8; font-size: 12px; text-align: center; }
.admin-empty-cell { padding: 30px !important; }
.admin-loading,
.admin-error { padding: 70px 20px; border: 1px dashed #cbd5e1; border-radius: 14px; background: rgba(255,255,255,.65); }
.admin-error { color: #b91c1c; }
.admin-search-row,
.admin-date-row { display: flex; align-items: end; gap: 7px; }
.admin-search-row input { width: 260px; }
.admin-date-row label { display: grid; gap: 3px; color: #64748b; font-size: 10px; font-weight: 800; }
.admin-date-row input { min-height: 36px; }
.admin-detail-overlay { z-index: 31000; padding: 20px; overflow: auto; background: rgba(15,23,42,.68); }
.admin-detail-shell {
    width: min(1500px, 100%);
    min-height: calc(100vh - 40px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 18px;
    background: #eef2f7;
    box-shadow: 0 28px 90px rgba(15,23,42,.35);
}
.admin-detail-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 17px 22px;
    border-bottom: 1px solid #dbe3ee;
    background: rgba(255,255,255,.97);
}
.admin-detail-head h2 { margin: 2px 0; color: #0f172a; font-size: 22px; }
.admin-detail-head p { margin: 0; color: #64748b; font-size: 11px; }
.admin-detail-actions { display: flex; gap: 8px; align-items: center; }
.admin-detail-body { display: grid; gap: 13px; padding: 17px 20px 30px; }
.admin-detail-info-grid,
.admin-metric-highlight {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 9px;
}
.admin-detail-info-grid article,
.admin-metric-highlight article {
    padding: 13px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
}
.admin-detail-info-grid span,
.admin-metric-highlight span { display: block; color: #64748b; font-size: 10px; font-weight: 800; }
.admin-detail-info-grid strong,
.admin-metric-highlight strong { display: block; margin-top: 5px; color: #0f172a; font-size: 15px; }
.admin-metric-highlight small { display: block; margin-top: 3px; color: #94a3b8; font-size: 9px; }
.admin-current-job {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
}
.admin-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.admin-gallery-card {
    min-width: 0;
    padding: 0 0 9px;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: zoom-in;
}
.admin-gallery-media { aspect-ratio: 1 / 1; overflow: hidden; background: #f1f5f9; }
.admin-gallery-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-gallery-card strong,
.admin-gallery-card small { display: block; padding: 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-gallery-card strong { margin-top: 8px; color: #334155; font-size: 10px; }
.admin-gallery-card small { margin-top: 2px; color: #94a3b8; font-size: 9px; }
.admin-image-viewer {
    z-index: 32000;
    display: grid;
    place-items: center;
    padding: 35px;
    background: rgba(2,6,23,.92);
}
.admin-image-viewer img { max-width: 92vw; max-height: 88vh; object-fit: contain; box-shadow: 0 20px 70px rgba(0,0,0,.45); }
.admin-image-viewer > .admin-x-btn { position: absolute; top: 20px; right: 20px; }
.admin-image-viewer > div { position: absolute; left: 30px; bottom: 18px; right: 30px; color: #fff; font-size: 12px; text-align: center; }
.admin-coupang-plan { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 10px; }
.admin-coupang-plan article {
    display: flex;
    gap: 12px;
    padding: 18px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #fff;
}
.admin-coupang-plan article > strong { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 9px; background: #111827; color: #fff; }
.admin-coupang-plan h3 { margin: 0 0 5px; color: #0f172a; font-size: 13px; }
.admin-coupang-plan p { margin: 0; color: #64748b; font-size: 11px; line-height: 1.5; }
.admin-note-box { padding: 17px; border: 1px solid #bfdbfe; border-radius: 14px; background: #eff6ff; color: #1e3a8a; }
.admin-note-box strong { display: block; margin-bottom: 4px; }
.admin-note-box p { margin: 0; font-size: 11px; line-height: 1.6; }

@media (max-width: 1300px) {
    .admin-summary-cards { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
    .admin-detail-info-grid, .admin-metric-highlight { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .admin-coupang-plan { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 800px) {
    .admin-dashboard-head, .admin-section-head, .admin-detail-head { align-items: stretch; flex-direction: column; }
    .admin-dashboard-head-actions, .admin-detail-actions, .admin-tabs { overflow-x: auto; }
    .admin-summary-cards { grid-template-columns: repeat(2, minmax(130px, 1fr)); padding-left: 14px; padding-right: 14px; }
    .admin-tabs, .admin-dashboard-body { padding-left: 14px; padding-right: 14px; }
    .admin-detail-info-grid, .admin-metric-highlight, .admin-coupang-plan { grid-template-columns: 1fr 1fr; }
    .admin-current-job { grid-template-columns: 1fr 1fr; }
    .admin-search-row, .admin-date-row { flex-wrap: wrap; }
}

/* ADMIN_IMAGE_LINEAGE_V2 */
.admin-lineage-summary-grid article small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
}
.admin-lineage-summary-grid .lineage-accent { background: #f8fbff; border-color: #bfdbfe; }
.admin-lineage-summary-grid .lineage-warning { background: #fff7ed; border-color: #fed7aa; }
.admin-gallery-media { position: relative; }
.admin-lineage-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(15,23,42,.15);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}
.admin-lineage-badge.initial { color: #166534; background: rgba(220,252,231,.95); border: 1px solid #86efac; }
.admin-lineage-badge.regen { color: #9a3412; background: rgba(255,237,213,.96); border: 1px solid #fdba74; }
.admin-lineage-badge.legacy { color: #475569; background: rgba(241,245,249,.96); border: 1px solid #cbd5e1; }
.admin-gallery-card.lineage-regen { border-color: #fdba74; box-shadow: inset 0 0 0 1px #ffedd5; }
.admin-gallery-card.lineage-initial { border-color: #bbf7d0; }
.admin-lineage-card-meta { color: #64748b !important; }
.admin-lineage-status {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
}
.admin-lineage-status.initial { color: #166534; background: #dcfce7; }
.admin-lineage-status.regen { color: #9a3412; background: #ffedd5; }
.admin-log-regen td { background: #fffaf5; }
.admin-lineage-groups { display: grid; gap: 12px; }
.admin-lineage-group {
    padding: 13px;
    border: 1px solid #dbe3ee;
    border-radius: 13px;
    background: #fff;
}
.admin-lineage-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}
.admin-lineage-group > header strong,
.admin-lineage-group > header small { display: block; }
.admin-lineage-group > header strong { color: #0f172a; font-size: 11px; }
.admin-lineage-group > header small { margin-top: 3px; color: #64748b; font-size: 9px; }
.admin-lineage-group > header > span {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    color: #9a3412;
    background: #ffedd5;
    font-size: 9px;
    font-weight: 900;
}
.admin-version-strip {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding-bottom: 3px;
}
.admin-version-card {
    flex: 0 0 130px;
    padding: 0 0 8px;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: zoom-in;
}
.admin-version-card.current { border: 2px solid #2563eb; }
.admin-version-card.archived { border-color: #fdba74; }
.admin-version-card > div { aspect-ratio: 1/1; overflow: hidden; background: #f1f5f9; }
.admin-version-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.admin-version-card strong,
.admin-version-card small { display: block; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-version-card strong { margin-top: 7px; color: #334155; font-size: 9px; }
.admin-version-card small { margin-top: 2px; color: #94a3b8; font-size: 8px; }
.admin-version-note,
.admin-version-missing {
    margin-top: 8px;
    padding: 9px 11px;
    border-radius: 9px;
    color: #92400e;
    background: #fffbeb;
    font-size: 9px;
    line-height: 1.45;
}

/* ADMIN_REFERENCE_AUDIT_V3 */
.admin-reference-groups{display:grid;gap:14px}.admin-reference-group{border:1px solid #d8e1ef;border-radius:14px;background:#fbfdff;padding:14px}.admin-reference-group h4{margin:0 0 4px;font-size:14px}.admin-reference-group p{margin:0 0 10px;color:#6b7a90;font-size:12px}.admin-reference-card .admin-gallery-media{position:relative}.admin-reference-badge{position:absolute;left:8px;top:8px;background:#0f172a;color:#fff;border-radius:999px;padding:4px 7px;font-size:10px;font-weight:700}.admin-reference-audit{display:grid;gap:10px}.admin-reference-audit-row{border:1px solid #dbe4f0;border-radius:12px;background:#fff;padding:12px}.admin-reference-audit-row header{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}.admin-reference-audit-row header strong{font-size:13px}.admin-reference-audit-row header span{font-size:11px;color:#64748b}.admin-audit-role{display:grid;grid-template-columns:110px 1fr;gap:10px;align-items:start;margin-top:8px}.admin-audit-role>span{font-size:11px;font-weight:700;color:#334155;padding-top:6px}.admin-audit-role>div{display:flex;gap:8px;flex-wrap:wrap}.admin-audit-thumb{width:92px;border:1px solid #d7e0eb;border-radius:10px;background:#f8fafc;padding:5px;text-align:left;cursor:pointer}.admin-audit-thumb img{width:80px;height:80px;object-fit:cover;border-radius:7px;display:block}.admin-audit-thumb small{display:block;margin-top:4px;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.admin-audit-thumb:hover,.admin-reference-card:hover{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.08)}


/* ADMIN_POPUP_LINEAGE_V4 */
.admin-image-viewer { z-index: 32000; display: grid; place-items: center; padding: 26px; background: rgba(2,6,23,.92); }
.admin-image-viewer-shell { width: min(1600px, 96vw); height: min(900px, 92vh); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: stretch; }
.admin-image-viewer-main { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; border: 2px solid rgba(167,139,250,.9); background: rgba(255,255,255,.04); }
.admin-image-viewer-main img { max-width: 100%; max-height: calc(92vh - 120px); object-fit: contain; box-shadow: none; }
#adminImageViewerLabel { position: absolute; left: 16px; right: 16px; bottom: -58px; display: grid; gap: 2px; color: #fff; text-align: center; }
#adminImageViewerLabel strong { font-size: 14px; }
#adminImageViewerLabel span { font-size: 12px; color: #cbd5e1; }
#adminImageViewerLabel small { font-size: 11px; color: #93c5fd; }
#adminImageViewerLabel em { margin-top: 4px; font-style: normal; font-size: 11px; color: #fcd34d; }
.admin-image-viewer-side { overflow-y: auto; padding: 10px; border: 2px solid rgba(250,204,21,.95); background: rgba(15,23,42,.82); }
.admin-viewer-side-title { margin-bottom: 12px; color: #fff; font-size: 13px; font-weight: 800; }
.admin-viewer-side-section + .admin-viewer-side-section { margin-top: 16px; }
.admin-viewer-side-section h4 { margin: 0 0 8px; color: #fde68a; font-size: 12px; }
.admin-viewer-thumb-list { display: grid; gap: 10px; }
.admin-viewer-thumb { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; width: 100%; padding: 6px; border: 1px solid #334155; border-radius: 10px; background: #0f172a; text-align: left; cursor: pointer; }
.admin-viewer-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.admin-viewer-thumb strong, .admin-viewer-thumb small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-viewer-thumb strong { color: #f8fafc; font-size: 11px; }
.admin-viewer-thumb small { margin-top: 3px; color: #94a3b8; font-size: 10px; }
.admin-viewer-thumb.active { border-color: #60a5fa; box-shadow: 0 0 0 2px rgba(96,165,250,.2) inset; }
.admin-viewer-thumb.reference { border-color: #facc15; }
@media (max-width: 1100px) { .admin-image-viewer-shell { grid-template-columns: 1fr; height: auto; } .admin-image-viewer-side { max-height: 280px; } #adminImageViewerLabel { position: static; margin-top: 10px; } }


/* ADMIN_SIMPLE_VIEWER_V6 */
.admin-image-viewer { padding: 24px; background: rgba(15,23,42,.94); }
.admin-image-viewer-shell {
    width: min(1580px, 96vw);
    height: min(900px, 92vh);
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 16px;
}
.admin-image-viewer-main {
    border: 0;
    border-radius: 14px;
    background: rgba(30,41,59,.78);
    box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.admin-image-viewer-main img {
    max-width: calc(100% - 80px);
    max-height: calc(92vh - 125px);
    border-radius: 8px;
}
.admin-image-viewer-side {
    border: 0;
    border-radius: 14px;
    background: rgba(30,41,59,.92);
    box-shadow: 0 18px 60px rgba(0,0,0,.22);
    scrollbar-width: thin;
}
.admin-viewer-side-title { color: #f8fafc; font-size: 12px; }
.admin-viewer-side-section h4 { color: #cbd5e1; font-size: 11px; }
.admin-viewer-thumb,
.admin-viewer-thumb.reference {
    border: 1px solid rgba(148,163,184,.22);
    background: rgba(15,23,42,.72);
}
.admin-viewer-thumb:hover { border-color: rgba(148,163,184,.55); background: rgba(30,41,59,.9); }
.admin-viewer-thumb.active {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(96,165,250,.22);
    background: rgba(30,58,138,.18);
}
.admin-image-viewer-toolbar {
    position: absolute;
    top: 14px;
    left: 50%;
    z-index: 5;
    transform: translateX(-50%);
    min-width: 54px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,.72);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    backdrop-filter: blur(6px);
}
.admin-image-nav {
    position: absolute;
    top: 50%;
    z-index: 6;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(15,23,42,.72);
    color: #fff;
    font-size: 34px;
    line-height: 42px;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.admin-image-nav:hover { background: rgba(51,65,85,.96); transform: translateY(-50%) scale(1.04); }
.admin-image-nav.prev { left: 14px; }
.admin-image-nav.next { right: 14px; }
.admin-image-nav[hidden] { display: none !important; }
#adminImageViewerLabel { bottom: 14px; }
#adminImageViewerLabel em { color: #fbbf24; }
@media (max-width: 1100px) {
    .admin-image-viewer-shell { grid-template-columns: 1fr; gap: 12px; }
    .admin-image-viewer-side { max-height: 260px; }
    .admin-image-viewer-main img { max-width: calc(100% - 64px); }
    #adminImageViewerLabel { position: static; padding: 10px 14px; }
}


/* ADMIN_COLOR_GROUPS_V7 */
.admin-color-group { margin-top: 16px; }
.admin-color-group:first-child { margin-top: 0; }
.admin-color-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 0 2px; }
.admin-color-group-head h4 { margin: 0; font-size: 15px; font-weight: 800; color: #0f172a; }
.admin-color-group-head span { font-size: 12px; color: #64748b; font-weight: 700; }


/* ADMIN_WORKSPACE_LAYOUT_V8 */
.admin-color-group {
    margin-top: 20px;
    padding-top: 2px;
}
.admin-color-group + .admin-color-group {
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}
.admin-shot-group {
    margin-top: 13px;
}
.admin-shot-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 0 2px;
}
.admin-shot-group-head strong {
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}
.admin-shot-group-head span {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
}
.admin-shot-group .admin-gallery {
    grid-template-columns: repeat(auto-fill, minmax(145px, 155px));
    justify-content: start;
}


/* ADMIN_COMPACT_DETAIL_V9 */
.admin-color-group {
    margin-top: 18px;
}
.admin-color-group + .admin-color-group {
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.admin-color-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 10px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}
.admin-color-gallery .admin-gallery-card {
    flex: 0 0 150px;
    width: 150px;
}
.admin-color-gallery .admin-gallery-media {
    width: 100%;
    aspect-ratio: 1 / 1;
}
.admin-more-btn {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.admin-more-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}
.admin-collapsible-table tbody tr:nth-child(n+9) {
    display: none;
}
.admin-collapsible-table.expanded tbody tr {
    display: table-row;
}


/* ADMIN_FIXED_CUT_COLUMNS_V10 */
.admin-fixed-table {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
}
.admin-fixed-table th,
.admin-fixed-table td {
    overflow: hidden;
}
.admin-cut-cell {
    max-width: 0;
}
.admin-cut-text {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-cut-text strong {
    font-weight: 800;
}
.admin-fixed-table th {
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ADMIN_DETAIL_LAYOUT_V11 */
/* Keep the product-monitor header visible while the detail popup scrolls. */
.admin-detail-shell {
    overflow: visible;
}
.admin-detail-head {
    top: 20px;
    z-index: 30;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 8px 20px rgba(15,23,42,.08);
}
.admin-lineage-summary-grid {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}
.admin-lineage-summary-grid article small {
    min-height: 13px;
}

/* Use the image viewer width efficiently and keep image information separate from the image. */
.admin-image-viewer {
    padding: 18px 28px;
}
.admin-image-viewer-shell {
    width: calc(100vw - 84px);
    max-width: 1780px;
    height: calc(100vh - 54px);
    max-height: 980px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 370px);
    gap: 14px;
}
.admin-image-viewer-main {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 14px;
}
.admin-image-viewer-canvas {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 20px 68px 18px;
    background: rgba(30,41,59,.78);
}
.admin-image-viewer-canvas img,
.admin-image-viewer-main img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
#adminImageViewerLabel,
.admin-image-viewer-info {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    display: grid;
    gap: 3px;
    min-height: 64px;
    padding: 10px 18px 12px;
    border-top: 1px solid rgba(148,163,184,.18);
    background: rgba(15,23,42,.96);
    color: #fff;
    text-align: center;
}
#adminImageViewerLabel strong { font-size: 13px; }
#adminImageViewerLabel span { font-size: 11px; color: #cbd5e1; }
#adminImageViewerLabel small { font-size: 10px; color: #93c5fd; }
#adminImageViewerLabel em { margin-top: 2px; font-size: 10px; }
.admin-image-viewer-side {
    min-width: 0;
    padding: 14px;
}
.admin-viewer-thumb {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 84px;
    padding: 7px;
}
.admin-viewer-thumb img {
    width: 82px;
    height: 70px;
}
.admin-image-viewer-toolbar { top: 12px; }
.admin-image-nav.prev { left: 14px; }
.admin-image-nav.next { right: 14px; }

@media (max-width: 1200px) {
    .admin-lineage-summary-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
    .admin-image-viewer-shell { grid-template-columns: minmax(0, 1fr) 300px; width: calc(100vw - 40px); }
}
@media (max-width: 900px) {
    .admin-detail-head { top: 0; }
    .admin-image-viewer-shell { grid-template-columns: 1fr; height: calc(100vh - 30px); }
    .admin-image-viewer-side { max-height: 250px; }
    .admin-image-viewer-canvas { min-height: 52vh; padding: 18px 56px; }
}


/* ADMIN_DETAIL_HEADER_FIXED_V12 */
/* Correct fixed-header behavior:
   - The detail shell itself does not scroll.
   - Header occupies its own row.
   - Only the detail body scrolls.
   This prevents content from sliding underneath / behind the header. */
.admin-detail-overlay {
    overflow: hidden !important;
    padding: 20px !important;
}
.admin-detail-shell {
    width: min(1500px, 100%) !important;
    height: calc(100vh - 40px) !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: hidden !important;
}
.admin-detail-head {
    position: relative !important;
    top: auto !important;
    z-index: 4 !important;
    flex: 0 0 auto !important;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: none !important;
}
.admin-detail-body {
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
}
@media (max-width: 900px) {
    .admin-detail-overlay { padding: 8px !important; }
    .admin-detail-shell { height: calc(100vh - 16px) !important; }
    .admin-detail-head { top: auto !important; }
}


/* ADMIN_DETAIL_SPLIT_SCROLL_V13 */
/* Exact requested structure:
   top PRODUCT MONITOR = fixed panel
   everything below = one independent vertical scroll area */
.admin-detail-overlay {
    overflow: hidden !important;
    padding: 12px !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
}
.admin-detail-shell {
    width: min(1500px, 100%) !important;
    height: calc(100vh - 24px) !important;
    min-height: 0 !important;
    max-height: calc(100vh - 24px) !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 18px !important;
}
.admin-detail-head {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    z-index: 5 !important;
    border-radius: 18px 18px 0 0 !important;
    box-shadow: none !important;
    background: #fff !important;
}
.admin-detail-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
}
@media (max-width: 900px) {
    .admin-detail-overlay {
        padding: 6px !important;
    }
    .admin-detail-shell {
        height: calc(100vh - 12px) !important;
        max-height: calc(100vh - 12px) !important;
    }
}


/* ADMIN_DETAIL_SCROLL_CONTENT_FIX_V14 */
/* v13 used a height-limited CSS grid for the scroll body.
   Grid auto-rows compressed the blocks to fit the viewport, which clipped
   image cards and tables and left almost nothing to scroll.
   Use a non-shrinking vertical flex flow instead. */
.admin-detail-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 13px !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}
.admin-detail-body > * {
    flex: 0 0 auto !important;
    min-height: max-content;
}
.admin-detail-body > .admin-block {
    overflow: hidden;
}
.admin-color-gallery {
    min-height: 0;
}
.admin-color-gallery .admin-gallery-card {
    flex-shrink: 0 !important;
}
.admin-collapsible-table {
    height: auto !important;
}


/* ADMIN_IMAGE_VIEWER_INFO_V15 */
.admin-image-viewer {
    padding: 18px 24px !important;
}
.admin-image-viewer-shell {
    width: calc(100vw - 48px) !important;
    max-width: none !important;
    height: calc(100vh - 36px) !important;
    max-height: none !important;
    grid-template-columns: minmax(0, 1fr) 360px !important;
    gap: 14px !important;
}
.admin-image-viewer-main {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    grid-template-rows: minmax(0, 1fr) !important;
}
.admin-image-viewer-canvas {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 18px 76px !important;
    box-sizing: border-box !important;
}
.admin-image-viewer-canvas img,
.admin-image-viewer-main img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}
/* Navigation stays at the same canvas-edge positions regardless of image dimensions. */
.admin-image-nav {
    top: 50% !important;
    transform: translateY(-50%) !important;
}
.admin-image-nav.prev { left: 18px !important; }
.admin-image-nav.next { right: 18px !important; }
.admin-image-nav:hover { transform: translateY(-50%) scale(1.04) !important; }

/* Old info below the image is no longer used; all information is in the right panel. */
#adminImageViewerLabel,
.admin-image-viewer-info {
    display: none !important;
}

.admin-image-viewer-side {
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 14px !important;
    box-sizing: border-box !important;
}
.admin-viewer-side-title {
    flex: 0 0 auto;
    margin-bottom: 10px !important;
    padding: 2px 2px 8px;
    border-bottom: 1px solid rgba(148,163,184,.18);
    font-size: 13px !important;
    font-weight: 800;
}
.admin-viewer-product-info {
    flex: 0 0 auto;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(148,163,184,.20);
    border-radius: 12px;
    background: rgba(15,23,42,.72);
}
.admin-viewer-product-info-title {
    margin-bottom: 8px;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 900;
}
.admin-viewer-product-info dl {
    margin: 0;
    display: grid;
    gap: 5px;
}
.admin-viewer-product-info dl > div {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}
.admin-viewer-product-info dt,
.admin-viewer-product-info dd {
    margin: 0;
    font-size: 10px;
    line-height: 1.45;
}
.admin-viewer-product-info dt {
    color: #94a3b8;
    font-weight: 700;
}
.admin-viewer-product-info dd {
    min-width: 0;
    color: #f8fafc;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-viewer-side-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scrollbar-width: thin;
}

@media (max-width: 1100px) {
    .admin-image-viewer-shell {
        grid-template-columns: minmax(0, 1fr) 320px !important;
        width: calc(100vw - 28px) !important;
    }
}
@media (max-width: 780px) {
    .admin-image-viewer-shell {
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(0, 1fr) 260px !important;
    }
    .admin-image-viewer-side {
        max-height: none !important;
    }
    .admin-image-viewer-canvas {
        padding: 14px 58px !important;
    }
}


/* ADMIN_IMAGE_FIT_V16 */
/* At 100% browser zoom, percentage max-height on the intrinsic <img> could
   resolve too loosely inside the nested grid and the image would size by width,
   causing the bottom to be clipped. Give the canvas a definite box and make
   the image fill that box with object-fit: contain. */
.admin-image-viewer-main {
    min-height: 0 !important;
    overflow: hidden !important;
}
.admin-image-viewer-canvas {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
#adminImageViewerImg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 8px;
}


/* ADMIN_IMAGE_VIEWER_CLOSE_INFO_V17 */
/* Keep the close button above the viewer shell so it always receives clicks. */
#adminImageViewerClose {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 33050 !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}
#adminImageViewerClose:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

/* Product info reads better left-aligned. */
.admin-viewer-product-info,
.admin-viewer-product-info-title,
.admin-viewer-product-info dl,
.admin-viewer-product-info dl > div,
.admin-viewer-product-info dt,
.admin-viewer-product-info dd {
    text-align: left !important;
}
.admin-viewer-product-info dl > div {
    align-items: start !important;
}
.admin-viewer-product-info dd {
    justify-self: stretch !important;
}

/* ADMIN_METRIC_TABLE_V18 */
.admin-metric-table-block {
    overflow: hidden;
}
.admin-metric-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}
.admin-metric-table-head h3 {
    margin: 0;
}
.admin-metric-search-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    width: min(360px, 100%);
}
.admin-metric-search-wrap input {
    flex: 1 1 auto;
    min-width: 0;
    height: 34px;
    padding: 0 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    font-size: 11px;
    outline: none;
}
.admin-metric-search-wrap input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96,165,250,.12);
}
.admin-metric-search-wrap button {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.admin-metric-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
}
.admin-metric-table {
    width: 100% !important;
    min-width: 980px !important;
    table-layout: fixed !important;
}
.admin-metric-table col.metric-col-key {
    width: 260px !important;
}
.admin-metric-table th,
.admin-metric-table td {
    box-sizing: border-box;
}
.admin-metric-table th:first-child,
.admin-metric-table td:first-child {
    width: 260px !important;
    max-width: 260px !important;
}
.admin-metric-table th:not(:first-child),
.admin-metric-table td:not(:first-child) {
    text-align: left;
}
.admin-metric-key,
.admin-metric-key strong {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-metric-key-head {
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-metric-sort {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.admin-metric-sort:hover {
    color: #2563eb;
}
.admin-sort-icon {
    width: 12px;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
}
.admin-metric-sort[data-sort-direction="asc"] .admin-sort-icon,
.admin-metric-sort[data-sort-direction="desc"] .admin-sort-icon {
    color: #2563eb;
}
.admin-metric-no-match {
    padding: 16px 10px 4px;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
}
@media (max-width: 900px) {
    .admin-metric-table-head {
        align-items: stretch;
        flex-direction: column;
    }
    .admin-metric-search-wrap {
        width: 100%;
    }
}

/* ADMIN_COUPANG_MANUAL_V20 */
.admin-coupang-summary-table { table-layout: fixed; width: 100%; }
.admin-coupang-summary-table th:first-child,
.admin-coupang-summary-table td:first-child { width: 22%; }
.admin-coupang-editor { margin-top: 14px; }
.admin-coupang-actions { display: flex; gap: 8px; align-items: center; }
.admin-coupang-kpis { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.admin-coupang-kpis article { padding: 14px; border: 1px solid #dbe3ee; border-radius: 12px; background: #f8fbff; }
.admin-coupang-kpis span, .admin-coupang-kpis strong { display: block; }
.admin-coupang-kpis span { color: #64748b; font-size: 10px; }
.admin-coupang-kpis strong { margin-top: 5px; color: #0f172a; font-size: 16px; }
.admin-coupang-image-groups { display: grid; gap: 18px; }
.admin-coupang-color-group { min-width: 0; }
.admin-coupang-image-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; }
.admin-coupang-image-card { flex: 0 0 160px; position: relative; padding: 8px; border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; }
.admin-coupang-image-card.selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.admin-coupang-check { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: #334155; font-size: 10px; font-weight: 800; cursor: pointer; }
.admin-coupang-preview { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 9px; overflow: hidden; background: #f1f5f9; cursor: zoom-in; }
.admin-coupang-preview img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.admin-coupang-image-card > strong,
.admin-coupang-image-card > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-coupang-image-card > strong { margin-top: 8px; color: #0f172a; font-size: 10px; }
.admin-coupang-image-card > small { margin-top: 2px; color: #94a3b8; font-size: 9px; }
.admin-coupang-image-card select { width: 100%; margin-top: 8px; padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; font-size: 10px; }
.admin-coupang-image-card select:disabled { opacity: .45; }
@media (max-width: 1200px) { .admin-coupang-kpis { grid-template-columns: repeat(3, minmax(140px,1fr)); } }
@media (max-width: 700px) { .admin-coupang-kpis { grid-template-columns: repeat(2, minmax(120px,1fr)); } .admin-coupang-image-card { flex-basis: 140px; } }


/* ADMIN_COUPANG_MANUAL_V21 */
.admin-coupang-summary-table { table-layout: fixed; }
.admin-coupang-summary-table th:last-child,
.admin-coupang-summary-table td:last-child { width: 76px; text-align: center; }
.admin-coupang-row-open > td { background: #f8fbff; border-bottom-color: transparent; }
.admin-coupang-inline-row > td { padding: 0 12px 16px !important; background: #f8fbff; }
.admin-coupang-inline-editor { margin: 0; padding: 16px; border: 1px solid #cbdcf5; border-radius: 0 0 14px 14px; background: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.admin-coupang-editor-head { margin-bottom: 12px; }
.admin-coupang-bulkbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid #d7e1ee; border-radius: 12px; background: rgba(248,251,255,.97); box-shadow: 0 4px 14px rgba(15,23,42,.05); }
.admin-coupang-bulk-select,
.admin-coupang-bulk-types,
.admin-coupang-color-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.admin-coupang-bulk-select strong { min-width: 58px; color: #0f172a; font-size: 11px; }
.admin-coupang-bulk-types > span { color: #64748b; font-size: 10px; font-weight: 700; margin-right: 2px; }
.admin-coupang-bulkbar button,
.admin-coupang-color-tools button { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; font-size: 10px; font-weight: 800; cursor: pointer; }
.admin-coupang-bulkbar button:hover,
.admin-coupang-color-tools button:hover { background: #f1f5f9; }
.admin-coupang-bulkbar button[data-coupang-assign="대표이미지"] { border-color: #2563eb; color: #1d4ed8; }
.admin-coupang-bulkbar button[data-coupang-assign="추가이미지"] { border-color: #0ea5e9; color: #0369a1; }
.admin-coupang-bulkbar button[data-coupang-assign="상세이미지"] { border-color: #8b5cf6; color: #6d28d9; }
.admin-coupang-bulkbar button.danger-light { border-color: #fecaca; color: #b91c1c; }
.admin-coupang-color-tools > span { color: #64748b; font-size: 10px; font-weight: 700; }
.admin-coupang-image-card { transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.admin-coupang-image-card.batch-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.13); }
.admin-coupang-image-card.used { background: #fbfdff; }
.admin-coupang-image-card.usage-hero { border-color: #2563eb; }
.admin-coupang-image-card.usage-detail { border-color: #8b5cf6; }
.admin-coupang-card-usage { min-height: 22px; margin-top: 7px; }
.admin-coupang-usage-badge { display: inline-flex; align-items: center; max-width: 100%; padding: 4px 7px; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-size: 9px; font-weight: 900; white-space: nowrap; }
.admin-coupang-usage-badge.hero { background: #dbeafe; color: #1d4ed8; }
.admin-coupang-usage-badge.detail { background: #ede9fe; color: #6d28d9; }
.admin-coupang-usage-badge.additional { background: #e0f2fe; color: #0369a1; }
.admin-coupang-check span { user-select: none; }
.admin-login-message.error { color: #b91c1c; }
@media (max-width: 1050px) {
    .admin-coupang-bulkbar { align-items: flex-start; flex-direction: column; }
}


/* ADMIN_GENERATION_LOG_VIEWER_V35 */
.admin-log-workspace { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.admin-log-head { align-items: center; gap: 12px; }
.admin-log-downloads { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-log-downloads button,
.admin-log-scope-tabs button,
.admin-log-filters button,
.admin-log-pagination button { border: 1px solid #d8e0eb; background: #fff; color: #243247; border-radius: 9px; padding: 8px 11px; font: inherit; cursor: pointer; }
.admin-log-downloads button:hover,
.admin-log-scope-tabs button:hover,
.admin-log-filters button:hover,
.admin-log-pagination button:hover { border-color: #9bb7dd; background: #f6f9fd; }
.admin-log-downloads button:disabled,
.admin-log-pagination button:disabled { cursor: default; opacity: .45; }
.admin-log-scope-tabs { display: inline-flex; width: fit-content; padding: 3px; border-radius: 10px; background: #edf2f8; gap: 3px; }
.admin-log-scope-tabs button { border: 0; background: transparent; padding: 7px 15px; font-weight: 700; }
.admin-log-scope-tabs button.active { background: #172033; color: #fff; box-shadow: 0 1px 3px rgba(23,32,51,.18); }
.admin-log-summary { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; }
.admin-log-summary article { min-width: 0; border: 1px solid #e1e7ef; border-radius: 10px; background: #f9fbfd; padding: 10px 12px; }
.admin-log-summary article span { display: block; color: #6d7888; font-size: 11px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-log-summary article strong { display: block; color: #172033; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-log-filters { display: grid; grid-template-columns: minmax(220px, 1.6fr) 140px 140px 120px 110px 110px auto auto; gap: 7px; align-items: center; }
.admin-log-filters input,
.admin-log-filters select { width: 100%; min-width: 0; border: 1px solid #d8e0eb; background: #fff; color: #243247; border-radius: 9px; padding: 8px 9px; font: inherit; }
.admin-log-caption { color: #6d7888; font-size: 12px; }
.admin-log-table-wrap { max-width: 100%; overflow: auto; border: 1px solid #e1e7ef; border-radius: 10px; }
.admin-generation-log-table { min-width: 1280px; }
.admin-generation-log-table th { position: sticky; top: 0; z-index: 2; background: #f2f5f9; white-space: nowrap; }
.admin-generation-log-table td { vertical-align: top; }
.admin-generation-log-table td:nth-child(1) { white-space: nowrap; }
.admin-generation-log-table td:nth-child(2) { min-width: 110px; }
.admin-generation-log-table td:nth-child(5) { min-width: 150px; max-width: 240px; }
.admin-generation-log-table td:nth-child(6),
.admin-generation-log-table td:nth-child(7) { min-width: 110px; }
.admin-generation-log-table td span { display: block; }
.admin-generation-log-table td small { display: block; color: #7b8797; margin-top: 2px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.admin-log-status { display: inline-flex !important; align-items: center; justify-content: center; min-width: 45px; padding: 3px 7px; border-radius: 999px; background: #edf1f6; color: #546175; font-weight: 700; font-size: 11px; }
.admin-log-status.success { background: #e9f7ef; color: #157347; }
.admin-log-status.failed { background: #fdecec; color: #b42318; }
.admin-log-detail-row td { padding: 0 !important; background: #fbfcfe; }
.admin-log-detail-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 1px; background: #e7ecf3; border-top: 1px solid #e1e7ef; }
.admin-log-detail-grid > div { min-width: 0; background: #fff; padding: 8px 10px; }
.admin-log-detail-grid span { display: block; color: #7a8595; font-size: 10px; margin-bottom: 3px; }
.admin-log-detail-grid strong { display: block; color: #273448; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.admin-log-detail-long { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; border-top: 1px solid #e1e7ef; }
.admin-log-detail-long section { min-width: 0; border: 1px solid #e1e7ef; border-radius: 8px; background: #fff; overflow: hidden; }
.admin-log-detail-long h5 { margin: 0; padding: 7px 9px; font-size: 11px; background: #f4f7fa; border-bottom: 1px solid #e1e7ef; }
.admin-log-detail-long pre { margin: 0; padding: 9px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #39465a; font: 11px/1.45 Consolas, "Malgun Gothic", monospace; }
.admin-log-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; }
.admin-log-pagination strong { min-width: 70px; text-align: center; font-size: 12px; }
@media (max-width: 1350px) {
    .admin-log-summary { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
    .admin-log-filters { grid-template-columns: minmax(200px, 1fr) 130px 130px 110px 100px 100px; }
    .admin-log-filters button { width: 100%; }
    .admin-log-detail-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}


/* ADMIN_SIMPLIFIED_WORKSPACE_V36 */
.admin-products-workspace { margin-bottom: 2px; }
.admin-products-log-area { min-width: 0; }
.admin-products-log-area .admin-log-workspace { margin-top: 2px; }
@media (max-width: 1180px) {
    .admin-summary-cards { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

/* ADMIN_PRODUCT_CENTRIC_WORKSPACE_V37 */
.admin-product-workspace-head { align-items: flex-end; gap: 16px; }
.admin-product-count-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.admin-product-count-switch button {
    appearance: none;
    border: 1px solid #ccd7e6;
    background: #fff;
    border-radius: 14px;
    padding: 15px 18px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "label value" "sub sub";
    align-items: end;
    gap: 2px 12px;
    text-align: left;
    cursor: pointer;
    color: #172033;
}
.admin-product-count-switch button:hover { border-color: #8ca9d7; background: #f8fbff; }
.admin-product-count-switch button.active { border: 2px solid #2563eb; background: #f4f8ff; padding: 14px 17px; }
.admin-product-count-switch span { grid-area: label; font-size: 13px; font-weight: 800; }
.admin-product-count-switch strong { grid-area: value; justify-self: end; font-size: 26px; line-height: 1; }
.admin-product-count-switch small { grid-area: sub; margin-top: 5px; color: #718096; font-size: 11px; }
.admin-product-centric-workspace { padding: 14px; }
.admin-product-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
}
.admin-product-toolbar > div:first-child { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.admin-product-toolbar > div:first-child > strong { font-size: 17px; }
.admin-product-toolbar > div:first-child > span { color: #52627a; font-size: 12px; }
.admin-product-toolbar > div:first-child > small { color: #8a5a00; font-size: 11px; }
.admin-product-summary-table { min-width: 1180px; table-layout: fixed; }
.admin-product-summary-table th:nth-child(1) { width: 14%; }
.admin-product-summary-table th:nth-child(2) { width: 21%; }
.admin-product-summary-table th:nth-child(3) { width: 18%; }
.admin-product-summary-table th:nth-child(4) { width: 12%; }
.admin-product-summary-table th:nth-child(5) { width: 13%; }
.admin-product-summary-table th:nth-child(6) { width: 14%; }
.admin-product-summary-table th:nth-child(7) { width: 8%; }
.admin-product-summary-row > td { vertical-align: middle; }
.admin-product-summary-row.expanded > td { background: #f7faff; }
.admin-product-summary-row td strong { display: block; font-size: 12px; line-height: 1.35; }
.admin-product-summary-row td small { display: block; margin-top: 4px; color: #738198; font-size: 10px; line-height: 1.35; }
.admin-product-name-cell > div { display: flex; align-items: center; gap: 7px; }
.admin-product-name-cell > div > strong { color: #0f4fd6; font-size: 13px; }
.admin-product-state { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.admin-product-state.current { background: #e9f7ef; color: #19713c; }
.admin-product-state.running { background: #e8f1ff; color: #1458c7; }
.admin-product-state.queued { background: #fff6df; color: #8b5a00; }
.admin-product-state.archived { background: #f1f3f6; color: #697386; }
.admin-product-generation-cell strong { color: #17623a; }
.admin-product-actions-cell { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.admin-primary-small-btn {
    border: 1px solid #1f5ed6;
    background: #1f5ed6;
    color: #fff;
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.admin-product-expanded-row > td { padding: 0 !important; background: #f5f8fd; }
.admin-product-log-panel { padding: 14px 16px 16px; border-top: 1px solid #d7e1ef; border-bottom: 1px solid #d7e1ef; }
.admin-product-log-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.admin-product-log-panel-head > div { display: flex; align-items: baseline; gap: 7px; }
.admin-product-log-panel-head strong { font-size: 14px; color: #17345f; }
.admin-product-log-panel-head span { color: #67758a; font-size: 11px; }
.admin-product-log-table-wrap { max-height: 480px; overflow: auto; border: 1px solid #dfe6f0; border-radius: 10px; background: #fff; }
.compact-product-log { min-width: 1040px; }
.compact-product-log th, .compact-product-log td { padding-top: 8px; padding-bottom: 8px; }
.admin-log-pagination.compact { margin-top: 10px; }
.admin-loading.compact { padding: 20px; min-height: 80px; }
@media (max-width: 980px) {
    .admin-product-count-switch { grid-template-columns: 1fr; }
    .admin-product-toolbar { align-items: stretch; flex-direction: column; }
    .admin-product-workspace-head { align-items: stretch; flex-direction: column; }
}

/* ADMIN_AI_SETTINGS_CENTER_V2_SIMPLE */
.admin-ai-settings-wrap { display: grid; gap: 14px; padding: 14px; max-width: 1240px; margin: 0 auto; }
.admin-ai-simple-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
    padding: 18px 20px; border: 1px solid #d8e2f0; border-radius: 16px; background: #f8fbff;
}
.admin-ai-simple-head h2 { margin: 4px 0 6px; font-size: 22px; color: #14213d; }
.admin-ai-simple-head p { margin: 0; max-width: 760px; color: #5d6b80; font-size: 12px; line-height: 1.55; }
.admin-ai-saved-state { flex: 0 0 auto; padding: 8px 11px; border-radius: 999px; background: #edf7f1; color: #24633e; font-size: 10px; font-weight: 800; }
.admin-ai-warning { padding: 11px 13px; border: 1px solid #f0c36a; border-radius: 10px; background: #fff8e7; color: #765000; font-size: 11px; line-height: 1.45; }
.admin-ai-card { border: 1px solid #dce4ee; border-radius: 14px; background: #fff; padding: 16px; }
.admin-ai-easy-card { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 14px; align-items: start; }
.admin-ai-number { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #172033; color: #fff; font-size: 13px; font-weight: 900; }
.admin-ai-easy-body { min-width: 0; }
.admin-ai-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.admin-ai-card-head h3 { margin: 0 0 4px; font-size: 15px; color: #172033; }
.admin-ai-card-head p { margin: 0; color: #6e7b8f; font-size: 11px; line-height: 1.5; }
.admin-ai-form-grid, .admin-ai-prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-ai-form-grid label, .admin-ai-prompt-grid label, .admin-ai-note-label { display: grid; gap: 6px; color: #334158; font-size: 11px; font-weight: 800; }
.admin-ai-form-grid label small, .admin-ai-prompt-grid label small { color: #8190a5; font-size: 9px; font-weight: 500; line-height: 1.45; }
.admin-ai-form-grid input, .admin-ai-note-label input, .admin-ai-prompt-grid textarea {
    width: 100%; box-sizing: border-box; border: 1px solid #cfd8e5; border-radius: 9px; background: #fff; color: #172033;
    font: inherit; font-weight: 500; outline: none;
}
.admin-ai-form-grid input, .admin-ai-note-label input { min-height: 40px; padding: 8px 10px; }
.admin-ai-prompt-grid textarea { min-height: 88px; resize: vertical; padding: 9px 10px; line-height: 1.45; }
.admin-ai-form-grid input:focus, .admin-ai-note-label input:focus, .admin-ai-prompt-grid textarea:focus { border-color: #5e8fe7; box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.admin-ai-safety-note { margin-top: 11px; padding: 10px 12px; border-radius: 9px; background: #f3f6fa; color: #5f6d80; font-size: 10px; line-height: 1.5; }
.admin-ai-safety-note strong { color: #24344f; }
.admin-ai-save-card {
    display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px 16px;
    border: 1px solid #cfdced; border-radius: 14px; background: #fff; padding: 14px 16px;
}
.admin-ai-save-card > div:first-child { display: grid; gap: 3px; }
.admin-ai-save-card strong { color: #22324c; font-size: 11px; }
.admin-ai-save-card span { color: #7a8799; font-size: 9px; }
.admin-ai-big-save { appearance: none; border: 1px solid #1f5ed6; background: #1f5ed6; color: #fff; border-radius: 9px; padding: 10px 16px; font-size: 11px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.admin-ai-big-save:hover { background: #174eb6; border-color: #174eb6; }
.admin-ai-message { grid-column: 1 / -1; min-height: 16px; color: #21623b; font-size: 10px; font-weight: 700; }
.admin-ai-message.error { color: #b42318; }
.admin-ai-advanced { border: 1px solid #dce4ee; border-radius: 14px; background: #f8fafc; overflow: hidden; }
.admin-ai-advanced > summary { cursor: pointer; list-style: none; padding: 13px 16px; font-size: 11px; font-weight: 900; color: #2b3a52; user-select: none; }
.admin-ai-advanced > summary::-webkit-details-marker { display: none; }
.admin-ai-advanced > summary::before { content: '▶'; display: inline-block; width: 17px; color: #6c7b91; font-size: 9px; transform-origin: 45% 50%; transition: transform .15s ease; }
.admin-ai-advanced[open] > summary::before { transform: rotate(90deg); }
.admin-ai-advanced-body { display: grid; gap: 12px; padding: 0 12px 12px; }
.admin-ai-advanced-model-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-ai-note-advanced { margin-top: 12px; }
.admin-ai-history { display: grid; gap: 8px; }
.admin-ai-history-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 11px; border: 1px solid #e0e6ef; border-radius: 10px; background: #fbfcfe; }
.admin-ai-history-main { min-width: 0; display: grid; gap: 2px; }
.admin-ai-history-main strong { color: #20304a; font-size: 11px; }
.admin-ai-history-main span { color: #68778b; font-size: 10px; }
.admin-ai-history-main small { color: #8994a4; font-size: 9px; word-break: break-word; }
.admin-ai-history-row button { appearance: none; border: 1px solid #c8d3e2; background: #fff; color: #26354d; border-radius: 8px; padding: 8px 11px; font-size: 10px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.admin-ai-history-row button:hover { background: #f6f9fd; border-color: #9eb2cf; }
.admin-ai-tech-meta { margin-top: 9px; color: #8a96a7; font-size: 9px; }
@media (max-width: 980px) {
    .admin-ai-settings-wrap { padding: 10px; }
    .admin-ai-simple-head { flex-direction: column; align-items: stretch; }
    .admin-ai-form-grid, .admin-ai-prompt-grid, .admin-ai-advanced-model-grid { grid-template-columns: 1fr; }
    .admin-ai-save-card { grid-template-columns: 1fr; }
    .admin-ai-message { grid-column: 1; }
    .admin-ai-easy-card { grid-template-columns: 30px minmax(0,1fr); gap: 10px; }
    .admin-ai-history-row { align-items: stretch; flex-direction: column; }
}
