/* --- Design Tokens --- */
:root {
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-color-focus: #3b82f6;
    
    /* Brand Palette */
    --color-primary: #1e3a8a; /* Deep Slate Blue */
    --color-primary-hover: #172554;
    --color-accent-blue: #2563eb;
    --color-accent-green: #10b981;
    --color-accent-orange: #f97316;
    --color-light-blue: #dbeafe;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Fonts */
    --font-heading: 'Outfit', 'Noto Sans JP', sans-serif;
    --font-body: 'Inter', 'Noto Sans JP', sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2.2rem;
    color: var(--color-accent-green);
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.sub-brand {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.club-info-badge {
    background-color: var(--color-light-blue);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent-blue);
}

/* Main Workspace Grid */
.app-main {
    display: grid;
    grid-template-columns: 52% 48%;
    gap: 20px;
    align-items: start;
    flex-grow: 1;
}

/* --- Catalog Section (Left) --- */
.catalog-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title-bar h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
}

.badge {
    background-color: var(--text-secondary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.catalog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Candidate Card */
.cand-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

.cand-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.cand-header-bar {
    padding: 12px 18px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cand-brand-badge {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
}

.cand-votes-stat {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent-green);
    background-color: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
}

.cand-body-flex {
    display: flex;
    padding: 16px;
    gap: 16px;
}

/* Carousel/Images inside Card */
.cand-image-container {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cand-main-image-wrapper {
    width: 100%;
    height: 170px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    overflow: hidden;
}

.cand-main-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cand-main-image-wrapper svg {
    max-width: 100%;
    max-height: 100%;
}

.cand-thumbs-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.cand-thumb-btn {
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--border-color);
    background-color: #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2px;
    transition: var(--transition-fast);
}

.cand-thumb-btn img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cand-thumb-btn svg {
    max-width: 100%;
    max-height: 100%;
}

.cand-thumb-btn:hover {
    border-color: #94a3b8;
}

.cand-thumb-btn.active {
    border-color: var(--color-accent-blue);
    background-color: var(--color-light-blue);
}

/* Specifications details inside Card */
.cand-details-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cand-name-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.cand-price-tag {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-accent-orange);
    margin-bottom: 8px;
}

.spec-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.spec-list-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.spec-list-table tr:last-child {
    border-bottom: none;
}

.spec-list-table td {
    padding: 4px 0;
}

.spec-label {
    width: 80px;
    font-weight: 600;
    color: var(--text-secondary);
}

.spec-val {
    color: var(--text-primary);
}

.spec-features-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.spec-feat-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #f1f5f9;
    color: var(--text-secondary);
}

.btn-select-for-vote {
    width: 100%;
    background-color: var(--color-accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-select-for-vote:hover {
    background-color: #1d4ed8;
}


/* --- Right Column: Tabs & Control Panels --- */
.control-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 700px;
}

/* Tab Headers */
.tab-navigation {
    display: flex;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--color-accent-blue);
    border-bottom-color: var(--color-accent-blue);
    font-weight: 700;
}

/* Tab Contents */
.tab-content-container {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: contentFadeIn 0.3s ease;
}

.content-header {
    margin-bottom: 20px;
}

.content-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.content-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}


/* --- Tab 1: Member Vote Form --- */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input[type="text"], .form-group select {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.size-helper-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-submit-registration {
    background-color: var(--color-accent-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-submit-registration:hover {
    background-color: #059669;
}

.recent-votes-section h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.vote-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.timeline-item {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: timelineEntry 0.3s ease;
}

.time-item-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.time-name {
    font-weight: 600;
    color: var(--text-primary);
}

.time-spec {
    color: var(--text-muted);
}

.time-vote-badge {
    background-color: var(--color-light-blue);
    color: var(--color-accent-blue);
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}

.time-comment {
    font-style: italic;
    color: var(--text-secondary);
    margin-left: 8px;
}


/* --- Tab 2: Dashboard Results --- */
.results-grid {
    margin-bottom: 20px;
}

.results-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.results-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
}

/* Custom CSS Horizontal bar charts */
.simple-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-row {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.chart-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.chart-bar-track {
    background-color: #e2e8f0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background-color: var(--color-accent-blue);
    border-radius: 6px;
    width: 0;
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.chart-val-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.selection-final-uniform {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selection-final-uniform label {
    font-size: 0.85rem;
    color: var(--color-primary);
}

.selection-final-uniform select {
    background-color: #fff;
    border: 1px solid #93c5fd;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    outline: none;
}

.helper-text-inline {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Size Matrix Table */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header-flex h4 {
    margin-bottom: 0;
}

.badge-price-calc {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-accent-orange);
    background-color: rgba(249, 115, 22, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #fff;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: center;
}

.matrix-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 8px;
    border-bottom: 2px solid var(--border-color);
}

.matrix-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.matrix-table tr:hover td {
    background-color: #f8fafc;
}

.matrix-total-highlight {
    font-weight: 700;
    color: var(--color-accent-blue);
}

/* Roster list table */
.list-table-container {
    max-height: 250px;
    overflow-y: auto;
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: left;
}

.roster-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

.roster-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-primary);
}

.roster-table tr:hover td {
    background-color: #f8fafc;
}

.editable-member-name {
    border-bottom: 1px dashed var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 2px;
}

.editable-member-name:hover {
    background-color: rgba(37, 99, 235, 0.05);
    border-bottom-color: var(--color-accent-blue);
}

.editable-member-name:focus {
    background-color: #fff;
    border: 1px solid var(--color-accent-blue);
    outline: none;
    cursor: text;
}

.roster-table select {
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    outline: none;
}

.roster-table select:focus {
    border-color: var(--color-accent-blue);
}

.btn-delete-member {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    transition: var(--transition-fast);
}

.btn-delete-member:hover {
    color: #ef4444;
}

.export-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.btn-export-primary {
    background-color: var(--color-accent-green);
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-export-primary:hover {
    background-color: #059669;
}

.btn-export-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-export-secondary:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}


/* --- Tab 3: Admin Candidate Editor --- */
.admin-selector-box {
    margin-bottom: 20px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.admin-selector-box select {
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    margin-left: 10px;
    width: 250px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sizes-checkbox-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
}

.checkbox-label {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Image upload boxes */
.image-upload-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.uploaders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 10px;
}

.uploader-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.drop-zone {
    height: 80px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background-color: #f8fafc;
    transition: var(--transition-fast);
    position: relative;
}

.drop-zone:hover {
    border-color: var(--color-accent-blue);
    background-color: var(--color-light-blue);
}

.drop-zone i {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.drop-zone span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-preview-thumb {
    height: 60px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 2px;
}

.upload-preview-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.upload-preview-thumb svg {
    max-width: 100%;
    max-height: 100%;
}

.btn-save-admin {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.btn-save-admin:hover {
    background-color: var(--color-primary-hover);
}


/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1e293b;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-lg);
    padding: 12px 24px;
    border-radius: 50px;
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast span {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}


/* --- Animations --- */
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes timelineEntry {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 10px;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .club-info-badge {
        width: 100%;
        justify-content: center;
    }
    
    .cand-body-flex {
        flex-direction: column;
    }
    
    .cand-image-container {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .uploaders-grid {
        grid-template-columns: 1fr;
    }
    
    .export-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* Brand Filter Buttons */
.brand-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.brand-filter-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.brand-filter-btn:hover {
    color: var(--text-primary);
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.brand-filter-btn.active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.2);
}

/* ===========================
   登録フォーム
=========================== */
.registration-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.registration-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reg-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reg-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.reg-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.reg-form input[type="text"],
.reg-form select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
    width: 100%;
    background: #fff;
}

.reg-form input[type="text"]:focus,
.reg-form select:focus {
    border-color: var(--color-accent-blue);
}

.btn-register {
    background-color: var(--color-accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-register:hover {
    background-color: #1d4ed8;
}

.optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ===========================
   登録済み一覧
=========================== */
.members-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
}

.members-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.vote-cell {
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================
   カード: 実画像バッジ・リンク
=========================== */
.upload-badge {
    font-size: 0.7rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 8px;
    vertical-align: middle;
}

.cand-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--color-accent-blue);
    text-decoration: none;
    margin-top: 6px;
}

.cand-link:hover {
    text-decoration: underline;
}

/* ===========================
   ボタン調整
=========================== */
.btn-action-small.danger {
    color: #ef4444;
    border-color: #fca5a5;
}

.btn-action-small.danger:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

/* カタログカード */
.candidate-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-brand-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.card-image-area {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cand-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-thumbnails {
    display: flex;
    gap: 6px;
}

.cand-thumb-btn {
    width: 52px;
    height: 52px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: #f8fafc;
    padding: 0;
    transition: border-color var(--transition-fast);
}

.cand-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cand-thumb-btn.active {
    border-color: var(--color-accent-blue);
}

.cand-thumb-btn:hover {
    border-color: var(--color-accent-blue);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cand-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.cand-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-accent-orange);
}

.cand-price .tax {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.cand-sizes {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.feature-tag {
    font-size: 0.68rem;
    background: var(--color-light-blue);
    color: var(--color-accent-blue);
    border-radius: 4px;
    padding: 2px 7px;
    font-weight: 600;
}

.card-number-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-primary);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0,0,0,0.30);
    letter-spacing: -1px;
}

.candidate-card {
    position: relative;
}

.cand-number-inline {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-light-blue);
    border-radius: 4px;
    padding: 1px 6px;
    margin-right: 4px;
}

/* ── 希望選択ボタン ── */
.card-vote-btns {
    display: flex;
    gap: 6px;
    padding: 8px 12px 4px;
}

.vote-btn {
    flex: 1;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    white-space: nowrap;
}
.vote-btn:hover { filter: brightness(0.95); }

.vote-btn-1        { border-color: #2563eb; color: #2563eb; }
.vote-btn-1.selected { background: #2563eb; color: #fff; border-color: #2563eb; }

.vote-btn-2        { border-color: #059669; color: #059669; }
.vote-btn-2.selected { background: #059669; color: #fff; border-color: #059669; }

.vote-btn-3        { border-color: #d97706; color: #d97706; }
.vote-btn-3.selected { background: #d97706; color: #fff; border-color: #d97706; }

/* カードの選択ハイライト */
.candidate-card.vote1-selected { outline: 3px solid #2563eb; outline-offset: -2px; }
.candidate-card.vote2-selected { outline: 3px solid #059669; outline-offset: -2px; }
.candidate-card.vote3-selected { outline: 3px solid #d97706; outline-offset: -2px; }

/* ── 希望グループ（ドロップダウン＋コメント） ── */
.vote-group {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vote-comment {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    resize: none;
    transition: border-color var(--transition-fast);
    background: #fff;
    color: var(--text-secondary);
}
.vote-comment:focus {
    outline: none;
    border-color: var(--border-color-focus);
}
.vote-comment::placeholder {
    color: #b0bec5;
    font-style: italic;
}

.table-comment {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── 管理者ロックUI ── */
.admin-locked-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 16px;
    gap: 12px;
}

.lock-icon {
    font-size: 2.2rem;
    color: var(--text-muted);
}

.lock-msg {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.admin-pw-row {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

.admin-pw-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: border-color var(--transition-fast);
}
.admin-pw-input:focus {
    outline: none;
    border-color: var(--border-color-focus);
}

.btn-admin-unlock {
    padding: 8px 16px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    white-space: nowrap;
}
.btn-admin-unlock:hover { background: var(--color-primary-hover); }

.admin-action-bar {
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.btn-action-small.success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #6ee7b7;
}
.btn-action-small.success:hover { background: #d1fae5; }

/* ── カードコメント欄 ── */
.card-comment-wrap {
    margin: 0 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-comment-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-vote-comment {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid var(--border-color-focus);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.84rem;
    resize: none;
    background: #fff;
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}
.card-vote-comment:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.card-vote-comment::placeholder { color: #b0bec5; font-style: italic; }

/* ── 必須バッジ ── */
.required-badge {
    font-size: 0.68rem;
    font-weight: 700;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── ローカルモードバナー ── */
.local-mode-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #78350f;
}
.local-mode-banner i { color: #b45309; }

/* ── 下書きバナー ── */
.draft-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    border: 1.5px solid #fbbf24;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #92400e;
}
.draft-banner i { color: #d97706; }
.draft-banner span { flex: 1; }

.btn-draft-clear {
    background: none;
    border: 1px solid #fbbf24;
    border-radius: 4px;
    color: #92400e;
    font-size: 0.78rem;
    padding: 2px 8px;
    cursor: pointer;
}
.btn-draft-clear:hover { background: #fef3c7; }

/* ── フォームボタン行（一時保存＋登録） ── */
.form-btn-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-draft {
    flex: 0 0 auto;
    padding: 12px 16px;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.btn-draft:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: var(--text-primary);
}

.btn-register {
    flex: 1;
}

