:root {
    --bg-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --success-hover: #059669;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.5rem;
    line-height: 1.6;
}

.app-container {
    width: 100%;
    max-width: 98%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.8s ease-out;
}

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

header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    color: white;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.upload-section {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 24px;
    margin: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.upload-section:hover, .upload-section.dragover {
    background: rgba(30, 41, 59, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.upload-section:hover::before, .upload-section.dragover::before {
    border-color: var(--primary-color);
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.upload-section:hover .upload-icon, .upload-section.dragover .upload-icon {
    transform: translateY(-5px);
}

.upload-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upload-content .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

button {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background-color: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.hidden {
    display: none !important;
}

/* Spinner */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results section */
.results-section {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.results-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.filter-controls {
    margin: 1rem 0;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

#filial-filter {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    min-width: 200px;
    outline: none;
    cursor: pointer;
}

#filial-filter:focus {
    border-color: var(--primary-color);
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    background: rgba(15, 23, 42, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 0.9rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}

th {
    background-color: rgba(30, 41, 59, 0.9);
    color: var(--text-muted);
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Converted cell highlight */
.cell-converted {
    color: #34d399;
    font-weight: 600;
}

/* Dashboard Grid */
.dashboard-grid {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
}

.chart-container {
    width: 100%;
    height: 280px;
    position: relative;
    margin-bottom: 1rem;
}

.chart-container h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-main);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-item.red .legend-color {
    background-color: #ed3237;
}

.legend-item.yellow .legend-color {
    background-color: #fcd116;
}

.legend-item.green .legend-color {
    background-color: #277a3d;
}

.preview-section-header {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.preview-section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.preview-section-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cell-combined {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.score-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

.score-badge.negative {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.final-score-cell {
    font-weight: 700 !important;
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.05);
    text-align: center !important;
}

@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-header button {
        width: 100%;
        justify-content: center;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 1200px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

#modal-title {
    margin-bottom: 1.5rem;
    padding-right: 2rem;
    color: white;
}

#modal-body {
    color: var(--text-muted);
    line-height: 1.8;
}

#modal-body p {
    margin-bottom: 1rem;
}

#modal-body ul {
    list-style-type: none;
    padding-left: 0;
}

#modal-body li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

#modal-body li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.2rem;
}

.modal-content.theme-red {
    border-top: 4px solid #ed3237;
}

.modal-content.theme-yellow {
    border-top: 4px solid #fcd116;
}

/* ── Action buttons group ─────────────────────────────────────── */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Register Quantities Button */
.btn-register {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-register:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

/* ── Dept Stats Bar (below chart) ─────────────────────────────── */
.dept-stats-bar {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.dept-stats-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-start;
}

.dept-stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    min-width: 110px;
    gap: 0.2rem;
    transition: transform 0.2s ease;
}

.dept-stat-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.dept-stat-name {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.dept-stat-pct {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

.dept-stat-pct.pct-green  { color: #34d399; }
.dept-stat-pct.pct-yellow { color: #fbbf24; }
.dept-stat-pct.pct-red    { color: #f87171; }
.dept-stat-pct:not(.pct-green):not(.pct-yellow):not(.pct-red) {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    font-style: italic;
}

/* ── Register Quantities Modal ────────────────────────────────── */
.register-modal-content {
    max-width: 780px;
    width: 95%;
}

.register-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--surface-border);
}

.register-modal-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.register-modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.3rem;
}

.register-modal-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Filial filter inside register modal */
.register-filial-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
}

.register-filial-bar label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.register-filial-select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--surface-border);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    flex: 1;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.register-filial-select:focus {
    border-color: var(--primary-color);
}

/* ── Executive Report Styles ──────────────────────────────────── */
.btn-report {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-report:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.report-modal-content {
    max-width: 900px;
    background: #f1f5f9;
    color: #1e293b;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.report-modal-actions-top {
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    z-index: 10;
}

.report-container {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* A4 Page Simulation */
.report-page {
    background: white;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-height: 1120px; /* A4 aspect ratio approx */
    position: relative;
    font-family: 'Inter', sans-serif;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #6366f1;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.report-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.025em;
}

.report-logo-text span {
    color: #6366f1;
}

.report-meta {
    text-align: right;
}

.report-meta h2 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.report-meta p {
    font-size: 0.875rem;
    color: #64748b;
}

.report-title-section {
    margin-bottom: 2.5rem;
}

.report-title-section h1 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    background: none;
    -webkit-text-fill-color: initial;
}

.report-title-section .subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

/* Participation Stats */
.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.report-stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.report-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 0.25rem;
}

.report-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.report-participation-note {
    grid-column: span 3;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin-top: -0.5rem;
}

/* Introduction Box */
.report-intro-box {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2.5rem;
    border: 1px solid #e2e8f0;
}

.report-intro-box p {
    font-size: 1rem;
    color: #334155;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.report-intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.report-intro-item {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    padding-left: 1rem;
    border-left: 3px solid #6366f1;
}

.report-intro-item strong {
    color: #1e293b;
    display: block;
    margin-bottom: 0.25rem;
}

/* Domain Charts */
.report-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-section-title::before {
    content: '';
    width: 4px;
    height: 1.25rem;
    background: #6366f1;
    border-radius: 2px;
}

.domain-chart-container {
    margin-bottom: 3rem;
}

.domain-bar-row {
    margin-bottom: 1.25rem;
}

.domain-bar-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.domain-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
}

.domain-score {
    font-weight: 700;
    font-size: 0.95rem;
}

.domain-bar-bg {
    height: 12px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
}

.domain-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* Methodological Summary */
.method-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    border-left: 4px solid #94a3b8;
}

.method-box h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #334155;
}

.method-box p {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

/* Intervention Guidelines */
.intervention-section {
    margin-bottom: 3rem;
}

.intervention-card {
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.intervention-card.red {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.intervention-card.yellow {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.intervention-card h5 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.intervention-card.red h5 { color: #dc2626; }
.intervention-card.yellow h5 { color: #d97706; }

.intervention-card ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: #475569;
}

.intervention-card li {
    margin-bottom: 0.5rem;
}

/* Footer & Conclusion */
.report-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.conclusion-msg {
    font-style: italic;
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.footer-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.report-anonymity-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Selection Modal (Report config) */
.selection-modal-content {
    max-width: 500px !important;
}

.selection-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.selection-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.selection-modal-body p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.selection-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.selection-input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e2e8f0;
}

.selection-modal-actions {
    display: flex;
    justify-content: flex-end;
}

/* PDF Page Break Utility */
.page-break {
    page-break-before: always;
}

@media print {
    .report-modal-actions-top, .close-modal { display: none; }
    .report-page { box-shadow: none; padding: 0; }
}
.register-dept-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.25rem;
    margin-bottom: 1.5rem;
}

.register-dept-list::-webkit-scrollbar { width: 6px; }
.register-dept-list::-webkit-scrollbar-track { background: rgba(15,23,42,0.3); border-radius: 4px; }
.register-dept-list::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 4px; }

.register-dept-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    transition: border-color 0.2s ease;
}

.register-dept-row:hover {
    border-color: rgba(99, 102, 241, 0.35);
}

.register-dept-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.register-dept-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.register-dept-responses {
    font-size: 0.78rem;
    color: #6366f1;
    font-weight: 500;
}

.register-dept-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 180px;
}

.register-dept-input-wrap label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.register-qty-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.register-qty-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.register-qty-input::placeholder { color: #475569; }

.register-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-border);
}

.register-status {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    flex: 1;
}

.register-status.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.register-status.error {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

@media (max-width: 600px) {
    .register-dept-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .register-dept-input-wrap {
        width: 100%;
        min-width: unset;
    }
    .action-buttons {
        width: 100%;
    }
    .action-buttons button {
        flex: 1;
        justify-content: center;
    }
}

/* ── Dropdown Styles ──────────────────────────────────────────── */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background-color: var(--surface-color);
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    z-index: 50;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 0.5rem;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: white;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
