/* Noto Sans JP font is loaded via link tag in HTML for better performance */

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #F5F5F5;
    min-height: 100vh;
    padding: 0px;
    color: #333333;
    font-size: 14px;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    background: #F5F5F5;
}

/* Legacy container for old pages */
.container {
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    border: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Wrapper */
.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Navigation */
.sidebar,
nav.sidebar {
    width: 200px;
    background: #1A237E;
    border-right: none;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px 16px;
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    padding: 20px 16px;
    background: rgba(13, 71, 161, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 24px;
    height: 24px;
}

.sidebar-user > div {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 2px;
}

/* Legacy user-info class for backward compatibility */
.user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-section {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    padding: 0 16px 8px 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.nav-link {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: none;
    padding: 11px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(33, 150, 243, 0.15);
    color: #FFFFFF;
    border-left-color: #2196F3;
}

.nav-link.active {
    background: rgba(33, 150, 243, 0.25);
    color: #FFFFFF;
    border-left-color: #2196F3;
    font-weight: 500;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.9;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

/* Legacy nav-item for backward compatibility */
.nav-item {
    width: 100%;
    background: transparent;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    gap: 12px;
    text-align: left;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(33, 150, 243, 0.15);
    color: #FFFFFF;
    border-left-color: #2196F3;
}

.nav-item.active {
    background: rgba(33, 150, 243, 0.25);
    color: #FFFFFF;
    border-left-color: #2196F3;
    font-weight: 500;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.9;
}

.nav-item span {
    flex: 1;
}

.logout-btn {
    width: 100%;
    margin: 0;
    border-radius: 4px;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #FFCDD2;
    border-left-color: #F44336;
}

.sidebar-footer .logout-btn {
    border-left: none;
}

/* Main Content Area */
.main-content {
    flex: 1;
    background: #F5F5F5;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.content-header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 24px 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* White content header for within page-content */
.page-content .content-header {
    background: white;
    color: #333333;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.page-content .content-header h2 {
    color: #212121;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.content-header h1 {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.5px;
}

main {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Page Content Area */
.page-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    max-width: 2000px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

input[type="checkbox"] {
    width: fit-content;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666666;
    font-size: 14px;
}

button[type="submit"] {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

button[type="submit"]:hover {
    background: #1976D2;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

button[type="submit"] svg {
    margin-right: 4px;
}

/* General Button Styles */
button {
    font-family: 'Noto Sans JP', sans-serif;
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background: #1976D2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

button svg {
    vertical-align: middle;
}

.btn-success {
    background: #4CAF50;
}

.btn-success:hover {
    background: #45A049;
}

.btn-danger {
    background: #F44336;
}

.btn-danger:hover {
    background: #E53935;
}

.btn-secondary {
    background: #9E9E9E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #757575;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Icon Button (for table actions) */
.btn-icon {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-icon:hover {
    background: #1976D2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.btn-icon.btn-danger {
    background: #F44336;
}

.btn-icon.btn-danger:hover {
    background: #E53935;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E0E0E0;
    background: white;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* Button Styles */
.btn-primary {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #1976D2;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    color: #333333;
    padding: 24px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #E0E0E0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card h3 {
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2196F3;
}

/* Data List */
.data-list {
    margin-top: 20px;
}

.data-item {
    background: white;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 4px;
    border-left: 4px solid #2196F3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.data-item:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.data-item h4 {
    margin-bottom: 8px;
    color: #333333;
    font-size: 16px;
    font-weight: 600;
}

.data-item p {
    color: #666666;
    font-size: 14px;
    margin: 5px 0;
}

.data-item button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.data-item button:hover {
    background: #1976D2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Datasource Header */
.datasource-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

/* Report Header */
.report-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
    padding: 10px 14px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Data Table */
.table-container {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #E0E0E0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #F5F5F5;
    color: #666666;
    border-bottom: 2px solid #E0E0E0;
}

.data-table th {
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #F0F0F0;
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background: #F9F9F9;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 14px 16px;
    color: #333333;
}

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

.data-table .table-actions {
    display: flex;
    gap: 8px;
}

.data-table .btn-delete {
    background: #F44336;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 70px;
    white-space: nowrap;
}

.data-table .btn-delete svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.data-table .btn-delete:hover {
    background: #E53935;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.data-table .btn-view {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 70px;
    white-space: nowrap;
}

.data-table .btn-view svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.data-table .btn-view:hover {
    background: #1976D2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.data-table .btn-edit {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 70px;
    white-space: nowrap;
}

.data-table .btn-edit svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.data-table .btn-edit:hover {
    background: #1976D2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Small Action Buttons (icon + text) */
.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: 'Noto Sans JP', sans-serif;
    min-width: 60px;
    white-space: nowrap;
}

.btn-small svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-small.btn-primary,
.btn-small.btn-view {
    background: #2196F3;
    color: white;
}

.btn-small.btn-primary:hover,
.btn-small.btn-view:hover {
    background: #1976D2;
}

.btn-small.btn-edit {
    background: #4CAF50;
    color: white;
}

.btn-small.btn-edit:hover {
    background: #388E3C;
}

.btn-small.btn-delete,
.btn-small.btn-danger {
    background: #F44336;
    color: white;
}

.btn-small.btn-delete:hover,
.btn-small.btn-danger:hover {
    background: #D32F2F;
}

.btn-small.btn-restore {
    background: #FF9800;
    color: white;
}

.btn-small.btn-restore:hover {
    background: #F57C00;
}

/* Action Buttons Container */
.action-buttons,
.table-actions,
.row-actions,
.field-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #F5F5F5;
    border-radius: 4px;
    border: 1px solid #E0E0E0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    fill: #BBDEFB;
}

.empty-state h3 {
    color: #333333;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.empty-state p {
    color: #666666;
    font-size: 14px;
    margin: 5px 0;
}

/* Status Message */
.status-message {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 14px;
}

.status-message.success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #81C784;
}

.status-message.error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #E57373;
}

.status-message.info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

.status-message.warning {
    background: #FFF9C4;
    color: #F57F17;
    border: 1px solid #F9A825;
}

/* Message alias for backward compatibility */
.message {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 14px;
}

.message.success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #81C784;
}

.message.error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #E57373;
}

.message.info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

.message.warning {
    background: #FFF9C4;
    color: #F57F17;
    border: 1px solid #F9A825;
}

/* Footer */
footer {
    background: #F5F5F5;
    padding: 20px;
    text-align: center;
    color: #666666;
    border-top: 1px solid #E0E0E0;
    font-size: 14px;
}

/* Designer Section */
.designer-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.designer-section h3 {
    color: #1976D2;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1976D2;
}

/* Selection Cards for Creation Mode */
.selection-card {
    position: relative;
    overflow: hidden;
}

.selection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.05) 0%, rgba(21, 101, 192, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.selection-card:hover {
    border-color: #1976D2 !important;
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.2) !important;
    transform: translateY(-4px);
}

.selection-card:hover::before {
    opacity: 1;
}

.selection-card:active {
    transform: translateY(-2px);
}

/* Info Boxes for Import Mode */
.info-box {
    border-radius: 4px;
    line-height: 1.6;
}

.info-box h4 {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Table List */
.table-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.table-list li {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.table-list li:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #2196F3;
}

.table-list li strong {
    color: #333333;
    font-size: 16px;
    font-weight: 600;
}

.table-list li small {
    color: #666666;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

/* Fields Table */
.fields-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
}

.fields-table thead {
    background: #F5F5F5;
    color: #666666;
}

.fields-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E0E0E0;
}

.fields-table tbody tr {
    border-bottom: 1px solid #F0F0F0;
    transition: background-color 0.2s;
}

.fields-table tbody tr:hover {
    background: #F9F9F9;
}

.fields-table tbody tr:last-child {
    border-bottom: none;
}

.fields-table td {
    padding: 12px 16px;
    color: #333333;
    font-size: 14px;
}

.fields-table input[type="text"],
.fields-table textarea,
.fields-table select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.fields-table input[type="text"]:focus,
.fields-table textarea:focus,
.fields-table select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.fields-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666666;
}

.loading svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading p {
    font-size: 16px;
    color: #999999;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Admin Users & User Management Styles */
.info-message {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #1565C0;
    font-size: 14px;
}

.filter-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.table-section {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-top: 20px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination button.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* Form Input Styles */
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-input:disabled {
    background: #F5F5F5;
    cursor: not-allowed;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333333;
    font-size: 14px;
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    background: white;
    resize: vertical;
    min-height: 80px;
}

.form-textarea:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
}

.form-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
}

.form-help {
    font-size: 13px;
    color: #666666;
    margin-top: 4px;
}

.required {
    color: #F44336;
    font-weight: 600;
}

/* Button with space separated classes */
.btn.primary {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn.primary:hover {
    background: #1976D2;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.btn.secondary {
    background: #9E9E9E;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn.secondary:hover {
    background: #757575;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    box-shadow: none;
}

.modal-close:hover {
    background: #F5F5F5;
    color: #333333;
    transform: none;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

/* Table Grid */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Form Editor Styles */
.form-editor-header {
    background: white;
    padding: 20px 24px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #E0E0E0;
    margin-bottom: 0;
}

.form-editor-title {
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 4px;
}

.form-editor-meta {
    font-size: 13px;
    color: #666666;
}

.form-editor-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    margin-top: 24px;
}

.form-settings-panel {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.settings-section {
    padding: 20px 24px;
    border-bottom: 1px solid #F0F0F0;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1976D2;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-preview-panel {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.preview-panel-header {
    padding: 16px 24px;
    background: #F5F5F5;
    border-bottom: 1px solid #E0E0E0;
    font-weight: 600;
    color: #333333;
}

.preview-form-container {
    padding: 24px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* Form Entry Styles */
.form-entry-container {
    background: white;
    border-radius: 8px;
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.success-banner {
    background: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: none;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.success-banner.show {
    display: flex;
}

.voice-input-panel {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    border: 2px solid #2196F3;
}

.voice-input-header {
    font-size: 18px;
    font-weight: 600;
    color: #1976D2;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-input-description {
    font-size: 14px;
    color: #1565C0;
    margin-bottom: 16px;
}

.voice-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.btn-voice-main {
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-voice-main:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.5);
}

.btn-voice-main.recording {
    background: #F44336;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(244, 67, 54, 0.7);
    }
}

.voice-status {
    font-size: 14px;
    font-weight: 500;
    color: #1976D2;
}

.voice-transcript {
    background: white;
    border-radius: 8px;
    padding: 16px;
    min-height: 100px;
    font-size: 14px;
    color: #333333;
    border: 1px solid #BBDEFB;
}

/* Form Container */
.form-container {
    background: white;
    padding: 24px;
    border-radius: 8px;
}

/* Redirect Container */
.redirect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.redirect-container .info {
    margin-top: 20px;
    font-size: 16px;
    color: #666666;
}

/* Search Filter Bar */
.search-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Template Card */
.template-card {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.template-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #2196F3;
}

.template-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.template-card-icon {
    width: 48px;
    height: 48px;
    background: #E3F2FD;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.template-card-icon svg {
    width: 28px;
    height: 28px;
    fill: #2196F3;
}

.template-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin: 0;
}

.template-card-info {
    font-size: 13px;
    color: #666666;
    margin-bottom: 12px;
}

.template-card-description {
    font-size: 14px;
    color: #666666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.template-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #E0E0E0;
    font-size: 12px;
    color: #999999;
}

.template-card-table {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #F5F5F5;
    border-radius: 4px;
    font-size: 12px;
    color: #666666;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Error Message */
.error-message {
    background: #FFEBEE;
    border-left: 4px solid #F44336;
    color: #C62828;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay .spinner {
    width: 64px;
    height: 64px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Fields Table Container */
.fields-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #E0E0E0;
}

/* Material Icons */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #E0E0E0;
    }
    
    .nav-item {
        padding: 12px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-editor-content {
        grid-template-columns: 1fr;
    }
    
    .table-grid {
        grid-template-columns: 1fr;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
}

/* モーダルダイアログ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: #FFFFFF;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    overflow: hidden;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 0;
    border-bottom: 2px solid #2196F3;
    background: #FFFFFF;
}

.modal-header h2,
.modal-header h3 {
    color: #333333;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    box-shadow: none;
}

.close-btn:hover {
    background: #F5F5F5;
    color: #333333;
    transform: none;
}

.modal-content h2 {
    color: #2196F3;
    font-size: 20px;
    font-weight: 600;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* アップロード進捗表示 */
.upload-progress {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3 0%, #1976D2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

#progress-text {
    text-align: center;
    color: #333333;
    font-weight: 500;
    font-size: 14px;
}

/* Report URL Styles */
.report-url {
    background: #E3F2FD;
    border-left: 3px solid #2196F3;
    padding: 10px 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
    word-break: break-all;
}

.report-url strong {
    color: #1976D2;
    margin-right: 8px;
}

.report-url a {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.2s;
}

.report-url a:hover {
    color: #1976D2;
    text-decoration: underline;
}

.copy-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    transition: all 0.2s;
    vertical-align: middle;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.copy-btn:hover {
    background: #1976D2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Status Indicators */
.status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #FFF9C4;
    color: #F57F17;
    border: 1px solid #FFF59D;
}

.status-processing {
    background: #BBDEFB;
    color: #1976D2;
    border: 1px solid #90CAF9;
    display: inline-flex;
    align-items: center;
}

.status-completed {
    background: #C8E6C9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.status-failed {
    background: #FFCDD2;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.processing-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #2196F3;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

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

/* DataSource Details Modal */
.details-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.details-section:last-child {
    border-bottom: none;
}

.details-section h3 {
    color: #2196F3;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2196F3;
}

.details-section h4 {
    color: #333;
    font-size: 14px;
    margin-bottom: 10px;
    margin-top: 15px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.details-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    width: 180px;
    border-bottom: 1px solid #ddd;
    color: #555;
}

.details-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.details-table tr:last-child th,
.details-table tr:last-child td {
    border-bottom: none;
}

/* .modal-header and .modal-header h2/h3 are defined above (Line 1720) */

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    width: 100%;
    padding: 30px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    background: #FFFFFF;
}

/* Spinner Animation */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Steps */
.progress-step {
    display: flex;
    align-items: center;
    padding: 8px 0;
    transition: opacity 0.3s ease;
}

.progress-step.active {
    opacity: 1 !important;
    font-weight: 500;
    color: #2196F3;
}

.progress-step.completed {
    opacity: 0.7 !important;
    color: #4CAF50;
}

.step-icon {
    font-size: 18px;
    margin-right: 10px;
    min-width: 24px;
}

.step-text {
    font-size: 14px;
}

/* Pulse Animation for Active Step */
.progress-step.active .step-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   MISSING CSS DEFINITIONS - COMPREHENSIVE
   ======================================== */

/* Page Header */
.page-header {
    background: #1976D2;
    color: white;
    padding: 24px 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: none;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Manager Header */
.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.toolbar-below {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

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

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: #F5F5F5;
}

.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 48px 40px;
    max-width: 400px;
    width: 100%;
}

.login-title {
    text-align: center;
    color: #1E88E5;
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 40px 0;
}

.login-form-group {
    margin-bottom: 24px;
}

.login-label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    background: white;
}

.login-input:focus {
    outline: none;
    border-color: #1E88E5;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: #1E88E5;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
}

.login-button:hover {
    background: #1976D2;
}

.login-link {
    display: block;
    text-align: center;
    color: #1E88E5;
    font-size: 14px;
    margin-top: 16px;
    text-decoration: none;
    transition: text-decoration 0.2s;
}

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

/* Data Manager Redirect Page Styles */
.redirect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 0 auto;
}

.redirect-container h2 {
    color: #333;
    margin: 0 0 12px 0;
    font-size: 24px;
}

.redirect-container p {
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.redirect-container .info {
    background: #E3F2FD;
    border-left: 4px solid #1976D2;
    padding: 12px;
    margin-top: 20px;
    text-align: left;
    border-radius: 4px;
}

.redirect-container .info strong {
    color: #1976D2;
}

.redirect-container .info p {
    margin-top: 8px;
}

/* Alert Messages */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid #2196F3;
}

/* Active States - Scoped to specific elements to avoid inheritance issues */
/* Note: Removed generic .active selector that was causing inheritance problems */
/* Each component should define its own .active styles */

.active_page {
    background: #2196F3;
    color: white;
}

/* Generic Button Styles */
.btn {
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans JP', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.primary {
    background: #2196F3 !important;
}

.secondary {
    background: #9E9E9E !important;
}

/* Modal Additional Styles */
.modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    box-shadow: none;
}

.modal-close-btn:hover {
    background: #F5F5F5;
    color: #333333;
    transform: none;
}

.modal-footer {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0;
    padding: 20px 30px;
    border-top: 1px solid #E0E0E0;
    background: #FFFFFF;
}

.modal-error {
    background: #FFEBEE;
    border-left: 4px solid #F44336;
    color: #C62828;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Column Modal */
.column-modal {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 2000;
    flex-direction: column;
}

/* Context Menu */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 180px;
    z-index: 3000;
}

.context-menu button {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu button:hover {
    background: #F5F5F5;
    transform: none;
    box-shadow: none;
}

/* Changes Indicator */
.changes-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFF9C4;
    border: 1px solid #FBC02D;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: #F57F17;
}

.changes-indicator-text {
    font-weight: 500;
}

/* Info Box */
.info {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 4px;
    color: #1565C0;
    font-size: 14px;
}

/* Spreadsheet Container */
.spreadsheet-container {
    background: white;
    border-radius: 8px;
    padding: 0;
    overflow: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 300px);
}

/* Import Wizard Styles */
.import-wizard {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.wizard-tabs {
    display: flex;
    background: #F5F5F5;
    border-bottom: 2px solid #E0E0E0;
}

.wizard-tab {
    flex: 1;
    min-width: 200px;
    padding: 20px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    font-family: 'Noto Sans JP', sans-serif;
    color: gray;
}

.wizard-tab:hover {
    background: rgba(33, 150, 243, 0.05);
}

.wizard-tab.active {
    background: white;
    color: #2196F3;
    font-weight: 600;
}

.wizard-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2196F3;
}

.wizard-tab-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E0E0E0;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.wizard-tab.active .wizard-tab-number {
    background: #2196F3;
    color: white;
}

.wizard-tab.completed .wizard-tab-number {
    background: #4CAF50;
    color: white;
}

.wizard-tab-label {
    font-size: 14px;
    font-weight: 500;
}

.wizard-content-area {
    padding: 32px;
    min-height: 400px;
}

.wizard-step-content {
    display: none;
}

.wizard-step-content.active {
    display: block;
    color: #333333;
}

.wizard-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 20px 0 0 0;
    border-top: none;
    background: transparent;
}

/* Alert Info */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-info {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
    color: #1565C0;
}

.alert-success {
    background: #E8F5E9;
    border-left: 4px solid #4CAF50;
    color: #2E7D32;
}

.alert-warning {
    background: #FFF9C4;
    border-left: 4px solid #F9A825;
    color: #F57F17;
}

.alert-danger {
    background: #FFEBEE;
    border-left: 4px solid #F44336;
    color: #C62828;
}

/* Utility Classes */
.text-danger {
    color: #c62828;
}

/* ============================================
   Table Context Sidebar
   Dedicated sidebar for table-related pages
   ============================================ */

.table-context-sidebar {
    width: 200px;
    background: #131955;
    border-right: none;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.context-sidebar-header {
    padding: 16px 12px;
    border-bottom: 1px solid #334155;
    background: #131955;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-sidebar-back {
    width: 100%;
}

.back-to-tables-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(51, 65, 85, 0.6);
    color: #CBD5E1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.back-to-tables-link:hover {
    background: rgba(71, 85, 105, 0.8);
    color: #ffffff;
    border-color: rgba(100, 116, 139, 0.6);
}

.back-to-tables-link svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.context-sidebar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.table-name-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #F1F5F9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.context-sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.context-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #CBD5E1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.context-nav-item:hover {
    background: #334155;
    color: #ffffff;
    border-left-color: #64748B;
}

.context-nav-item.active {
    background: #3B82F6;
    color: #ffffff;
    border-left-color: #60A5FA;
    font-weight: 600;
}

.context-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.context-nav-item.active svg {
    opacity: 1;
    color: #ffffff;
}

.context-nav-item span {
    flex: 1;
}

/* Layout adjustment for pages with context sidebar */
.main-content.with-context-sidebar {
    display: flex;
    flex-direction: row;
    padding: 0;
}

.main-content.with-context-sidebar .table-context-sidebar {
    flex-shrink: 0;
}

.main-content.with-context-sidebar .page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content.with-context-sidebar .page-header {
    padding: 16px 24px;
}

.main-content.with-context-sidebar .page-content {
    flex: 1;
    overflow-y: auto;
}

/* Responsive adjustments for context sidebar */
@media (max-width: 1024px) {
    .table-context-sidebar {
        width: 180px;
    }
    
    .context-nav-item {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .context-nav-item svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 768px) {
    .table-context-sidebar {
        width: 56px;
    }

    .context-sidebar-header {
        padding: 12px 8px;
        justify-content: center;
    }

    .context-sidebar-title {
        display: none;
    }

    .context-nav-item {
        padding: 12px;
        justify-content: center;
    }

    .context-nav-item span {
        display: none;
    }

    .context-nav-item svg {
        margin: 0;
    }
}

/* Loading Spinner Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.loading-container p {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #1976D2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}