/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: rgba(24, 24, 27, 0.85);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-input-focus: rgba(255, 255, 255, 0.08);

    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent-blue: #4285f4;
    --accent-blue-hover: #5a9cf6;
    --accent-red: #ea4335;
    --accent-yellow: #fbbc04;
    --accent-green: #34a853;

    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(66, 133, 244, 0.5);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-card: 0 4px 40px rgba(0, 0, 0, 0.4), 0 0 80px rgba(66, 133, 244, 0.03);
    --shadow-glow: 0 0 30px rgba(66, 133, 244, 0.15);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
    position: relative;
}

/* ===========================
   Particle Canvas
   =========================== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===========================
   Progress Bar
   =========================== */
.progress-bar-container {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 32px 20px;
    max-width: 500px;
    margin: 0 auto;
    display: none; /* Hidden by default until step 1 */
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
    position: relative;
}

.step-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-normal);
}

.step-check {
    display: none;
    width: 18px;
    height: 18px;
    color: #fff;
}

.step-indicator.active .step-circle {
    border-color: var(--accent-blue);
    background: rgba(66, 133, 244, 0.15);
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.2);
}

.step-indicator.active .step-number {
    color: var(--accent-blue);
}

.step-indicator.completed .step-circle {
    border-color: var(--accent-green);
    background: var(--accent-green);
}

.step-indicator.completed .step-number {
    display: none;
}

.step-indicator.completed .step-check {
    display: block;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-normal);
    white-space: nowrap;
}

.step-indicator.active .step-label {
    color: var(--text-primary);
}

.step-indicator.completed .step-label {
    color: var(--accent-green);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 12px;
    margin-bottom: 28px;
    border-radius: 1px;
    overflow: hidden;
    min-width: 60px;
}

.step-line-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-green);
    transition: width var(--transition-slow);
    border-radius: 1px;
}

/* ===========================
   Step Sections
   =========================== */
.step-section {
    display: none;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 520px;
    padding: 30px 20px 60px;
    margin: 0 auto;
    animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.step-section.active {
    display: block;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Card
   =========================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: rgba(66, 133, 244, 0.1);
    border: 1px solid rgba(66, 133, 244, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.card-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent-blue);
}

.card-icon.success-icon {
    background: rgba(52, 168, 83, 0.1);
    border-color: rgba(52, 168, 83, 0.2);
}

.card-icon.success-icon svg {
    color: var(--accent-green);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ===========================
   Form Elements
   =========================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.required {
    color: var(--accent-red);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

input:focus,
textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="date"] {
    color-scheme: dark;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

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

/* ===========================
   Radio Buttons
   =========================== */
.gender-box-group {
    display: flex;
    gap: 8px; /* Reduced gap to attach them closer */
    height: 46px; /* Explicit height to match typical input padding */
}

.gender-box {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.gender-box input[type="radio"] {
    display: none;
}

.gender-label {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.gender-box:hover .gender-label {
    border-color: rgba(255, 255, 255, 0.2);
}

.gender-box input[type="radio"]:checked + .gender-label {
    background: rgba(66, 133, 244, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* ===========================
   Buttons
   =========================== */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-blue-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

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

.btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 12px 20px;
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid rgba(66, 133, 244, 0.3);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

/* =========================================
   Intro (Step 0) Styles
   ========================================= */
.privacy-notice {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.privacy-notice p {
    margin-bottom: 12px;
}
.privacy-notice p:last-child {
    margin-bottom: 0;
}

.consent-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 32px;
    user-select: none;
}

.consent-checkbox input {
    display: none;
}

.consent-checkbox .checkmark {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary); /* Changed from var(--bg-lighter) as it's not defined */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0; /* Added for consistency with radio-custom */
}

.consent-checkbox input:checked + .checkmark {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.consent-checkbox input:checked + .checkmark::after {
    content: '';
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-2px);
}

.consent-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.start-btn {
    animation: none;
}

.btn-secondary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ===========================
   Messages
   =========================== */
.error-message {
    color: var(--accent-red);
    font-size: 0.85rem;
    padding: 10px 14px;
    background: rgba(234, 67, 53, 0.08);
    border: 1px solid rgba(234, 67, 53, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: '⚠';
    font-size: 1rem;
}

.success-message {
    color: var(--accent-green);
    font-size: 0.85rem;
    padding: 10px 14px;
    background: rgba(52, 168, 83, 0.08);
    border: 1px solid rgba(52, 168, 83, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message::before {
    content: '✓';
    font-size: 1rem;
    font-weight: bold;
}

.timer-text {
    font-size: 0.8rem;
    color: var(--accent-yellow);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.hidden {
    display: none !important;
}

/* ===========================
   Summary Section (Step 3)
   =========================== */
.summary-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    margin-right: 16px;
}

.summary-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
}

.completion-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(66, 133, 244, 0.08);
    border: 1px solid rgba(66, 133, 244, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.completion-notice svg {
    flex-shrink: 0;
    color: var(--accent-blue);
}

/* ===========================
   Input Validation States
   =========================== */
input.error,
textarea.error {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.1);
}

input.success {
    border-color: var(--accent-green);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
    .progress-bar-container {
        padding: 24px 16px 0;
    }

    .step-section {
        padding: 20px 16px 40px;
    }

    .card {
        padding: 28px 20px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .input-with-button {
        flex-direction: column;
    }

    .step-line {
        min-width: 40px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
    }

    .step-label {
        font-size: 0.7rem;
    }
}

/* ===========================
   Confetti animation (Step 3)
   =========================== */
@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    width: 8px;
    height: 8px;
    z-index: 100;
    border-radius: 2px;
    animation: confettiFall 3s ease-in forwards;
    pointer-events: none;
}

/* ===========================
   Loading spinner on button
   =========================== */
.btn-primary.loading {
    pointer-events: none;
}

.btn-primary.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ===========================
   Modal Overlay
   =========================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    animation: fadeSlideUp 0.3s ease;
}

.modal-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.modal-card input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-fast);
}

.modal-card input[type="password"]:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.modal-buttons .btn-primary {
    flex: 1;
}

.btn-ghost {
    padding: 12px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    flex: 1;
    padding: 12px 24px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: #d33426;
    box-shadow: 0 0 20px rgba(234, 67, 53, 0.2);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================
   Admin Dashboard
   =========================== */
#adminDashboard {
    max-width: 960px;
}

.admin-container {
    width: 100%;
}

.admin-header {
    margin-bottom: 24px;
}

.admin-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-title-row h1 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-yellow));
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, var(--accent-yellow), var(--accent-red));
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Table Card */
.admin-table-card {
    padding: 24px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.table-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    transition: all var(--transition-fast);
    min-width: 240px;
}

.search-box:focus-within {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
}

.search-box svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.search-box input {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    box-shadow: none !important;
}

/* Member Table */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#memberTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#memberTable thead th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

#memberTable tbody td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    vertical-align: middle;
}

#memberTable tbody tr {
    transition: background var(--transition-fast);
}

#memberTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.td-num {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    width: 40px;
}

.td-name {
    color: var(--text-primary) !important;
    font-weight: 600;
    white-space: nowrap;
    min-width: 80px;
}

.td-phone {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.td-nick {
    color: var(--accent-blue) !important;
    white-space: nowrap;
    min-width: 80px;
}

.td-gender {
    white-space: nowrap;
}

.td-region {
    white-space: nowrap;
    color: var(--text-primary);
}

.td-purpose {
    max-width: 150px;
    cursor: pointer;
}

.purpose-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
    pointer-events: none; /* Let the td handle the click */
}

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

.td-date {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text-muted) !important;
    font-size: 0.8rem;
}

.td-action {
    text-align: center;
    width: 50px;
}

.btn-delete-small {
    background: transparent;
    border: 1px solid rgba(234, 67, 53, 0.2);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    cursor: pointer;
    color: var(--accent-red);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-small:hover {
    background: rgba(234, 67, 53, 0.1);
    border-color: var(--accent-red);
}

/* No Data */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===========================
   OCR File Upload
   =========================== */
.ocr-upload-group {
    margin-bottom: 20px;
}

.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.file-upload-input {
    display: none;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    font-weight: 500;
}

.file-upload-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

.upload-icon {
    color: var(--accent-blue);
}

.upload-status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-status-text.loading {
    color: var(--accent-yellow);
}

.upload-status-text.success {
    color: var(--accent-green);
}

.upload-status-text.error {
    color: var(--accent-red);
}

/* ===========================
   Admin Dashboard Responsive
   =========================== */
@media (max-width: 768px) {
    #adminDashboard {
        max-width: 100%;
    }

    .admin-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    /* Keep all columns visible and rely on horizontal scroll */
    #memberTable {
        font-size: 0.8rem;
        min-width: 900px; /* Ensure enough width to prevent squishing */
    }

    #memberTable tbody td {
        padding: 10px 8px;
    }
}

/* ===========================
   Member Login Button (Step 0)
   =========================== */
.member-login-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 16px;
    position: relative;
}

.member-login-divider::before,
.member-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.member-login-divider span {
    padding: 0 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-member-login {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-member-login:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-member-login svg {
    flex-shrink: 0;
}

/* ===========================
   Home Page (Step 0) Layout
   =========================== */
.login-card {
    border-color: rgba(66, 133, 244, 0.2);
    box-shadow: var(--shadow-card), 0 0 50px rgba(66, 133, 244, 0.07);
}

.register-intro-card {
    background: rgba(18, 18, 22, 0.75);
    border-color: rgba(255, 255, 255, 0.06);
    padding: 28px 32px;
}

.register-intro-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.register-intro-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.register-intro-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.register-intro-card .privacy-notice {
    font-size: 0.88rem;
}

.register-intro-card .consent-checkbox {
    margin-bottom: 20px;
}

.btn-signup {
    width: 100%;
    padding: 13px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
}

.btn-signup:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-signup:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===========================
   Deposit Info Bar (Step 0)
   =========================== */
.deposit-info-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(251, 188, 4, 0.08);
    border: 1px solid rgba(251, 188, 4, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: var(--accent-yellow);
    line-height: 1.4;
}

/* ===========================
   Pending Message (Step 0 Login)
   =========================== */
.pending-message {
    background: rgba(251, 188, 4, 0.08);
    border: 1px solid rgba(251, 188, 4, 0.25);
    border-radius: var(--radius-sm);
    color: var(--accent-yellow);
    font-size: 0.85rem;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

/* ===========================
   Approval Toggle (Admin Table)
   =========================== */
.approve-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.approve-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.approve-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    border-radius: 11px;
    transition: all var(--transition-fast);
}

.approve-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all var(--transition-fast);
}

.approve-toggle input:checked + .approve-slider {
    background: rgba(52, 168, 83, 0.2);
    border-color: var(--accent-green);
}

.approve-toggle input:checked + .approve-slider::before {
    background: var(--accent-green);
    transform: translateX(18px);
}

.approve-toggle input:disabled + .approve-slider {
    opacity: 0.5;
}

.td-approve {
    text-align: center;
}

/* ===========================
   Admin Tabs
   =========================== */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
    width: fit-content;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.admin-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.admin-tab.active {
    background: rgba(66, 133, 244, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(66, 133, 244, 0.25);
}

.admin-tab-panel {
    width: 100%;
}

/* ===========================
   Notice Management (Admin)
   =========================== */
.notice-form-wrap {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.notice-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notice-admin-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.notice-admin-item.pinned {
    border-color: rgba(251, 188, 4, 0.3);
    background: rgba(251, 188, 4, 0.04);
}

.notice-admin-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.notice-pin-badge {
    font-size: 0.75rem;
    color: var(--accent-yellow);
    font-weight: 600;
}

.notice-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notice-admin-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.notice-admin-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ===========================
   Notice Board (Member Dashboard)
   =========================== */
.notice-board-card {
    margin-bottom: 20px;
}

.notice-board-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notice-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px 20px 16px;
}

.notice-item.pinned {
    border-color: rgba(251, 188, 4, 0.35);
    background: rgba(251, 188, 4, 0.04);
}

.notice-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.notice-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: -0.01em;
    flex: 1;
}

.notice-item.pinned .notice-item-title {
    color: #fff;
}

.notice-item-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 3px 10px;
    margin-top: 2px;
    white-space: nowrap;
}

.notice-item-content {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.7;
}

.notice-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.notice-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.notice-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ===========================
   WIP Overlay (수익인증 제작중)
   =========================== */
.wip-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.wip-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-align: center;
    padding: 24px;
}

.wip-badge svg {
    color: var(--accent-yellow);
    opacity: 0.8;
}

.wip-badge span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.wip-badge p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ===========================
   Member Dashboard
   =========================== */
#memberDashboard {
    max-width: 960px;
}

.member-container {
    width: 100%;
}

.member-header {
    margin-bottom: 24px;
}

/* Month Navigation */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-month-nav {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-month-nav:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.month-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 140px;
    text-align: center;
}

/* Profit Records Card */
.member-records-card {
    padding: 24px;
    margin-bottom: 16px;
}

.member-form-card {
    padding: 24px;
}

.profit-records-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profit-record-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: all var(--transition-fast);
}

.profit-record-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.profit-record-card.positive {
    border-left: 3px solid var(--accent-green);
}

.profit-record-card.negative {
    border-left: 3px solid var(--accent-red);
}

.record-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-left {
    flex: 1;
    min-width: 0;
}

.record-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.record-memo {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.record-amount {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.record-amount.positive {
    color: var(--accent-green);
}

.record-amount.negative {
    color: var(--accent-red);
}

.btn-record-delete {
    background: transparent;
    border: 1px solid rgba(234, 67, 53, 0.15);
    border-radius: 6px;
    padding: 5px 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-record-delete:hover {
    background: rgba(234, 67, 53, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* No Records */
.no-records {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-records svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.no-records p {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.no-records p.sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.loading-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===========================
   Member Dashboard Responsive
   =========================== */
@media (max-width: 768px) {
    #memberDashboard {
        max-width: 100%;
    }

    .member-header .admin-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
