:root {
    --primary-color: #005bb5;
    /* Enhanced contrast for 40+ */
    --secondary-color: #0088cc;
    --accent-color: #e67e22;
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Softer, premium shadow */
    --text-color: #1a2a3a;
    /* Darker for better legibility */
    --text-muted: #5a6a7a;
    --error-color: #d32f2f;
    --success-color: #2e7d32;
    --warning-color: #ed6c02;
    --border-color: #ced4da;
    --input-focus: #005bb5;
}

.hidden {
    display: none !important;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    background: linear-gradient(135deg, #eef6ff 0%, #f4f7f9 100%) fixed;
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}
.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
    transition: max-width 0.3s ease; /* Smooth transition when widening */
}


.container.view-wide {
    max-width: 98%; /* Use almost full screen width for dashboard/reception */
    width: 1800px;  /* But cap it for extremely wide screens to stay usable */
}


/* Navbar - Slimmed down and simplified */
.navbar {
    background: #ffffff;
    border-bottom: 2px solid var(--primary-color);
    padding: 0.5rem 0;
    /* Reduced height */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    transition: max-width 0.3s ease;
}

.container.view-wide .nav-container,
.view-wide .nav-container {
    max-width: 1450px;
}

#app-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
}

.nav-links {
    display: none;
    /* Hide top nav links for standard users as requested */
}

/* Admin Toolbar - Professional Overlay */
.admin-toolbar {
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e1e8ed;
    padding: 0.75rem 1rem;
    z-index: 5000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.admin-toolbar .toolbar-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    transition: max-width 0.3s ease;
}

.view-wide .admin-toolbar .toolbar-content {
    max-width: 1450px;
}

.btn-toolbar {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toolbar.active {
    background: var(--primary-color);
    color: white;
}

.btn-toolbar.logout {
    color: var(--error-color);
    background: rgba(231, 76, 60, 0.05);
}

/* Version Display logic */
body {
    padding-bottom: 30px; /* Minimal default padding */
}

body.view-dashboard-view,
body.view-reception-view {
    padding-bottom: 80px; /* Leave room for admin toolbar */
}

/* Views & Overlays */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

.timeframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(240, 244, 248, 0.95);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.timeframe-message {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--primary-color);
}

.timeframe-message h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 400px;
    width: 90%;
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards - Section Styling */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid #e1e8ed;
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid #f0f4f8;
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 1.4rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap; /* Prevents vertical wrapping (v7.6.1) */
}

.source-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap; /* v7.6.1: Force single line on mobile */
}

.card h2::before {
    content: "";
    width: 6px;
    height: 1.4rem;
    background: var(--primary-color);
    border-radius: 3px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 1.5rem 0 1rem 0; /* Reduced from 3.5rem top margin (v7.3.3) */
    padding: 0.6rem 1.2rem;
    background: #f0f7ff;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
}

.form-section-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 2px solid #e1e8ed;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.form-section-card .form-group:last-child {
    margin-bottom: 0;
}

/* Form Elements - High Contrast & Large Targets */
.form-group {
    margin-bottom: 1.8rem; /* Increased from 1.2rem */
}

.form-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end; /* Align inputs to the bottom */
    flex-wrap: wrap;
    margin-top: 0.5rem; /* Reduced from 1rem (v7.3.3) */
}

/* Participant row density (v7.3.3) */
.participant-row .form-group {
    margin-bottom: 0.4rem !important; /* Extremely tight */
}

.participant-row .form-row {
    margin-top: 0.1rem !important;
    gap: 0.5rem !important; /* Reduced for mobile flow (v7.5.2) */
}

.participant-row {
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #eee;
    margin-bottom: 0.5rem;
}

.participant-row:last-child {
    border-bottom: none;
}

label {
    display: block;
    margin-bottom: 0.4rem; /* Reduced for better density */
    font-weight: 700;
    font-size: 0.95rem; /* Slightly smaller for density */
    color: var(--text-color);
}

/* Fix for label wrapping causing misalignment in rows */
.form-row .form-group label {
    min-height: auto; /* Allow auto dynamic height */
    display: flex;
    align-items: flex-end;
    padding-bottom: 1px;
}

.required {
    color: var(--error-color);
    margin-left: 0.25rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem;
    /* Better touch target */
    border: 2px solid #ced4da;
    /* Thicker border for better visibility */
    border-radius: 8px;
    font-size: 1.1rem;
    /* Larger font */
    background: #ffffff;
    color: var(--text-color);
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 91, 181, 0.1);
}

#add-participant {
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    color: #64748b;
    padding: 1.2rem;
    font-weight: 800;
    font-size: 1.15rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 1.5rem 0 2.5rem 0;
    width: 100%;
}

#add-participant:hover {
    background-color: #f1f5f9;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#add-participant:active {
    transform: translateY(0);
}

/* Participant Card (Mobile/Desktop Optimized) */
.participant-row {
    background: #ffffff;
    padding: 1rem 0.85rem; /* Aggressively slimmed (v7.5.2) */
    border-radius: 10px;
    margin-bottom: 0.8rem;
    border: 2px solid #dee2e6;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    display: flex;
    flex-direction: column;
    /* Use column for better mobile flow by default */
    gap: 0.25rem;
}

/* Participant row header label */
.participant-label {
    font-weight: bold;
    font-size: 1.1rem;
    background: #f0f7ff;
    padding: 0.3rem 0.75rem;
    margin-bottom: 0.6rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.label-rep {
    font-size: 0.75rem;
    background: var(--primary-color);
    color: white;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: normal;
    vertical-align: middle;
}

/* On Desktop, keep vertical card layout for readability.
   form-row inside handles the horizontal flow naturally. */
@media (min-width: 992px) {
    .participant-row {
        gap: 0.5rem;
    }

    .participant-row .form-row {
        flex-wrap: nowrap;
    }
}

.participant-row .row-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.participant-row .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 91, 181, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 91, 181, 0.3);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #e0e0e0;
    color: var(--text-color);
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 600;
}

#add-participant {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: white;
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 1.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    transition: all 0.2s;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 91, 181, 0.15);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--error-color);
}

/* Dashboard Row Styles */
.row-checked-in {
    background-color: rgba(39, 174, 96, 0.05);
}

.row-cancelled {
    background-color: #f1f3f5;
    opacity: 0.6;
}

.row-cancelled td {
    color: #999;
    text-decoration: line-through;
}

.row-cancelled .badge {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* Capacity Split Grid - Premium Cards */
.capacity-split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.split-card {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--primary-color); /* Ensure one consistent border */
}

.split-card:nth-child(2) { border-top-color: var(--error-color); }
.split-card:nth-child(3) { border-top-color: #00b894; }
.split-card:nth-child(4) { border-top-color: #e17055; }


.split-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}



.split-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.split-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
}

.split-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Stats-list - Simple and Clean per request */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem; /* Extremely tight gap (v7.8.3) */
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.breakdown-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.8rem; /* Reduced padding (v7.8.3) */
    border: 1px solid #e2e8f0;
}

.breakdown-card .section-title {
    margin: 0 0 0.5rem 0 !important; /* Reduced margin (v7.8.3) */
    background: transparent;
    padding: 0;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.75rem;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0.6rem; /* Tightened row padding (v7.8.3) */
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.9rem;
}

.stats-label {
    font-weight: 600;
    color: #475569;
}

/* --- Public Stats Dashboard (v7.3) --- */
.public-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.public-stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    text-align: left;
    transition: transform 0.2s ease;
    border-top: 6px solid var(--primary-color);
}

.public-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.public-stat-label {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-stat-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 1rem 0;
}

.public-stat-value {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--text-dark);
}

.public-stat-unit {
    font-size: 1rem;
    color: var(--text-muted);
}

.public-stat-capacity {
    margin-top: auto;
    font-size: 0.9rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
}

.public-stat-capacity strong {
    color: var(--primary-color);
}

.public-progress-container {
    margin-top: 1rem;
    height: 12px;
    background: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
}

.public-progress {
    height: 100%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-ippan { background: #0984e3 !important; }
.bg-mintsuri { background: #6c5ce7 !important; }
.bg-suiho { background: #00b894 !important; }
.bg-harimitsu { background: #e17055 !important; }

.stats-count {
    font-weight: 800;
    color: var(--primary-color);
}

/* Dashboard Premium Summary Cards (v5.3 Compact) */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns on mobile */
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .stats-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.summary-card {
    background: white;
    padding: 1rem 0.8rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    text-align: center;
    border-top: 5px solid #cbd5e1; /* Default soft gray */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
}

.summary-value small {
    font-size: 0.8rem;
    font-weight: 400;
    color: #94a3b8;
}

.badge-ippan { background-color: #0984e3 !important; }
.badge-mintsuri { background-color: #6c5ce7 !important; }
.badge-suiho { background-color: #00b894 !important; }
.badge-harimitsu { background-color: #e17055 !important; }


/* Result Card (Screenshot Optimization) - v4.8 */
.result-card {
    text-align: center;
    padding: 1rem !important;
    max-width: 500px;
    margin: 0 auto;
}

.result-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

/* High Contrast Entry Number (v5.1) */
.entry-number-container {
    background: #003366; /* Deep Navy Background */
    border: none;
    border-radius: 12px;
    padding: 1.2rem;
    margin: 0.75rem 0;
    box-shadow: 0 8px 16px rgba(0,51,102,0.2);
}

.entry-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffffff; /* Explicit White Text */
    line-height: 1;
    letter-spacing: 2px;
}

.result-details {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.result-details p {
    margin: 0;
}

.result-card .alert {
    padding: 0.75rem;
    margin-top: 0.75rem !important;
    font-size: 0.9rem;
}

/* Button & Link Visual Fixes */
.btn-primary.w-100, .btn-secondary.w-100 {
    white-space: normal; /* Allow multi-line if needed on narrow phones */
    line-height: 1.3;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 3.5rem;
}

@media (max-width: 480px) {
    .btn-primary.w-100 {
        font-size: 1.1rem !important;
        padding: 0.8rem !important;
    }
    .entry-number {
        font-size: 2.5rem;
    }
}

.reception-sidebar {
    border-right: 1px solid #eee;
    padding-right: 1.5rem;
}

.reception-group-list {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

th, td {
    padding: 0.4rem 0.6rem; /* Tightened row spacing */
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

th {
    background-color: #f8fafc;
    font-weight: 800;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.reception-group-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.reception-group-item.active {
    background: #e7f3ff;
    border-left: 4px solid var(--primary-color);
}

.reception-desk {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #eee;
}

/* Ikesu Assignment UI */
.ikesu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: min-content;
    gap: 1.5rem;
}

.ikesu-box {
    background: white;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
}

.ikesu-box.drag-over {
    background: #e7f3ff;
    border-color: var(--primary-color);
}

.drag-item-group {
    background: white;
    border: 1px solid #ddd;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    user-select: none;
    -webkit-user-select: none;
}

.drag-item-group.draggable {
    cursor: grab;
    touch-action: none;
}

.drag-item-participants {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #eee;
    display: none;
}

.drag-item-participants.expanded {
    display: block;
}

/* Toast System */
.toast-container {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
}

.toast {
    background: #333;
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
}

/* --- Admin Tab Navigation --- */
.admin-tab-nav {
    display: flex;
    flex-wrap: wrap; 
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 12px;
}

.admin-tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 1rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    white-space: nowrap;
    text-align: center;
}

.admin-tab-btn:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.admin-tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 91, 181, 0.3);
}

.admin-tab-content {
    display: none;
}

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

@media (max-width: 768px) {
    body {
        line-height: 1.3 !important;
        font-size: 22px !important;
    }

    .container {
        margin: 0 !important;
        padding: 0 0.75rem !important;
        max-width: 98% !important;
    }

    .navbar {
        padding: 0 !important;
    }

    #app-title {
        font-size: 1.2rem !important;
    }

    .nav-container {
        flex-direction: row;
        justify-content: center;
    }

    .card {
        padding: 0.2rem !important;
        border-radius: 4px !important;
        margin-bottom: 0.2rem !important;
        box-shadow: none !important;
        border: 1px solid #eee !important;
    }

    .card-header {
        margin-bottom: 0.1rem !important;
        padding-bottom: 0.05rem !important;
    }

    .card h2 {
        font-size: 1.15rem !important;
    }

    .section-title {
        margin: 0.3rem 0 0.1rem 0 !important;
        font-size: 1rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    .form-group {
        margin-bottom: 0 !important;
    }

    .form-row {
        gap: 1rem !important;
    }

    input,
    select,
    textarea {
        padding: 0.5rem 0.6rem !important;
        font-size: 1.1rem !important;
        border-width: 1px !important;
        border-radius: 4px !important;
    }

    label {
        font-size: 1rem !important;
        margin-bottom: 0.1rem !important;
        font-weight: bold !important;
        color: #444 !important;
    }

    .admin-tab-nav {
        gap: 0.5rem;
        padding: 0.4rem;
    }
    
    .admin-tab-btn {
        min-width: calc(50% - 0.25rem); /* 2 columns on mobile */
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }

    .participant-row {
        padding: 0.4rem 0.5rem !important;
        margin-bottom: 0.4rem !important;
        gap: 0.1rem !important;
        border-left: 3px solid var(--primary-color) !important;
    }

    .participant-label {
        padding-bottom: 0.3rem !important;
        margin-bottom: 0.5rem !important;
        font-size: 1rem !important;
        border-bottom: 1px solid #eee !important;
    }

    #add-participant {
        padding: 0.8rem !important;
        font-size: 1.1rem !important;
        margin-top: 1.5rem !important;
        margin-bottom: 2rem !important;
        border-width: 2px !important;
    }

    /* Table density */
    th,
    td {
        padding: 0.3rem 0.2rem !important;
        font-size: 0.8rem !important;
    }

    /* Button slimming */
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.9rem !important;
        border-radius: 4px !important;
    }

    /* Reception & List items */
    .reception-group-item {
        padding: 0.3rem 0.5rem !important;
        margin-bottom: 0.15rem !important;
    }

    .reception-desk {
        padding: 0.3rem !important;
    }

    /* Override utility margins for absolute density on mobile */
    .mt-1 {
        margin-top: 0.02rem !important;
    }

    .mt-2 {
        margin-top: 0.05rem !important;
    }

    .mt-3 {
        margin-top: 0.1rem !important;
    }

    .mt-4 {
        margin-top: 0.15rem !important;
    }

    .mb-4 {
        margin-bottom: 0.15rem !important;
    }

    .ikesu-grid {
        gap: 0.4rem !important;
        grid-template-columns: 1fr;
    }

    .ikesu-box {
        padding: 0.3rem !important;
        min-height: auto !important;
    }

    /* Footer slimming */
    .footer .container {
        padding: 0.5rem 0 !important;
    }
}

/* Admin Toolbar (Bottom) */
.admin-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #2c3e50;
    color: white;
    z-index: 2001;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.toolbar-content {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
}

.btn-toolbar {
    background: transparent;
    border: none;
    color: #bdc3c7;
    padding: 0.6rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    flex: 1;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
}

.btn-toolbar.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.btn-toolbar.logout {
    color: #e74c3c;
}

/* --- Registration Confirmation Styles --- */
.confirm-box {
    background: #f8fbff;
    border: 1px solid #d1e3f8;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.confirm-box p {
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Improved alignment */
    border-bottom: 1px dashed #e1e8ed;
    padding-bottom: 0.4rem;
}

.confirm-box p:last-child {
    border-bottom: none;
}

.confirm-box strong {
    font-size: 0.95rem; /* Slightly larger labels for better ratio */
    color: #5a6a7a;
    font-weight: 700;
    flex-shrink: 0;
}

.confirm-box span {
    font-size: 1.0rem; /* Adjusted from 1.1rem for better balance */
    color: var(--text-color);
    font-weight: 800;
    text-align: right;
    word-break: break-all;
    margin-left: 1rem;
    background: #fff;
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

#conf-participant-summary li {
    background: white;
    margin-bottom: 0.4rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #eee;
    list-style: none;
    font-weight: 700;
}

/* --- Premium Result Card (Screenshot Area) --- */
.result-card {
    text-align: center;
    padding: 1.5rem 1rem !important; /* Reduced from 3rem */
    background: linear-gradient(135deg, #ffffff 0%, #eef7ff 100%) !important;
    border: 5px double var(--primary-color) !important; /* Slightly thinner */
    border-radius: 16px !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 91, 181, 0.15) !important;
}

.result-card::after {
    content: "REGISTERED";
    position: absolute;
    top: 12px;
    right: -28px;
    background: var(--primary-color);
    color: white;
    padding: 3px 35px;
    transform: rotate(45deg);
    font-size: 0.6rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.result-card::before {
    content: "✅";
    font-size: 3rem; /* Reduced from 5rem */
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.result-card h3 {
    font-size: 1.5rem; /* Reduced from 2rem */
    color: var(--success-color);
    margin-bottom: 1rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.entry-number-container {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 1.5rem; /* Reduced from 2rem 2.5rem */
    border-radius: 14px;
    margin: 1rem auto;
    display: inline-block;
    min-width: 200px; /* Reduced from 260px */
    box-shadow: 0 8px 20px rgba(0, 91, 181, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.entry-number-container .label {
    display: block;
    font-size: 0.9rem; /* Reduced from 1.1rem */
    margin-bottom: 0.2rem;
    opacity: 0.9;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.entry-number {
    font-size: 2.5rem; /* Reduced from 4rem */
    font-weight: 900;
    letter-spacing: 3px;
    display: block;
    line-height: 1;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.result-details {
    background: white;
    padding: 1rem; /* Reduced from 1.2rem */
    border-radius: 12px;
    margin-top: 1rem; /* Reduced from 2rem */
    border: 1px solid #e1e8ed;
    text-align: left;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.result-details p { margin-bottom: 0.3rem; font-size: 0.95rem; }

.result-recovery-info {
    margin-top: 1rem;
    padding: 0.8rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: left;
    font-size: 0.8rem;
}

.result-recovery-info h4 {
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.2rem;
}

.result-recovery-info ul {
    margin-top: 0.4rem;
    padding-left: 1.2rem;
    color: #475569;
}

.result-details p {
    margin-bottom: 0.4rem;
    font-size: 1rem; /* Reduced from 1.1rem */
    border-bottom: 1px dashed #f0f4f8;
    padding-bottom: 0.3rem;
}

.result-details strong {
    color: var(--text-muted);
    font-weight: 700;
    width: 7rem;
    display: inline-block;
}

/* --- Reception List High-Visibility & Color Coding (v6.0) --- */
.reception-group-item {
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
    border-radius: 10px !important;
    background: #fff !important;
    border: 1px solid #e1e8ed !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03) !important;
    width: 100% !important;
    cursor: pointer;
}

.reception-group-item.active {
    border-color: var(--primary-color) !important;
    background: #f0f7ff !important;
    box-shadow: 0 4px 12px rgba(0, 91, 181, 0.1) !important;
}

.badge-ippan { background-color: #0984e3 !important; color: white !important; }
.badge-mintsuri { background-color: #6c5ce7 !important; color: white !important; }
.badge-suiho { background-color: #00b894 !important; color: white !important; }
.badge-harimitsu { background-color: #e17055 !important; color: white !important; }

/* --- Global Sync Status Indicator (v7.3.2) --- */
.sync-status-indicator {
    position: fixed;
    right: 1rem;
    bottom: 2.5rem; /* Just above the version tag */
    background: rgba(255, 255, 255, 0.9);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 5001;
    border: 1px solid #e2e8f0;
}

.sync-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8; /* Default gray */
    transition: background-color 0.3s;
}

.sync-dot.syncing { 
    background: #3498db; 
    animation: syncPulse 1.5s infinite;
}
.sync-dot.success { background: #10b981; }
.sync-dot.error { background: #ef4444; }

@keyframes syncPulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* ==========================================
   TIMEFRAME OVERLAY (v6.7.3 RECOVERY)
   ========================================== */
.timeframe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 2rem;
}

.timeframe-overlay.hidden {
    display: none;
}

.timeframe-message {
    background: white;
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid #e1e8ed;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
}

.timeframe-message h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.timeframe-message p {
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.6;
}

/* Coordinator Table Style (v7.6.0) */
.mintsuri-table {
    min-width: 600px;
}

.mintsuri-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    color: #475569;
    border-bottom: 2px solid #e1e8ed;
}

.mintsuri-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.mintsuri-table tr:hover {
    background: #fdfdfd;
}
/* --- Admin URL Tile Grid (v7.6.5) --- */
.url-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #475569;
    margin: 1.5rem 0 0.75rem 0;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.url-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .url-grid {
        grid-template-columns: 1fr;
    }
}

.url-tile {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.url-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.url-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.url-tile-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.url-tile-body {
    display: flex;
    gap: 0.5rem;
}

.url-tile-body input {
    flex: 1;
    font-size: 0.8rem !important;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

.btn-copy-wide {
    min-width: 65px;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.btn-open-link {
    min-width: 65px;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-open-link:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

/* v7.7.0: Redesigned Dashboard Filter Buttons */
.filter-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e2e8f0;
    background: white;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category-specific color variables */
.filter-btn[data-filter="all"] { --b-color: #475569; color: #475569; }
.filter-btn[data-filter="一般"] { --b-color: #3498db; color: #3498db; }
.filter-btn[data-filter="みん釣り"] { --b-color: #9b59b6; color: #9b59b6; }
.filter-btn[data-filter="水宝"] { --b-color: #2ecc71; color: #2ecc71; }
.filter-btn[data-filter="ハリミツ"] { --b-color: #e67e22; color: #e67e22; }

.filter-btn:hover {
    border-color: var(--b-color);
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.filter-btn.active {
    background: var(--b-color);
    border-color: var(--b-color);
    color: white !important;
    box-shadow: 0 4px 12px -2px rgba(0,0,0,0.15);
}
