* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', 'Yu Gothic', sans-serif; background: #f5f5f5; }

/* ヘッダー */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 16px; background: #1a237e; color: #fff;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-left h1 { font-size: 18px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 8px; }

.sync-status { font-size: 12px; color: #90caf9; }
.sync-status.error { color: #ef9a9a; }

.search-input {
    padding: 4px 10px; border: none; border-radius: 4px;
    font-size: 13px; width: 220px;
}

/* ボタン */
.btn {
    padding: 4px 12px; border: 1px solid #ccc; border-radius: 4px;
    background: #fff; cursor: pointer; font-size: 12px; color: #333;
    text-decoration: none;
}
.btn:hover { background: #e0e0e0; }
.btn-primary { background: #1565c0; color: #fff; border-color: #1565c0; }
.btn-primary:hover { background: #0d47a1; }
.btn-sync { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.btn-sync:hover { background: #1b5e20; }
.btn-sync.syncing { background: #888; cursor: not-allowed; }
.btn-columns { background: #546e7a; color: #fff; border-color: #546e7a; }
.btn-logout { background: transparent; color: #90caf9; border-color: #90caf9; }
.btn-logout:hover { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 2px 8px; font-size: 11px; }

/* AG-Grid */
.grid-container {
    height: calc(100vh - 50px); width: 100%;
}
.ag-theme-alpine .ag-header-cell-label { font-size: 12px; }
.ag-theme-alpine .ag-cell { font-size: 12px; }
.ag-theme-alpine .editable-cell { border-right: 1px solid #e0e0e0; }
.ag-theme-alpine .editable-cell:hover { background: #e8f5e9 !important; cursor: text; }

/* 更新済みバッジ */
.updated-badge {
    display: inline-block; padding: 1px 5px; border-radius: 3px;
    background: #e3f2fd; color: #1565c0; font-size: 10px; cursor: pointer;
}

/* 列設定パネル */
.column-panel {
    position: fixed; top: 50px; right: 0; width: 280px; max-height: calc(100vh - 50px);
    background: #fff; border-left: 1px solid #ddd; box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 100; overflow-y: auto;
}
.column-panel-header {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; background: #f5f5f5; border-bottom: 1px solid #ddd;
    font-size: 13px; font-weight: 600; position: sticky; top: 0;
}
.column-list { padding: 4px 0; }
.column-item {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.column-item:hover { background: #f0f0f0; }
.column-item input { cursor: pointer; }

/* モーダル */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 200;
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: #fff; border-radius: 8px; width: 500px; max-height: 80vh;
    overflow-y: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 15px; }
.modal-close { border: none; background: none; font-size: 20px; cursor: pointer; color: #666; }
.modal-body { padding: 16px; }
.modal-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-top: 1px solid #eee;
}
.edit-updated-at { font-size: 11px; color: #888; }

.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11px; color: #666; margin-bottom: 2px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 5px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px;
}
.form-group textarea { height: 60px; resize: vertical; }

/* ログイン */
.login-container {
    max-width: 350px; margin: 100px auto; padding: 30px;
    background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}
.login-container h2 { margin-bottom: 20px; color: #1a237e; }
.login-container input {
    display: block; width: 100%; padding: 8px 12px; margin-bottom: 12px;
    border: 1px solid #ddd; border-radius: 4px; font-size: 14px;
}
.login-container .error { color: #c62828; margin-bottom: 12px; font-size: 13px; }
